Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,390
    • Issues 4,390
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 373
    • Merge Requests 373
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16627

Closed
Open
Opened May 03, 2019 by David Feuer@treeowlReporter

Trouble resolving Typeable 'LiftedRep

Summary

Inference fails with a simple TypeRep application.

Steps to reproduce

{-# language TypeInType, ScopedTypeVariables #-}
module Silly where
import Type.Reflection (Typeable, typeRep, TypeRep)
import Type.Reflection.Unsafe (mkTrApp)
import GHC.Exts (TYPE, RuntimeRep (..))
import Data.Kind (Type)

mkTrFun :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
                  (a :: TYPE r1) (b :: TYPE r2).
           TypeRep a -> TypeRep b -> TypeRep ((a -> b) :: Type)
mkTrFun a b = typeRep `mkTrApp` a `mkTrApp` b

Expected behavior

I expected this to compile.

Actual behavior

Silly.hs:11:15: error:
    • No instance for (Typeable 'LiftedRep)
        arising from a use of ‘typeRep’
    • In the first argument of ‘mkTrApp’, namely ‘typeRep’
      In the first argument of ‘mkTrApp’, namely ‘typeRep `mkTrApp` a’
      In the expression: typeRep `mkTrApp` a `mkTrApp` b
   |
11 | mkTrFun a b = typeRep `mkTrApp` a `mkTrApp` b
   |               ^^^^^^^

This is a rather perplexing error, because 'LiftedRep is most assuredly typeable.

Environment

  • GHC version used: 8.6.3

Optional:

  • Operating System:
  • System Architecture:
Edited May 03, 2019 by David Feuer
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#16627