[Haskell-beginners] Re: Hudak state emulation discussion - can you give me some idea?

Will Ness will_n48 at yahoo.com
Wed Mar 18 11:36:06 EDT 2009


Will Ness <will_n48 <at> yahoo.com> writes:

> infixl 8 +'
> infix  8 <'
> infix  7 :=
> infixl 6 ;              -- infixr is good too
> 
> (p; q) s = q (p s)      -- (;)  = CB  -- flip (.)
> (x:=f) s = x s (f s)    -- (:=) = S
> goto f s = f s          -- id   = I
> (f+'g) s = f s + g s
> (f<'g) s = f s < g s
> if' p c s = if (p s) then (c s) else s
> x' (a,b) = a
> i' (a,b) = b
> 

Er, forgot to include the two state updaters of the article,

x (a,b) v = (v,b)
i (a,b) v = (a,v)





More information about the Beginners mailing list