]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/InstanceHierarchy.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / InstanceHierarchy.scl
1 import "Prelude" hiding (zero, one)
2
3 class MyAdditive a where
4     zero :: a
5     
6 class (MyAdditive a) => MyRing a where
7     one :: a
8
9 instance MyAdditive Integer where
10     zero = 0
11
12 instance MyRing Integer where
13     one = 1
14     
15 data Poly a = Poly [a]
16
17 instance (MyAdditive a) => MyAdditive (Poly a) where
18     zero = Poly []
19
20 instance (MyRing a) => MyRing (Poly a) where
21     one = Poly [one]
22     
23 main :: Poly Integer
24 main = one
25 --
26 [1]