Re: [Haskell-cafe] expanding do notation / StateMonad example from tutorial all about monads

2005-12-31 Thread Lemmih
On 12/31/05, Marc Weber <[EMAIL PROTECTED]> wrote: > Hi.. I'm still struggling with monads ;-) > > In the tutorial "All about monads" there is the function getOne used: > > getOne:: (Random a) => (a,a) -> State StdGen a > getOne bound = do g <-get > (x,g')= return $ randomR bounds

[Haskell-cafe] expanding do notation / StateMonad example from tutorial all about monads

2005-12-31 Thread Marc Weber
Hi.. I'm still struggling with monads ;-) In the tutorial "All about monads" there is the function getOne used: getOne:: (Random a) => (a,a) -> State StdGen a getOne bound = do g <-get (x,g')= return $ randomR bounds g put g' return x In the