2 ms·
What the hell is `:@:`? Cannot google that, and the GHC docs don't tell either.
by tempodox 3y ago
What the hell is `:@:`? Cannot google that, and the GHC docs don't tell either.
- joek1301 3y agoIt defines a new infix data constructor. So if `it` and `ct` are values of type `ITerm` and `CTerm` respectively, `it :@: ct` is a value of type `ITerm`. (It could have been written using a prefix operator like `ITerm`'s other data constructors.)
- tikhonj 3y agoIt's a constructor defined with infix syntax. You can make constructors with custom infix names by starting the name with the : character. Alternatively, you could call that constructor App or something and have the same effect: data ITerm = Ann CTerm Type | Bound Int | Free Name | App ITerm CTerm deriving (Show, Eq)