elm/exercises/strain/Strain.example

9 lines
238 B
Text

module Strain (..) where
import List
keep : (a -> Bool) -> List a -> List a
keep predicate list = List.filter predicate list
discard : (a -> Bool) -> List a -> List a
discard predicate list = (keep (\val -> not (predicate val)) list)