Sha256: f379584808aae516947e0ab4e1957176a54974e24e791bd18ff126c6a035d284
Contents?: true
Size: 839 Bytes
Versions: 327
Compression:
Stored size: 839 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
327 entries across 327 versions & 1 rubygems