summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T6161.hs
blob: 1f19e67b19c149fd79c72c5ff92d9539500b25f6 (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 TypeFamilies, FlexibleContexts, FlexibleInstances #-}

module T6161 where

data family Fam  a

data instance Fam Float = FamFloat Float

class Super a where
  testSup :: a -> Float

class Super a => Duper a where
  testDup :: a -> Float

--class ( Super (Fam a) ) => Foo a where
class Duper (Fam a) => Foo a where
  testFoo :: Fam a -> Float

instance Foo a => Duper (Fam a) where
  testDup x = testFoo x + testSup x

--instance Super (Fam Float) where
--  testSup (FamFloat x) = x

instance Foo Float where
  testFoo (FamFloat _) = 5.0

testProg :: Float
testProg = testDup (FamFloat 3.0)