blob: 59a2c47983d446b98d0d9b9f8c4589375e744c85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{-# LANGUAGE TypeFamilies, FlexibleContexts, UndecidableInstances #-}
module Main 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)
|