1 {-# LANGUAGE MultiParamTypeClasses #-}
2 {-# LANGUAGE FunctionalDependencies #-}
5 class C from to | from
-> to
where
7 instance C
Float Char where
8 instance C
Double Bool where
11 polyFoo
:: (C from to
) => from
15 (C fromA toA
, C fromB toB
) =>
22 monoBar
= polyBar
id monoFoo
23 -- fromA = Float, fromB = Double, toA = toB
24 -- [W] C Float to, C Double to
25 -- => [D] to ~ Char, [D] to ~ Bool