X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FKinds1.scl;h=c599b3369b3ccaa2c58f7a477caa80cdb37195ac;hp=2f2f0d1d199567739dbf405ca141c73498400567;hb=172abed5dbf73c1304a7a95bb8504ea293556948;hpb=dcca7344e1da6f975859fd79fbc6cead7d363042 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 index 2f2f0d1d1..c599b3369 100644 --- 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 @@ -1,15 +1,15 @@ -class Functor f where - map :: (a -> b) -> f a -> f b - -data Either a b = Left a | Right b - -instance Functor (Either a) where - map _ (Left x) = Left x - map f (Right y) = Right (f y) - -id :: Integer -> Integer -id x = x - -main = map id (Left (12 :: Integer)) --- +class Functor f where + map :: (a -> b) -> f a -> f b + +data Either a b = Left a | Right b + +instance Functor (Either a) where + map _ (Left x) = Left x + map f (Right y) = Right (f y) + +id :: Integer -> Integer +id x = x + +main = map id (Left (12 :: Integer)) +-- (Left 12) \ No newline at end of file