无法从此表达式派生(显示)

时间:2012-04-22 11:19:02

标签: haskell

此代码不起作用

data Expression = Atom String
  | Sequence [Expression]
  deriving (show)

我收到此错误:

$ runghc bug.hs
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-apple-darwin):
    nameModule show{tv a9J}

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

我做错了什么,还是确实是个错误?

1 个答案:

答案 0 :(得分:6)

类型类以大写字母开头,因此应为Show,而不是show。虽然,GHC应该给你一个体面的错误信息,而不是恐慌,所以该部分是indeed a bug