[Haskell-cafe] Let's teach GHC idiom brackets!

Christopher Done chrisdone at gmail.com
Thu Feb 19 11:08:50 UTC 2015


On 19 February 2015 at 11:37, Mathieu Boespflug <mboes at tweag.net> wrote:
>  how would I write the following using idiom brackets?
>
> (,) <$> g x y <*> h (g x y)

(| (g x y,h (g x y)) |)

With applicative-quoters: [i|(,) (g x y) (h (g x y))|]

> or
>
> f <*> g x y <*> h ((,) <$> g x y)

(|id f (g x y) (h (| (g x y,)) |) |)

With applicative-quoters: [i|id f (g x y) (h [i|(,) (g x y)|])|]

(nesting permitting)


More information about the Haskell-Cafe mailing list