gameServer/Utils.hs
changeset 3501 a3159a410e5c
parent 3500 af8390d807d6
child 3555 4c5ca656d1bb
equal deleted inserted replaced
3500:af8390d807d6 3501:a3159a410e5c
   117 unfoldrE :: (b -> Either b (a, b)) -> b -> ([a], b)
   117 unfoldrE :: (b -> Either b (a, b)) -> b -> ([a], b)
   118 unfoldrE f b  =
   118 unfoldrE f b  =
   119     case f b of
   119     case f b of
   120         Right (a, new_b) -> let (a', b') = unfoldrE f new_b in (a : a', b')
   120         Right (a, new_b) -> let (a', b') = unfoldrE f new_b in (a : a', b')
   121         Left new_b       -> ([], new_b)
   121         Left new_b       -> ([], new_b)
       
   122 
       
   123 showB :: Show a => a -> B.ByteString
       
   124 showB = B.pack .show