Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用haskell中的其中一个,编译中的错误_Haskell_Ghc_Parsec - Fatal编程技术网

使用haskell中的其中一个,编译中的错误

使用haskell中的其中一个,编译中的错误,haskell,ghc,parsec,Haskell,Ghc,Parsec,我在Haskell是个十足的新手。 我正在尝试编译我下载的这个Haskell文件,但它给了我一些错误 No instance for (Text.Parsec.Prim.Stream s m Char) arising from a use of 'letter' at Parse.lhs:649:26-31 Possible fix: add an instance declaration for (Text.Parsec.Prim.Stream s m Char) In the fi

我在Haskell是个十足的新手。 我正在尝试编译我下载的这个Haskell文件,但它给了我一些错误

No instance for (Text.Parsec.Prim.Stream s m Char)
  arising from a use of 'letter' at Parse.lhs:649:26-31
Possible fix:
  add an instance declaration for (Text.Parsec.Prim.Stream s m Char)
In the first argument of '(<|>)', namely 'letter'
In the expression: letter <|> oneOf "_"
In the definition of 'firstAllowed':
  firstAllowed = letter <|> oneOf "_"
没有(Text.Parsec.Prim.Stream s m Char)的实例
源于在语法分析中使用“字母”。lhs:649:26-31
可能的解决方案:
为(Text.Parsec.Prim.Stream s m Char)添加实例声明
在“()”的第一个参数中,即“字母”
在表达式中:字母“_”中的一个
在“firstAllowed”的定义中:
firstAllowed=字母“\u1”中的一个
不确定这是否足够,但下面是代码中出现错误的部分:

parseIdent = do { str <- indent
                ; return (makeIdent str)
                } <?> "identifier"
  where firstAllowed = oneOf "_" <|> letter

parseIdent=do{str在您引用的部分中,本地
firstAllowed
函数似乎没有在任何地方使用。如果删除
where
行,会发生什么情况

或者,您可以尝试将此类型签名添加到
firstAllowed

 where
    firstAllowed :: Stream s m Char => ParsecT s u m Char
    firstAllowed = ...

给自己写一个计划?