Skip to content

Bug while writing a simple parser with Parsec

module Main where

import Control.Monad.Identity
import Control.Monad.State
import Data.List
import Text.ParserCombinators.Parsec

type Name = String

data Value = VlInt Int | VlBool Bool deriving Show

data Term =
  TmVal Value
  | TmVar Name
  | TmLet Name Term Term
  | TmAdd Term Term
  deriving Show

parseTerm :: Parser Term
parseTerm = parseVal <|> parseVar <|> parseLet <|> parseAdd

And then I get:

GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( Main.hs, interpreted ) ghc: panic! (the 'impossible' happened)

(GHC version 8.0.2 for x86_64-unknown-linux):

initTc: unsolved constraints

WC {wc_insol =

\[W\] parseVal_a2YR t_a2YQ\[tau:1\] (CHoleCan: parseVal)
\[W\] parseVar_a2YY t_a2YX\[tau:1\] (CHoleCan: parseVar)
\[W\] parseLet_a2Z5 t_a2Z4\[tau:1\] (CHoleCan: parseLet)
\[W\] parseAdd_a2Z8 t_a2Z7\[tau:1\] (CHoleCan: parseAdd)}

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

Trac metadata
Trac field Value
Version 8.0.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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