A type checker plugin for row types
Simon Peyton Jones
simonpj at microsoft.com
Fri Sep 15 14:55:22 UTC 2017
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 then I’m not sure. Even
f :: Lacks r “f” => V (Row (r .& (“f” .= Int))) -> V (Row (r .& (“f” .= Int)))
f n x = ???
Somehow in the ??? I have to update field n of a tuple x. How do I do that?
And I’m also very uncomfortable having Core littered with unsafeCoerces. I like Core being statically typed. What is the simplest primitive(s) we could add to Core to make it possible to express this stuff type-safely?
Simon
From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Nicolas Frisby
Sent: 10 September 2017 23:25
To: ghc-devs at haskell.org
Cc: Andres Löh <andres at well-typed.com>; Adam Gundry <adam at well-typed.com>; Richard Eisenberg <goldfire at gmail.com>
Subject: A type checker plugin for row types
Hi all. I've been spending my free time for the last couple months on a type checker plugin for row types. The free time waxes and wanes; sending an email like this one was my primary goal for the past couple weeks.
At the very least, I hoped this project would let me finally get some hands on experience with OutsideIn. And I definitely have. But I've also made more progress than I anticipated, and I think the plugin is starting to have legs!
I haven't uploaded the code yet to github -- it's not quite ready to share. But I did do a write up on the dev wiki.
https://ghc.haskell.org/trac/ghc/wiki/Plugins/TypeChecker/RowTypes/Coxswain
I would really appreciate and questions, comments, and --- boy, oh boy --- answers.
I hope to upload within a week or so, and I'll update that wiki page and reply to this email when I do.
Thanks very much. -Nick
P.S. -- I've CC'd and BCC'd people who I anticipate would be specifically interested in this (e.g. plugins, row types, etc). Please feel free to forward to others that come to mind; I know some inboxes abjectly can't afford default list traffic.
P.P.S. -- One hold up for the upload is: which license? I intend to release under BSD3, mainly to match GHC since one ideal scenario would involve being packaged with/integrated into GHC. But my brief recent research suggests that the Apache license might be more conducive to eventual widespread adoption. If you'd be willing to advise or even just refer me to other write ups, please feel free to email me directly or to start a separate thread on a more appropriate distribution list (CC'ing me, please). Thanks again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170915/10532f70/attachment.html>
More information about the ghc-devs
mailing list