summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T7147.hs
blob: 247e5f0fcd9f94bab8dbd045352f18735601137e (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
30
31
32
33
34
35
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}

module Prog where

class AddName i d | d->i where 
  addName :: d -> d

class Rec rec struct | rec->struct where
  mapRec :: (struct->struct) -> rec -> rec

-- We got a very bogus siguature for addNameRec in thc 7.6rc1
-- addNameRec :: forall rec struct.
--                Recursive.Rec rec struct
--                -> DefinedNames.AddName (GHC.Prim.Any *) struct
--                -> rec
--                -> rec

addNameRec x = mapRec addName x

instance AddName Int Bool where
  addName = error "urk"
instance AddName Float Char where
  addName = error "urk"

instance Rec Char Bool where
  mapRec = error "urk"
instance Rec Bool Char where
  mapRec = error "urk"


foo1 :: Char -> Char
foo1 = addNameRec 

foo2 :: Bool -> Bool
foo2 = addNameRec