Implicit parameters

2 views
Skip to first unread message

Simon Peyton Jones

unread,
5:03 AM (5 hours ago) 5:03 AM
to Core Libraries Committee, Simon Peyton Jones
Dear CLC

Can I ask for your advice?


The fix is easy: it simply means giving the built-in class IP a representational role, thus

type role IP nominal representational   -- New
class IP (x :: Symbol) a | x -> a where
  ip :: a

Now, this shouldn't be a CLC issue at all. IP is a purely internal matter.  It just happens to be the way that GHC implements the implicit-parameter feature of Haskell. The only user-visible change is that GHC will typecheck a few more programs that it previously rejected.

However IP is exported by base:GHC.Base.  That entire module should not be in `base` but today it is, so the change makes a user-visible change to `base`.

Would you like a proposal?  I ask because it's all busy-work if you plan to remove GHC.Base from `base` in any case.

I have only just realised this.  (It never occurred to me that IP would leak into `base`.)  The patch is ready to land.

You can see more background in #26737 and the MR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/15337

Thanks

Simon

Julian Ospald

unread,
6:36 AM (4 hours ago) 6:36 AM
to Simon Peyton Jones, Core Libraries Committee
Please create a proposal. We'll fast-track it.

On 1/14/26 6:03 PM, Simon Peyton Jones wrote:
> Dear CLC
>
> Can I ask for your advice?
>
> I'm busy fixing GHC issue https://gitlab.haskell.org/ghc/ghc/-/
> issues/26737 <https://gitlab.haskell.org/ghc/ghc/-/issues/26737>
> gitlab.haskell.org/ghc/ghc/-/merge_requests/15337 <https://
> gitlab.haskell.org/ghc/ghc/-/merge_requests/15337>
>
> Thanks
>
> Simon
>
> --
> You received this message because you are subscribed to the Google
> Groups "haskell-core-libraries" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to haskell-core-libr...@googlegroups.com
> <mailto:haskell-core-libr...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/haskell-
> core-libraries/CAJKmMz-wDYnjB0kpxrmHm0g%3DHGxd%3Dts9_BgDtrTA5hi%3Dgcn-
> YA%40mail.gmail.com <https://groups.google.com/d/msgid/haskell-core-
> libraries/CAJKmMz-wDYnjB0kpxrmHm0g%3DHGxd%3Dts9_BgDtrTA5hi%3Dgcn-
> YA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages