What is the most modern associative list in types?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the most modern associative list in types?

Serguey Zefirov
Hello cafe.

I am trying to express some environment in types to constrain program behavour. For this I need associative list of types, something along the lines of [(Symbol, *)] so that I can lookup on "variable" name and get type associated with it.

I looked into HList library but it does not provide one most generally useful way (albeit there are dozen or so of ways in there).

So where can I get most modern HList-like library? Or what should I read to get most modern HList myself?

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: What is the most modern associative list in types?

Artem Pelenitsyn
Hello Serguey,

I think a very similar task was tackled by Richard Eisenberg in his Stitch manuscript (from 2018) by simple vectors (i.e length-indexed lists): checkout Section 6 of https://cs.brynmawr.edu/~rae/papers/2018/stitch/stitch.pdf, and the Ctx type in particular.
They use De Bruijn, so your assoc lists end up just vectors. Otherwise, it would be the same HList, essentially. So maybe this answer is not enlightening, but maybe you find the paper useful, at least.

--
Kind regards,
Artem Pelenitsyn


On Tue, 23 Jul 2019 at 05:45, Serguey Zefirov <[hidden email]> wrote:
Hello cafe.

I am trying to express some environment in types to constrain program behavour. For this I need associative list of types, something along the lines of [(Symbol, *)] so that I can lookup on "variable" name and get type associated with it.

I looked into HList library but it does not provide one most generally useful way (albeit there are dozen or so of ways in there).

So where can I get most modern HList-like library? Or what should I read to get most modern HList myself?
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: What is the most modern associative list in types?

Serguey Zefirov
Yes, it is extremely useful, thank you very much!

вт, 23 июл. 2019 г. в 19:51, Artem Pelenitsyn <[hidden email]>:
Hello Serguey,

I think a very similar task was tackled by Richard Eisenberg in his Stitch manuscript (from 2018) by simple vectors (i.e length-indexed lists): checkout Section 6 of https://cs.brynmawr.edu/~rae/papers/2018/stitch/stitch.pdf, and the Ctx type in particular.
They use De Bruijn, so your assoc lists end up just vectors. Otherwise, it would be the same HList, essentially. So maybe this answer is not enlightening, but maybe you find the paper useful, at least.

--
Kind regards,
Artem Pelenitsyn


On Tue, 23 Jul 2019 at 05:45, Serguey Zefirov <[hidden email]> wrote:
Hello cafe.

I am trying to express some environment in types to constrain program behavour. For this I need associative list of types, something along the lines of [(Symbol, *)] so that I can lookup on "variable" name and get type associated with it.

I looked into HList library but it does not provide one most generally useful way (albeit there are dozen or so of ways in there).

So where can I get most modern HList-like library? Or what should I read to get most modern HList myself?
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: What is the most modern associative list in types?

Daniel Díaz Carrete
In reply to this post by Serguey Zefirov

Hi Serguey,

 

I don’t know what extra functionality you require but, for what is worth, my library red-black-record features a Symbol-to-Type map . It’s implemented as a type-level red-black-tree.

 

https://hackage.haskell.org/package/red-black-record-2.0.2.2/docs/Data-RBR.html#t:Map

 

The map can be manipulated with the Insert, Delete and Value associated type families.

 

Regards,

Daniel Díaz


> Hello cafe.


>
> I am trying to express some environment in types to constrain program
> behavour. For this I need associative list of types, something along the
> lines of [(Symbol, *)] so that I can lookup on "variable" name and get type
> associated with it.
>
> I looked into HList library but it does not provide one most generally
> useful way (albeit there are dozen or so of ways in there).
>
> So where can I get most modern HList-like library? Or what should I read
> to get most modern HList myself?  


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.