X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=funcdeps%2Ftest.icl;h=56022e9f2f4ffa982fdf825a462d35aa0a237233;hb=0ea5eda00d4894e4d4a0f46351c258e12d8307c1;hp=3f9bb2175c40f3afae8a3425b4086e3082db3678;hpb=e93ca347c979046dff47bdd1f12c582a6bf70cac;p=clean-tests.git diff --git a/funcdeps/test.icl b/funcdeps/test.icl index 3f9bb21..56022e9 100644 --- a/funcdeps/test.icl +++ b/funcdeps/test.icl @@ -2,6 +2,25 @@ module test import StdEnv +:: Zero = Zero +:: Succ a = Succ a +:: Ar3 a b c :== (a -> b -> c) + +class succ a ~b :: a -> b +instance succ Zero (Succ Zero) where succ Zero = Succ Zero +instance succ a (Succ a) where succ a = Succ a + +class plus a b | succ a b :: a b +instance plus Zero a a +where + plus a b = b +instance plus (Succ a) b c | plus a (Succ b) c +where + plus (Succ a) b = plus a (Succ b) + +Start :: Int +Start = 42 + class fmap t :: (a -> b) (t a) -> t b instance fmap ((,)a) where fmap f (a, b) = (a, f b)