Haskell check what operator was used

时间:2016-10-20 19:27:37

标签: haskell

Hello I need to make function that will do something based on entered operator.

Is there way to check what operator was used? for example (>=) or (+)

something like

check op | op == (+) = "Entered + operator"
         | op == (==) = "Entered == operator"
         | otherwise = "Something else"

so

 check (+)

will return: Entered + operator

0 个答案:

没有答案