
19 Jul
2018
19 Jul
'18
10:14 a.m.
I can define operators directly or through their parenthesised name:
let x .+ y = x + y let (.+) x y = (+) x y let (.+) x = (+) x let (.+) = (.+)
but I can't define them via sections:
let (x .+) = (x +) <interactive>:11:6: Parse error in pattern: x .+ let (.+ y) = (+ y) <interactive>:12:6: Parse error in pattern: .+ y
It seems natural to write, for example instance Monad Maybe where ... (>>= f) = \case Nothing -> Nothing Just a -> f a Is there any particular reason this is not possible? Thanks, Tom
2498
Age (days ago)
2498
Last active (days ago)
0 comments
1 participants
participants (1)
-
Tom Ellis