X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=funcdeps%2Ftest.icl;h=56022e9f2f4ffa982fdf825a462d35aa0a237233;hb=0ca0e0086ac4e1b0be40f820d213fcfcb7deec20;hp=5a035458d3fef44f41bfd0cf142c1465ba178b6b;hpb=5ca0aeeb9cd8f264c1dafcd54082e429571f59c1;p=clean-tests.git diff --git a/funcdeps/test.icl b/funcdeps/test.icl index 5a03545..56022e9 100644 --- a/funcdeps/test.icl +++ b/funcdeps/test.icl @@ -1,18 +1,28 @@ module test -import StdMisc +import StdEnv :: Zero = Zero -:: Succ a = Succ - +:: Succ a = Succ a :: Ar3 a b c :== (a -> b -> c) -class C m :: (m b) +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 -instance C ((->) a) where C = \x->undef +class fmap t :: (a -> b) (t a) -> t b -Start :: (a -> b -> c) -Start = t +instance fmap ((,)a) where fmap f (a, b) = (a, f b) -t :: (Ar3 a b c) -t = C +Start = fmap inc (42, 37)