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.180 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.179 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.178 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.177 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.176 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.175 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.174 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.173 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.172 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.171 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.170 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.169 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.167 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.166 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.165 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.164 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.163 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.162 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.161 tracks/elixir/exercises/list-ops/list_ops.exs
trackler-2.2.1.160 tracks/elixir/exercises/list-ops/list_ops.exs