Re: A type checker plugin for row types

2017-09-18 Thread Nicolas Frisby
Thank you Matthew! I very much appreciate this kind of feedback. 1) I've updated the (bulk of the) wiki page to match the github repo just now. In particular, the "Elm" example lives here https://github.com/nfrisby/coxswain/blob/master/sculls/Elm.hs, so I just copied its most recent version onto t

Re: A type checker plugin for row types

2017-09-18 Thread Matthew Pickering
Hi Nicolas, I briefly tried out the plugin this morning and have a few comments. 1. The example file on the wiki page fails to compile. I needed to modify two of the constraints on `getName` and `getPos` to get it to work. 2. I was inspecting how well the compiler optimises your representation an

Re: A type checker plugin for row types

2017-09-16 Thread Nicolas Frisby
If you'd like to see how exactly the plugin manipulates constraints, I suggest using the `summarize` and `trace` options that are discussed here: https://ghc.haskell.org/trac/ghc/wiki/Plugins/TypeChecker/RowTypes/Coxswain#PluginDebugOptions Also, the `sculls/Examples.hs` and `sculls/Elm.hs` files

Re: A type checker plugin for row types

2017-09-16 Thread Ara Adkins
Excellent! I've very much been looking forward to having a look at the code for this! On Sat, Sep 16, 2017 at 10:27 PM, Nicolas Frisby wrote: > I've uploaded the code to GitHub. > > https://github.com/nfrisby/coxswain > > I went with a BSD3 licence. > > It's still very much a work in progress, s

Re: A type checker plugin for row types

2017-09-16 Thread Nicolas Frisby
I've uploaded the code to GitHub. https://github.com/nfrisby/coxswain I went with a BSD3 licence. It's still very much a work in progress, so I only recommend using it for experimentation for now. Thanks. -Nick On Sun, Sep 10, 2017 at 3:24 PM Nicolas Frisby wrote: > Hi all. I've been spendin

Re: A type checker plugin for row types

2017-09-15 Thread Nicolas Frisby
Hello Simon! Thanks for taking a look. I've attempted to address your Core question by adding a new section to the wiki page: https://ghc.haskell.org/trac/ghc/wiki/Plugins/TypeChecker/RowTypes/Coxswain#SomeLightCoreSnorkeling Regarding the necessary EvTerms, I haven't thought through that enough

RE: A type checker plugin for row types

2017-09-15 Thread Simon Peyton Jones via ghc-devs
Nick Good work! You ask some questions about the constraint solver – I hope that the answer from others have helped. If not, do re-ask. My main comment is: what does Core look like? I think your answer is “No change to Core, but there are lots of unsafe coerces littered around”. But even t

Re: A type checker plugin for row types

2017-09-14 Thread Richard Eisenberg
Here are my stabs at answers to two of your questions. > • When/where exactly do Derived constraints arise? I'm not recognizing them > in the OutsideIn paper. I agree with others' comments on this point, but perhaps I can expand. A Derived constraint is essentially a Wanted constraint, but one

Re: A type checker plugin for row types

2017-09-11 Thread Ben Gamari
On September 11, 2017 9:34:15 AM GMT+01:00, Adam Gundry wrote: >Hi Nick, > >This is great work, and I look forward to seeing the code once it is >ready. I've had a quick glance over your wiki page, and thought I >should >send you some initial comments, though it deserves deeper attention >which I

Re: A type checker plugin for row types

2017-09-11 Thread Nicolas Frisby
Adam, thanks for: 1) The reference to Iavor's paper --- it is a nice more-detailed description of the plugin API/semantics, and the Nelson-Oppen parallel is very illuminating! 2) Asking "Do you mean "touchable" or "unification variable" here and elsewhere?" That prompted me to finally dig deeper

Re: A type checker plugin for row types

2017-09-11 Thread Iavor Diatchki
Ah, yes, derived constraints. The mapping to logic I have in my mind is as follows: Given = assumption, used in proofs Wanted = goal, needs proof Derived = implied by assumptions and goals A derived constraint may be used to instantiate touchable unification variables, and guarantees that in doi

Re: A type checker plugin for row types

2017-09-11 Thread Adam Gundry
Hi Nick, This is great work, and I look forward to seeing the code once it is ready. I've had a quick glance over your wiki page, and thought I should send you some initial comments, though it deserves deeper attention which I will try to find time to give it. :-) I don't see a reference to Iavor

Re: A type checker plugin for row types

2017-09-11 Thread Iavor Diatchki
Hello Nick, very nice! Do you have any thoughts on how to use rows in class/type family declarations (i.e. how do we match on them)? For example, if I was to use the rows to make up some sort of record, system (i.e. declare `Rec :: Row -> Type`), how might I define the `Show` instance for `Rec`?

Re: A type checker plugin for row types

2017-09-10 Thread Ara Adkins
Glad I could be of help! I just gave it a read and that generated core is much better than I expected. I’d still have some concerns regarding certain uses (e.g. named arguments) having more performance overhead than hoped, but at this stage it’s far better than I would’ve initially thought! De

Re: A type checker plugin for row types

2017-09-10 Thread Nicolas Frisby
Whoops! I forgot about that section of my draft. I added a little blurb ("Performance?") Thanks Ara! On Sun, Sep 10, 2017 at 3:41 PM Ara Adkins wrote: > Just given this a read! > > It looks like you’ve put a fantastic amount of effort into this so far, > and I can certainly see how it’s findin

Re: A type checker plugin for row types

2017-09-10 Thread Ara Adkins
Just given this a read! It looks like you’ve put a fantastic amount of effort into this so far, and I can certainly see how it’s finding its legs! I’m very much looking forward to seeing this develop further. I can definitely foresee some uses for polykinded column types, and the possibility f