blob: 646cf44e87cecd6f74f42f7c67ab71f618f4da9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
module T5978 where
class C from to | from -> to where
instance C Float Char where
instance C Double Bool where
polyFoo :: (C from to) => from
polyFoo = undefined
polyBar ::
(C fromA toA, C fromB toB) =>
(toA -> toB) ->
fromA -> fromB
polyBar = undefined
monoBar :: Double
monoBar = polyBar id monoFoo
-- fromA = Float, fromB = Double, toA = toB
-- [W] C Float to, C Double to
-- => [D] to ~ Char, [D] to ~ Bool
monoFoo :: Float
monoFoo = polyFoo
|