Help With GHC Extension

Matt Brown matt at softmechanics.net
Fri Mar 19 21:14:54 EDT 2010


Thanks for the advice, Simon.  Wiki sounds like a good start.  In the
meantime, my patches are available at ftp://ftp.softmechanics.net, in case
anyone wants a look. I'll try to keep them in sync with head.  Those
interested can peruse the following examples (my test cases for development
-- all compile and run as described):

http://softmechanics.net/node/14
http://softmechanics.net/node/15
http://softmechanics.net/node/16
http://softmechanics.net/node/17
... more coming, including some that fail.

I'll take a look at OutsideIn. Will be interesting to see where ghc
development's headed.  Are there similar papers describing the current TI
system?  There is still much I don't understand.

thanks again,
-matt

On Fri, Mar 19, 2010 at 5:18 AM, Simon Peyton-Jones <simonpj at microsoft.com>
wrote:
> Matt
>
> I have not thought about this for a while.  Read the stuff in the user
manual about overlapping instances
http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-overlap,
esp the bit about "GHC is conservative about committing..".  Also "Note
[Overlapping instances]" in InstEnv.  I suspect that you will have these
problems in spades.
>
> Just at the moment I am in the middle of a major rewrite of the type
inference machinery, using the OutsideIn algorithm in our ICFP08 and ICFP09
papers.  I'm stalled writing papers for ICFP10 at the moment, but I _will_
get back to it.  But it means that it's not a great moment to patch the main
inference engine, at least not in the main HEAD.
>
> So I suggest you forge ahead in a proof-of-concept way.  Start a wiki
page, describe your idea, give examples, write a paper for the Haskell
Symposium, describe corner cases, articulate design choices, seek feedback.
Then hopefully you'll be well positioned to see whether it'd be a good idea
to apply the idea to the new inference setup.
>
> Simon
>
> | -----Original Message-----
> | From: cvs-ghc-bounces at haskell.org [mailto:cvs-ghc-bounces at haskell.org]
On Behalf Of
> | Matt Brown
> | Sent: 17 March 2010 22:04
> | To: cvs-ghc at haskell.org
> | Subject: Help With GHC Extension
> |
> | Hi All,
> |
> | I've been experimenting with an idea to allow matching instances by
> | context.  The basic idea is to allow duplicate instance declarations,
> | then select the "best" instance during simplification (in
> | typecheck/Inst.lhs:lookupPred specifically).  I'm not sure I have the
> | right vocabulary to describe it, so I've attached a basic example of
> | what I'm going for.
> |
> | I've done some hacking, and arrived at a basic proof of concept.  I've
> | gotten pretty far along with a minimal understanding of how GHC works
> | -- mostly by trial and error, and by following types and error
> | messages.  It isn't pretty though, and I was hoping at this point to
> | get some feedback and guidance towards a cleaner, more robust
> | solution.
> |
> | I have some specific questions, but I thought it might be helpful to
> | share what I have so far.  What would be the appropriate forum?
> | Should I create a new feature request or proposal in Trac?  I have my
> | GHC patches and a few simple examples (similar to attached).
> |
> | Thanks in advance,
> | -matt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/cvs-ghc/attachments/20100319/c8335bb7/attachment-0001.html


More information about the Cvs-ghc mailing list