[Re-sending to the list, sorry for the doubled mail, John] Hi John,
Am Samstag, den 08.11.2008, 12:32 -0800 schrieb John MacFarlane:
> I've uploaded an early version of gitit, a Haskell wiki program, to
> HackageDB. Gitit uses HAppS as a webserver, git for file storage,
> pandoc for rendering the (markdown) pages, and highlighting-kate for
> highlighted source code.
looking through your code, I see this:
newSession :: (MonadState AppState (Ev (t GHC.Conc.STM)), MonadTrans t,
Monad (t GHC.Conc.STM)) =>
SessionData -> Ev (t GHC.Conc.STM) SessionKey
newSession u = do
key <- getRandom
setSession key u
return key
for a project of mine, I had so solve a similar problem, and first I
used this way, but I’m wondering: The event is serialized without the
random seed (I think), so when your app crashes and the event log is
re-done, you might get a different key? Or does is getRandom function
somehow deterministical?
My solution was to pass a RNG into my function:
> addNewIssue :: MonadState State m => StdGen -> m Issue
and then use
> gen <- liftIO $ newStdGen
> i <- update $ AddNewIssue gen
But maybe I’m worring too much... what do you think?
Greetings,
Joachim
--
Joachim "nomeata" Breitner
mail: [EMAIL PROTECTED] | ICQ# 74513189 | GPG-Key: 4743206C
JID: [EMAIL PROTECTED] | http://www.joachim-breitner.de/
Debian Developer: [EMAIL PROTECTED]
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
