[Haskell-cafe] Function application layout

Daniel Fischer daniel.is.fischer at googlemail.com
Thu May 26 14:52:06 CEST 2011


On Thursday 26 May 2011 14:35:41, Neil Brown wrote:
> foo is the function we want to apply, and eg shows how to apply it in 
> do-notation with an argument on each line.  I couldn't manage to remove 
> the r$ at the beginning of each line, which rather ruins the whole 
> scheme :-(  On the plus side, there's no brackets, it's only two extra 
> characters per line, and you can have whatever you like after the r$.

Wouldn't that be also achievable with

infixl 0 ?

(?) :: (a -> b) -> a -> b
f ? x = f x

eg = foo
  ? 2 + 1
  ? 'c'
  ? "hello" ++ "goodbye"
  ? 3.0

?



More information about the Haskell-Cafe mailing list