[Haskell-cafe] Re: Sugar for function application
apfelmus at quantentunnel.de
Thu Mar 25 04:26:46 EDT 2010
Tillmann Rendel wrote:
> I like this idea, because it would enable non-monadic embedded DSLs to
> use layout.
> For example, consider setting properties in wxHaskell:
> layoutSet myButton $$
> text := "Ok"
> on action := doSomething
You can abuse do notation to achieve that, by wrapping the list in a
suitable Writer monad
layoutSet myButton $ do
text &= "Ok"
on action &= doSomething
(&=) :: Property a -> a -> Writer Properties ()
It's ugly semantically but pleasant syntactically.
More information about the Haskell-Cafe