#haskell - Mon 19 Feb 2007 between 06:02 and 06:08

NY Lost Funds



lambdabotNot in scope: `readIORef'
xpika> runST ( newIORef 3 >>= readSTRef )
lambdabotNot in scope: `readSTRef'
xpika:(
sorearBaughn: unsafePerformIO is typesafe. IORef is typesafe. the combination is *not*
xpikanow that's just mean
sorearxpika: dons declared that State is good enough for anybody
xpika: and he doesn't seem to think not importing unsafeIOtoST is enough
xpikarunStateT ( get ) 3
> runStateT ( get ) 3
lambdabotadd an instance declaration for (Show (m (s, s)))
sorear> runState get 3
lambdabot(3,3)
Baughn@type runState
lambdabotforall s a. State s a -> s -> (a, s)
sorearBaughn:
@docs System.IO.Unsafe
lambdabothttp://haskell.org/ghc/docs/latest/html/libraries/base/System-IO-Unsafe.html
xpika> runStateT ( get ) 3
sorearBaughn: ^^^ read the haddock for unsafePerformIO
xpika> runStateT ( put 4 >> get 3 ) 3
lambdabotadd an instance declaration for (Show (m (a, s)))
xpika> runStateT ( do { put 4 ; get 3 }) 3
lambdabotadd an instance declaration for (Show (m (a, s)))
Baughn@docs runStateT
lambdabotrunStateT not available
fuzani've been frustrating myself with bncf for the past couple hours. i'm trying to define the grammar for a c-like language in which you have to variables must be defined before any expressions/functions. my problem however is that functions and variables both consume a "Type" terminal, in which case if I define any variables before a function my parser dies upon reaching the '(' (since it's trying ot make a variable )
xpika> runStateT ( put 4 >> get ) 3
lambdabotadd an instance declaration for (Show (m (s, s)))
xpika> runState ( put 4 >> get ) 3
lambdabot(4,4)
xpikawhat does the T do?
quicksilverTransformer
StateT is a monad transformed, you apply it to another 'base' monad
xpikaas apposed to ?
such as IO?
quicksilverthat's what the 'm' in in the show m (s,s) was
Baughnxpika: As opposed to State, for example
muxrunStateT (modify (+1) >> liftIO $ putStrLn "incremented") 3
quicksilveryes, for example

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 

IrcArchive

NY Lost Funds