Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3,608
    • Issues 3,608
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 201
    • Merge Requests 201
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14828

Closed
Open
Opened Feb 20, 2018 by jol@trac-jol
  • Report abuse
  • New issue
Report abuse New issue

panic! when using :print on some functions with class constraints?

These are the problematic ones I've found:

> :t foldl
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
> :print foldl
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-unknown-linux):
	isUnliftedType
  t1_a1H7[rt] :: TYPE t_a1H6[rt]
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1952:10 in ghc:Type

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> :t fmap
fmap :: Functor f => (a -> b) -> f a -> f b
> :print fmap
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-unknown-linux):
	isUnliftedType
  t1_a1Hu[rt] :: TYPE t_a1Ht[rt]
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1952:10 in ghc:Type

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

> :t return
return :: Monad m => a -> m a
> :print return
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-unknown-linux):
	isUnliftedType
  t1_a1Wt[rt] :: TYPE t_a1Ws[rt]
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1952:10 in ghc:Type

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

> :t pure
pure :: Applicative f => a -> f a
> :print pure
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-unknown-linux):
	isUnliftedType
  t1_a1WP[rt] :: TYPE t_a1WO[rt]
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1952:10 in ghc:Type

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

These that don't have constraints are fine:

> :print id
id = (_t1::a -> a)
> :print map
map = (_t2::(a1 -> b) -> [a1] -> [b])
> :print const
const = (_t3::a2 -> b1 -> a2)

This value and function created in the session are fine:

> let x :: Monad m => m (); x = return ()
Prelude| 
> :p x
x = (_t5::Monad m1 => m1 ())
> let f :: Monad m => Int -> m Int; f n = return (n + 1)
Prelude| 
> :p f
f = (_t6::Monad m2 => Int -> m2 Int)

mempty and mappend imported from Data.Monoid are fine:

> :m + Data.Monoid
> :p mempty
mempty = (_t7::Monoid a4 => a4)
> :p mappend
mappend = (_t8::Monoid a4 => a4 -> a4 -> a4)

foldl' and foldr imported from Data.List are not fine:

> :m + Data.List
> :p foldl'
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-unknown-linux):
	isUnliftedType
  t1_a6Qy[rt] :: TYPE t_a6Qx[rt]
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1952:10 in ghc:Type

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

> :p Data.List.foldr
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-unknown-linux):
	isUnliftedType
  t2_a6RG[rt] :: TYPE t1_a6RF[rt]
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:1952:10 in ghc:Type

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

but all and init from that same module are fine:

> :p Data.List.all
all = (_t13::Foldable t1 => (a22 -> Bool) -> t1 a22 -> Bool)
> :p Data.List.init
init = (_t14::[a29] -> [a29])

So, in a given module, among functions with class constraints, some have the error and others don't. I haven't found a value that's not a function with the error, and I haven't found a function with no class constraints exhibit the error.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture

Related issues

  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
6
Labels
bug compiler crash debugger GHCi P::normal Trac import
Assign labels
  • View project labels
Reference: ghc/ghc#14828