Commit 04c8a083 authored by Michael Hanus 's avatar Michael Hanus

Replaces definition of prim_show by prim_show primitives for literals

parent bb0d9ff0
......@@ -422,22 +422,31 @@ showTuple ss = showChar '('
-- Returns the string representation of a character.
showCharLiteral :: Char -> String
showCharLiteral x = prim_show $## x
showCharLiteral x = prim_showCharLiteral $## x
prim_showCharLiteral :: Char -> String
prim_showCharLiteral external
-- Returns the string representation of a string.
showStringLiteral :: String -> String
showStringLiteral x = prim_show $## x
showStringLiteral x = prim_showStringLiteral $## x
prim_showStringLiteral :: String -> String
prim_showStringLiteral external
-- Returns the string representation of an integer.
showIntLiteral :: Int -> String
showIntLiteral x = prim_show $## x
showIntLiteral x = prim_showIntLiteral $## x
prim_showIntLiteral :: Int -> String
prim_showIntLiteral external
-- Returns the string representation of a floating point number.
showFloatLiteral :: Float -> String
showFloatLiteral x = prim_show $## x
showFloatLiteral x = prim_showFloatLiteral $## x
prim_show :: _ -> String
prim_show external
prim_showFloatLiteral :: Float -> String
prim_showFloatLiteral external
type ReadS a = String -> [(a, String)]
......
......@@ -65,7 +65,20 @@
<library>prim_standard</library>
<entry>prim_chr</entry>
</primitive>
<primitive name="prim_show" arity="1">
<primitive name="prim_showIntLiteral" arity="1">
<library>prim_readshowterm</library>
<entry>prim_showTerm</entry>
</primitive>
<primitive name="prim_showFloatLiteral" arity="1">
<library>prim_readshowterm</library>
<entry>prim_showTerm</entry>
</primitive>
<primitive name="prim_showCharLiteral" arity="1">
<library>prim_readshowterm</library>
<entry>prim_showTerm</entry>
</primitive>
<primitive name="prim_showStringLiteral" arity="1">
<library>prim_readshowterm</library>
<entry>prim_showTerm</entry>
</primitive>
......@@ -85,6 +98,7 @@
<library>prim_readshowterm</library>
<entry>prim_readStringLiteral</entry>
</primitive>
<primitive name="prim_error" arity="1">
<library>prim_standard</library>
<entry>prim_error</entry>
......
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