rare zooi
[fp1415.git] / fp2 / week2 / ReturnEnBind.icl
1 module ReturnEnBind
2
3 import StdEnv, Random
4
5 Start = 42
6
7 (bind1) infix 0 :: (St s a) (a -> (St s b)) -> St s b
8 //(bind1) infix 0 :: (s -> *(a,s)) (a -> (a -> *(a,s))) -> (s -> *(b,s))
9 (bind1) f1 f2 = \st0 f2 (fst (f1 st0) (snd (f1 st0))
10 // (r, st1) = f1 st0
11 //(bind) f f2 :== \st0 -> let (r,st1) = f st0
12 // in f2 r st1
13
14
15 som2 :: (RandomSeed -> (Int,RandomSeed))
16 som2 ...
17
18 seqList1 :: [St s a] -> St s [a]
19 seqList1 ...