elm/exercises/strain/Strain.example

10 lines
238 B
Text
Raw Normal View History

module Strain (..) where
2015-10-13 18:56:46 +00:00
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)