packages feed

MicroHs-0.17.4.0 / lib / Text / Show.hs

-- Copyright 2023,2024 Lennart Augustsson-- See LICENSE file for full license.module Text.Show(module Text.Show) whereimport qualified Prelude()              -- do not import Preludeimport Primitivesimport Data.Bool_Typeimport Data.Char_Typeimport Data.List_Typeimport {-# SOURCE #-} Data.Typeabletype ShowS = String -> Stringclass Show a where  showsPrec :: Int -> a -> ShowS  show      :: a -> String  showList  :: [a] -> ShowS  showsPrec _ x s = show x ++ s  show x          = shows x ""  showList        = showListWith showsshows :: forall a . Show a => a -> ShowSshows = showsPrec 0showChar :: Char -> ShowSshowChar = (:)showString :: String -> ShowSshowString = (++)showParen :: Bool -> ShowS -> ShowSshowParen False sh = shshowParen True  sh = \ x -> '(' : sh (')' : x)showListWith :: forall a . (a -> ShowS) -> [a] -> ShowSshowListWith _  []     s = '[' : ']' : sshowListWith sh (x:xs) s = '[' : sh x (shl xs)  where    shl []     = ']' : s    shl (y:ys) = ',' : sh y (shl ys)appPrec :: IntappPrec = 10appPrec1 :: IntappPrec1 = 11