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,864
    • Issues 4,864
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 452
    • Merge requests 452
  • 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
  • #19678
Closed
Open
Created Apr 09, 2021 by Richard Eisenberg@raeDeveloper

GHC offers no way to see the RuntimeReps in a FunTy

#19677 (closed) describes a bug where the crux is the RuntimeRep arguments to (->). But I cannot get GHC to print these.

Here is a smaller test case:

{-# LANGUAGE ExplicitForAll, DataKinds, KindSignatures #-}

module Bug where

import GHC.Exts

class C x where
  meth :: x -> ()
instance C (a -> b) where
  meth _ = ()

foo :: forall (a :: TYPE WordRep) (b :: TYPE IntRep). (a -> b) -> ()
foo = meth

The error is

Bug.hs:13:7: error:
    • No instance for (C (a -> b)) arising from a use of ‘meth’
        (maybe you haven't applied a function to enough arguments?)
    • In the expression: meth
      In an equation for ‘foo’: foo = meth
   |
13 | foo = meth
   |       ^^^^

Erroring is correct here -- there really is no applicable instance. But I don't have enough information to understand why. -fprint-explicit-runtime-reps doesn't do it. Maybe a new -fprint-explicit-fun to force GHC to use FUN in its pretty-printer?

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