Skip to content

ala from Control.Lens.Wrapped panics

Panic.hs:

module Panic where

import Control.Lens.Wrapped
import Data.Monoid

foo :: Maybe String
foo = ala Last foldMap [Just "foo"]

main.hs:

module Main where
import Panic (foo)

main :: IO ()
main = print foo
$ ghc -c -O2 Panic.hs
$ ghc -c -O2 main.hs
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.0.20170404 for x86_64-unknown-linux):
        splitTyConApp
  (Exchange (Unwrapped (Last String)) (Unwrapped (Last String)) |> <*
                                                                    -> * -> *>_N) (Maybe
                                                                                     [Char]) ((Identity |> <*
                                                                                                            -> *>_N) (Maybe
                                                                                                                        [Char]))
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1134:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1105:34 in ghc:Type

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

The GHC version is 8134f7d4.

Control.Lens.Wrapped is from the latest version of lens on GitHub: https://github.com/ekmett/lens/blob/9c4447de7ef57f67dbe293320d45bd8a546be522/src/Control/Lens/Wrapped.hs

Edited by Fumiaki Kinoshita
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information