jwiegley / gitlib

180 stars 56 forks source link

enable AllowAmbiguousTypes errors building with ghc 7.8.1rc1 #25

Closed jrmithdobbs closed 7 years ago

jrmithdobbs commented 10 years ago
Git/Types.hs:142:12:
    Could not deduce (Oid r0 ~ Oid r)
    from the context (MonadGit r m, MonadGit s n)
      bound by the type signature for
                 copyOid :: (MonadGit r m, MonadGit s n) => Oid r -> n (Oid s)
      at Git/Types.hs:142:12-61
    NB: ‛Oid’ is a type function, and may not be injective
    The type variable ‛r0’ is ambiguous
    Expected type: Oid r -> n (Oid s)
      Actual type: Oid r0 -> n (Oid s)
    In the ambiguity check for:
      forall r (n :: * -> *) s (m :: * -> *).
      (MonadGit r m, MonadGit s n) =>
      Oid r -> n (Oid s)
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the type signature for ‛copyOid’:
      copyOid :: (MonadGit r m, MonadGit s n) => Oid r -> n (Oid s)

Git/Types.hs:196:19:
    Could not deduce (MonadGit r m0)
      arising from the ambiguity check for ‛treeEntryToOid’
    from the context (MonadGit r m)
      bound by the type signature for
                 treeEntryToOid :: MonadGit r m => TreeEntry r -> Oid r
      at Git/Types.hs:196:19-54
    The type variable ‛m0’ is ambiguous
    In the ambiguity check for:
      forall r (m :: * -> *). MonadGit r m => TreeEntry r -> Oid r
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the type signature for ‛treeEntryToOid’:
      treeEntryToOid :: MonadGit r m => TreeEntry r -> Oid r
jrmithdobbs commented 10 years ago

If you add AllowAmbiguousTypes to default-extensions things do build.

jrmithdobbs commented 10 years ago

And cabal test in gitlib-libgit2 passes with it built this way.