[Haskell-cafe] Sparse records/ADTs

Yuri de Wit ydewit at gmail.com
Fri Oct 26 17:25:34 CEST 2012


Would this be relevant?

https://github.com/jonsterling/Data.Records


On Fri, Oct 26, 2012 at 11:17 AM, Jon Fairbairn
<jon.fairbairn at cl.cam.ac.uk>wrote:

> Twan van Laarhoven <twanvl at gmail.com> writes:
>
> > On 24/10/12 12:08, Jon Fairbairn wrote:
> >>
> >> Is there a convenient way of handling a data structure with lots
> >> of fields of different types that may or may not be filled in?
> >>
> >
> > Not sure about convenience, but here is a type safe solution
> > with O(log n) lookups and updates. The idea is to define a
> > GADT tree type with a fixed layout:
>
> Thanks for your reply (and for all the others). Since type safe
> is something that (for me) goes without saying, this is the best
> solution, but it doesn’t really satisfy the convenience aspect.
> (I had already looked at solutions using Map and contemplated a
> tree structure, but didn’t like anything I had come up with). In
> short, it looks like the answer to my question is “No.” :-/
>
> --
> Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk
>
>
> _______________________________________________
> 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/20121026/c1ecb2cc/attachment.htm>


More information about the Haskell-Cafe mailing list