summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T9565.hs
blob: 1dacb972141d6590a754983074acd3e7edb02a6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE TypeFamilies, FlexibleContexts, UndecidableInstances #-}

-- This is a copy of typecheck/should_run/T3500b, but it's here for
-- a different reason: at one time, it sent the compiler into a loop.
-- ANd T3500b isn't tested 'fast' mode

module T9565 where

newtype Mu f = Mu (f (Mu f))

type family Id m
type instance Id m = m

instance Show (Id (f (Mu f))) => Show (Mu f) where
    show (Mu f) = show f

showMu :: Mu (Either ()) -> String
showMu = show

item :: Mu (Either ())
item = Mu (Right (Mu (Left ())))

main = print (showMu item)