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,870
    • Issues 4,870
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • 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
  • #19277
Closed
Open
Created Jan 29, 2021 by Sorokin-Anton@Sorokin-Anton

type family creates a type synonym, which should not be created

Summary

We can use types that never allowed (example below)

Steps to reproduce

λ> :set -XTypeFamilies -XMultiParamTypeClasses -XFlexibleInstances -XUndecidableInstances 
λ> :{
class HasX a where
  type X a
instance Eq a => HasX a where
  type X a = a
:}
λ> :kind! X (IO Int)
X (IO Int) :: *
= IO Int
λ> z :: X (IO String) ; z = getLine
λ> z
1
"1"

Please provide a set of concrete steps to reproduce the issue.

Expected behavior

X (IO Int) is not equivalent IO Int , cause we have type X a = a only for Eq types

Environment

  • GHC version used: 8.8.4
Edited Jan 29, 2021 by Sorokin-Anton
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking