Skip to content

Possible type-checker regression in GHC 8.0 when compiling `microlens`

I just updated the GHC 8.0 snapshot I was using from 8.0.0.20160214-g977fb8 to 8.0.0.20160218-g23baff79, and suddenly hackage:microlens-0.4.2.0 fails to build with

...
Preprocessing library microlens-0.4.2.0...
[1 of 4] Compiling Lens.Micro.Type  ( src/Lens/Micro/Type.hs, dist/build/Lens/Micro/Type.o )
[2 of 4] Compiling Lens.Micro.Internal ( src/Lens/Micro/Internal.hs, dist/build/Lens/Micro/Internal.o )

src/Lens/Micro/Internal.hs:184:3: error:
    • Couldn't match type ‘s’ with ‘g0 a’
        ‘s’ is untouchable
          inside the constraints: (Traversable g,
                                   s ~ g a,
                                   t ~ g b,
                                   Applicative f)
          bound by the type signature for:
                     each :: (Traversable g, s ~ g a, t ~ g b, Applicative f) =>
                             (a -> f b) -> s -> f t
          at src/Lens/Micro/Internal.hs:184:3-27
    • In the ambiguity check for ‘each’
      To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
      When checking the class method:
        each :: forall s t a b. Each s t a b => Traversal s t a b
      In the class declaration for ‘Each’
  1. ..is this a regression or a feature? :-)
Trac metadata
Trac field Value
Version
Type Bug
TypeOfFailure OtherFailure
Priority highest
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information