[Haskell-cafe] Strange error with type classes + associated types

Conal Elliott conal at conal.net
Sat Apr 17 13:28:45 EDT 2010


Oh!  I'd completely forgotten about this idea.  Looking at Data.LinearMap in
vector-space, I see a comment about exactly this ambiguity, as well as the
start of a new module that wraps a data type around the linear map
representation.  I don't recall whether I got stuck or just distracted.

On Sat, Apr 17, 2010 at 3:46 AM, Roman Leshchinskiy <rl at cse.unsw.edu.au>wrote:

> On 17/04/2010, at 11:00, Conal Elliott wrote:
>
> > I'm unsure now, but I think I tried making Basis a data type (not syn)
> and ran into the problem I mentioned above.  The Basis *synonyms* also have
> HasTrie instances, which is crucially important.  If we switch to
> (injective) data types, then we lose the HasTrie instances.  I'd be okay
> with defining HasTrie instances (preferably via "deriving") for the
> associated Basis data types, but I couldn't figure out how to.  Maybe it's
> not possible currently, or maybe I just didn't know how.
>
> Could you perhaps make (:-*) a proper type rather than a synonym? That
> would help with the ambiguity.
>
> Roman
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100417/acba91a5/attachment.html


More information about the Haskell-Cafe mailing list