happstack-state-0.5.1: Event-based distributed state.

Happstack.State.Util

Contents

Synopsis

Random numbers

getRandom :: Random a => AnyEv aSource

Get a random number.

getRandomR :: Random a => (a, a) -> AnyEv aSource

Get a random number inside the range.

TH helpers

inferRecordUpdaters :: Name -> Q [Dec]Source

Infer updating functions for a record. Given a data declaration of data Foo = Foo {bar :: String, baz :: Int} then $(inferRecordUpdaters ''Foo) will define functions a_bar :: String -> Foo -> Foo, withBar :: Update String a -> Update Foo a, etc. that can be used as convenience updaters.