haskell / hackage-security

Hackage security framework based on TUF (The Update Framework)
http://hackage.haskell.org/package/hackage-security
56 stars 47 forks source link

hackage-repo-tool: Fix a compile warning. #217

Closed 23Skidoo closed 6 years ago

23Skidoo commented 6 years ago

The warning was:

• The constraint ‘ToJSON WriteJSON (Signed a)’
    matches an instance declaration
  instance (Monad m, ToJSON m a) => ToJSON m (Signed a)
    -- Defined in ‘hackage-security-0.5.3.0:Hackage.Security.TUF.Signed’
  This makes type inference for inner bindings fragile;
    either use MonoLocalBinds, or simplify it using the instance

Fixed by simplifying using the instance.

hvr commented 6 years ago

I'm not sure this is a proper fix; I'd like to hear from @edsko what his type-safety intention was here...

hvr commented 6 years ago

Alright, thanks! :-)

bgamari commented 6 years ago

For the record, the motivation for this warning is described in Note [Instance and Given overlap] in TcInteract and Note [Simplifiable given constraints] in TcValidity.