X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Ftests%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FFunctor.scl;fp=bundles%2Forg.simantics.scl.compiler%2Ftests%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FFunctor.scl;h=0000000000000000000000000000000000000000;hb=a8758de5bc19e5adb3f618d3038743a164f09912;hp=6bbd359794113ce6adcd1ffd68d69f73efd0b5b1;hpb=12d9af17384d960b75d58c3935d2b7b46d93e87b;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Functor.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Functor.scl deleted file mode 100644 index 6bbd35979..000000000 --- a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Functor.scl +++ /dev/null @@ -1,23 +0,0 @@ -import "JavaBuiltin" as Java - -class Functor f where - map :: (a -> b) -> f a -> f b - -data Foo a = Foo a - -instance Functor Foo where - map f (Foo x) = Foo (f x) - -instance Functor Maybe where - map f Nothing = Nothing - map f (Just x) = Just (f x) - -data List a = Nil | Cons a (List a) - -instance Functor List where - map f Nil = Nil - map f (Cons h t) = Cons (f h) (map f t) - -main = map (map (Java.iadd 1)) (Cons Nothing (Cons (Just (1 :: Integer)) Nil)) --- -(Cons null (Cons 2 Nil)) \ No newline at end of file