
24 Dec
2010
24 Dec
'10
10:32 a.m.
Hi, I'm just messing around with infix operators, and I'm trying to implement some kind of ternary if operator: (??) :: Bool -> (Bool -> a) -> a (??) = flip ($) (?:) :: a -> a -> (Bool -> a) t ?: f = \b -> if b then t else f test b = b ?? ("IF" ?: "THEN") I would like to get rid of the parentheses around the ("IF" ?: "THEN") part, but I'm not familiar with the use of theinfixr/infixl functions. I'm not sure which one to use in this case and how exactly to use it. Can anyone shed some light? Thanks a lot, Patrick -- ===================== Patrick LeBoutillier Rosemère, Québec, Canada