0
Parsec을 사용하여 정수 함수에서 Int 유형을 가져와야합니다. N의 유형ParSec 정수 함수를 사용하여 Int?
N :: Num a => a -> Expr a
내가
Shane.hs:227:18:
Couldn't match expected type `Int' with actual type `Integer'
Expected type: Text.Parsec.Prim.ParsecT String u0 Identity Int
Actual type: Text.Parsec.Prim.ParsecT String u0 Identity Integer
In the second argument of `liftM', namely `integer'
In the second argument of `(<|>)', namely `liftM N integer'
Failed, modules loaded: none.
그것이 가능 여기 INT 타입을 추출하는 것입니다 무엇입니까 오류 인 경우 순간에 내 코드
aTerm = parens aExpression
<|> liftM GetV identifier
<|> liftM N integer
입니까? fromInteger를 어떤 방법으로 사용합니까? Int에서 Integer로 변경하는 것은 옵션이 아닙니다.
사용 사례에 따라, 확인해야 할 수도 있습니다 여부를 분석'Integer'는'Int' 범위에 있으며, 구문 분석에 실패하지합니다. –