summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/FD3.hs
blob: 475e379c108ed9183b33da8579e3fdea9238b532 (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
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}

-- #1795

module ShouldCompile where

data A a = A

class MkA a b | a -> b where
   mkA :: a -> A b

instance MkA a a where

translate :: (String, a) -> A a
translate a = mkA a

{- From the call to mkA

[W] MkA alpha beta
[W] alpha ~ (String,a)
[W] A beta ~ A a

==>  beta:=a, alpha:=(String,a)
-}