updated practicum files
[fp1415.git] / fp2 / week2 / mart / oldold / old / ReturnEnBind.icl
1 module ReturnEnBind
2
3 import StdEnv, Random
4
5 Start = (r1, r2, r3, r4, nullRandomSeed, s1, s2, s3)
6 where
7 (r1, s1) = som2 nullRandomSeed
8 (r2, s2) = som2 s1
9 (r3, s3) = som2 s2
10 (r4, _) = som2 s3
11
12 (bind1) infix 0 :: (St s a) (a -> (St s b)) -> St s b
13 (bind1) f g = uncurry g o f
14
15 som2 :: (RandomSeed -> (Int,RandomSeed))
16 som2 = (\s -> random s) bind1 (\a -> random (snd a))
17
18 seqList1 :: [St s a] -> St s [a]
19 seqList1 ...