]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Kinds1.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Kinds1.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Kinds1.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Kinds1.scl
new file mode 100644 (file)
index 0000000..2f2f0d1
--- /dev/null
@@ -0,0 +1,15 @@
+class Functor f where\r
+    map :: (a -> b) -> f a -> f b\r
+\r
+data Either a b = Left a | Right b\r
+\r
+instance Functor (Either a) where\r
+    map _ (Left x)  = Left x\r
+    map f (Right y) = Right (f y)\r
+\r
+id :: Integer -> Integer\r
+id x = x\r
+\r
+main = map id (Left (12 :: Integer))\r
+--\r
+(Left 12)
\ No newline at end of file