-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Display things for humans to read -- -- Efficiently display things for humans to read @package display @version 0.0.1 -- | Display human-readable values to the user efficiently. See the -- display method for documentation. -- -- Use the OverloadedStrings language extension when using this module to -- produce Builder values conveniently e.g. "Hello" <> -- display name. module Display -- | Display a value in a human-readable format. This is the opposite of -- the Show class which is intended for programmers to read. See -- Display for how to use this for your own types. -- --
-- mconcat (intersperse ", " (map display [1, 4, 5])) ---- -- This example requires the OverloadedStrings language extension. display :: Display a => a -> Builder -- | Display to a ByteString value. displayByteString :: Display a => a -> ByteString -- | Display to a ByteString value. displayLazyByteString :: Display a => a -> ByteString -- | Display to a String value. Very inefficient. Only use when you -- are forced to by another API. displayString :: Display a => a -> String -- | Display to a Text value. Inefficient. Only use when you have -- to. displayText :: Display a => a -> Text -- | Display to a Text value. Inefficient. Only use when you have -- to. displayLazyText :: Display a => a -> Text -- | Display a value in a human-readable format. This is the opposite of -- the Show class which is intended for programmers to read, and -- can be used alongside Show. -- -- For example, consider: Maybe String -- --
-- >>> show (Just "abc") -- Just "abc" -- -- >>> show Nothing -- Nothing ---- -- whereas display is meant for printing to users, so you might -- write this: -- --
-- >>> display (Just "abc") -- abc -- -- >>> display Nothing -- "" ---- -- You can safely use newtype deriving with this type, e.g. -- --
-- newtype Name = Name Text deriving (Show, Display) ---- -- Instances for exceptions can be written like this: -- --
-- data MyException = SomeProblem deriving (Show, Typeable) -- instance Exception MyException where displayException = displayString --class Display a -- | Display a value in a human-readable format. This is the opposite of -- the Show class which is intended for programmers to read. See -- Display for how to use this for your own types. -- --
-- mconcat (intersperse ", " (map display [1, 4, 5])) ---- -- This example requires the OverloadedStrings language extension. display :: Display a => a -> Builder instance Display.Display a => Display.Display (GHC.Base.Maybe a) instance (Display.Display a, Display.Display b) => Display.Display (Data.Either.Either a b) instance Display.Display Data.Text.Internal.Text instance Display.Display Data.Text.Internal.Lazy.Text instance Display.Display Data.ByteString.Builder.Internal.Builder instance Display.Display Data.ByteString.Internal.ByteString instance Display.Display Data.ByteString.Lazy.Internal.ByteString instance Display.Display [GHC.Types.Char] instance Display.Display GHC.Types.Char instance Display.Display GHC.Int.Int8 instance Display.Display GHC.Int.Int16 instance Display.Display GHC.Int.Int32 instance Display.Display GHC.Int.Int64 instance Display.Display GHC.Types.Int instance Display.Display GHC.Integer.Type.Integer instance Display.Display GHC.Word.Word8 instance Display.Display GHC.Word.Word16 instance Display.Display GHC.Word.Word32 instance Display.Display GHC.Word.Word64 instance Display.Display GHC.Types.Word instance Display.Display GHC.Types.Float instance Display.Display GHC.Types.Double