Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,867
    • Issues 4,867
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 457
    • Merge requests 457
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19826
Closed
Open
Created May 11, 2021 by vdukhovni@trac-vdukhovniDeveloper

`Note [NOINLINE someNatVal]` possibly outdated?

Summary

In GHC.TypeNats the NOINLINE someNatVal note talks about care around use of Any in the definition of someNatVal, with additional related text in GHC.HsToCore.Expr.

But actual use of Any in combination with withDict is nowhere to be found in either the compiler or the base library. Only the testsuite appears to contain such usage:

testsuite/tests/ghci/scripts/T19667Ghci.hs--- See Note [NOINLINE someNatVal] in GHC.TypeNats
testsuite/tests/ghci/scripts/T19667Ghci.hs-{-# NOINLINE reifySymbol #-}
testsuite/tests/ghci/scripts/T19667Ghci.hs-reifySymbol :: forall r. String -> (forall (n :: Symbol). KnownSymbol n => Proxy n -> r) -> r
testsuite/tests/ghci/scripts/T19667Ghci.hs:reifySymbol n k = withDict @(SSymbol Any) @(KnownSymbol Any) (SSymbol n) (k @Any) (Proxy @(Any @Symbol))
--
testsuite/tests/typecheck/should_fail/T16646Fail.hs-reify :: forall a r. a -> (forall (s :: Type). Reifies s a => Proxy s -> r) -> r
testsuite/tests/typecheck/should_fail/T16646Fail.hs:reify a k = withDict @_ @(Reifies (Any @Type) a) (const a) (k @Any) Proxy
--
testsuite/tests/typecheck/should_run/T16646.hs-reify :: forall a r. a -> (forall (s :: Type). Reifies s a => Proxy s -> r) -> r
testsuite/tests/typecheck/should_run/T16646.hs-{-# NOINLINE reify #-} -- See Note [NOINLINE someNatVal] in GHC.TypeNats
testsuite/tests/typecheck/should_run/T16646.hs:reify a k = withDict @(forall (proxy :: Type -> Type). proxy Any -> a)
testsuite/tests/typecheck/should_run/T16646.hs-                     @(Reifies (Any @Type) a)
testsuite/tests/typecheck/should_run/T16646.hs-                     (const a) (k @Any) Proxy
--
testsuite/tests/typecheck/should_run/T19667.hs--- See Note [NOINLINE someNatVal] in GHC.TypeNats
testsuite/tests/typecheck/should_run/T19667.hs-{-# NOINLINE reifySymbol #-}
testsuite/tests/typecheck/should_run/T19667.hs-reifySymbol :: forall r. String -> (forall (n :: Symbol). KnownSymbol n => Proxy n -> r) -> r
testsuite/tests/typecheck/should_run/T19667.hs:reifySymbol n k = withDict @(SSymbol Any) @(KnownSymbol Any) (SSymbol n) (k @Any) (Proxy @(Any @Symbol))

Even the reflection package does not appear to be explicitly using Any anywhere obvious. I find this somewhat confusing...

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking