s243a

ats.Types.ToStateJSON.hs

Nov 17th, 2014
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. starting at line of
  2.  
  3. https://github.com/waldheinz/ads/blob/master/src/lib/Types.hs
  4. ------------------------------------------------------------------------ STM aware serialization----------------------------------------------------------------------class ToStateJSON a where  toStateJSON :: a -> STM Valueinstance ToStateJSON a => ToStateJSON [a] where  toStateJSON xs = toJSON <$> mapM toStateJSON xsinstance ToStateJSON a => ToStateJSON (TVar a) where  toStateJSON v = readTVar v >>= toStateJSON
Advertisement
Add Comment
Please, Sign In to add comment