Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newtype EventId =
- EventId
- { getEventId :: ByteString
- }
- deriving (Eq)
- instance Show EventId where
- showsPrec _ = shows . B16.encodeBase16 . getEventId
- instance ToJSON EventId where
- toJSON e = AesonTypes.String $ pack $ exportEventId e
- instance FromJSON EventId where
- parseJSON = withObject "EventId" $ \i -> do
- i' <- i .: "id"
- return $ fromJust $ eventId' i'
- ####
- • No instance for (FromJSON ByteString) arising from a use of ‘.:’
- • In a stmt of a 'do' block: i' <- i .: "id"
- In the expression:
- do i' <- i .: "id"
- return $ fromJust $ eventId' i'
- In the second argument of ‘($)’, namely
- ‘\ i
- -> do i' <- i .: "id"
- return $ fromJust $ eventId' i'’
- |
- 52 | i' <- i .: "id"
- | ^^^^^^^^^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement