]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Kinds1.scl
Merge commit 'bd5bc6e45f700e755b61bd112631796631330ecb'
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Kinds1.scl
1 class Functor f where\r
2     map :: (a -> b) -> f a -> f b\r
3 \r
4 data Either a b = Left a | Right b\r
5 \r
6 instance Functor (Either a) where\r
7     map _ (Left x)  = Left x\r
8     map f (Right y) = Right (f y)\r
9 \r
10 id :: Integer -> Integer\r
11 id x = x\r
12 \r
13 main = map id (Left (12 :: Integer))\r
14 --\r
15 (Left 12)