Sha256: f4de44a3c186b408509e635574f3097cae6e1690ce5664666b82e746a68aba8c

Contents?: true

Size: 532 Bytes

Versions: 160

Compression:

Stored size: 532 Bytes

Contents

defmodule Strain do
  @doc """
  Given a `list` of items and a function `fun`, return the list of items where
  `fun` returns true.

  Do not use `Enum.filter`.
  """
  @spec keep(list :: list(any), fun :: ((any) -> boolean)) :: list(any)
  def keep(list, fun) do
  end

  @doc """
  Given a `list` of items and a function `fun`, return the list of items where
  `fun` returns false.

  Do not use `Enum.reject`.
  """
  @spec discard(list :: list(any), fun :: ((any) -> boolean)) :: list(any)
  def discard(list, fun) do
  end
end

Version data entries

160 entries across 160 versions & 1 rubygems

Version Path
trackler-2.2.1.29 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.28 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.27 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.26 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.25 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.24 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.23 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.22 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.21 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.20 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.19 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.18 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.17 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.16 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.15 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.14 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.13 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.12 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.11 tracks/elixir/exercises/strain/strain.exs
trackler-2.2.1.10 tracks/elixir/exercises/strain/strain.exs