stefan (& list)
i have been looking at this a little since your prompt
and have re-instated the (P a ==> P s a) patch, this
time slightly more useful and less intrusive. [1]
> also, patterns then wouldn't represent pure
> computations anymore.
precisely the reason why i left it alone!
> i see what you mean; my goal atm is to have some kind
> of DSL that can be taught to non-programmers, and
> based on my experiences with the SC pattern system, i
> wanted to give yours a try.
i wonder if you considered writing a parser for a very
simple pattern language, like the ones alex mclean has
been making? i think these are an interesting
alternative to an embedded-DSL, which still leave
non-programmers writing haskell.
i mention this because i find the only real problem
with 'plain' haskell is precisely notational -- and
this not just for non-programmers. in particular the
'temporary naming' that is often required in the
interaction between monadic and non-monadic functions.
i've often wondered about an alternate 'do' notation
with a left-to-right rule such that if 'a' and 'y' are
monadic values as in:
do a' <- a
y' <- y
return (a' + b / (x * y'))
we could instead write:
^a + b / (x * ^y)
or even drop the ^ (or whatever symbol) and have the
re-writing be 'type-directed'.
bests
rohan
[1] there is a new runP function that allows you to
provide a monadic 'update' function over the pattern
state that is evaluated each time the pattern is
'stepped', the result of the previous step (ie. for a
pattern (P st a) a value of type a) is also provided to
the update function. the 'prp' function (now even a
worse name!) allows patterns to run a pure function
over the pattern state from within the pattern. there
are trivial examples at:
Help/Pattern/Step/prp.help.lhs
Help/Pattern/Step/prp/x-c.hs
certainly not helpful for non-programmers, and i still
would not take it as any kind of starting point!
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art