Equivalent of python eval in Haskell

后端 未结 5 684
闹比i
闹比i 2021-02-05 20:21

There is function in python called eval that takes string input and evaluates it.

>>> x = 1
>>> print eval(\'x+1\')
2
>>>         


        
5条回答
  •  甜味超标
    2021-02-05 20:41

    There is no eval equivalent, Haskell is a statically compiled language, same as C or C++ which does not have eval neither.

提交回复
热议问题