Parsec で整数関数から Int 型を取得する必要があります。現時点での私のコードは
aTerm = parens aExpression
<|> liftM GetV identifier
<|> liftM N integer
N の型はどこですか
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 型を抽出することはできますか? 何らかの方法で fromInteger を使用していますか? Int から Integer への変更はオプションではありません。