[Haskell-cafe] Re: Map constructor in a DSL
Dupont Corentin
corentin.dupont at gmail.com
Thu Oct 28 08:53:46 EDT 2010
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 more generic
than data type based.
Corentin
On Thu, Oct 28, 2010 at 2:02 PM, steffen <steffen.siering at googlemail.com>wrote:
> 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] http://tom.lokhorst.eu/2009/09/deeply-embedded-dsls
> [4] http://tom.lokhorst.eu/2010/02/awesomeprelude-presentation-video
>
> On 28 Okt., 12:09, Dupont Corentin <corentin.dup... at gmail.com> wrote:
> > 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 a -> Exp ref b
> > It's from which DSL? It is accessible on the net?
> >
> > Chris suggested me that I can only define the Foldr constructor and
> deduce
> > Map from it.
> > But maybe I have to add a List constructor for that.
> >
> > But in the suggestions from Ryan and Brandon I don't understand why I
> should
> > add an extra type parameter and what it is!
> >
> > Steffen: Wow nice. I'll integrate that ;)
> >
> > 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 -> E b
> > Add :: NumE a => E a -> E a -> E a
> > etc.
> >
> > And, along with it, an untyped counterpart:
> >
> > -- | An untyped term.
> > data UE
> > = UVRef UV
> > | UConst Const
> > | UCast Type UE
> > | UAdd UE UE
> > etc.
> >
> > What that for? What's the use of having beautiful GADT if you have to
> > maintain an untyped ADT aside??
> >
> > Corentin
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-C... at haskell.orghttp://
> www.haskell.org/mailman/listinfo/haskell-cafe
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101028/0dd052c6/attachment.html
More information about the Haskell-Cafe
mailing list