Extending a datatype in Haskell

后端 未结 4 1313
夕颜
夕颜 2020-12-31 08:33

Haskell newbie here.

I wrote an evaluator for a minimal assembly-like language.

Now, I want to extend that language to support some syntactic sugar which,

4条回答
  •  猫巷女王i
    2020-12-31 09:14

    Syntactic sugar is usually handled by a parser; you'd extend (not in the sense of OO inheritance) the parser to detect the new constructs and translate them to the kind of structures that your evaluator can handle.

提交回复
热议问题