Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Count where
- test :: [Int]
- test = [count, count 1 2 3, count "" [True,False] id (+)]
- count :: Count t => t
- count = count' undefined
- class Count t where
- count' :: a -> t
- instance Count Int where
- count' = const 0
- instance Count r => Count (a -> r) where
- count' x = const count' x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement