Commit 8a94d28f authored by bbr's avatar bbr
Browse files

show qualified terms

external instances also updated. The default implementation is
a call to showsPrec
parent 436f5c87
...@@ -59,12 +59,14 @@ instance Curry C_OrRef where ...@@ -59,12 +59,14 @@ instance Curry C_OrRef where
foldCurry _ c _ _ = c foldCurry _ c _ _ = c
showQ d (C_OrRef x1) = showParen (d>10) (showString "Unsafe.OrRef" . showsPrec d x1)
instance Show C_OrRef where instance Show C_OrRef where
showsPrec d (C_OrRef x1) = showsPrec d x1 showsPrec d (C_OrRef x1) = showParen (d>10) (showString "OrRef" . showsPrec d x1)
showsPrec _ (C_OrRefFreeVar i) = Prelude.showString((:)('_')(Prelude.show(i))) showsPrec _ (C_OrRefFreeVar i) = Prelude.showString((:)('_')(Prelude.show(i)))
......
...@@ -10,7 +10,7 @@ prim_showTerm = prim_show ...@@ -10,7 +10,7 @@ prim_showTerm = prim_show
--because of type classes there is no need to qualify in kics --because of type classes there is no need to qualify in kics
prim_showQTerm :: Curry t0 => t0 -> Result (List C_Char) prim_showQTerm :: Curry t0 => t0 -> Result (List C_Char)
prim_showQTerm = prim_show prim_showQTerm x _ = toCurry (showQ 0 x [])
prim_readsUnqualifiedTerm :: Curry t0 => prim_readsUnqualifiedTerm :: Curry t0 =>
List C_String -> C_String -> Result (List (T2 t0 C_String)) List C_String -> C_String -> Result (List (T2 t0 C_String))
......
...@@ -30,6 +30,10 @@ class (BaseCurry a,Show a,Read a) => Curry a where ...@@ -30,6 +30,10 @@ class (BaseCurry a,Show a,Read a) => Curry a where
-- name of the type -- name of the type
typeName :: a -> String typeName :: a -> String
-- show qualified terms
showQ :: Int -> a -> String -> String
showQ = showsPrec
-- generic programming -- generic programming
--toC_Term :: HNFMode -> State -> a -> C_Data --toC_Term :: HNFMode -> State -> a -> C_Data
--fromC_Term :: C_Data -> a --fromC_Term :: C_Data -> a
......
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