Skip to content
GitLab
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 5,263
    • Issues 5,263
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4272
Closed
Open
Issue created Aug 25, 2010 by Ghost User@ghostContributor

Typechecker loop with type families

The following code (which I think is ill-typed) causes GHC to hang, both on 6.12.1 and 6.13.20100616:

{-# LANGUAGE TypeFamilies, ScopedTypeVariables, FlexibleContexts #-}
module Crash where

class Family f where
  terms :: f a -> a

class Family (TermFamily a) => TermLike a where
  type TermFamily a :: * -> *

laws :: forall a b. TermLike a => TermFamily a a -> b
laws t = prune t (terms (undefined :: TermFamily a a))

prune :: TermLike a => TermFamily a a -> TermFamily a a -> b
prune = undefined

The compiler still hangs if I remove the typeclass constraints (everything to the left of a =>, I mean), but everything else seems to be necessary for the compiler to loop. Using -dshow-passes shows that it's the typechecker that loops.

Trac metadata
Trac field Value
Version 6.13
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