Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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,842
    • Issues 4,842
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15687

Closed
Open
Created Sep 29, 2018 by AntC@trac-AntC

Type synonym unused binds no warning?

I was taken aback this was accepted

type Silly a b = Maybe b

x :: Silly Int Bool
x = Just True
y :: Silly Char Bool
y = Just False

z = x == y                    -- returns False

What's with the a in Silly's decl? That's not a phantom type. It's ignored and thrown away. So x and y are the same type, and can be compare for equality.

I expected a rule: all tyvars in the type's head must appear on rhs. Or at least a warning there was something silly. I tried -Wall, -fwarn-unused-binds, -Wunused-type-patterns.

I was just checking up on a remark that type synonyms are at the type level like implicit bidirectional pattern synonyms. For those, all vars must appear on both sides.

Trac metadata
Trac field Value
Version 8.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Windows
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking