[erlang-questions] *current* value?

Joe Armstrong erlang@REDACTED
Fri Oct 19 21:44:22 CEST 2007


What do I think?

I think if we do this we'll have to spend several years writing
thousands of lines
of text explaining why monads are really easy to understand.

Given the *enormous* difficutly that people have in understanding monads in
Haskell it might be inadvisable to introduce them into Erlang.

Some amazing command in emacs would be nice

meta-x monadify-region might daisy-chain an additional dummy argument through
a sequence of function calls in the manner you describe :-)

/Joe


On 10/18/07, Joel Reymont <joelr1@REDACTED> wrote:
> The process dictionary could be used to simplify parsing, I think.
>
> You could write this Haskell parser combinator
>
> whileStatement = do
>    reserved "While"
>    e <- expr
>    reserved "Begin"
>    xs <- statements
>    reserved "End"
>    return $ While e (Compound xs)
>
> like this
>
> reserved("while"),
> E = expr(),
> reserved("begin"),
> Xs = statements(),
> reserved("end"),
> {while, e, {compound, xs}}.
>
> instead of the more verbose
>
> {S1, ok} = reserved(S, "while"),
> {S2, E} = expr(S1),
> {S3, ok} = reserved(S2, "begin"),
> {S4, Xs} = statements(S3),
> {S5, ok} = reserved(S4, "end"),
> {S5, {while, e, {compound, xs}}}.
>
> This assumes that parsers throw exceptions upon failure.
>
> What do you think?
>
> --
> http://wagerlabs.com
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list