I don't know whether there is a regression but there is a difference between mono-traversable-1.0.4.0 and mono-traversable-1.0.5.0:
With 1.0.4.0, the following code compiles, but with 1.0.5.0, FlexibleContexts is needed. Without it, there is a compiler error. The code was tested on nightly-2017-12-08 and lts-10.0
Code:
{-# LANGUAGE NoImplicitPrelude, GeneralizedNewtypeDeriving, TypeFamilies #-}
module Lib where
import ClassyPrelude
newtype Foo = Foo ByteString deriving MonoFoldable
type instance Element Foo = Word8
Error:
/home/jchia/hs/test/src/Lib.hs:7:39: error:
• Non type-variable argument
in the constraint: Eq (Element ByteString)
(Use FlexibleContexts to permit this)
• In the expression:
ghc-prim-0.5.1.1:GHC.Prim.coerce
@(Eq Element ByteString =>
Element ByteString -> ByteString -> Bool)
@(Eq Element Foo => Element Foo -> Foo -> Bool)
oelem
In an equation for ‘oelem’:
oelem
= ghc-prim-0.5.1.1:GHC.Prim.coerce
@(Eq Element ByteString =>
Element ByteString -> ByteString -> Bool)
@(Eq Element Foo => Element Foo -> Foo -> Bool)
oelem
When typechecking the code for ‘oelem’
in a derived instance for ‘MonoFoldable Foo’:
To see the code I am typechecking, use -ddump-deriv
In the instance declaration for ‘MonoFoldable Foo’
|
7 | newtype Foo = Foo ByteString deriving MonoFoldable
| ^^^^^^^^^^^^
I don't know whether there is a regression but there is a difference between mono-traversable-1.0.4.0 and mono-traversable-1.0.5.0:
With 1.0.4.0, the following code compiles, but with 1.0.5.0,
FlexibleContexts
is needed. Without it, there is a compiler error. The code was tested on nightly-2017-12-08 and lts-10.0Code:
Error: