[Haskell-cafe] Applicative do?

Philippa Cowderoy flippa at flippac.org
Fri Oct 9 13:33:58 EDT 2009


Robert Atkey wrote:
> On Fri, 2009-10-09 at 18:06 +0100, Philippa Cowderoy wrote:
>
>   
>> This leads us to the bikeshed topic: what's the concrete syntax? 
>>     
>
> I implemented a simple Camlp4 syntax extension for Ocaml to do this. I
> chose the syntax:
>
>    applicatively
>    let x = foo
>    let y = bar
>    in <pure stuff>
>
> I quite like the word "applicatively".
>
>   

In an ML context I rather like it! It doesn't really feel haskelly to me 
though, partly because code that looks like ANF in Haskell is normally 
in a do block and failing that a single let block instead of a series of 
nested lets.

> Your overloading suggestion sounds to me like it would require the
> desugaring process to know something about types, but I'm not sure.
>
>   

It doesn't the way I've suggested it, whereas doing it perfectly would 
do because not all Monads are directly Applicatives. I just reckon the 
imperfection isn't too big a burden applied to new code when you can 
newtype Monads into Applicatives on demand and get sensible code.

-- 
flippa at flippac.org


More information about the Haskell-Cafe mailing list