Ticket #5978: TypeCheck7_4_1.hs

File TypeCheck7_4_1.hs, 441 bytes (added by Lemming, 2 years ago)
Line 
1{-# LANGUAGE MultiParamTypeClasses #-}
2{-# LANGUAGE FunctionalDependencies #-}
3module TypeCheck7_4_1 where
4
5class C from to | from -> to where
6
7instance C Float Char where
8instance C Double Bool where
9
10
11polyFoo :: (C from to) => from
12polyFoo = undefined
13
14polyBar ::
15   (C fromA toA, C fromB toB) =>
16   (toA -> toB) ->
17   fromA -> fromB
18polyBar = undefined
19
20
21monoFoo :: Float
22monoFoo = polyFoo
23
24monoBar :: Double
25monoBar = polyBar id monoFoo