How come that this works
> (* 30) 4
120
but this doesn't
> * 30 40
error: parse error on input ‘*’
(* 30) is a section, which still treats * as a binary (infix) operator, just one that's missing an argument, short for (\x -> x * 30). The parentheses themselves are part of the syntax, rather than being the explicit (but redundant) parentheses you can wrap around an arbitrary expression.
You can think of (*) as a degenerate section that is missing both arguments. You cannot otherwise use an infix operator in the prefix position without using parentheses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With