
24 Dec
2010
24 Dec
'10
4:46 p.m.
On 12/24/10 10:32, Patrick LeBoutillier wrote:
test b = b ?? ("IF" ?: "THEN")
This is right-associative. This binds more tightly in the ?:. Either is sufficent to make your infix work: infixr 1 ?? infixr 1 ?: or infix 1 ?? infix 2 ?: (I picked low numbers 1 and 2 arbitrarily and because C's ?: operator is also rather low precedence. See what happens if you do + and * inside your ternary-if if you use infix numbers like 8 or 9.)