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,875
    • Issues 4,875
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 462
    • Merge requests 462
  • 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
  • #8162
Closed
Open
Created Aug 23, 2013 by takano-akio@takano-akioReporter

Type unsoundness with type families and UndecidableInstances

''This problem has already been fixed but I'm creating a ticket here to attach an example that demonstrates the problem, following a suggestion here: http://www.haskell.org/pipermail/glasgow-haskell-users/2013-August/022716.html''

The following is accepted by GHC 7.6.

type family F a
type instance F (a -> a) = Int
type instance F (a -> a -> a) = IO String

However these definitions allows an Int to be coerced to IO String under !UndecidableInstances, breaking type safety. The problem is that you can define an infinite type LA = LA -> LA using type families, then F LA can be reduced to both Int and to IO String.

I'll attach a program that demonstrates how this problem can cause a segfault.

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