Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- listCount : (a -> Bool) -> List a -> Int
- listCount test list =
- list
- |> List.filter test
- |> List.length
- listAll : (a -> Bool) -> List a -> Bool
- listAll test list =
- let
- passed =
- list
- |> listCount test
- in
- passed == List.length list
- listAny : (a -> Bool) -> List a -> Bool
- listAny test list =
- let
- numElements =
- listCount test list
- in
- numElements > 0
- listNone : (a -> Bool) -> List a -> Bool
- listNone test list =
- not (listAny test list)
Add Comment
Please, Sign In to add comment