Ticket #3330 (closed bug: fixed)
Type checker hangs
| Reported by: | MartijnVanSteenbergen | Owned by: | chak |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.1 |
| Component: | Compiler (Type checker) | Version: | 6.12.1 RC1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | x86_64 (amd64) |
| Type of failure: | Compile-time crash | Difficulty: | Unknown |
| Test Case: | indexed-types/should_fail/T3330a,b,c | Blocked By: | |
| Blocking: | Related Tickets: |
Description
The following module causes ghc --make and ghci to hang. -ddump-tc-trace produces output indefinitely.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
import Generics.MultiRec
import Control.Monad.Writer
data AnyF s f where
AnyF :: s ix -> f ix -> AnyF s f
children :: HFunctor s (PF s) => s ix -> (PF s) r ix -> [AnyF s r]
children p x = execWriter (hmapM p collect x) where
collect :: (HFunctor s (PF s)) => s ix -> r ix -> Writer [AnyF s r] (r ix)
collect w x = tell [AnyF w x] >> return x
Module Generics.MultiRec is from Hackage package multirec-0.4.
The code contains a type error: if arguments p and collect are swapped the code compiles fine.
I haven't tried making this example any smaller.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

