Reputation: 33
In SML the "nonfix" operator can be used like:
datatype Proposition = Not_ of Proposition
nonfix ~:
val ~: = Not_
In Haskell it would be like:
data Proposition = Not_ Proposition
nonfix ~
(~) = Not_
But I didn't find an equivalent to "nonfix" in Haskell.
Upvotes: 3
Views: 167
Reputation: 153222
You didn't find an equivalent because there isn't one. Make a different plan. Options include a non-embedded DSL; quasiquoters; using postfix instead of prefix; using a non-operator name (such as not
or (!)
); using CPP or another preprocessor.
Upvotes: 2