Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/PreludeText/CShow.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Prelude where

class  Show a  where 
        showsPrec :: Int -> a -> ShowS
        show      :: a -> String
        showList  :: [a] -> ShowS
        showsType :: a -> ShowS

        showsPrec _ x s = show x ++ s
        show x          = showsPrec 0 x ""

        showList [] = showString "[]"
	showList (x:xs) = 
		showChar '[' . showsPrec 0 x . showl xs
	        where showl []     = showChar ']'
		      showl (x:xs) = showString "," . showsPrec 0 x . showl xs

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].