Commit 6dae3660 authored by bbr's avatar bbr
Browse files

show instances for list and character

parent 502ed454
......@@ -91,7 +91,7 @@ showsPrecList recursiveCall listCall _ xs
showFreel (ListFreeVar r) = showString ('_':show r++")")
showFreel (x:<xs) = recursiveCall x . showChar ':' . showFreel xs
showFreel _ = showString "showFreel _"
showFreel (ListOr r _) = showString ('_':show (deref r)++")")
showQStandardList :: Curry a => [a] -> ShowS
showQStandardList xs = showChar '[' .
......@@ -123,12 +123,15 @@ charToSc c = SearchChar (intToFour d64) (intToFour d16) (intToFour d4) (intToFou
(d4,m4) = divMod m16 4
instance Show C_Four where
show _ = error "probably someone used $# instead of $## for an external character function"
showsPrec d (C_FourOr r _) = showChar '_' . showsPrec d (deref r)
showsPrec _ _ = error "probably due to usage of ($#) instead of ($##) \
\for an external function with argument type string or character"
instance Show C_Char where
show (C_Char c) = show c
show (SearchChar f1 f2 f3 f4) = show (scToChar f1 f2 f3 f4)
show (C_CharFreeVar r) = '_':show r
show (C_CharOr r _) = '_':show (deref r)
showList cs = if any isFreeChar cs
then showChar '[' . showFreel cs
......
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