Commit 23c521c1 authored by bbr's avatar bbr
Browse files

hopefully the last fix of a show instance

parent d09843b0
......@@ -54,6 +54,7 @@ instance (Show t0) => Show (IOVal t0) where
where
showStr = showString "IOVal" . showsPrec 11 x1
showsPrec _ (IOValFreeVar i) = showString ('_':show i)
showsPrec _ (IOValOr i _) = showString ('_':show (deref i))
instance Show (IO (IOVal a)) where
show _ = "IO"
......@@ -64,6 +65,7 @@ instance Show (C_IO a) where
instance Show C_Success where
showsPrec _ C_Success = showString "success"
showsPrec _ (C_SuccessFreeVar ref) = showString ('_':show ref)
showsPrec _ (C_SuccessOr ref _) = showString ('_':show (deref ref))
instance Show (FreeVarRef a) where
show (FreeVarRef i _) = show i
......@@ -74,6 +76,7 @@ instance Show (a->b) where
instance Show a => Show (Prim a) where
show (PrimValue x) = show x
show (PrimFreeVar r) = "_"++show r
show (PrimOr r _) = "_"++show (deref r)
instance Show a => Show (List a) where
showsPrec = showsPrecList (showsPrec 0) (showsPrec 0)
......@@ -85,6 +88,7 @@ showsPrecList recursiveCall listCall _ xs
where
isFreeList List = False
isFreeList (ListFreeVar _) = True
isFreeList (ListOr _ _) = True
isFreeList (_ :< xs) = isFreeList xs
isFreeList _ = True
......@@ -207,6 +211,7 @@ instance Show C_Int where
| isFreeNat n = showParen (d>10) (showString "Neg " . showsPrecNat 11 n)
| otherwise = showsPrec d (fromCurry x::Integer)
showsPrec _ (C_IntFreeVar i) = showChar '_' . shows i
showsPrec _ (C_IntOr i _) = showChar '_' . shows (deref i)
-----------------------------------------------------------------
-- external Read instances
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment