Sha256: bcd7e265d0099bcb322b335112483a4478a57e16e06704239131efa707cd9e6a

Contents?: true

Size: 830 Bytes

Versions: 69

Compression:

Stored size: 830 Bytes

Contents

defmodule ListOps do
  # Please don't use any external modules (especially List) in your
  # implementation. The point of this exercise is to create these basic functions
  # yourself.
  #
  # Note that `++` is a function from an external module (Kernel, which is
  # automatically imported) and so shouldn't be used either.

  @spec count(list) :: non_neg_integer
  def count(l) do
  end

  @spec reverse(list) :: list
  def reverse(l) do
  end

  @spec map(list, (any -> any)) :: list
  def map(l, f) do
  end

  @spec filter(list, (any -> as_boolean(term))) :: list
  def filter(l, f) do
  end

  @type acc :: any
  @spec reduce(list, acc, (any, acc -> acc)) :: acc
  def reduce(l, acc, f) do
  end

  @spec append(list, list) :: list
  def append(a, b) do
  end

  @spec concat([[any]]) :: [any]
  def concat(ll) do
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.138 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.137 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.136 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.135 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.134 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.133 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.132 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.131 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.130 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.129 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.128 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.127 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.126 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.125 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.124 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.123 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.122 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.121 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.120 tracks/elixir/exercises/list-ops/list_ops.exs