summaryrefslogtreecommitdiff
path: root/fp2/week2/ReturnEnBind.icl
blob: 0bece5f3725f17ae4678bb4d489f221f40dcc54f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 ...