elm/exercises/strain/Strain.example

10 lines
240 B
Text
Raw Normal View History

2015-10-13 18:56:46 +00:00
module StrainExample 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)