elm/exercises/strain/Strain.example

14 lines
243 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
2015-10-13 18:56:46 +00:00
discard : (a -> Bool) -> List a -> List a
discard predicate list =
(keep (\val -> not (predicate val)) list)