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,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 357
    • Merge Requests 357
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13770

Closed
Open
Opened May 30, 2017 by Gabor Greif@ggreif💬Developer

HEAD: Type mentioned in error won't show up in pattern signature

I am encountering a stange problem:

ghc-stage2 T13770.hs -c -fprint-explicit-kinds

T13770.hs:29:52: error:
    ? Could not deduce: (r4 :: GHC.Types.RuntimeRep)
                        ~~ ('GHC.Types.LiftedRep :: GHC.Types.RuntimeRep)
      from the context: (* ~ *, (f :: *) ~~ (arg -> res :: *))
        bound by a pattern with pattern synonym:
                   Fun :: forall k (fun :: k).
                          () =>
                          forall (arg :: TYPE r1) (res :: TYPE r2).
                          (k ~ *, (fun :: k) ~~ (arg -> res :: *)) =>
                          TypeRep (TYPE r1) arg -> TypeRep (TYPE r2) res -> TypeRep k fun,
                 in a pattern binding in
                      'do' block
        at T13770.hs:19:19-35
      or from: (* :: *) ~~ (TYPE r1 :: *)
        bound by a pattern with constructor:
                   Refl :: forall k (a :: k). (:~:) k a a,
                 in a pattern binding in
                      'do' block
        at T13770.hs:22:19-22
      or from: (* :: *) ~~ (TYPE r2 :: *)
        bound by a pattern with constructor:
                   Refl :: forall k (a :: k). (:~:) k a a,
                 in a pattern binding in
                      'do' block
        at T13770.hs:23:19-22
      or from: (TYPE r2 ~ *, (res :: TYPE r2) ~~ (arg1 -> res1 :: *))
        bound by a pattern with pattern synonym:
                   Fun :: forall k (fun :: k).
                          () =>
                          forall (arg :: TYPE r1) (res :: TYPE r2).
                          (k ~ *, (fun :: k) ~~ (arg -> res :: *)) =>
                          TypeRep (TYPE r1) arg -> TypeRep (TYPE r2) res -> TypeRep k fun,
                 in a pattern binding in
                      'do' block
        at T13770.hs:27:37-41
      ?r4? is a rigid type variable bound by
        a pattern with pattern synonym:
          Fun :: forall k (fun :: k).
                 () =>
                 forall (arg :: TYPE r1) (res :: TYPE r2).
                 (k ~ *, (fun :: k) ~~ (arg -> res :: *)) =>
                 TypeRep (TYPE r1) arg -> TypeRep (TYPE r2) res -> TypeRep k fun,
        in a pattern binding in
             'do' block
        at T13770.hs:27:37-41
      When matching the kind of ?arg1?
      Expected type: TypeRep * (arg1 -> res1)
        Actual type: TypeRep (TYPE r2) res
    ? In the second argument of ?postulate?, namely ?fargrep?
      In a stmt of a 'do' block: Refl <- postulate vrep fargrep
      In the expression:
        do A2 satur _ <- a2 retrep vrep
           fargrep@Fun {} <- pure retrep
           HRefl <- fargrep `eqTypeRep` retrep
           Refl <- postulate vrep fargrep
           ....
   |
29 |                             Refl <- postulate vrep fargrep
   |                                                    ^^^^^^^

Notice how r4 is mentioned in the error message but none of the signatures refer to it. This is confusing.

Trac metadata
Trac field Value
Version 8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13770