frasertweedale / hs-jose

Haskell JOSE and JWT library
http://hackage.haskell.org/package/jose
Apache License 2.0
122 stars 46 forks source link

Overlapping instance #18

Closed jkarni closed 8 years ago

jkarni commented 8 years ago

There are overlapping instances defined for AsError without OVERLAPS/OVERLAPPABLE pragmas. Attempting to use Error as an AsError results in:

Overlapping instances for Jose.AsError Jose.Error
  arising from a use of ‘Jose.decodeCompact’
Matching instances:
  instance Jose.AsError Jose.Error -- Defined in ‘Crypto.JOSE.Error’
  instance Jose.AsJWTError e => Jose.AsError e
    -- Defined in ‘Crypto.JWT’
In the expression: Jose.decodeCompact
In the second argument of ‘($)’, namely
  ‘Jose.decodeCompact $ BSL.fromStrict hdr’
In the expression:
  withExceptT convertErr $ Jose.decodeCompact $ BSL.fromStrict hdr

The options are adding the overlapping pragmas, or making the instance for JWTError just instance AsError JWTError where {...}. The latter seems more reasonable to me, since

PR #17 implements the second option.

(And thanks for the library, by the way!)

frasertweedale commented 8 years ago

fixed in 7bd2d194ba9f5b82786a0fa04ba540cf68b0aef8