From 892075a5f701177235c0296c28899563836b42e2 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 21 Apr 2015 14:25:25 +0200 Subject: rare zooi --- fp2/week2/ReturnEnBind.icl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 fp2/week2/ReturnEnBind.icl (limited to 'fp2/week2') diff --git a/fp2/week2/ReturnEnBind.icl b/fp2/week2/ReturnEnBind.icl new file mode 100644 index 0000000..0bece5f --- /dev/null +++ b/fp2/week2/ReturnEnBind.icl @@ -0,0 +1,19 @@ +module ReturnEnBind + +import StdEnv, Random + +Start = 42 + +(bind1) infix 0 :: (St s a) (a -> (St s b)) -> St s b +//(bind1) infix 0 :: (s -> *(a,s)) (a -> (a -> *(a,s))) -> (s -> *(b,s)) +(bind1) f1 f2 = \st0 f2 (fst (f1 st0) (snd (f1 st0)) +// (r, st1) = f1 st0 +//(bind) f f2 :== \st0 -> let (r,st1) = f st0 +// in f2 r st1 + + +som2 :: (RandomSeed -> (Int,RandomSeed)) +som2 ... + +seqList1 :: [St s a] -> St s [a] +seqList1 ... -- cgit v1.2.3