Safe Haskell | None |
---|---|
Language | Haskell2010 |
Octane.Utility.Embed
Description
These helper functions are usually used with embedFile
.
- decodeBimap :: (FromJSON (Map b a), Ord a, Ord b) => ByteString -> Bimap a b
- decodeMap :: FromJSON (Map a b) => ByteString -> Map a b
- decodeSet :: (FromJSON a, Ord a) => ByteString -> Set a
Documentation
decodeBimap :: (FromJSON (Map b a), Ord a, Ord b) => ByteString -> Bimap a b Source #
Decodes some bytes into a bidirection map. The bytes are assumed to be a
JSON object mapping values to keys. That means the resulting bimap is
twist
ed from what you might expect.
>>>
decodeBimap "{ \"value\": \"key\" }" :: Bimap.Bimap String String
fromList [("key","value")]