-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generic deriving of Read/Show with no record labels. -- -- Please see the README on GitHub at -- https://github.com/jacobstanley/quiet#readme @package quiet @version 0.1 module Quiet.Internal data ConType ConPrefix :: ConType ConInfix :: String -> ConType class QShow f qshowsPrec_ :: QShow f => ConType -> Int -> f a -> ShowS qshowsNullary :: QShow f => f a -> Bool class QRead f qreadPrec_ :: QRead f => ConType -> ReadPrec (f a) qreadNullary :: QRead f => Proxy f -> Bool expectInfix :: String -> ReadPrec () instance Quiet.Internal.QRead GHC.Generics.U1 instance GHC.Read.Read c => Quiet.Internal.QRead (GHC.Generics.K1 i c) instance (Quiet.Internal.QRead a, GHC.Generics.Constructor c) => Quiet.Internal.QRead (GHC.Generics.M1 GHC.Generics.C c a) instance Quiet.Internal.QRead a => Quiet.Internal.QRead (GHC.Generics.M1 GHC.Generics.S s a) instance Quiet.Internal.QRead a => Quiet.Internal.QRead (GHC.Generics.M1 GHC.Generics.D d a) instance (Quiet.Internal.QRead a, Quiet.Internal.QRead b) => Quiet.Internal.QRead (a GHC.Generics.:+: b) instance (Quiet.Internal.QRead a, Quiet.Internal.QRead b) => Quiet.Internal.QRead (a GHC.Generics.:*: b) instance Quiet.Internal.QShow GHC.Generics.U1 instance GHC.Show.Show c => Quiet.Internal.QShow (GHC.Generics.K1 i c) instance (Quiet.Internal.QShow a, GHC.Generics.Constructor c) => Quiet.Internal.QShow (GHC.Generics.M1 GHC.Generics.C c a) instance Quiet.Internal.QShow a => Quiet.Internal.QShow (GHC.Generics.M1 GHC.Generics.S s a) instance Quiet.Internal.QShow a => Quiet.Internal.QShow (GHC.Generics.M1 GHC.Generics.D d a) instance (Quiet.Internal.QShow a, Quiet.Internal.QShow b) => Quiet.Internal.QShow (a GHC.Generics.:+: b) instance (Quiet.Internal.QShow a, Quiet.Internal.QShow b) => Quiet.Internal.QShow (a GHC.Generics.:*: b) -- | Generic deriving of Read / Show with no record labels. -- -- Often one wants to create a newtype which has a convieniant -- field accessor like unUserId below, but that makes the -- derived Show instance overly verbose. -- -- For example: -- --
-- newtype UserId = UserId { unUserId :: String } deriving (Show)
--
--
-- Renders as:
--
--
-- >>> show (UserId "simon")
-- UserId {unUserId = "simon"}
--
--
-- With qshowsPrec you can have a Show instance which
-- doesn't print the field labels. It will render as if the
-- unUserId accessor wasn't present at all.
--
--
-- newtype UserId = UserId { unUserId :: String } deriving (Generic)
--
-- instance Show UserId where showsPrec = qshowsPrec
--
--
-- -- >>> show (UserId "simon") -- UserId "simon" ---- -- A compatible Read instance can also be derived using -- qreadPrec if necessary. -- --
-- instance Read UserId where showsPrec = qreadPrec --module Quiet -- | This implements a quiet version of showsPrec which omits labels -- for record fields when rendering constructors. qshowsPrec :: (Generic a, QShow (Rep a)) => Int -> a -> ShowS -- | This implements a quiet version of readPrec which expects -- labels for record fields to be omitted when parsing constructors. qreadPrec :: (Generic a, QRead (Rep a)) => ReadPrec a