Indentation in do notation

19 views
Skip to first unread message

dag.od...@gmail.com

unread,
Mar 28, 2012, 8:51:37 PM3/28/12
to haskell-se...@googlegroups.com
Hello

I understand why the end tag in do-notation must be indented further than its start tag. I understand that this is consistent with how do-notation is otherwise parsed. But is it technically necessary, or is it just enforced for consistency? Allow me to argue two points:

  1. DoAndIfThenElse shows that convenience and intuitiveness is valued more than consistency in the case of do notation.
  2. The embedded XML syntax of HSX is a rather special case that doesn't really feel like normal code: it both is and feels more like pragma instructions to a pre-processor. Staying consistent with how the Haskell is parsed is rather paradoxical — in deed, the XML syntax itself is not "valid Haskell".

Unless there are technical reasons for the current parsing rules in do notation, I would really prefer the restriction to be lifted. I think it would be less confusing to people who haven't used HSX or HSP before, too.


Cheers, and thanks for all the good work,

Dag

Niklas Broberg

unread,
Mar 29, 2012, 3:18:28 AM3/29/12
to haskell-se...@googlegroups.com
That's a good point actually. Having just implemented the mentioned DoAndIfThenElse, I doubt it would be difficult to do as you suggest. I'll have a go at implementing this to get a feel for how difficult it would be, while waiting for more input.

Cheers,

/Niklas

Niklas Broberg

unread,
Mar 29, 2012, 4:58:14 AM3/29/12
to haskell-se...@googlegroups.com
On Thu, Mar 29, 2012 at 9:18 AM, Niklas Broberg <niklas....@gmail.com> wrote:
That's a good point actually. Having just implemented the mentioned DoAndIfThenElse, I doubt it would be difficult to do as you suggest. I'll have a go at implementing this to get a feel for how difficult it would be, while waiting for more input.

Affirmative, no problem at all implementing it. So, anyone against?

/Niklas

Jeremy Shaw

unread,
Mar 29, 2012, 10:43:18 AM3/29/12
to haskell-se...@googlegroups.com
Nice! I am *for* it.

On Thu, Mar 29, 2012 at 3:58 AM, Niklas Broberg

> --
> You received this message because you are subscribed to the Google Groups
> "Haskell Server Pages" group.
> To post to this group, send email to haskell-se...@googlegroups.com.
> To unsubscribe from this group, send email to
> haskell-server-p...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/haskell-server-pages?hl=en.

dag.od...@gmail.com

unread,
Mar 29, 2012, 11:03:23 AM3/29/12
to haskell-se...@googlegroups.com
On 29 March 2012 10:58, Niklas Broberg <niklas....@gmail.com> wrote:
Affirmative, no problem at all implementing it. So, anyone against?

Cool!
Reply all
Reply to author
Forward
0 new messages