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