Skip to content

Conversation

lmbollen
Copy link
Member

@lmbollen lmbollen commented Aug 21, 2025

This gives us BitPack instances for Proxy a where a is a Kind from our derived BitPack instance for Proxy a. Examples are Proxy 42, Proxy (n :: Nat) or KnownNat n => Proxy n.

This gives us `BitPack` instances for `Proxy a` where `a` is a Kind from our derived `BitPack` instance for `Proxy a`
@lmbollen lmbollen force-pushed the lucas/proxy-bitpack-instance branch from a749521 to b659c7e Compare August 21, 2025 13:12
@martijnbastiaan
Copy link
Member

This is the second time that we've been really confused by NoPolyKinds. Could you please add it to the default-extensions of clash-prelude?

Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a commit titled Add regression doctests for BitPack (Proxy a) should also change the definition of the instance without explaining why. Likewise, the whole PR and PR cover letter need to mention this change.

Your commit message for the other commit more clearly describes the change than the PR cover letter. How about changing the PR cover letter to:

This gives us BitPack instances for Proxy a where a is a Kind from our derived BitPack instance for Proxy a. Examples are Proxy 42, Proxy (n :: Nat) or KnownNat n => Proxy n.

This should have been added in #2990

This PR also corrects a mistake in the BitPack instance definition, which was not intended to have any constraints.

This should also be backported to 1.8, see #2991

Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I indiicated in PR #2994, I'm confused by the structure you're going for. Why make a PR on your topic branch instead of just including the default extension here or closing this and making a new PR with a new title?

@@ -12,7 +12,7 @@ Maintainer : QBayLogic B.V. <devops@qbaylogic.com>
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}

{-# LANGUAGE PolyKinds #-} -- Required for BitPack (KnownNat n) => BitPack (Proxy n) instances
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this on initial review, but what does BitPack (KnownNat n) mean? I initially mentally autocorrected this to KnownNat n => BitPack (Proxy n) which makes sense although it is overly specific: it forces n to be a Nat which needs PolyKinds. How about:

Suggested change
{-# LANGUAGE PolyKinds #-} -- Required for BitPack (KnownNat n) => BitPack (Proxy n) instances
{-# LANGUAGE PolyKinds #-} -- Required for BitPack (Proxy (n :: Nat)) instances

It's still overly specific, but at least it makes sense. I don't think a BitPack (KnownNat n) constraint means anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants