fails with build with aeson-2.0

Issue #5 resolved
Former user created an issue
wt                       > /tmp/stack-7ecca05b7af93e0f/jwt-0.10.0/src/Web/JWT.hs:510:15: error:
jwt                       >     • Couldn't match type: StrictMap.HashMap T.Text Value
jwt                       >                      with: Data.Aeson.KeyMap.KeyMap Value
jwt                       >       Expected: Object -> ClaimsMap
jwt                       >         Actual: StrictMap.HashMap T.Text Value -> ClaimsMap
jwt                       >     • In the expression: ClaimsMap . Map.fromList . StrictMap.toList
jwt                       >       In an equation for ‘fromHashMap’:
jwt                       >           fromHashMap = ClaimsMap . Map.fromList . StrictMap.toList
jwt                       >     |
jwt                       > 510 | fromHashMap = ClaimsMap . Map.fromList . StrictMap.toList
jwt                       >     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jwt                       > 
jwt                       > /tmp/stack-7ecca05b7af93e0f/jwt-0.10.0/src/Web/JWT.hs:518:40: error:
jwt                       >     • Couldn't match type ‘T.Text’ with ‘Key’
jwt                       >       Expected: [aeson-2.0.2.0:Data.Aeson.Types.Internal.Pair]
jwt                       >         Actual: [(T.Text, Value)]
jwt                       >     • In the second argument of ‘($)’, namely
jwt                       >         ‘catMaybes
jwt                       >            [fmap ("iss" .=) iss, fmap ("sub" .=) sub,
jwt                       >             either ("aud" .=) ("aud" .=) <$> aud, fmap ("exp" .=) exp, ....]
jwt                       >            ++
jwt                       >              Map.toList
jwt                       >                (unClaimsMap $ removeRegisteredClaims unregisteredClaims)’
jwt                       >       In the expression:
jwt                       >         object
jwt                       >           $ catMaybes
jwt                       >               [fmap ("iss" .=) iss, fmap ("sub" .=) sub,
jwt                       >                either ("aud" .=) ("aud" .=) <$> aud, fmap ("exp" .=) exp, ....]
jwt                       >               ++
jwt                       >                 Map.toList
jwt                       >                   (unClaimsMap $ removeRegisteredClaims unregisteredClaims)
jwt                       >       In an equation for ‘toJSON’:
jwt                       >           toJSON JWTClaimsSet {..}
jwt                       >             = object
jwt                       >                 $ catMaybes
jwt                       >                     [fmap ("iss" .=) iss, fmap ("sub" .=) sub,
jwt                       >                      either ("aud" .=) ("aud" .=) <$> aud, ....]
jwt                       >                     ++
jwt                       >                       Map.toList
jwt                       >                         (unClaimsMap $ removeRegisteredClaims unregisteredClaims)
jwt                       >     |
jwt                       > 518 |     toJSON JWTClaimsSet{..} = object $ catMaybes [
jwt                       >     |                                        ^^^^^^^^^^^...
jwt                       > 
jwt                       > /tmp/stack-7ecca05b7af93e0f/jwt-0.10.0/src/Web/JWT.hs:533:54: error:
jwt                       >     • Couldn't match type: Data.Aeson.KeyMap.KeyMap Value
jwt                       >                      with: StrictMap.HashMap k0 Value
jwt                       >       Expected: StrictMap.HashMap k0 Value
jwt                       >         Actual: Object
jwt                       >     • In the second argument of ‘StrictMap.lookup’, namely ‘o’
jwt                       >       In the expression: StrictMap.lookup "aud" o
jwt                       >       In the second argument of ‘(<*>)’, namely
jwt                       >         ‘case StrictMap.lookup "aud" o of
jwt                       >            (Just as@(Array _)) -> Just <$> Right <$> parseJSON as
jwt                       >            (Just (String t)) -> pure $ Left <$> stringOrURI t
jwt                       >            _ -> pure Nothing’
jwt                       >     |
jwt                       > 533 |                      <*> case StrictMap.lookup "aud" o of
jwt                       >     |                                                      ^

reported by juhp

Comments (1)

  1. Log in to comment