[Haskell-cafe] Some help needed to start Haskell with Yi

Robert Greayer robgreayer at gmail.com
Wed Nov 18 20:54:04 EST 2009


On Wed, Nov 18, 2009 at 8:15 PM, Daniel Fischer <daniel.is.fischer at web.de>wrote:
>
>> Am Donnerstag 19 November 2009 01:07:37 schrieb Henning Thielemann:
>> > Kapil Hari Paranjape schrieb:
>> > > Hello,
>> > >
>> > > On Sat, 14 Nov 2009, Jaco van Iterson wrote:
>> > >> Only installation with 'cabal install yi' in a Cygwin shell under MS
>> > >> Windows XP ended in:
>> > >> Yi\Prelude.hs:182:9:
>> > >>     Duplicate instance declarations:
>> > >>       instance Category Accessor.T -- Defined at
>> Yi\Prelude.hs:182:9-38
>> > >>       instance Category Accessor.T
>> > >>         -- Defined in data-accessor-0.2.1:Data.Accessor.Private
>> > >> cabal.exe: Error: some packages failed to install:
>> > >> yi-0.6.1 failed during the building phase. The exception was:
>> > >> exit: ExitFailure 1
>> > >>
>> > >> Seems easy to fix but I can't even find where on my drive I can find
>> the
>> > >> source code.
>> > >>
>> > >> Where is the source?
>> >
>> > Seems to be that the author defined an orphan instance - something one
>> > should never do!
>>
>> So what do you do if you need an instance ClassX TypeY but the author of
>> the package that
>> defines TypeY hasn't provided one?
>>
>> You can define an orphan instance or duplicate packageY but with the
>> instance. Both are
>> bad. Providing an orphan instance until packageY has one seems the lesser
>> evil to me.
>> Are there any good options?
>
>
Whether it qualifies as 'good' or not, I'm not sure, but I think the
standard recommendation is to newtype-wrap the type you want to make an
orphan instance of, and make the instance on that (new) type.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091118/9182bb77/attachment.html


More information about the Haskell-Cafe mailing list