Hi JP,

Thanks for your response. :D

On Mon, May 21, 2012 at 12:53 AM, Jean-Philippe Bernardy
<[email protected]> wrote:
> On Sun, May 20, 2012 at 10:44 PM, Favonia <[email protected]> wrote:
>> To me, typeclass seems more Haskell-ish and I would like to stick to
>> that if possible.
> Typeclasses are perhaps the clunkiest part of Haskell. Certainly you can't
> say that records are less Haskellish :)

Well I am comparing the coding styles, not particular constructs. I
was comparing typeclasses+non-recursive records and fixpoints of
recursive definitions of records. I feel Haskell provides a little bit
more syntax sugars for the former. In the end they are all valid
Haskell and this is just my personal taste. I did try to give some
technical, objective reasons below:

>> Two technical downsides of Prototype are that we
>> need to define all kinds of accessors, and that I am afraid it will be
>> slightly less efficient. I would like to understand if there are
>> reasons that we need Prototype. To clarify: I am fine with Prototype
>> as long as there's a usage for which typeclasses and records are
>> simply too awkward. It's very likely that I, as a beginner, overlooked
>> some important code in Yi. :-)

> What we want to achieve is to give a number of default cases in the codebase
> and let the user chose one of them and extend/refine it. Perhaps you can
> show both encodings side by side (including client code) so we can see the
> pros and cons clearly.

Yes I can see the purpose of Prototype (fixpoints of recursive
definitions of records) and I certainly want that, but I think
typeclasses+non-recursive records can serve our purpose too. I have
forked the repo on github but am not sure how much time I need to
revamp the whole core system. I guess whether there is a need to use
Prototype depends on whether these is mutual recursion between fields,
whether you want to extend it incrementally several times, and whether
the list of fields is so long that you don't want to list them in
every customization.

At least I have not seen mutual recursion between fields in color
themes. :P My guess is that they can be done with non-recursive
records. That still allows an user to override fields.

> Cheers,
> JP.

Regards,
Favonia

-- 
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel

Reply via email to