Integral
not a type: it is a class. It describes a type restriction.
So signature:
someFunction :: (Integral a) => a -> Bool -> a
, " a
Integral
, ".
(Integral a, Bool b) => a -> b -> a
, Bool
- , .
Integral
? , , - - - , Int
:
instance Integral Int where
-- (declarations here)
: Sizeable
:
class Sizeable s where
size :: s -> Int
, , size
. , :
instance Sizeable [a] where
size = length
instance Sizeable (a,b) where
size _ = 2
instance Sizeable (a,b,c) where
size _ = 3
, :
sizePlusOne s = (size s) + 1
:
sizePlusOne :: (Sizeable s) => s -> Int