Thank you for your rich responses.
Indeed I think I miss some thinks in my DSL, that would make things easier
to deal with lists and first class functions.
I don't really know what for now.
Perhaps a List Constructor? Or a constructor on functions like yours Ryan?
EAp :: Exp ref (a - b) - Exp ref
I think you would love to have a look at AwesomePrelude[1] or a fork
of AwesomePrelude using associated types[2]
Some more background information by Tom Lokhorst [3][4].
[1] http://github.com/tomlokhorst/AwesomePrelude
[2] http://github.com/urso/AwesomePrelude
[3]
This is really cool.
The blog post [3] finally explained to me why I had so much difficulties
implementing the Equal constructor ;)
I shared this in a previous thread:
http://osdir.com/ml/haskell-cafe@haskell.org/2010-06/msg00369.html
Maybe latter I'll shift to a class type based DSL. They seem
2010-10-28 12:09, Dupont Corentin skrev:
I'm also looking at the Atom's DSL to get inspiration.
Something I don't understand in it is that it has two languages, on typed:
data E a where
VRef :: V a - E a
Const:: a - E a
Cast :: (NumE a, NumE b) = E a -
On Thu, Oct 28, 2010 at 3:09 AM, Dupont Corentin
corentin.dup...@gmail.com wrote:
EAp :: Exp ref (a - b) - Exp ref a - Exp ref b
It's from which DSL? It is accessible on the net?
It's my own, just written off the top of my head as an example.
Accessible on the net: yes, it's in your email.
Hi,
I think you may want to over think your types again.
Especially your Evaluator-Monad, and maybe your Map constructor.
The Problem is, due to your use of Either and the need for evalObs to
finally transform from Obs [a] type to Evaluator [a] you will end
up in another Monad for Either:
Ah, it's too early in the morning...
There is still some room to simplify (e.g. fuse the liftE (map ...)
ops).
Here a simpler Version:
evalObs (Map f obs) = liftE (map (evalObs.f.Konst)) (evalObs obs)
=
either (return.Left)