[Haskell-cafe] extensible records - Vinyl - alternatives?
Alberto G. Corona
agocorona at gmail.com
Sun May 4 20:28:18 UTC 2014
hmmm..
I doubt that the solution mentioned in the link can cover all the cases
mentioned in the OOHaskell paper. The best OO EDSL must be something like
OOHaskell with nice method invocation syntax.
2014-05-04 14:56 GMT+02:00 <mantkiew at gsd.uwaterloo.ca>:
> I found this nice stackoverflow answer.
>
>
> http://stackoverflow.com/questions/20910331/how-do-i-model-inheritance-in-haskell
>
> It seems that the "inheritance " pattern proposed there could be nicely
> automated, that is have an EDSL allowing me to write
>
> ```
> Camera inherits Pos, Vel
> ```
>
> which would get desugared according to the pattern as in the answer.
>
> Has anybody done anything similar?
>
> Michal
>
> *From: *Alberto G. Corona
> *Sent: *Sunday, May 4, 2014 4:15 AM
> *To: *adam vogt
> *Cc: *Peter Althainz; haskell-cafe
> *Subject: *Re: [Haskell-cafe] extensible records - Vinyl - alternatives?
>
> Are there any lens implementation of OOHaskell?. That would produce a
> massive exodus from the OO comunity to haskell.
>
>
> 2014-05-03 18:54 GMT+02:00 adam vogt <vogt.adam at gmail.com>:
>
>> Hello Peter,
>>
>> Could you show what you mean by "named labels"?
>>
>> Vinyl is a fine choice, but have you looked at HList >= 0.3? The
>> lenses/labels done with Data.HList.Labelable are prettier than the
>> vinyl alternative in my biased opinion. Furthermore, they support
>> changing types in the record unlike vinyl (ie. they provide a Lens
>> not Lens').
>>
>> HList is a bit slow at compile time
>> <http://code.haskell.org/~aavogt/HList-benchmark/a.html> if you make
>> records with many fields. That situation may improve soon if we take
>> advantage of the ordering on Symbol that ghc-7.8 introduced. In other
>> words, we will probably follow the lead of
>> <http://www.haskell.org/haskellwiki/CTRex> and make Records sorted by
>> their labels.
>>
>> There are quite a few other libraries
>> <
>> http://www.haskell.org/haskellwiki/Extensible_record#Libraries_on_hackage
>> >.
>> Also consider lens' makeClassy as another solution to the records
>> problem.
>>
>> Regards,
>> Adam
>>
>> On Sat, May 3, 2014 at 6:16 AM, Peter Althainz <althainz at gmail.com>
>> wrote:
>> > Dear All,
>> >
>> > I'm searching a handsome library for handling large amounts of
>> configuration
>> > data in a flexible manner. So to speak I want to use some kind of
>> > inheritance of data fields. I think this is where the extensible records
>> > discussion is a proper description of my use case.
>> >
>> > I've found 2 libraries making this work, so far:
>> >
>> > HList
>> > Vinyl
>> >
>> > I currently prefer Vinyl due to the complex types in HList, lens
>> > compatibiliy, named labels. (I love the HList and OOHaskel papers, but
>> for
>> > practical use, I currently prefer Vinyl).
>> >
>> > What do you think, what is the best way nowadays to use extensible
>> records?
>> > Is Vinyl a good choice from your point of view?
>> >
>> > regards
>> > Peter
>> >
>> > _______________________________________________
>> > Haskell-Cafe mailing list
>> > Haskell-Cafe at haskell.org
>> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>> >
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
>
> --
> Alberto.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
--
Alberto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140504/993b045d/attachment.html>
More information about the Haskell-Cafe
mailing list