[Haskell-cafe] monad subexpressions

Neil Mitchell ndmitchell at gmail.com
Thu Aug 2 20:56:09 EDT 2007


Hi Chris,

> I've heard Simon (Peyton-Jones) twice now mention the desire to be able
> to embed a monadic subexpression into a monad.

I think this is a fantastic idea, please do so!

>     $( expr   )   -- conflicts with template haskell
>     ( <- expr )   -- makes sense, and I think it's unambiguous
>
> Other ideas:
>
>     ``expr``      -- back-ticks make sense for UNIX shell scripters
>     (| expr |)    -- I don't think anything uses this yet

This final (| one |) looks way too much like template haskell, it has
the feel of template haskell, even if it isn't yet in the syntax. Your
(<- proposal) feels a bit like an operator section - I'm not sure if
that is a good thing or a bad thing, but for some reason feels
slightly clunky and high-syntax overhead, perhaps because of the
inevitable space between the <- and expr, and that ()<- are all fairly
high semantic value currently in Haskell, while this extension should
blend in, rather than stand out. The `` syntax is clever, and I like
it, but I worry that its quite a long way from the current use of ` as
infix, although I'm not sure if that is a particular issue given -
(negation/subtraction) and -- (comment) couldn't be more different.

Thanks

Neil


More information about the Haskell-Cafe mailing list