blob: c763c5984a1acbc935a11644b12bee37c7385062 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
module Col where
type family Elem c
type instance Elem [e] = e
class (Eq (Elem c)) => Col c where
count :: Elem c -> c -> Int
instance Eq e => Col [e] where
count x = length . filter (==x)
|