I want to apply the function of argument 3 differently based on a boolean value (one of the arguments).
I would like to be able to apply it in an infix manner so that I can relate it (example below). something like the following, but it really works.
f :: Bool -> a -> a -> a
f True i j = i
f False i j = j
... y `(f True)` z `(f False)` b
Do I need to have Bool as a second variable? Or something different? I am lost.
PS the reason I wanted to do this was to have an extra append function
source
share