summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/Simpl020_A.hs
blob: db81be5ddff3dfc82bff420bd84474685f681e9a (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
{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
module Simpl020_A where

class GUIValue a

class GUIObject w where
  toGUIObject     :: w -> ()
  cset            :: GUIValue a => a -> w

instance GUIValue Int

class GUIObject w => HasSize w where
  width :: Int -> w

class HasSize w => HasGeometry w where
  geometry :: Int -> w

class GUIObject w => Window w where

instance (GUIObject w, Window w) => HasSize w where
  width w = geometry w

instance Window w => HasGeometry w where
  geometry g = cset g

instance GUIObject ()

instance Window ()