text-show-instances 3.5 → 3.6
raw patch · 39 files changed
+1035/−1865 lines, 39 filesdep +processdep ~Win32dep ~quickcheck-instancesdep ~text-showPVP ok
version bump matches the API change (PVP)
Dependencies added: process
Dependency ranges changed: Win32, quickcheck-instances, text-show, text-show-instances, time
API changes (from Hackage documentation)
- TextShow.Compiler.Hoopl: liftShowbLabelMapPrec :: (v -> Builder) -> Int -> LabelMap v -> Builder
- TextShow.Compiler.Hoopl: liftShowbPointed :: (a -> Builder) -> Pointed t b a -> Builder
- TextShow.Compiler.Hoopl: liftShowbUniqueMapPrec :: (v -> Builder) -> Int -> UniqueMap v -> Builder
- TextShow.Compiler.Hoopl: showbDPath :: DPath -> Builder
- TextShow.Compiler.Hoopl: showbDominatorNode :: DominatorNode -> Builder
- TextShow.Compiler.Hoopl: showbDominatorTree :: DominatorTree -> Builder
- TextShow.Compiler.Hoopl: showbLabel :: Label -> Builder
- TextShow.Compiler.Hoopl: showbLabelSetPrec :: Int -> LabelSet -> Builder
- TextShow.Compiler.Hoopl: showbUnique :: Unique -> Builder
- TextShow.Compiler.Hoopl: showbUniqueSetPrec :: Int -> UniqueSet -> Builder
- TextShow.Control.Applicative.Trans: liftShowbBackwardsPrec :: TextShow1 f => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Backwards f a -> Builder
- TextShow.Control.Applicative.Trans: liftShowbLiftPrec :: TextShow1 f => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Lift f a -> Builder
- TextShow.Control.Monad.Trans: liftShowbErrorTPrec :: (TextShow e, TextShow1 m) => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> ErrorT e m a -> Builder
- TextShow.Control.Monad.Trans: liftShowbExceptTPrec :: (TextShow e, TextShow1 m) => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> ExceptT e m a -> Builder
- TextShow.Control.Monad.Trans: liftShowbIdentityTPrec :: TextShow1 f => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> IdentityT f a -> Builder
- TextShow.Control.Monad.Trans: liftShowbListTPrec :: TextShow1 m => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> ListT m a -> Builder
- TextShow.Control.Monad.Trans: liftShowbMaybeTPrec :: TextShow1 m => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> MaybeT m a -> Builder
- TextShow.Control.Monad.Trans: liftShowbWriterTLazyPrec :: (TextShow w, TextShow1 m) => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> WriterT w m a -> Builder
- TextShow.Control.Monad.Trans: liftShowbWriterTStrictPrec :: (TextShow w, TextShow1 m) => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> WriterT w m a -> Builder
- TextShow.Data.Bifunctor: instance (TextShow.Classes.TextShow (f a b), TextShow.Classes.TextShow (g a b)) => TextShow.Classes.TextShow (Data.Bifunctor.Product.Product f g a b)
- TextShow.Data.Bifunctor: instance (TextShow.Classes.TextShow (f a b), TextShow.Classes.TextShow (g a b)) => TextShow.Classes.TextShow (Data.Bifunctor.Sum.Sum f g a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (f (p a b)) => TextShow.Classes.TextShow (Data.Bifunctor.Tannen.Tannen f p a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (f a) => TextShow.Classes.TextShow (Data.Bifunctor.Clown.Clown f a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (f a) => TextShow.Classes.TextShow1 (Data.Bifunctor.Clown.Clown f a)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (g b) => TextShow.Classes.TextShow (Data.Bifunctor.Joker.Joker g a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (p (Data.Bifunctor.Fix.Fix p a) a) => TextShow.Classes.TextShow (Data.Bifunctor.Fix.Fix p a)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (p (f a) (g b)) => TextShow.Classes.TextShow (Data.Bifunctor.Biff.Biff p f g a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (p a a) => TextShow.Classes.TextShow (Data.Bifunctor.Join.Join p a)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (p a b) => TextShow.Classes.TextShow (Data.Bifunctor.Wrapped.WrappedBifunctor p a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow (p b a) => TextShow.Classes.TextShow (Data.Bifunctor.Flip.Flip p a b)
- TextShow.Data.Bifunctor: instance TextShow.Classes.TextShow1 g => TextShow.Classes.TextShow1 (Data.Bifunctor.Joker.Joker g a)
- TextShow.Data.Bifunctor: liftShowbBiffPrec2 :: (TextShow2 p, TextShow1 f, TextShow1 g) => (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> Biff p f g a b -> Builder
- TextShow.Data.Bifunctor: liftShowbClownPrec :: TextShow1 f => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Clown f a b -> Builder
- TextShow.Data.Bifunctor: liftShowbFixPrec :: TextShow2 p => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Fix p a -> Builder
- TextShow.Data.Bifunctor: liftShowbFlipPrec2 :: TextShow2 p => (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> Flip p a b -> Builder
- TextShow.Data.Bifunctor: liftShowbJoinPrec :: TextShow2 p => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Join p a -> Builder
- TextShow.Data.Bifunctor: liftShowbJokerPrec :: TextShow1 g => (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> Joker g a b -> Builder
- TextShow.Data.Bifunctor: liftShowbProductPrec2 :: (TextShow2 f, TextShow2 g) => (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> Product f g a b -> Builder
- TextShow.Data.Bifunctor: liftShowbSumPrec2 :: (TextShow2 f, TextShow2 g) => (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> Sum f g a b -> Builder
- TextShow.Data.Bifunctor: liftShowbTannenPrec2 :: (TextShow1 f, TextShow2 p) => (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> Tannen f p a b -> Builder
- TextShow.Data.Bifunctor: liftShowbWrappedBifunctorPrec2 :: TextShow2 p => (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> WrappedBifunctor p a b -> Builder
- TextShow.Data.Bifunctor: showbBiffPrec :: TextShow (p (f a) (g b)) => Int -> Biff p f g a b -> Builder
- TextShow.Data.Bifunctor: showbClownPrec :: TextShow (f a) => Int -> Clown f a b -> Builder
- TextShow.Data.Bifunctor: showbFixPrec :: TextShow (p (Fix p a) a) => Int -> Fix p a -> Builder
- TextShow.Data.Bifunctor: showbFlipPrec :: TextShow (p b a) => Int -> Flip p a b -> Builder
- TextShow.Data.Bifunctor: showbJoinPrec :: TextShow (p a a) => Int -> Join p a -> Builder
- TextShow.Data.Bifunctor: showbJokerPrec :: TextShow (g b) => Int -> Joker g a b -> Builder
- TextShow.Data.Bifunctor: showbProductPrec :: (TextShow (f a b), TextShow (g a b)) => Int -> Product f g a b -> Builder
- TextShow.Data.Bifunctor: showbSumPrec :: (TextShow (f a b), TextShow (g a b)) => Int -> Sum f g a b -> Builder
- TextShow.Data.Bifunctor: showbTannenPrec :: TextShow (f (p a b)) => Int -> Tannen f p a b -> Builder
- TextShow.Data.Bifunctor: showbWrappedBifunctorPrec :: TextShow (p a b) => Int -> WrappedBifunctor p a b -> Builder
- TextShow.Data.Binary: liftShowbDecoder :: (a -> Builder) -> Decoder a -> Builder
- TextShow.Data.Containers: liftShowbIntMapPrec :: (v -> Builder) -> Int -> IntMap v -> Builder
- TextShow.Data.Containers: liftShowbMapPrec2 :: (k -> Builder) -> (v -> Builder) -> Int -> Map k v -> Builder
- TextShow.Data.Containers: liftShowbSCCPrec :: (Int -> vertex -> Builder) -> ([vertex] -> Builder) -> Int -> SCC vertex -> Builder
- TextShow.Data.Containers: liftShowbSequencePrec :: ([a] -> Builder) -> Int -> Seq a -> Builder
- TextShow.Data.Containers: liftShowbSetPrec :: ([a] -> Builder) -> Int -> Set a -> Builder
- TextShow.Data.Containers: liftShowbTreePrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Tree a -> Builder
- TextShow.Data.Containers: liftShowbViewLPrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> ViewL a -> Builder
- TextShow.Data.Containers: liftShowbViewRPrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> ViewR a -> Builder
- TextShow.Data.Containers: showbIntSetPrec :: Int -> IntSet -> Builder
- TextShow.Data.Functor.Trans: liftShowbConstantPrec :: (Int -> a -> Builder) -> Int -> Constant a b -> Builder
- TextShow.Data.Functor.Trans: liftShowbReversePrec :: TextShow1 f => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> Reverse f a -> Builder
- TextShow.Data.Time: showbAbsoluteTime :: AbsoluteTime -> Builder
- TextShow.Data.Time: showbDay :: Day -> Builder
- TextShow.Data.Time: showbDiffTime :: DiffTime -> Builder
- TextShow.Data.Time: showbLocalTime :: LocalTime -> Builder
- TextShow.Data.Time: showbNominalDiffTime :: NominalDiffTime -> Builder
- TextShow.Data.Time: showbTimeLocalePrec :: Int -> TimeLocale -> Builder
- TextShow.Data.Time: showbTimeOfDay :: TimeOfDay -> Builder
- TextShow.Data.Time: showbTimeZone :: TimeZone -> Builder
- TextShow.Data.Time: showbUTCTime :: UTCTime -> Builder
- TextShow.Data.Time: showbZonedTime :: ZonedTime -> Builder
- TextShow.Data.UnorderedContainers: liftShowbHashMapPrec2 :: (k -> Builder) -> (v -> Builder) -> Int -> HashMap k v -> Builder
- TextShow.Data.UnorderedContainers: liftShowbHashSetPrec :: ([a] -> Builder) -> Int -> HashSet a -> Builder
- TextShow.Data.Vector: liftShowbVectorPrec :: ([a] -> Builder) -> Int -> Vector a -> Builder
- TextShow.Data.Vector: showbSizePrec :: Int -> Size -> Builder
- TextShow.Data.Vector: showbVectorPrimitivePrec :: (TextShow a, Prim a) => Int -> Vector a -> Builder
- TextShow.Data.Vector: showbVectorStorablePrec :: (TextShow a, Storable a) => Int -> Vector a -> Builder
- TextShow.Data.Vector: showbVectorUnboxedPrec :: (TextShow a, Unbox a) => Int -> Vector a -> Builder
- TextShow.GHC.LanguageExtensions.Type: showbExtension :: Extension -> Builder
- TextShow.Language.Haskell.TH: showbAnnLookupPrec :: Int -> AnnLookup -> Builder
- TextShow.Language.Haskell.TH: showbAnnTargetPrec :: Int -> AnnTarget -> Builder
- TextShow.Language.Haskell.TH: showbBangPrec :: Int -> Bang -> Builder
- TextShow.Language.Haskell.TH: showbBodyPrec :: Int -> Body -> Builder
- TextShow.Language.Haskell.TH: showbCallconv :: Callconv -> Builder
- TextShow.Language.Haskell.TH: showbClausePrec :: Int -> Clause -> Builder
- TextShow.Language.Haskell.TH: showbConPrec :: Int -> Con -> Builder
- TextShow.Language.Haskell.TH: showbDecPrec :: Int -> Dec -> Builder
- TextShow.Language.Haskell.TH: showbDecidedStrictness :: DecidedStrictness -> Builder
- TextShow.Language.Haskell.TH: showbDoc :: Doc -> Builder
- TextShow.Language.Haskell.TH: showbExpPrec :: Int -> Exp -> Builder
- TextShow.Language.Haskell.TH: showbFamFlavour :: FamFlavour -> Builder
- TextShow.Language.Haskell.TH: showbFamilyResultSigPrec :: Int -> FamilyResultSig -> Builder
- TextShow.Language.Haskell.TH: showbFixityDirection :: FixityDirection -> Builder
- TextShow.Language.Haskell.TH: showbFixityPrec :: Int -> Fixity -> Builder
- TextShow.Language.Haskell.TH: showbForeignPrec :: Int -> Foreign -> Builder
- TextShow.Language.Haskell.TH: showbFunDepPrec :: Int -> FunDep -> Builder
- TextShow.Language.Haskell.TH: showbGuardPrec :: Int -> Guard -> Builder
- TextShow.Language.Haskell.TH: showbInfoPrec :: Int -> Info -> Builder
- TextShow.Language.Haskell.TH: showbInjectivityAnnPrec :: Int -> InjectivityAnn -> Builder
- TextShow.Language.Haskell.TH: showbInline :: Inline -> Builder
- TextShow.Language.Haskell.TH: showbKindPrec :: Int -> Kind -> Builder
- TextShow.Language.Haskell.TH: showbLitPrec :: Int -> Dec -> Builder
- TextShow.Language.Haskell.TH: showbLocPrec :: Int -> Loc -> Builder
- TextShow.Language.Haskell.TH: showbMatchPrec :: Int -> Match -> Builder
- TextShow.Language.Haskell.TH: showbModNamePrec :: Int -> ModName -> Builder
- TextShow.Language.Haskell.TH: showbModuleInfoPrec :: Int -> ModuleInfo -> Builder
- TextShow.Language.Haskell.TH: showbModulePrec :: Int -> Module -> Builder
- TextShow.Language.Haskell.TH: showbNameFlavourPrec :: Int -> NameFlavour -> Builder
- TextShow.Language.Haskell.TH: showbNameSpace :: NameSpace -> Builder
- TextShow.Language.Haskell.TH: showbOccNamePrec :: Int -> OccName -> Builder
- TextShow.Language.Haskell.TH: showbOverlap :: Overlap -> Builder
- TextShow.Language.Haskell.TH: showbPatPrec :: Int -> Pat -> Builder
- TextShow.Language.Haskell.TH: showbPhasesPrec :: Int -> Phases -> Builder
- TextShow.Language.Haskell.TH: showbPkgNamePrec :: Int -> PkgName -> Builder
- TextShow.Language.Haskell.TH: showbPragmaPrec :: Int -> Pragma -> Builder
- TextShow.Language.Haskell.TH: showbPredPrec :: Int -> Pred -> Builder
- TextShow.Language.Haskell.TH: showbRangePrec :: Int -> Range -> Builder
- TextShow.Language.Haskell.TH: showbRole :: Role -> Builder
- TextShow.Language.Haskell.TH: showbRuleBndrPrec :: Int -> RuleBndr -> Builder
- TextShow.Language.Haskell.TH: showbRuleMatch :: RuleMatch -> Builder
- TextShow.Language.Haskell.TH: showbSafety :: Safety -> Builder
- TextShow.Language.Haskell.TH: showbSourceStrictness :: SourceStrictness -> Builder
- TextShow.Language.Haskell.TH: showbSourceUnpackedness :: SourceUnpackedness -> Builder
- TextShow.Language.Haskell.TH: showbStmtPrec :: Int -> Stmt -> Builder
- TextShow.Language.Haskell.TH: showbStrictPrec :: Int -> Strict -> Builder
- TextShow.Language.Haskell.TH: showbTyLitPrec :: Int -> TyLit -> Builder
- TextShow.Language.Haskell.TH: showbTySynEqnPrec :: Int -> TySynEqn -> Builder
- TextShow.Language.Haskell.TH: showbTyVarBndrPrec :: Int -> TyVarBndr -> Builder
- TextShow.Language.Haskell.TH: showbTypeFamilyHeadPrec :: Int -> TypeFamilyHead -> Builder
- TextShow.Language.Haskell.TH: showbTypePrec :: Int -> Type -> Builder
- TextShow.System.Console.Haskeline: showbCompletionPrec :: Int -> Completion -> Builder
- TextShow.System.Console.Haskeline: showbHistory :: History -> Builder
- TextShow.System.Console.Haskeline: showbInterrupt :: Interrupt -> Builder
- TextShow.System.Console.Haskeline: showbPrefsPrec :: Int -> Prefs -> Builder
- TextShow.System.Console.Terminfo: showbColorPrec :: Int -> Color -> Builder
- TextShow.System.Console.Terminfo: showbSetupTermError :: SetupTermError -> Builder
- TextShow.System.Directory: showbPermissionsPrec :: Int -> Permissions -> Builder
- TextShow.System.Locale: showbTimeLocalePrec :: Int -> TimeLocale -> Builder
- TextShow.System.Posix: showbDLPrec :: Int -> DL -> Builder
- TextShow.System.Posix: showbGroupEntryPrec :: Int -> GroupEntry -> Builder
- TextShow.System.Posix: showbProcessStatusPrec :: Int -> ProcessStatus -> Builder
- TextShow.System.Posix: showbRTLDFlags :: RTLDFlags -> Builder
- TextShow.System.Posix: showbUserEntryPrec :: Int -> UserEntry -> Builder
- TextShow.System.Random: showbStdGenPrec :: Int -> StdGen -> Builder
- TextShow.System.Time: showbCalendarTimePrec :: Int -> CalendarTime -> Builder
- TextShow.System.Time: showbClockTime :: ClockTime -> Builder
- TextShow.System.Time: showbDay :: Day -> Builder
- TextShow.System.Time: showbMonth :: Month -> Builder
- TextShow.System.Time: showbTimeDiffPrec :: Int -> TimeDiff -> Builder
- TextShow.Text.PrettyPrint: liftShowbAnnotDetailsPrec :: (Int -> a -> Builder) -> Int -> AnnotDetails a -> Builder
- TextShow.Text.PrettyPrint: liftShowbSpanPrec :: (Int -> a -> Builder) -> Int -> Span a -> Builder
- TextShow.Text.PrettyPrint: showbMode :: Mode -> Builder
- TextShow.Text.PrettyPrint: showbPrettyLevelAnnotPrec :: Int -> PrettyLevel -> Builder
- TextShow.Text.PrettyPrint: showbPrettyLevelPrec :: Int -> PrettyLevel -> Builder
- TextShow.Text.PrettyPrint: showbStylePrec :: Int -> Style -> Builder
- TextShow.Text.PrettyPrint: showbTextDetailsPrec :: Int -> TextDetails -> Builder
- TextShow.Text.XHtml: showbHotLinkPrec :: Int -> HotLink -> Builder
- TextShow.Text.XHtml: showbHtml :: Html -> Builder
- TextShow.Text.XHtml: showbHtmlAttr :: HtmlAttr -> Builder
- TextShow.Text.XHtml: showbHtmlList :: [Html] -> Builder
- TextShow.Text.XHtml: showbHtmlTable :: HtmlTable -> Builder
- TextShow.Trace.Hpc: showbBoxLabelPrec :: Int -> BoxLabel -> Builder
- TextShow.Trace.Hpc: showbCondBox :: CondBox -> Builder
- TextShow.Trace.Hpc: showbHash :: Hash -> Builder
- TextShow.Trace.Hpc: showbHpcPos :: HpcPos -> Builder
- TextShow.Trace.Hpc: showbMixPrec :: Int -> Mix -> Builder
- TextShow.Trace.Hpc: showbTixModulePrec :: Int -> TixModule -> Builder
- TextShow.Trace.Hpc: showbTixPrec :: Int -> Tix -> Builder
+ TextShow.Data.Bifunctor: instance forall k (g :: * -> *) (a :: k). TextShow.Classes.TextShow1 g => TextShow.Classes.TextShow1 (Data.Bifunctor.Joker.Joker g a)
+ TextShow.Data.Bifunctor: instance forall k (p :: * -> k -> *) (a :: k). TextShow.Classes.TextShow (p (Data.Bifunctor.Fix.Fix p a) a) => TextShow.Classes.TextShow (Data.Bifunctor.Fix.Fix p a)
+ TextShow.Data.Bifunctor: instance forall k (p :: k -> k -> *) (a :: k). TextShow.Classes.TextShow (p a a) => TextShow.Classes.TextShow (Data.Bifunctor.Join.Join p a)
+ TextShow.Data.Bifunctor: instance forall k k1 (f :: k1 -> *) (a :: k1) (b :: k). TextShow.Classes.TextShow (f a) => TextShow.Classes.TextShow (Data.Bifunctor.Clown.Clown f a b)
+ TextShow.Data.Bifunctor: instance forall k k1 (f :: k1 -> k -> *) (a :: k1) (b :: k) (g :: k1 -> k -> *). (TextShow.Classes.TextShow (f a b), TextShow.Classes.TextShow (g a b)) => TextShow.Classes.TextShow (Data.Bifunctor.Product.Product f g a b)
+ TextShow.Data.Bifunctor: instance forall k k1 (f :: k1 -> k -> *) (a :: k1) (b :: k) (g :: k1 -> k -> *). (TextShow.Classes.TextShow (f a b), TextShow.Classes.TextShow (g a b)) => TextShow.Classes.TextShow (Data.Bifunctor.Sum.Sum f g a b)
+ TextShow.Data.Bifunctor: instance forall k k1 (g :: k1 -> *) (b :: k1) (a :: k). TextShow.Classes.TextShow (g b) => TextShow.Classes.TextShow (Data.Bifunctor.Joker.Joker g a b)
+ TextShow.Data.Bifunctor: instance forall k k1 (p :: k1 -> k -> *) (a :: k1) (b :: k). TextShow.Classes.TextShow (p a b) => TextShow.Classes.TextShow (Data.Bifunctor.Wrapped.WrappedBifunctor p a b)
+ TextShow.Data.Bifunctor: instance forall k k1 (p :: k1 -> k -> *) (b :: k1) (a :: k). TextShow.Classes.TextShow (p b a) => TextShow.Classes.TextShow (Data.Bifunctor.Flip.Flip p a b)
+ TextShow.Data.Bifunctor: instance forall k k1 k2 (f :: k2 -> *) (p :: k1 -> k -> k2) (a :: k1) (b :: k). TextShow.Classes.TextShow (f (p a b)) => TextShow.Classes.TextShow (Data.Bifunctor.Tannen.Tannen f p a b)
+ TextShow.Data.Bifunctor: instance forall k k1 k2 k3 (p :: k3 -> k2 -> *) (f :: k1 -> k3) (a :: k1) (g :: k -> k2) (b :: k). TextShow.Classes.TextShow (p (f a) (g b)) => TextShow.Classes.TextShow (Data.Bifunctor.Biff.Biff p f g a b)
+ TextShow.Data.Bifunctor: instance forall k1 (f :: k1 -> *) (a :: k1). TextShow.Classes.TextShow (f a) => TextShow.Classes.TextShow1 (Data.Bifunctor.Clown.Clown f a)
+ TextShow.Data.Time: instance TextShow.Classes.TextShow Data.Time.Clock.Scale.UniversalTime
+ TextShow.System.Directory: instance TextShow.Classes.TextShow System.Directory.XdgDirectory
Files
- CHANGELOG.md +10/−0
- include/inline.h +0/−13
- src/TextShow/Compiler/Hoopl.hs +57/−130
- src/TextShow/Control/Applicative/Trans.hs +15/−36
- src/TextShow/Control/Monad/Trans.hs +47/−110
- src/TextShow/Data/Bifunctor.hs +40/−195
- src/TextShow/Data/Binary.hs +13/−17
- src/TextShow/Data/Containers.hs +41/−103
- src/TextShow/Data/Functor/Trans.hs +14/−23
- src/TextShow/Data/Tagged.hs +7/−8
- src/TextShow/Data/Time.hs +63/−114
- src/TextShow/Data/UnorderedContainers.hs +17/−34
- src/TextShow/Data/Vector.hs +17/−58
- src/TextShow/GHC/ForeignSrcLang/Type.hs +33/−0
- src/TextShow/GHC/LanguageExtensions/Type.hs +5/−17
- src/TextShow/Language/Haskell/TH.hs +119/−495
- src/TextShow/System/Console/Haskeline.hs +11/−43
- src/TextShow/System/Console/Terminfo.hs +9/−28
- src/TextShow/System/Directory.hs +14/−10
- src/TextShow/System/Locale.hs +3/−11
- src/TextShow/System/Posix.hs +9/−48
- src/TextShow/System/Random.hs +6/−15
- src/TextShow/System/Time.hs +9/−48
- src/TextShow/System/Win32.hs +96/−89
- src/TextShow/Text/PrettyPrint.hs +32/−72
- src/TextShow/Text/XHtml.hs +16/−57
- src/TextShow/Trace/Hpc.hs +18/−72
- src/TextShow/Utils.hs +9/−2
- tests/Instances/Data/Time.hs +31/−0
- tests/Instances/GHC/ForeignSrcLang/Type.hs +32/−0
- tests/Instances/Language/Haskell/TH.hs +10/−0
- tests/Instances/Miscellaneous.hs +11/−3
- tests/Instances/System/Directory.hs +10/−0
- tests/Instances/System/Win32.hs +73/−0
- tests/Spec/Data/TimeSpec.hs +18/−0
- tests/Spec/GHC/ForeignSrcLang/TypeSpec.hs +45/−0
- tests/Spec/System/DirectorySpec.hs +13/−1
- tests/Spec/System/Win32Spec.hs +41/−0
- text-show-instances.cabal +21/−13
CHANGELOG.md view
@@ -1,3 +1,13 @@+### 3.6 [2017.04.22]+* New `TextShow` instances:+ * `directory`: `XdgDirectory` (from `System.Directory`)+ * `ghc-boot-th`: `ForeignSrcLang` (from `GHC.ForeignSrcLang.Type`)+ * `time`: `UniversalTime` (from `Data.Time.Clock`) and `SystemTime` (from `Data.Time.Clock.System` with `time-1.8` or later)+ * `Win32`: Lots of datatypes added in `Win32-2.5.0.0`+* Remove most monomorphic `TextShow` functions, as their utility is questionable, and their maintenance burden is undeniable+* Made the instances in `TextShow.Data.Bifunctor` poly-kinded when possible+* Fix testsuite compilation on older GHCs+ ### 3.5 [2017.01.07] * Add `TextShow(1)` instances for `Data.Graph.SCC` * `TextShow.Instances` no longer reexports the entirety of `TextShow`. Doing so meant that `text-show-instances` would be burdened with bumping its major version number every time that `text-show` made an API change in `TextShow` in order to follow the PVP.
− include/inline.h
@@ -1,13 +0,0 @@-#ifndef INLINE_H-#define INLINE_H--#define OPEN_PRAGMA {-#-#define CLOSE_PRAGMA #-}--#if __GLASGOW_HASKELL__ >= 702-#define INLINE_INST_FUN(F) OPEN_PRAGMA INLINE F CLOSE_PRAGMA-#else-#define INLINE_INST_FUN(F)-#endif--#endif
src/TextShow/Compiler/Hoopl.hs view
@@ -11,28 +11,18 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @hoopl@ library.+'TextShow' instances for data types in the @hoopl@ library. /Since: 2/ -}-module TextShow.Compiler.Hoopl (- showbLabel- , liftShowbLabelMapPrec- , showbLabelSetPrec- , liftShowbPointed- , showbUnique- , liftShowbUniqueMapPrec- , showbUniqueSetPrec- , showbDominatorNode- , showbDominatorTree- , showbDPath- ) where+module TextShow.Compiler.Hoopl () where import Compiler.Hoopl (Label, LabelMap, LabelSet, Pointed(..),- Unique, UniqueMap, UniqueSet)+ UniqueMap, UniqueSet) #if MIN_VERSION_hoopl(3,9,0) import Compiler.Hoopl.Internals (lblToUnique) #else+import Compiler.Hoopl (Unique) import Compiler.Hoopl.GHC (lblToUnique, uniqueToInt) #endif import Compiler.Hoopl.Passes.Dominator (DominatorNode(..), DominatorTree(..), DPath(..))@@ -42,150 +32,87 @@ import TextShow (TextShow(..), TextShow1(..), TextShow2(..), Builder, singleton, showbPrec1) import TextShow.Data.Containers ()-import TextShow.Data.Integral (showbIntPrec) import TextShow.TH (deriveTextShow, deriveTextShow1) -#include "inline.h"---- | Convert a 'Label' to a 'Builder'.------ /Since: 2/-showbLabel :: Label -> Builder-showbLabel l = singleton 'L' <> showbUnique (lblToUnique l)-{-# INLINE showbLabel #-}---- | Convert a 'LabelMap' to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbLabelMapPrec :: (v -> Builder) -> Int -> LabelMap v -> Builder-liftShowbLabelMapPrec sp = liftShowbPrec (const sp) undefined-{-# INLINE liftShowbLabelMapPrec #-}---- | Convert a 'LabelSet' to a 'Builder' with the given precedence.------ /Since: 2/-showbLabelSetPrec :: Int -> LabelSet -> Builder-showbLabelSetPrec = showbPrec-{-# INLINE showbLabelSetPrec #-}---- | Convert a 'Pointed' value to a 'Builder' with the given show function.------ /Since: 3/-liftShowbPointed :: (a -> Builder) -> Pointed t b a -> Builder-liftShowbPointed _ Bot = "_|_"-liftShowbPointed _ Top = singleton 'T'-liftShowbPointed sp (PElem a) = sp a-{-# INLINE liftShowbPointed #-}---- | Convert a 'Unique' value to a 'Builder'.------ /Since: 2/-showbUnique :: Unique -> Builder-#if MIN_VERSION_hoopl(3,9,0)-showbUnique = showbIntPrec 0-#else-showbUnique = showbIntPrec 0 . uniqueToInt-#endif-{-# INLINE showbUnique #-}---- | Convert a 'UniqueMap' to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbUniqueMapPrec :: (v -> Builder) -> Int -> UniqueMap v -> Builder-liftShowbUniqueMapPrec sp = liftShowbPrec (const sp) undefined-{-# INLINE liftShowbUniqueMapPrec #-}---- | Convert a 'UniqueSet' to a 'Builder' with the given precedence.------ /Since: 2/-showbUniqueSetPrec :: Int -> UniqueSet -> Builder-showbUniqueSetPrec = showbPrec-{-# INLINE showbUniqueSetPrec #-}---- | Convert a 'DominatorNode' to a 'Builder'.------ /Since: 2/-showbDominatorNode :: DominatorNode -> Builder-showbDominatorNode Entry = "entryNode"-showbDominatorNode (Labelled l) = showbLabel l-{-# INLINE showbDominatorNode #-}---- | Convert a 'DominatorTree' to a 'Builder'.------ /Since: 2/-showbDominatorTree :: DominatorTree -> Builder-showbDominatorTree t = mconcat $ "digraph {\n" : dot t ["}\n"]- where- dot :: DominatorTree -> [Builder] -> [Builder]- dot (Dominates root trees) =- (dotnode root :) . outedges trees . flip (foldl subtree) trees- where- outedges :: [DominatorTree] -> [Builder] -> [Builder]- outedges [] = id- outedges (Dominates n _ : ts) =- \bs -> " "- : showbDominatorNode root- : " -> "- : showbDominatorNode n- : singleton '\n'- : outedges ts bs-- dotnode :: DominatorNode -> Builder- dotnode Entry = " entryNode [shape=plaintext, label=\"entry\"]\n"- dotnode (Labelled l) = " " <> showbLabel l <> singleton '\n'-- subtree :: [Builder] -> DominatorTree -> [Builder]- subtree = flip dot---- | Convert a 'DPath' to a 'Builder'.------ /Since: 2/-showbDPath :: DPath -> Builder-showbDPath (DPath ls) = mconcat $ foldr (\l path ->showbLabel l <> " -> " : path)- ["entry"]- ls-{-# INLINE showbDPath #-}-+-- | /Since: 2/ instance TextShow Label where- showb = showbLabel- INLINE_INST_FUN(showb)+ showb l = singleton 'L' <> showb (lblToUnique l)+ {-# INLINE showb #-} +-- | /Since: 2/ $(deriveTextShow ''LabelMap)+-- | /Since: 2/ $(deriveTextShow1 ''LabelMap) +-- | /Since: 2/ $(deriveTextShow ''LabelSet) +-- | /Since: 2/ instance TextShow a => TextShow (Pointed t b a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 (Pointed t b) where- liftShowbPrec sp _ _ = liftShowbPointed $ sp 0- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec _ _ _ Bot = "_|_"+ liftShowbPrec _ _ _ Top = singleton 'T'+ liftShowbPrec sp _ _ (PElem a) = sp 0 a+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance TextShow2 (Pointed t) where liftShowbPrec2 _ _ = liftShowbPrec- INLINE_INST_FUN(liftShowbPrec2)+ {-# INLINE liftShowbPrec2 #-} #if !(MIN_VERSION_hoopl(3,9,0))+-- | /Since: 2/ instance TextShow Unique where- showb = showbUnique- INLINE_INST_FUN(showb)+ showb = showb . uniqueToInt+ {-# INLINE showb #-} #endif +-- | /Since: 2/ $(deriveTextShow ''UniqueMap)+-- | /Since: 2/ $(deriveTextShow1 ''UniqueMap) +-- | /Since: 2/ $(deriveTextShow ''UniqueSet) +-- | /Since: 2/ instance TextShow DominatorNode where- showb = showbDominatorNode- INLINE_INST_FUN(showb)+ showb Entry = "entryNode"+ showb (Labelled l) = showb l+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow DominatorTree where- showb = showbDominatorTree- INLINE_INST_FUN(showb)+ showb t = mconcat $ "digraph {\n" : dot t ["}\n"]+ where+ dot :: DominatorTree -> [Builder] -> [Builder]+ dot (Dominates root trees) =+ (dotnode root :) . outedges trees . flip (foldl subtree) trees+ where+ outedges :: [DominatorTree] -> [Builder] -> [Builder]+ outedges [] = id+ outedges (Dominates n _ : ts) =+ \bs -> " "+ : showb root+ : " -> "+ : showb n+ : singleton '\n'+ : outedges ts bs + dotnode :: DominatorNode -> Builder+ dotnode Entry = " entryNode [shape=plaintext, label=\"entry\"]\n"+ dotnode (Labelled l) = " " <> showb l <> singleton '\n'++ subtree :: [Builder] -> DominatorTree -> [Builder]+ subtree = flip dot++-- | /Since: 2/ instance TextShow DPath where- showb = showbDPath- INLINE_INST_FUN(showb)+ showb (DPath ls) = mconcat $ foldr (\l path -> showb l <> " -> " : path)+ ["entry"]+ ls+ {-# INLINE showb #-}
src/TextShow/Control/Applicative/Trans.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -9,56 +8,36 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for applicative functor transformers.+'TextShow' instances for applicative functor transformers. /Since: 2/ -}-module TextShow.Control.Applicative.Trans (- liftShowbBackwardsPrec- , liftShowbLiftPrec- ) where+module TextShow.Control.Applicative.Trans () where import Control.Applicative.Backwards (Backwards(..)) import Control.Applicative.Lift (Lift(..)) import TextShow (TextShow(..), TextShow1(..),- Builder, showbPrec1, showbUnaryWith)--#include "inline.h"---- | Convert a 'Backwards' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbBackwardsPrec :: TextShow1 f- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Backwards f a -> Builder-liftShowbBackwardsPrec sp sl p (Backwards x)- = showbUnaryWith (liftShowbPrec sp sl) "Backwards" p x-{-# INLINE liftShowbBackwardsPrec #-}---- | Convert a 'Lift' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbLiftPrec :: TextShow1 f- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Lift f a -> Builder-liftShowbLiftPrec sp _ p (Pure x) = showbUnaryWith sp "Pure" p x-liftShowbLiftPrec sp sl p (Other y) = showbUnaryWith (liftShowbPrec sp sl) "Other" p y-{-# INLINE liftShowbLiftPrec #-}+ showbPrec1, showbUnaryWith)+import TextShow.Utils (liftShowbUnaryWith) +-- | /Since: 2/ instance (TextShow1 f, TextShow a) => TextShow (Backwards f a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 f => TextShow1 (Backwards f) where- liftShowbPrec = liftShowbBackwardsPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (Backwards x) = liftShowbUnaryWith sp sl "Backwards" p x+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow1 f, TextShow a) => TextShow (Lift f a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 f => TextShow1 (Lift f) where- liftShowbPrec = liftShowbLiftPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp _ p (Pure x) = showbUnaryWith sp "Pure" p x+ liftShowbPrec sp sl p (Other y) = showbUnaryWith (liftShowbPrec sp sl) "Other" p y+ {-# INLINE liftShowbPrec #-}
src/TextShow/Control/Monad/Trans.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans -fno-warn-warnings-deprecations #-} {-|@@ -9,19 +8,11 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for monad transformers.+'TextShow' instances for monad transformers. /Since: 2/ -}-module TextShow.Control.Monad.Trans (- liftShowbErrorTPrec- , liftShowbExceptTPrec- , liftShowbIdentityTPrec- , liftShowbListTPrec- , liftShowbMaybeTPrec- , liftShowbWriterTLazyPrec- , liftShowbWriterTStrictPrec- ) where+module TextShow.Control.Monad.Trans () where import Control.Monad.Trans.Error (ErrorT(..)) import Control.Monad.Trans.Except (ExceptT(..))@@ -33,145 +24,91 @@ import TextShow (TextShow(..), TextShow1(..), TextShow2(..), Builder, showbPrec1, showbUnaryWith)--#include "inline.h"+import TextShow.Utils (liftShowbUnaryWith) --- | Convert an 'ErrorT' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbErrorTPrec :: (TextShow e, TextShow1 m)+liftMShowbUnaryWith :: (TextShow1 m, TextShow1 f) => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> ErrorT e m a -> Builder-liftShowbErrorTPrec sp sl p (ErrorT m) =+ -> Builder -> Int -> m (f a) -> Builder+liftMShowbUnaryWith sp sl name p m = showbUnaryWith (liftShowbPrec (liftShowbPrec sp sl)- (liftShowbList sp sl)) "ErrorT" p m-{-# INLINE liftShowbErrorTPrec #-}+ (liftShowbList sp sl)) name p m+{-# INLINE liftMShowbUnaryWith #-} --- | Convert an 'ExceptT' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbExceptTPrec :: (TextShow e, TextShow1 m)+liftShowbWriterTPrec :: (TextShow1 m, TextShow w) => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> ExceptT e m a -> Builder-liftShowbExceptTPrec sp sl p (ExceptT m) =- showbUnaryWith (liftShowbPrec (liftShowbPrec sp sl)- (liftShowbList sp sl)) "ExceptT" p m-{-# INLINE liftShowbExceptTPrec #-}---- | Convert an 'IdentityT' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbIdentityTPrec :: TextShow1 f- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> IdentityT f a -> Builder-liftShowbIdentityTPrec sp sl p (IdentityT m) =- showbUnaryWith (liftShowbPrec sp sl) "IdentityT" p m-{-# INLINE liftShowbIdentityTPrec #-}---- | Convert a 'ListT' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbListTPrec :: TextShow1 m- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> ListT m a -> Builder-liftShowbListTPrec sp sl p (ListT m) =- showbUnaryWith (liftShowbPrec (liftShowbPrec sp sl)- (liftShowbList sp sl)) "ListT" p m-{-# INLINE liftShowbListTPrec #-}---- | Convert a 'MaybeT' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbMaybeTPrec :: TextShow1 m- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> MaybeT m a -> Builder-liftShowbMaybeTPrec sp sl p (MaybeT m) =- showbUnaryWith (liftShowbPrec (liftShowbPrec sp sl)- (liftShowbList sp sl)) "MaybeT" p m-{-# INLINE liftShowbMaybeTPrec #-}---- | Convert a lazy 'WL.WriterT' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbWriterTLazyPrec :: (TextShow w, TextShow1 m)- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> WL.WriterT w m a -> Builder-liftShowbWriterTLazyPrec sp sl p (WL.WriterT m) =- showbUnaryWith (liftShowbPrec (liftShowbPrec2 sp sl showbPrec showbList)- (liftShowbList2 sp sl showbPrec showbList))- "WriterT" p m-{-# INLINE liftShowbWriterTLazyPrec #-}---- | Convert a strict 'WS.WriterT' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbWriterTStrictPrec :: (TextShow w, TextShow1 m)- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> WS.WriterT w m a -> Builder-liftShowbWriterTStrictPrec sp sl p (WS.WriterT m) =+ -> Int -> m (a, w) -> Builder+liftShowbWriterTPrec sp sl p m = showbUnaryWith (liftShowbPrec (liftShowbPrec2 sp sl showbPrec showbList) (liftShowbList2 sp sl showbPrec showbList)) "WriterT" p m-{-# INLINE liftShowbWriterTStrictPrec #-}+{-# INLINE liftShowbWriterTPrec #-} +-- | /Since: 2/ instance (TextShow e, TextShow1 m, TextShow a) => TextShow (ErrorT e m a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow e, TextShow1 m) => TextShow1 (ErrorT e m) where- liftShowbPrec = liftShowbErrorTPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (ErrorT m) = liftMShowbUnaryWith sp sl "ErrorT" p m+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow e, TextShow1 m, TextShow a) => TextShow (ExceptT e m a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow e, TextShow1 m) => TextShow1 (ExceptT e m) where- liftShowbPrec = liftShowbExceptTPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (ExceptT m) = liftMShowbUnaryWith sp sl "ExceptT" p m+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow1 f, TextShow a) => TextShow (IdentityT f a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 f => TextShow1 (IdentityT f) where- liftShowbPrec = liftShowbIdentityTPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (IdentityT m) = liftShowbUnaryWith sp sl "IdentityT" p m+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow1 m, TextShow a) => TextShow (ListT m a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 m => TextShow1 (ListT m) where- liftShowbPrec = liftShowbListTPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (ListT m) = liftMShowbUnaryWith sp sl "ListT" p m+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow1 m, TextShow a) => TextShow (MaybeT m a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 m => TextShow1 (MaybeT m) where- liftShowbPrec = liftShowbMaybeTPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (MaybeT m) = liftMShowbUnaryWith sp sl "MaybeT" p m+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow w, TextShow1 m, TextShow a) => TextShow (WL.WriterT w m a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow w, TextShow1 m) => TextShow1 (WL.WriterT w m) where- liftShowbPrec = liftShowbWriterTLazyPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (WL.WriterT m) = liftShowbWriterTPrec sp sl p m+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow w, TextShow1 m, TextShow a) => TextShow (WS.WriterT w m a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow w, TextShow1 m) => TextShow1 (WS.WriterT w m) where- liftShowbPrec = liftShowbWriterTStrictPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (WS.WriterT m) = liftShowbWriterTPrec sp sl p m+ {-# INLINE liftShowbPrec #-}
src/TextShow/Data/Bifunctor.hs view
@@ -1,6 +1,12 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-}++#if __GLASGOW_HASKELL__ >= 706+{-# LANGUAGE PolyKinds #-}+#endif+ {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -11,32 +17,11 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @bifunctors@ library.+'TextShow' instances for data types in the @bifunctors@ library. /Since: 2/ -}-module TextShow.Data.Bifunctor (- showbBiffPrec- , liftShowbBiffPrec2- , showbClownPrec- , liftShowbClownPrec- , showbFixPrec- , liftShowbFixPrec- , showbFlipPrec- , liftShowbFlipPrec2- , showbJoinPrec- , liftShowbJoinPrec- , showbJokerPrec- , liftShowbJokerPrec- , showbProductPrec- , liftShowbProductPrec2- , showbSumPrec- , liftShowbSumPrec2- , showbTannenPrec- , liftShowbTannenPrec2- , showbWrappedBifunctorPrec- , liftShowbWrappedBifunctorPrec2- ) where+module TextShow.Data.Bifunctor () where import Data.Bifunctor.Biff (Biff) import Data.Bifunctor.Clown (Clown)@@ -49,232 +34,92 @@ import Data.Bifunctor.Tannen (Tannen) import Data.Bifunctor.Wrapped (WrappedBifunctor) -import TextShow (TextShow(..), TextShow1(..), TextShow2(..), Builder)+import TextShow (TextShow(..), TextShow1(..), TextShow2(..)) import TextShow.TH (deriveTextShow2, makeShowbPrec, makeLiftShowbPrec) --- | Convert a 'Biff' value to a 'Builder' with the given precedence.------ /Since: 2/-showbBiffPrec :: TextShow (p (f a) (g b)) => Int -> Biff p f g a b -> Builder-showbBiffPrec = showbPrec-{-# INLINE showbBiffPrec #-}---- | Convert a 'Biff' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbBiffPrec2 :: (TextShow2 p, TextShow1 f, TextShow1 g)- => (Int -> a -> Builder) -> ([a] -> Builder)- -> (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> Biff p f g a b -> Builder-liftShowbBiffPrec2 = liftShowbPrec2-{-# INLINE liftShowbBiffPrec2 #-}---- | Convert a 'Clown' value to a 'Builder' with the given precedence.------ /Since: 2/-showbClownPrec :: TextShow (f a) => Int -> Clown f a b -> Builder-showbClownPrec = showbPrec-{-# INLINE showbClownPrec #-}---- | Convert a 'Clown' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbClownPrec :: TextShow1 f => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Clown f a b -> Builder-liftShowbClownPrec sp sl = liftShowbPrec2 sp sl undefined undefined-{-# INLINE liftShowbClownPrec #-}---- | Convert a 'Fix' value to a 'Builder' with the given precedence.------ /Since: 3/-showbFixPrec :: TextShow (p (Fix p a) a) => Int -> Fix p a -> Builder-showbFixPrec = showbPrec-{-# INLINE showbFixPrec #-}---- | Convert a 'Fix' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbFixPrec :: TextShow2 p => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Fix p a -> Builder-liftShowbFixPrec sp sl p =- liftShowbPrec2 (liftShowbPrec sp sl) (liftShowbList sp sl) sp sl p . out-{-# INLINE liftShowbFixPrec #-}---- | Convert a 'Flip' value to a 'Builder' with the given precedence.------ /Since: 2/-showbFlipPrec :: TextShow (p b a) => Int -> Flip p a b -> Builder-showbFlipPrec = showbPrec-{-# INLINE showbFlipPrec #-}---- | Convert a 'Flip' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbFlipPrec2 :: TextShow2 p- => (Int -> a -> Builder) -> ([a] -> Builder)- -> (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> Flip p a b -> Builder-liftShowbFlipPrec2 = liftShowbPrec2-{-# INLINE liftShowbFlipPrec2 #-}---- | Convert a 'Join' value to a 'Builder' with the given precedence.------ /Since: 2/-showbJoinPrec :: TextShow (p a a) => Int -> Join p a -> Builder-showbJoinPrec = showbPrec-{-# INLINE showbJoinPrec #-}---- | Convert a 'Join' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbJoinPrec :: TextShow2 p => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Join p a -> Builder-liftShowbJoinPrec sp sl p = liftShowbPrec2 sp sl sp sl p . runJoin-{-# INLINE liftShowbJoinPrec #-}---- | Convert a 'Joker' value to a 'Builder' with the given precedence.------ /Since: 2/-showbJokerPrec :: TextShow (g b) => Int -> Joker g a b -> Builder-showbJokerPrec = showbPrec-{-# INLINE showbJokerPrec #-}---- | Convert a 'Joker' value to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbJokerPrec :: TextShow1 g => (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> Joker g a b -> Builder-liftShowbJokerPrec = liftShowbPrec2 undefined undefined-{-# INLINE liftShowbJokerPrec #-}---- | Convert a 'Product' value to a 'Builder' with the given precedence.------ /Since: 2/-showbProductPrec :: (TextShow (f a b), TextShow (g a b))- => Int -> Product f g a b -> Builder-showbProductPrec = showbPrec-{-# INLINE showbProductPrec #-}---- | Convert a 'Product' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbProductPrec2 :: (TextShow2 f, TextShow2 g)- => (Int -> a -> Builder) -> ([a] -> Builder)- -> (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> Product f g a b -> Builder-liftShowbProductPrec2 = liftShowbPrec2-{-# INLINE liftShowbProductPrec2 #-}---- | Convert a 'Sum' value to a 'Builder' with the given precedence.------ /Since: 3/-showbSumPrec :: (TextShow (f a b), TextShow (g a b))- => Int -> Sum f g a b -> Builder-showbSumPrec = showbPrec-{-# INLINE showbSumPrec #-}---- | Convert a 'Sum' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbSumPrec2 :: (TextShow2 f, TextShow2 g)- => (Int -> a -> Builder) -> ([a] -> Builder)- -> (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> Sum f g a b -> Builder-liftShowbSumPrec2 = liftShowbPrec2-{-# INLINE liftShowbSumPrec2 #-}---- | Convert a 'Tannen' value to a 'Builder' with the given precedence.------ /Since: 2/-showbTannenPrec :: TextShow (f (p a b)) => Int -> Tannen f p a b -> Builder-showbTannenPrec = showbPrec-{-# INLINE showbTannenPrec #-}---- | Convert a 'Tannen' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbTannenPrec2 :: (TextShow1 f, TextShow2 p)- => (Int -> a -> Builder) -> ([a] -> Builder)- -> (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> Tannen f p a b -> Builder-liftShowbTannenPrec2 = liftShowbPrec2-{-# INLINE liftShowbTannenPrec2 #-}---- | Convert a 'WrappedBifunctor' value to a 'Builder' with the given precedence.------ /Since: 2/-showbWrappedBifunctorPrec :: TextShow (p a b) => Int -> WrappedBifunctor p a b -> Builder-showbWrappedBifunctorPrec = showbPrec-{-# INLINE showbWrappedBifunctorPrec #-}---- | Convert a 'WrappedBifunctor' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbWrappedBifunctorPrec2 :: TextShow2 p- => (Int -> a -> Builder) -> ([a] -> Builder)- -> (Int -> b -> Builder) -> ([b] -> Builder)- -> Int -> WrappedBifunctor p a b -> Builder-liftShowbWrappedBifunctorPrec2 = liftShowbPrec2-{-# INLINE liftShowbWrappedBifunctorPrec2 #-}-+-- | /Since: 2/ instance TextShow (p (f a) (g b)) => TextShow (Biff p f g a b) where showbPrec = $(makeShowbPrec ''Biff)+-- | /Since: 2/ instance (TextShow2 p, TextShow1 f, TextShow1 g, TextShow a) => TextShow1 (Biff p f g a) where liftShowbPrec = liftShowbPrec2 showbPrec showbList+-- | /Since: 2/ $(deriveTextShow2 ''Biff) +-- | /Since: 2/ instance TextShow (f a) => TextShow (Clown f a b) where showbPrec = $(makeShowbPrec ''Clown)+-- | /Since: 2/ instance TextShow (f a) => TextShow1 (Clown f a) where liftShowbPrec = $(makeLiftShowbPrec ''Clown)+-- | /Since: 2/ $(deriveTextShow2 ''Clown) +-- | /Since: 2/ instance TextShow (p (Fix p a) a) => TextShow (Fix p a) where showbPrec = $(makeShowbPrec ''Fix)+-- | /Since: 2/ instance TextShow2 p => TextShow1 (Fix p) where- liftShowbPrec = liftShowbFixPrec+ liftShowbPrec sp sl p =+ liftShowbPrec2 (liftShowbPrec sp sl) (liftShowbList sp sl) sp sl p . out +-- | /Since: 2/ instance TextShow (p b a) => TextShow (Flip p a b) where showbPrec = $(makeShowbPrec ''Flip)+-- | /Since: 2/ instance (TextShow2 p, TextShow a) => TextShow1 (Flip p a) where liftShowbPrec = liftShowbPrec2 showbPrec showbList+-- | /Since: 2/ $(deriveTextShow2 ''Flip) +-- | /Since: 2/ instance TextShow (p a a) => TextShow (Join p a) where showbPrec = $(makeShowbPrec ''Join)+-- | /Since: 2/ instance TextShow2 p => TextShow1 (Join p) where- liftShowbPrec = liftShowbJoinPrec+ liftShowbPrec sp sl p = liftShowbPrec2 sp sl sp sl p . runJoin +-- | /Since: 2/ instance TextShow (g b) => TextShow (Joker g a b) where showbPrec = $(makeShowbPrec ''Joker)+-- | /Since: 2/ instance TextShow1 g => TextShow1 (Joker g a) where liftShowbPrec = $(makeLiftShowbPrec ''Joker)+-- | /Since: 2/ $(deriveTextShow2 ''Joker) +-- | /Since: 2/ instance (TextShow (f a b), TextShow (g a b)) => TextShow (Product f g a b) where showbPrec = $(makeShowbPrec ''Product)+-- | /Since: 2/ instance (TextShow2 f, TextShow2 g, TextShow a) => TextShow1 (Product f g a) where liftShowbPrec = liftShowbPrec2 showbPrec showbList+-- | /Since: 2/ $(deriveTextShow2 ''Product) +-- | /Since: 2/ instance (TextShow (f a b), TextShow (g a b)) => TextShow (Sum f g a b) where showbPrec = $(makeShowbPrec ''Sum)+-- | /Since: 2/ instance (TextShow2 f, TextShow2 g, TextShow a) => TextShow1 (Sum f g a) where liftShowbPrec = liftShowbPrec2 showbPrec showbList+-- | /Since: 2/ $(deriveTextShow2 ''Sum) +-- | /Since: 2/ instance TextShow (f (p a b)) => TextShow (Tannen f p a b) where showbPrec = $(makeShowbPrec ''Tannen)+-- | /Since: 2/ instance (TextShow1 f, TextShow2 p, TextShow a) => TextShow1 (Tannen f p a) where liftShowbPrec = liftShowbPrec2 showbPrec showbList+-- | /Since: 2/ $(deriveTextShow2 ''Tannen) +-- | /Since: 2/ instance TextShow (p a b) => TextShow (WrappedBifunctor p a b) where showbPrec = $(makeShowbPrec ''WrappedBifunctor)+-- | /Since: 2/ instance (TextShow2 p, TextShow a) => TextShow1 (WrappedBifunctor p a) where liftShowbPrec = liftShowbPrec2 showbPrec showbList+-- | /Since: 2/ $(deriveTextShow2 ''WrappedBifunctor)
src/TextShow/Data/Binary.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -10,32 +9,29 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' function for 'Decoder's.+'TextShow' instance for 'Decoder'. /Since: 2/ -}-module TextShow.Data.Binary (liftShowbDecoder) where+module TextShow.Data.Binary () where import Data.Binary.Get.Internal (Decoder(..)) import Data.Monoid.Compat import TextShow (TextShow(..), TextShow1(..), Builder, fromString, showbPrec1) -#include "inline.h"---- | Convert a 'Decoder' to a 'Builder' with the given show function.------ /Since: 3/-liftShowbDecoder :: (a -> Builder) -> Decoder a -> Builder-liftShowbDecoder _ (Fail _ msg) = "Fail: " <> fromString msg-liftShowbDecoder _ (Partial _) = "Partial _"-liftShowbDecoder sp (Done _ a) = "Done: " <> sp a-liftShowbDecoder _ (BytesRead _ _) = "BytesRead"-+-- | /Since: 2/ instance TextShow a => TextShow (Decoder a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 Decoder where- liftShowbPrec sp _ _ = liftShowbDecoder $ sp 0- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp' _ _ = go $ sp' 0+ where+ go :: (a -> Builder) -> Decoder a -> Builder+ go _ (Fail _ msg) = "Fail: " <> fromString msg+ go _ (Partial _) = "Partial _"+ go sp (Done _ a) = "Done: " <> sp a+ go _ (BytesRead _ _) = "BytesRead"+ {-# INLINE liftShowbPrec #-}
src/TextShow/Data/Containers.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS -fno-warn-orphans #-} {-|@@ -9,21 +8,11 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @containers@ library.+'TextShow' instances for data types in the @containers@ library. /Since: 2/ -}-module TextShow.Data.Containers (- liftShowbIntMapPrec- , showbIntSetPrec- , liftShowbMapPrec2- , liftShowbSCCPrec- , liftShowbSequencePrec- , liftShowbViewLPrec- , liftShowbViewRPrec- , liftShowbSetPrec- , liftShowbTreePrec- ) where+module TextShow.Data.Containers () where import qualified Data.Foldable as F import Data.Graph (SCC)@@ -38,132 +27,81 @@ import Data.Set (Set) import Data.Tree (Tree) -import TextShow (TextShow(..), TextShow1(..), TextShow2(..),- Builder, showbPrec1)+import TextShow (TextShow(..), TextShow1(..), TextShow2(..), showbPrec1) import TextShow.Data.Integral () import TextShow.TH (deriveTextShow, deriveTextShow1) import TextShow.Utils (showbUnaryListWith) -#include "inline.h"---- | Convert an 'IntMap' to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbIntMapPrec :: (v -> Builder) -> Int -> IntMap v -> Builder-liftShowbIntMapPrec sp p =- showbUnaryListWith (liftShowbList2 showbPrec undefined- (const sp) undefined) p . IM.toList-{-# INLINE liftShowbIntMapPrec #-}---- | Convert an 'IntSet' to a 'Builder' with the given precedence.------ /Since: 2/-showbIntSetPrec :: Int -> IntSet -> Builder-showbIntSetPrec p = showbUnaryListWith showbList p . IS.toList-{-# INLINE showbIntSetPrec #-}---- | Convert a 'Map' to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbMapPrec2 :: (k -> Builder) -> (v -> Builder) -> Int -> Map k v -> Builder-liftShowbMapPrec2 sp1 sp2 p =- showbUnaryListWith (liftShowbList2 (const sp1) undefined- (const sp2) undefined) p . M.toList-{-# INLINE liftShowbMapPrec2 #-}---- | Convert an 'SCC' to a 'Builder' with the given show functions and precedence.------ /Since: next/-liftShowbSCCPrec :: (Int -> vertex -> Builder) -> ([vertex] -> Builder)- -> Int -> SCC vertex -> Builder-liftShowbSCCPrec = liftShowbPrec-{-# INLINE liftShowbSCCPrec #-}---- | Convert a 'Sequence' to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbSequencePrec :: ([a] -> Builder) -> Int -> Seq a -> Builder-liftShowbSequencePrec sl p = showbUnaryListWith sl p . F.toList-{-# INLINE liftShowbSequencePrec #-}---- | Convert a 'ViewL' value to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbViewLPrec :: (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> ViewL a -> Builder-liftShowbViewLPrec = liftShowbPrec-{-# INLINE liftShowbViewLPrec #-}---- | Convert a 'ViewR' value to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbViewRPrec :: (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> ViewR a -> Builder-liftShowbViewRPrec = liftShowbPrec-{-# INLINE liftShowbViewRPrec #-}---- | Convert a 'Set' to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbSetPrec :: ([a] -> Builder) -> Int -> Set a -> Builder-liftShowbSetPrec sl p = showbUnaryListWith sl p . Set.toList-{-# INLINE liftShowbSetPrec #-}---- | Convert a 'Tree' to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbTreePrec :: (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Tree a -> Builder-liftShowbTreePrec = liftShowbPrec-{-# INLINE liftShowbTreePrec #-}-+-- | /Since: 2/ instance TextShow v => TextShow (IntMap v) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 IntMap where- liftShowbPrec sp _ = liftShowbIntMapPrec (sp 0)- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp _ p =+ showbUnaryListWith (liftShowbList2 showbPrec undefined+ (const (sp 0)) undefined) p . IM.toList+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance TextShow IntSet where- showbPrec = showbIntSetPrec- INLINE_INST_FUN(showbPrec)+ showbPrec p = showbUnaryListWith showbList p . IS.toList+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow k, TextShow v) => TextShow (Map k v) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow k => TextShow1 (Map k) where liftShowbPrec = liftShowbPrec2 showbPrec showbList- INLINE_INST_FUN(liftShowbPrec)+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance TextShow2 Map where- liftShowbPrec2 sp1 _ sp2 _ = liftShowbMapPrec2 (sp1 0) (sp2 0)- INLINE_INST_FUN(liftShowbPrec2)+ liftShowbPrec2 sp1 _ sp2 _ p =+ showbUnaryListWith (liftShowbList2 (const (sp1 0)) undefined+ (const (sp2 0)) undefined) p . M.toList+ {-# INLINE liftShowbPrec2 #-} +-- | /Since: 2/ instance TextShow a => TextShow (Seq a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 Seq where- liftShowbPrec _ = liftShowbSequencePrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec _ sl p = showbUnaryListWith sl p . F.toList+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ $(deriveTextShow ''ViewL)+-- | /Since: 2/ $(deriveTextShow1 ''ViewL) +-- | /Since: 2/ $(deriveTextShow ''ViewR)+-- | /Since: 2/ $(deriveTextShow1 ''ViewR) +-- | /Since: 2/ instance TextShow a => TextShow (Set a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 Set where- liftShowbPrec _ = liftShowbSetPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec _ sl p = showbUnaryListWith sl p . Set.toList+ {-# INLINE liftShowbPrec #-} +-- | /Since: 3.6/ $(deriveTextShow ''SCC)+-- | /Since: 3.6/ $(deriveTextShow1 ''SCC)++-- | /Since: 2/ $(deriveTextShow ''Tree)+-- | /Since: 2/ $(deriveTextShow1 ''Tree)
src/TextShow/Data/Functor/Trans.hs view
@@ -14,7 +14,7 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for functor transformers.+'TextShow' instances for functor transformers. Note that : @@ -26,51 +26,42 @@ /Since: 2/ -}-module TextShow.Data.Functor.Trans (liftShowbConstantPrec, liftShowbReversePrec) where+module TextShow.Data.Functor.Trans () where import Data.Functor.Constant (Constant(..)) import Data.Functor.Reverse (Reverse(..)) import TextShow (TextShow(..), TextShow1(..), TextShow2(..), Builder, showbPrec1, showbUnaryWith)--#include "inline.h"+import TextShow.Utils (liftShowbUnaryWith) -- | Convert a 'Constant' value to a 'Builder' with the given show function -- and precedence.------ /Since: 3/ liftShowbConstantPrec :: (Int -> a -> Builder) -> Int -> Constant a b -> Builder liftShowbConstantPrec sp p (Constant x) = showbUnaryWith sp "Constant" p x {-# INLINE liftShowbConstantPrec #-} --- | Convert a 'Reverse' value to a 'Builder' with the given show functions--- and precedence.------ /Since: 3/-liftShowbReversePrec :: TextShow1 f- => (Int -> a -> Builder) -> ([a] -> Builder)- -> Int -> Reverse f a -> Builder-liftShowbReversePrec sp sl p (Reverse x) =- showbUnaryWith (liftShowbPrec sp sl) "Reverse" p x-{-# INLINE liftShowbReversePrec #-}-+-- | /Since: 2/ instance TextShow a => TextShow (Constant a b) where showbPrec = liftShowbConstantPrec showbPrec- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow a => TextShow1 (Constant a) where liftShowbPrec _ _ = liftShowbConstantPrec showbPrec- INLINE_INST_FUN(liftShowbPrec)+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance TextShow2 Constant where liftShowbPrec2 sp _ _ _ = liftShowbConstantPrec sp- INLINE_INST_FUN(liftShowbPrec2)+ {-# INLINE liftShowbPrec2 #-} +-- | /Since: 2/ instance (TextShow1 f, TextShow a) => TextShow (Reverse f a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 f => TextShow1 (Reverse f) where- liftShowbPrec = liftShowbReversePrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec sp sl p (Reverse x) = liftShowbUnaryWith sp sl "Reverse" p x+ {-# INLINE liftShowbPrec #-}
src/TextShow/Data/Tagged.hs view
@@ -14,7 +14,7 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' function for 'Tagged' values.+'TextShow' instance for 'Tagged'. /Since: 2/ -}@@ -24,23 +24,22 @@ import TextShow (TextShow(..), TextShow1(..), TextShow2(..), Builder, showbPrec1, showbUnaryWith) -#include "inline.h"- -- | Convert a 'Tagged' value to a 'Builder' with the given show function and precedence.------ /Since: 3/ liftShowbTaggedPrec :: (Int -> b -> Builder) -> Int -> Tagged s b -> Builder liftShowbTaggedPrec sp p (Tagged b) = showbUnaryWith sp "Tagged" p b {-# INLINE liftShowbTaggedPrec #-} +-- | /Since: 2/ instance TextShow b => TextShow (Tagged s b) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 (Tagged s) where liftShowbPrec sp _ = liftShowbTaggedPrec sp- INLINE_INST_FUN(liftShowbPrec)+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance TextShow2 Tagged where liftShowbPrec2 _ _ sp _ = liftShowbTaggedPrec sp- INLINE_INST_FUN(liftShowbPrec2)+ {-# INLINE liftShowbPrec2 #-}
src/TextShow/Data/Time.hs view
@@ -12,34 +12,21 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @time@ library.+'TextShow' instances for data types in the @time@ library. /Since: 2/ -}-module TextShow.Data.Time (- showbDay- , showbDiffTime- , showbUTCTime- , showbNominalDiffTime- , showbAbsoluteTime- , showbTimeZone- , showbTimeOfDay- , showbLocalTime- , showbZonedTime-#if MIN_VERSION_time(1,5,0)- , showbTimeLocalePrec-#endif- ) where+module TextShow.Data.Time () where import Data.Fixed (Pico) import Data.Monoid.Compat import Data.Semigroup (mtimesDefault) import Data.Time.Calendar (Day, toGregorian)-import Data.Time.Clock (DiffTime, UTCTime, NominalDiffTime)+import Data.Time.Clock (DiffTime, UTCTime, NominalDiffTime, UniversalTime) import Data.Time.Clock.TAI (AbsoluteTime, taiToUTCTime) import Data.Time.Format (NumericPadOption) import Data.Time.LocalTime (TimeZone(..), TimeOfDay(..), LocalTime(..), ZonedTime(..),- utc, utcToLocalTime, utcToZonedTime)+ ut1ToLocalTime, utc, utcToLocalTime, utcToZonedTime) import TextShow (TextShow(..), Builder, FromStringShow(..), fromString, lengthB, showbSpace, singleton)@@ -51,76 +38,13 @@ import TextShow.TH (deriveTextShow) #endif -#include "inline.h"---- | Convert a 'Day' into a 'Builder'.------ /Since: 2/-showbDay :: Day -> Builder-showbDay = showbGregorian-{-# INLINE showbDay #-}---- | Convert a 'DiffTime' into a 'Builder'.------ /Since: 2/-showbDiffTime :: DiffTime -> Builder-showbDiffTime = showb . FromStringShow-{-# INLINE showbDiffTime #-}---- | Convert a 'UTCTime' into a 'Builder'.------ /Since: 2/-showbUTCTime :: UTCTime -> Builder-showbUTCTime = showb . utcToZonedTime utc-{-# INLINE showbUTCTime #-}---- | Convert a 'NominalDiffTime' into a 'Builder'.------ /Since: 2/-showbNominalDiffTime :: NominalDiffTime -> Builder-showbNominalDiffTime = showb . FromStringShow-{-# INLINE showbNominalDiffTime #-}---- | Convert a 'AbsoluteTime' into a 'Builder'.------ /Since: 2/-showbAbsoluteTime :: AbsoluteTime -> Builder-showbAbsoluteTime t = showbLocalTime (utcToLocalTime utc $ taiToUTCTime (const 0) t)- <> " TAI" -- ugly, but standard apparently-{-# INLINE showbAbsoluteTime #-}---- | Convert a 'TimeZone' into a 'Builder'.------ /Since: 2/-showbTimeZone :: TimeZone -> Builder-showbTimeZone zone@(TimeZone _ _ "") = timeZoneOffsetBuilder zone-showbTimeZone (TimeZone _ _ name) = fromString name-{-# INLINE showbTimeZone #-}---- | Convert a 'TimeOfDay' into a 'Builder'.------ /Since: 2/-showbTimeOfDay :: TimeOfDay -> Builder-showbTimeOfDay (TimeOfDay h m sec) = showb2 zeroOpt h- <> singleton ':'- <> showb2 zeroOpt m- <> singleton ':'- <> showb2Fixed zeroOpt sec-{-# INLINE showbTimeOfDay #-}---- | Convert a 'LocalTime' into a 'Builder'.------ /Since: 2/-showbLocalTime :: LocalTime -> Builder-showbLocalTime (LocalTime d t) = showbGregorian d <> showbSpace <> showb t-{-# INLINE showbLocalTime #-}+#if MIN_VERSION_time(1,7,0)+import Data.Maybe (fromJust)+#endif --- | Convert a 'ZonedTime' into a 'Builder'.------ /Since: 2/-showbZonedTime :: ZonedTime -> Builder-showbZonedTime (ZonedTime t zone) = showb t <> showbSpace <> showb zone-{-# INLINE showbZonedTime #-}+#if MIN_VERSION_time(1,8,0)+import Data.Time.Clock.System (SystemTime)+#endif pad1 :: NumericPadOption -> Builder -> Builder pad1 (Just c) b = singleton c <> b@@ -178,52 +102,77 @@ zeroOpt = Just '0' {-# INLINE zeroOpt #-} -#if MIN_VERSION_time(1,5,0)--- | Convert a 'TimeLocale' to a 'Builder' with the given precedence. This function is--- available with @time-1.5@ or later.------ /Since: 2/-showbTimeLocalePrec :: Int -> TimeLocale -> Builder-showbTimeLocalePrec = showbPrec-{-# INLINE showbTimeLocalePrec #-}-#endif-+-- | /Since: 2/ instance TextShow Day where- showb = showbDay- INLINE_INST_FUN(showb)+ showb = showbGregorian+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow DiffTime where- showb = showbDiffTime- INLINE_INST_FUN(showb)+ showb = showb . FromStringShow+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow UTCTime where- showb = showbUTCTime- INLINE_INST_FUN(showb)+ showb = showb . utcToZonedTime utc+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow NominalDiffTime where- showb = showbNominalDiffTime- INLINE_INST_FUN(showb)+ showb = showb . FromStringShow+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow AbsoluteTime where- showb = showbAbsoluteTime- INLINE_INST_FUN(showb)+ showb t = showb (utcToLocalTime utc $+#if MIN_VERSION_time(1,7,0)+ fromJust $ taiToUTCTime (const (Just 0)) t)+#else+ taiToUTCTime (const 0) t)+#endif+ <> " TAI" -- ugly, but standard apparently+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow TimeZone where- showb = showbTimeZone- INLINE_INST_FUN(showb)+ showb zone@(TimeZone _ _ "") = timeZoneOffsetBuilder zone+ showb (TimeZone _ _ name) = fromString name+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow TimeOfDay where- showb = showbTimeOfDay- INLINE_INST_FUN(showb)+ showb (TimeOfDay h m sec) = showb2 zeroOpt h+ <> singleton ':'+ <> showb2 zeroOpt m+ <> singleton ':'+ <> showb2Fixed zeroOpt sec+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow LocalTime where- showb = showbLocalTime- INLINE_INST_FUN(showb)+ showb (LocalTime d t) = showbGregorian d <> showbSpace <> showb t+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow ZonedTime where- showb = showbZonedTime- INLINE_INST_FUN(showb)+ showb (ZonedTime t zone) = showb t <> showbSpace <> showb zone+ {-# INLINE showb #-} +-- | /Since: 3.6/+instance TextShow UniversalTime where+ showb t = showb $ ut1ToLocalTime 0 t+ {-# INLINE showb #-}+ #if MIN_VERSION_time(1,5,0)+-- | Only available with @time-1.5@ or later.+--+-- /Since: 2/ $(deriveTextShow ''TimeLocale)+#endif++#if MIN_VERSION_time(1,8,0)+-- | Only available with @time-1.8@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''SystemTime) #endif
src/TextShow/Data/UnorderedContainers.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module: TextShow.Data.UnorderedContainers@@ -8,59 +7,43 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for 'HashMap's and 'HashSet's.+'TextShow' instances for 'HashMap' and 'HashSet'. /Since: 2/ -}-module TextShow.Data.UnorderedContainers (- liftShowbHashMapPrec2- , liftShowbHashSetPrec- ) where+module TextShow.Data.UnorderedContainers () where import qualified Data.HashMap.Lazy as HM (toList) import Data.HashMap.Lazy (HashMap) import qualified Data.HashSet as HS (toList) import Data.HashSet (HashSet) -import TextShow (TextShow(..), TextShow1(..), TextShow2(..),- Builder, showbPrec1)+import TextShow (TextShow(..), TextShow1(..), TextShow2(..), showbPrec1) import TextShow.Utils (showbUnaryListWith) -#include "inline.h"---- | Convert a 'HashMap' to a 'Builder' with the given show functions and precedence.------ /Since: 3/-liftShowbHashMapPrec2 :: (k -> Builder) -> (v -> Builder)- -> Int -> HashMap k v -> Builder-liftShowbHashMapPrec2 sp1 sp2 p =- showbUnaryListWith (liftShowbList2 (const sp1) undefined- (const sp2) undefined) p . HM.toList-{-# INLINE liftShowbHashMapPrec2 #-}---- | Convert a 'HashSet' to a 'Builder' with the given show function and precedence.------ /Since: 3/-liftShowbHashSetPrec :: ([a] -> Builder) -> Int -> HashSet a -> Builder-liftShowbHashSetPrec sl p = showbUnaryListWith sl p . HS.toList-{-# INLINE liftShowbHashSetPrec #-}-+-- | /Since: 2/ instance (TextShow k, TextShow v) => TextShow (HashMap k v) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow k => TextShow1 (HashMap k) where liftShowbPrec = liftShowbPrec2 showbPrec showbList- INLINE_INST_FUN(liftShowbPrec)+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance TextShow2 HashMap where- liftShowbPrec2 sp1 _ sp2 _ = liftShowbHashMapPrec2 (sp1 0) (sp2 0)- INLINE_INST_FUN(liftShowbPrec2)+ liftShowbPrec2 sp1 _ sp2 _ p =+ showbUnaryListWith (liftShowbList2 (const (sp1 0)) undefined+ (const (sp2 0)) undefined) p . HM.toList+ {-# INLINE liftShowbPrec2 #-} +-- | /Since: 2/ instance TextShow a => TextShow (HashSet a) where showbPrec = showbPrec1- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 HashSet where- liftShowbPrec _ = liftShowbHashSetPrec- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec _ sl p = showbUnaryListWith sl p . HS.toList+ {-# INLINE liftShowbPrec #-}
src/TextShow/Data/Vector.hs view
@@ -9,18 +9,13 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for @Vector@ types.+'TextShow' instances for @Vector@ types. /Since: 2/ -} module TextShow.Data.Vector (- liftShowbVectorPrec- , showbVectorGenericPrec+ showbVectorGenericPrec , liftShowbVectorGenericPrec- , showbVectorPrimitivePrec- , showbVectorStorablePrec- , showbVectorUnboxedPrec- , showbSizePrec ) where import qualified Data.Vector as B (Vector)@@ -45,17 +40,6 @@ import TextShow.Utils (showbUnaryList, showbUnaryListWith) #endif -#include "inline.h"---- | Convert a boxed 'B.Vector' to a 'Builder' with the given show function--- and precedence.--- Note that with @vector-0.11@ and above, the precedence argument is ignored.------ /Since: 3/-liftShowbVectorPrec :: ([a] -> Builder) -> Int -> B.Vector a -> Builder-liftShowbVectorPrec = liftShowbVectorGenericPrec-{-# INLINE liftShowbVectorPrec #-}- -- | Convert a generic 'G.Vector' to a 'Builder' with the given precedence. -- Note that with @vector-0.11@ and above, the precedence argument is ignored. --@@ -81,55 +65,30 @@ #endif {-# INLINE liftShowbVectorGenericPrec #-} --- | Convert a primitive 'P.Vector' to a 'Builder' with the given precedence.--- Note that with @vector-0.11@ and above, the precedence argument is ignored.------ /Since: 2/-showbVectorPrimitivePrec :: (TextShow a, Prim a) => Int -> P.Vector a -> Builder-showbVectorPrimitivePrec = showbVectorGenericPrec-{-# INLINE showbVectorPrimitivePrec #-}---- | Convert a storable 'S.Vector' to a 'Builder' with the given precedence.--- Note that with @vector-0.11@ and above, the precedence argument is ignored.------ /Since: 2/-showbVectorStorablePrec :: (TextShow a, Storable a) => Int -> S.Vector a -> Builder-showbVectorStorablePrec = showbVectorGenericPrec-{-# INLINE showbVectorStorablePrec #-}---- | Convert an unboxed 'U.Vector' to a 'Builder' with the given precedence.--- Note that with @vector-0.11@ and above, the precedence argument is ignored.------ /Since: 2/-showbVectorUnboxedPrec :: (TextShow a, Unbox a) => Int -> U.Vector a -> Builder-showbVectorUnboxedPrec = showbVectorGenericPrec-{-# INLINE showbVectorUnboxedPrec #-}---- | Convert a 'Size' to a 'Builder' with the given precedence.------ /Since: 2/-showbSizePrec :: Int -> Size -> Builder-showbSizePrec = showbPrec-{-# INLINE showbSizePrec #-}-+-- | /Since: 2/ instance TextShow a => TextShow (B.Vector a) where showbPrec = showbVectorGenericPrec- INLINE_INST_FUN(showbPrec)+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance TextShow1 B.Vector where- liftShowbPrec _ sl = liftShowbVectorPrec sl- INLINE_INST_FUN(liftShowbPrec)+ liftShowbPrec _ sl = liftShowbVectorGenericPrec sl+ {-# INLINE liftShowbPrec #-} +-- | /Since: 2/ instance (TextShow a, Prim a) => TextShow (P.Vector a) where- showbPrec = showbVectorPrimitivePrec- INLINE_INST_FUN(showbPrec)+ showbPrec = showbVectorGenericPrec+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow a, Storable a) => TextShow (S.Vector a) where- showbPrec = showbVectorStorablePrec- INLINE_INST_FUN(showbPrec)+ showbPrec = showbVectorGenericPrec+ {-# INLINE showbPrec #-} +-- | /Since: 2/ instance (TextShow a, Unbox a) => TextShow (U.Vector a) where- showbPrec = showbVectorUnboxedPrec- INLINE_INST_FUN(showbPrec)+ showbPrec = showbVectorGenericPrec+ {-# INLINE showbPrec #-} +-- | /Since: 2/ $(deriveTextShow ''Size)
+ src/TextShow/GHC/ForeignSrcLang/Type.hs view
@@ -0,0 +1,33 @@+{-# LANGUAGE CPP #-}++#if defined(MIN_VERSION_ghc_boot_th)+# if MIN_VERSION_ghc_boot_th(8,2,0)+{-# LANGUAGE TemplateHaskell #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}+# endif+#endif++{-|+Module: TextShow.GHC.ForeignSrcLang.Type+Copyright: (C) 2014-2017 Ryan Scott+License: BSD-style (see the file LICENSE)+Maintainer: Ryan Scott+Stability: Provisional+Portability: GHC++'TextShow' instance for the 'ForeignSrcLang' data type.+Only provided if using @ghc-boot-th-8.2@ or later.++/Since: 3.3/+-}+module TextShow.GHC.ForeignSrcLang.Type () where++#if defined(MIN_VERSION_ghc_boot_th)+# if MIN_VERSION_ghc_boot_th(8,2,0)+import GHC.ForeignSrcLang.Type (ForeignSrcLang)+import TextShow.TH (deriveTextShow)++-- | /Since: 3.6/+$(deriveTextShow ''ForeignSrcLang)+# endif+#endif
src/TextShow/GHC/LanguageExtensions/Type.hs view
@@ -13,29 +13,17 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' function for the 'Extension' data type.-This module only exports functions if using @ghc-boot-th@.+'TextShow' instance for the 'Extension' data type.+Only provided if using @ghc-boot-th@. /Since: 3.3/ -}-module TextShow.GHC.LanguageExtensions.Type (-#if !defined(MIN_VERSION_ghc_boot_th)- ) where-#else- showbExtension- ) where+module TextShow.GHC.LanguageExtensions.Type () where +#if defined(MIN_VERSION_ghc_boot_th) import GHC.LanguageExtensions.Type (Extension)--import TextShow (TextShow(..), Builder) import TextShow.TH (deriveTextShow) --- | Convert an 'Extension' to a 'Builder'.--- This function is only available when using @ghc-boot@.------ /Since: 3.3/-showbExtension :: Extension -> Builder-showbExtension = showb-+-- | /Since: 3.3/ $(deriveTextShow ''Extension) #endif
src/TextShow/Language/Haskell/TH.hs view
@@ -12,108 +12,11 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @template-haskell@ library.+'TextShow' instances for data types in the @template-haskell@ library. /Since: 2/ -}-module TextShow.Language.Haskell.TH (-#if MIN_VERSION_template_haskell(2,9,0)- showbAnnLookupPrec- , showbAnnTargetPrec,-#endif-#if MIN_VERSION_template_haskell(2,11,0)- showbBangPrec,-#endif- showbBodyPrec- , showbCallconv-#if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))- , showbClassInstancePrec-#endif- , showbClausePrec- , showbConPrec-#if MIN_VERSION_template_haskell(2,11,0)- , showbDecidedStrictness-#endif- , showbDecPrec-#if MIN_VERSION_template_haskell(2,12,0)- , showbDerivClausePrec- , showbDerivStrategy-#endif- , showbExpPrec- , showbFamFlavour-#if MIN_VERSION_template_haskell(2,11,0)- , showbFamilyResultSigPrec-#endif- , showbFixityPrec- , showbFixityDirection- , showbForeignPrec- , showbFunDepPrec- , showbGuardPrec- , showbInfoPrec-#if MIN_VERSION_template_haskell(2,11,0)- , showbInjectivityAnnPrec-#endif-#if MIN_VERSION_template_haskell(2,8,0)- , showbInline-#else- , showbInlineSpecPrec-#endif- , showbKindPrec- , showbLitPrec- , showbLocPrec- , showbMatchPrec- , showbModNamePrec-#if MIN_VERSION_template_haskell(2,9,0)- , showbModulePrec- , showbModuleInfoPrec-#endif- , showbName- , showbName'- , showbNameFlavourPrec- , showbNameSpace- , showbOccNamePrec-#if MIN_VERSION_template_haskell(2,11,0)- , showbOverlap-#endif- , showbPatPrec-#if MIN_VERSION_template_haskell(2,12,0)- , showbPatSynArgsPrec- , showbPatSynDirPrec-#endif-#if MIN_VERSION_template_haskell(2,8,0)- , showbPhasesPrec-#endif- , showbPkgNamePrec- , showbPragmaPrec- , showbPredPrec- , showbRangePrec-#if MIN_VERSION_template_haskell(2,9,0)- , showbRole-#endif-#if MIN_VERSION_template_haskell(2,8,0)- , showbRuleBndrPrec- , showbRuleMatch-#endif- , showbSafety-#if MIN_VERSION_template_haskell(2,11,0)- , showbSourceStrictness- , showbSourceUnpackedness-#endif- , showbStmtPrec- , showbStrictPrec-#if MIN_VERSION_template_haskell(2,11,0)- , showbTypeFamilyHeadPrec-#endif-#if MIN_VERSION_template_haskell(2,8,0)- , showbTyLitPrec-#endif- , showbTypePrec-#if MIN_VERSION_template_haskell(2,9,0)- , showbTySynEqnPrec-#endif- , showbTyVarBndrPrec- , showbDoc- ) where+module TextShow.Language.Haskell.TH (showbName, showbName') where import Data.Char (isAlpha) import Data.Maybe (fromJust)@@ -130,122 +33,9 @@ import TextShow (TextShow(..), Builder, fromString, singleton, toLazyText)-import TextShow.Data.Integral (showbIntPrec) import TextShow.Text.PrettyPrint (renderB) import TextShow.TH (deriveTextShow) --- | Convert a 'Body' to a 'Builder' with the given precedence.------ /Since: 2/-showbBodyPrec :: Int -> Body -> Builder-showbBodyPrec = showbPrec---- | Convert a 'Callconv' to a 'Builder'.------ /Since: 2/-showbCallconv :: Callconv -> Builder-showbCallconv = showb---- | Convert a 'Clause' to a 'Builder' with the given precedence.------ /Since: 2/-showbClausePrec :: Int -> Clause -> Builder-showbClausePrec = showbPrec---- | Convert a 'Con' to a 'Builder' with the given precedence.------ /Since: 2/-showbConPrec :: Int -> Con -> Builder-showbConPrec = showbPrec---- | Convert a 'Dec' to a 'Builder' with the given precedence.------ /Since: 2/-showbDecPrec :: Int -> Dec -> Builder-showbDecPrec = showbPrec---- | Convert an 'Exp' to a 'Builder' with the given precedence.------ /Since: 2/-showbExpPrec :: Int -> Exp -> Builder-showbExpPrec = showbPrec---- | Convert a 'FamFlavour' to a 'Builder'.------ /Since: 2/-showbFamFlavour :: FamFlavour -> Builder-showbFamFlavour = showb---- | Convert a 'Fixity' to a 'Builder' with the given precedence.------ /Since: 2/-showbFixityPrec :: Int -> Fixity -> Builder-showbFixityPrec = showbPrec---- | Convert a 'FixityDirection' to a 'Builder'.------ /Since: 2/-showbFixityDirection :: FixityDirection -> Builder-showbFixityDirection = showb---- | Convert a 'Foreign' to a 'Builder' with the given precedence.------ /Since: 2/-showbForeignPrec :: Int -> Foreign -> Builder-showbForeignPrec = showbPrec---- | Convert a 'FunDep' to a 'Builder' with the given precedence.------ /Since: 2/-showbFunDepPrec :: Int -> FunDep -> Builder-showbFunDepPrec = showbPrec---- | Convert a 'Guard' to a 'Builder' with the given precedence.------ /Since: 2/-showbGuardPrec :: Int -> Guard -> Builder-showbGuardPrec = showbPrec---- | Convert an 'Info' to a 'Builder' with the given precedence.------ /Since: 2/-showbInfoPrec :: Int -> Info -> Builder-showbInfoPrec = showbPrec---- | Convert a 'Kind' to a 'Builder' with the given precedence.------ /Since: 2/-showbKindPrec :: Int -> Kind -> Builder-#if MIN_VERSION_template_haskell(2,8,0)-showbKindPrec = showbTypePrec-#else-showbKindPrec = showbPrec-#endif---- | Convert a 'Lit' to a 'Builder' with the given precedence.------ /Since: 2/-showbLitPrec :: Int -> Dec -> Builder-showbLitPrec = showbPrec---- | Convert a 'Loc' to a 'Builder' with the given precedence.------ /Since: 2/-showbLocPrec :: Int -> Loc -> Builder-showbLocPrec = showbPrec---- | Convert a 'Match' to a 'Builder' with the given precedence.------ /Since: 2/-showbMatchPrec :: Int -> Match -> Builder-showbMatchPrec = showbPrec---- | Convert a 'ModName' to a 'Builder' with the given precedence.------ /Since: 2/-showbModNamePrec :: Int -> ModName -> Builder-showbModNamePrec = showbPrec- -- | Convert a 'Name' to a 'Builder'. -- -- /Since: 2/@@ -276,8 +66,8 @@ Name occ NameS -> occB occ Name occ (NameQ m) -> modB m <> singleton '.' <> occB occ Name occ (NameG _ _ m) -> modB m <> singleton '.' <> occB occ- Name occ (NameU u) -> occB occ <> singleton '_' <> showbIntPrec 0 (mkInt u)- Name occ (NameL u) -> occB occ <> singleton '_' <> showbIntPrec 0 (mkInt u)+ Name occ (NameU u) -> occB occ <> singleton '_' <> showb (mkInt u)+ Name occ (NameL u) -> occB occ <> singleton '_' <> showb (mkInt u) #if MIN_VERSION_template_haskell(2,10,0) mkInt = id@@ -307,366 +97,200 @@ else classify $ TL.tail t' else False --- | Convert a 'NameFlavour' to a 'Builder' with the given precedence.------ /Since: 3.3/-showbNameFlavourPrec :: Int -> NameFlavour -> Builder-showbNameFlavourPrec = showbPrec---- | Convert a 'NameSpace' to a 'Builder'.------ /Since: 3.3/-showbNameSpace :: NameSpace -> Builder-showbNameSpace = showb---- | Convert an 'OccName' to a 'Builder' with the given precedence.------ /Since: 2/-showbOccNamePrec :: Int -> OccName -> Builder-showbOccNamePrec = showbPrec---- | Convert a 'Pat' to a 'Builder' with the given precedence.------ /Since: 2/-showbPatPrec :: Int -> Pat -> Builder-showbPatPrec = showbPrec---- | Convert a 'PkgName' to a 'Builder' with the given precedence.------ /Since: 2/-showbPkgNamePrec :: Int -> PkgName -> Builder-showbPkgNamePrec = showbPrec---- | Convert a 'Pragma' to a 'Builder' with the given precedence.------ /Since: 2/-showbPragmaPrec :: Int -> Pragma -> Builder-showbPragmaPrec = showbPrec---- | Convert a 'Pred' to a 'Builder' with the given precedence.------ /Since: 2/-showbPredPrec :: Int -> Pred -> Builder-#if MIN_VERSION_template_haskell(2,10,0)-showbPredPrec = showbTypePrec-#else-showbPredPrec = showbPrec-#endif---- | Convert a 'Range' to a 'Builder' with the given precedence.------ /Since: 2/-showbRangePrec :: Int -> Range -> Builder-showbRangePrec = showbPrec---- | Convert a 'Safety' to a 'Builder'.------ /Since: 2/-showbSafety :: Safety -> Builder-showbSafety = showb---- | Convert a 'Stmt' to a 'Builder' with the given precedence.------ /Since: 2/-showbStmtPrec :: Int -> Stmt -> Builder-showbStmtPrec = showbPrec---- | Convert a 'Strict' to a 'Builder' with the given precedence.--- Note that 'Strict' is a type synonym for 'Bang' on @template-haskell-2.11.0.0@--- and later, and precedence matters for 'Bang'. On earlier versions of--- @template-haskell@, however, the precedence argument is ignored.------ /Since: 3/-showbStrictPrec :: Int -> Strict -> Builder-#if MIN_VERSION_template_haskell(2,11,0)-showbStrictPrec = showbBangPrec-#else-showbStrictPrec = showbPrec-#endif---- | Convert a 'Type' to a 'Builder' with the given precedence.------ /Since: 2/-showbTypePrec :: Int -> Type -> Builder-showbTypePrec = showbPrec---- | Convert a 'TyVarBndr' to a 'Builder' with the given precedence.------ /Since: 2/-showbTyVarBndrPrec :: Int -> TyVarBndr -> Builder-showbTyVarBndrPrec = showbPrec---- | Convert a 'Doc' to a 'Builder'.------ /Since: 2/-showbDoc :: Doc -> Builder-showbDoc = renderB . to_HPJ_Doc--#if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))--- | Convert a 'ClassInstance' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell@ 2.5.0.0 or 2.6.0.0.------ /Since: 2/-showbClassInstancePrec :: Int -> ClassInstance -> Builder-showbClassInstancePrec = showbPrec-#endif--#if MIN_VERSION_template_haskell(2,8,0)--- | Convert an 'Inline' to a 'Builder'.--- This function is only available with @template-haskell-2.8.0.0@ or later.------ /Since: 2/-showbInline :: Inline -> Builder-showbInline = showb---- | Convert a 'Phases' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.8.0.0@ or later.------ /Since: 2/-showbPhasesPrec :: Int -> Phases -> Builder-showbPhasesPrec = showbPrec---- | Convert a 'RuleMatch' to a 'Builder'.--- This function is only available with @template-haskell-2.8.0.0@ or later.------ /Since: 2/-showbRuleMatch :: RuleMatch -> Builder-showbRuleMatch = showb---- | Convert a 'RuleBndr' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.8.0.0@ or later.------ /Since: 2/-showbRuleBndrPrec :: Int -> RuleBndr -> Builder-showbRuleBndrPrec = showbPrec---- | Convert a 'TyLit' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.8.0.0@ or later.------ /Since: 2/-showbTyLitPrec :: Int -> TyLit -> Builder-showbTyLitPrec = showbPrec-#else--- | Convert an 'InlineSpec' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.7.0.0@ or earlier.------ /Since: 2/-showbInlineSpecPrec :: Int -> InlineSpec -> Builder-showbInlineSpecPrec = showbPrec-#endif--#if MIN_VERSION_template_haskell(2,9,0)--- | Convert an 'AnnLookup' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.9.0.0@ or later.------ /Since: 2/-showbAnnLookupPrec :: Int -> AnnLookup -> Builder-showbAnnLookupPrec = showbPrec---- | Convert an 'AnnTarget' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.9.0.0@ or later.------ /Since: 2/-showbAnnTargetPrec :: Int -> AnnTarget -> Builder-showbAnnTargetPrec = showbPrec---- | Convert a 'Module' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.9.0.0@ or later.------ /Since: 2/-showbModulePrec :: Int -> Module -> Builder-showbModulePrec = showbPrec---- | Convert a 'ModuleInfo' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.9.0.0@ or later.------ /Since: 2/-showbModuleInfoPrec :: Int -> ModuleInfo -> Builder-showbModuleInfoPrec = showbPrec---- | Convert a 'Role' to a 'Builder'.--- This function is only available with @template-haskell-2.9.0.0@ or later.------ /Since: 2/-showbRole :: Role -> Builder-showbRole = showb---- | Convert a 'TySynEqn' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.9.0.0@ or later.------ /Since: 2/-showbTySynEqnPrec :: Int -> TySynEqn -> Builder-showbTySynEqnPrec = showbPrec-#endif--#if MIN_VERSION_template_haskell(2,11,0)--- | Convert a 'Bang' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbBangPrec :: Int -> Bang -> Builder-showbBangPrec = showbPrec---- | Convert a 'DecidedStrictness' to a 'Builder'.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbDecidedStrictness :: DecidedStrictness -> Builder-showbDecidedStrictness = showb---- | Convert a 'FamilyResultSig' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbFamilyResultSigPrec :: Int -> FamilyResultSig -> Builder-showbFamilyResultSigPrec = showbPrec---- | Convert an 'InjectivityAnn' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbInjectivityAnnPrec :: Int -> InjectivityAnn -> Builder-showbInjectivityAnnPrec = showbPrec---- | Convert an 'Overlap' to a 'Builder'.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3.2.1/-showbOverlap :: Overlap -> Builder-showbOverlap = showb---- | Convert a 'SourceStrictness' to a 'Builder'.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbSourceStrictness :: SourceStrictness -> Builder-showbSourceStrictness = showb---- | Convert a 'SourceUnpackedness' to a 'Builder'.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbSourceUnpackedness :: SourceUnpackedness -> Builder-showbSourceUnpackedness = showb---- | Convert an 'TypeFamilyHead' to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.11.0.0@ or later.------ /Since: 3/-showbTypeFamilyHeadPrec :: Int -> TypeFamilyHead -> Builder-showbTypeFamilyHeadPrec = showbPrec-#endif--#if MIN_VERSION_template_haskell(2,12,0)--- | Convert a 'DerivClause' value to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.12.0.0@ or later.------ /Since: next/-showbDerivClausePrec :: Int -> DerivClause -> Builder-showbDerivClausePrec = showbPrec---- | Convert a 'DerivStrategy' to a 'Builder'.--- This function is only available with @template-haskell-2.12.0.0@ or later.------ /Since: next/-showbDerivStrategy :: DerivStrategy -> Builder-showbDerivStrategy = showb---- | Convert a 'PatSynArgs' value to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.12.0.0@ or later.------ /Since: 3.3/-showbPatSynArgsPrec :: Int -> PatSynArgs -> Builder-showbPatSynArgsPrec = showbPrec---- | Convert a 'PatSynDir' value to a 'Builder' with the given precedence.--- This function is only available with @template-haskell-2.12.0.0@ or later.------ /Since: 3.3/-showbPatSynDirPrec :: Int -> PatSynDir -> Builder-showbPatSynDirPrec = showbPrec-#endif-+-- | /Since: 2/ $(deriveTextShow ''Body)+-- | /Since: 2/ $(deriveTextShow ''Callconv)+-- | /Since: 2/ $(deriveTextShow ''Clause)+-- | /Since: 2/ $(deriveTextShow ''Con)+-- | /Since: 2/ $(deriveTextShow ''Dec)+-- | /Since: 2/ $(deriveTextShow ''Exp)+-- | /Since: 2/ $(deriveTextShow ''FamFlavour)+-- | /Since: 2/ $(deriveTextShow ''Fixity)+-- | /Since: 2/ $(deriveTextShow ''FixityDirection)+-- | /Since: 2/ $(deriveTextShow ''Foreign)+-- | /Since: 2/ $(deriveTextShow ''FunDep)+-- | /Since: 2/ $(deriveTextShow ''Guard)+-- | /Since: 2/ $(deriveTextShow ''Info)+-- | /Since: 2/ $(deriveTextShow ''Lit)+-- | /Since: 2/ $(deriveTextShow ''Loc)+-- | /Since: 2/ $(deriveTextShow ''Match)+-- | /Since: 2/ $(deriveTextShow ''ModName) +-- | /Since: 2/ instance TextShow Name where showb = showbName +-- | /Since: 3.3/ $(deriveTextShow ''NameFlavour)+-- | /Since: 3.3/ $(deriveTextShow ''NameSpace)+-- | /Since: 2/ $(deriveTextShow ''OccName)+-- | /Since: 2/ $(deriveTextShow ''Pat)+-- | /Since: 2/ $(deriveTextShow ''PkgName)+-- | /Since: 2/ $(deriveTextShow ''Pragma)+-- | /Since: 2/ $(deriveTextShow ''Range)+-- | /Since: 2/ $(deriveTextShow ''Safety)+-- | /Since: 2/ $(deriveTextShow ''Stmt)+-- | /Since: 2/ $(deriveTextShow ''Type)+-- | /Since: 2/ $(deriveTextShow ''TyVarBndr) +-- | /Since: 2/ instance TextShow Doc where- showb = showbDoc+ showb = renderB . to_HPJ_Doc #if MIN_VERSION_template_haskell(2,5,0) && !(MIN_VERSION_template_haskell(2,7,0))+-- | Only available with @template-haskell-2.5@.+--+-- /Since: 2/ $(deriveTextShow ''ClassInstance) #endif #if MIN_VERSION_template_haskell(2,8,0)+-- | Only available with @template-haskell-2.8.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''Inline)+-- | Only available with @template-haskell-2.8.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''Phases)+-- | Only available with @template-haskell-2.8.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''RuleBndr)+-- | Only available with @template-haskell-2.8.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''RuleMatch)+-- | Only available with @template-haskell-2.8.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''TyLit) #else+-- | Only available with @template-haskell-2.7@ or earlier.+--+-- /Since: 2/ $(deriveTextShow ''InlineSpec)+-- | Only available with @template-haskell-2.7@ or earlier.+--+-- /Since: 2/ $(deriveTextShow ''Kind) #endif #if MIN_VERSION_template_haskell(2,9,0)+-- | Only available with @template-haskell-2.9.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''AnnLookup)+-- | Only available with @template-haskell-2.9.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''AnnTarget)+-- | Only available with @template-haskell-2.9.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''Module)+-- | Only available with @template-haskell-2.9.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''ModuleInfo)+-- | Only available with @template-haskell-2.9.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''Role)+-- | Only available with @template-haskell-2.9.0.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''TySynEqn) #endif #if !(MIN_VERSION_template_haskell(2,10,0))+-- | Only available with @template-haskell-2.10@ or earlier.+--+-- /Since: 2/ $(deriveTextShow ''Pred) #endif #if MIN_VERSION_template_haskell(2,11,0)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''Bang)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''DecidedStrictness)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''FamilyResultSig)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''InjectivityAnn)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''Overlap)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''SourceStrictness)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''SourceUnpackedness)+-- | Only available with @template-haskell-2.11.0.0@ or later.+--+-- /Since: 3/ $(deriveTextShow ''TypeFamilyHead) #else+-- | Only available with @template-haskell-2.11@ or earlier.+--+-- /Since: 3/ $(deriveTextShow ''Strict) #endif #if MIN_VERSION_template_haskell(2,12,0)+-- | Only available with @template-haskell-2.12.0.0@ or later.+--+-- /Since: 3.6/ $(deriveTextShow ''DerivClause)+-- | Only available with @template-haskell-2.12.0.0@ or later.+--+-- /Since: 3.6/ $(deriveTextShow ''DerivStrategy)+-- | Only available with @template-haskell-2.12.0.0@ or later.+--+-- /Since: 3.3/ $(deriveTextShow ''PatSynArgs)+-- | Only available with @template-haskell-2.12.0.0@ or later.+--+-- /Since: 3.3/ $(deriveTextShow ''PatSynDir) #endif
src/TextShow/System/Console/Haskeline.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-}@@ -10,63 +9,32 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @haskeline@ library.+'TextShow' instances for data types in the @haskeline@ library. /Since: 2/ -}-module TextShow.System.Console.Haskeline (- showbInterrupt- , showbPrefsPrec- , showbCompletionPrec- , showbHistory- ) where+module TextShow.System.Console.Haskeline () where import System.Console.Haskeline (Interrupt, Prefs) import System.Console.Haskeline.Completion (Completion) import System.Console.Haskeline.History (History, historyLines) -import TextShow (TextShow(..), Builder, FromStringShow(..))+import TextShow (TextShow(..), FromStringShow(..)) import TextShow.TH (deriveTextShow) import TextShow.Utils (showbUnaryListWith) -#include "inline.h"---- | Convert an 'Interrupt' to a 'Builder'.------ /Since: 2/-showbInterrupt :: Interrupt -> Builder-showbInterrupt = showb-{-# INLINE showbInterrupt #-}---- | Convert a 'Prefs' value to a 'Builder' with the given precedence.------ /Since: 2/-showbPrefsPrec :: Int -> Prefs -> Builder-showbPrefsPrec p = showbPrec p . FromStringShow-{-# INLINE showbPrefsPrec #-}---- | Convert a 'Completion' value to a 'Builder' with the given precedence.------ /Since: 2/-showbCompletionPrec :: Int -> Completion -> Builder-showbCompletionPrec = showbPrec-{-# INLINE showbCompletionPrec #-}---- | Convert a 'History' value to a 'Builder'.------ /Since: 2/-showbHistory :: History -> Builder-showbHistory = showbUnaryListWith showb 0 . historyLines-{-# INLINE showbHistory #-}-+-- | /Since: 2/ $(deriveTextShow ''Interrupt) +-- | /Since: 2/ instance TextShow Prefs where- showbPrec = showbPrefsPrec- INLINE_INST_FUN(showbPrec)+ showbPrec p = showbPrec p . FromStringShow+ {-# INLINE showbPrec #-} +-- | /Since: 2/ $(deriveTextShow ''Completion) +-- | /Since: 2/ instance TextShow History where- showb = showbHistory- INLINE_INST_FUN(showb)+ showb = showbUnaryListWith showb 0 . historyLines+ {-# INLINE showb #-}
src/TextShow/System/Console/Terminfo.hs view
@@ -13,44 +13,25 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @terminfo@ library. This module-only exports functions if using a Unix-like operating system (i.e., not Windows).+'TextShow' instances for data types in the @terminfo@ library.+Only provided if using a Unix-like operating system (i.e., not Windows). /Since: 2/ -}-module TextShow.System.Console.Terminfo (-#if defined(mingw32_HOST_OS)- ) where-#else- showbColorPrec- , showbSetupTermError- ) where+module TextShow.System.Console.Terminfo () where +#if !defined(mingw32_HOST_OS) import System.Console.Terminfo.Base (SetupTermError) import System.Console.Terminfo.Color (Color) -import TextShow (TextShow(..), Builder, FromStringShow(..))+import TextShow (TextShow(..), FromStringShow(..)) import TextShow.TH (deriveTextShow) -#include "inline.h"---- | Convert a 'Color' to a 'Builder' with the given precedence.------ /Since: 2/-showbColorPrec :: Int -> Color -> Builder-showbColorPrec = showbPrec-{-# INLINE showbColorPrec #-}---- | Convert a 'SetupTermError' to a 'Builder'.------ /Since: 2/-showbSetupTermError :: SetupTermError -> Builder-showbSetupTermError = showb . FromStringShow-{-# INLINE showbSetupTermError #-}-+-- | /Since: 2/ $(deriveTextShow ''Color) +-- | /Since: 2/ instance TextShow SetupTermError where- showb = showbSetupTermError- INLINE_INST_FUN(showb)+ showb = showb . FromStringShow+ {-# INLINE showb #-} #endif
src/TextShow/System/Directory.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -8,22 +9,25 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' function for 'Permissions'.+'TextShow' instance for 'Permissions'. /Since: 2/ -}-module TextShow.System.Directory (showbPermissionsPrec) where+module TextShow.System.Directory () where import System.Directory (Permissions)+#if MIN_VERSION_directory(1,2,3)+import System.Directory (XdgDirectory)+#endif -import TextShow (TextShow(..), Builder) import TextShow.TH (deriveTextShow) --- | Convert 'Permissions' to a 'Builder' with the given precedence.------ /Since: 2/-showbPermissionsPrec :: Int -> Permissions -> Builder-showbPermissionsPrec = showbPrec-{-# INLINE showbPermissionsPrec #-}-+-- | /Since: 2/ $(deriveTextShow ''Permissions)++#if MIN_VERSION_directory(1,2,3)+-- | Only available with @directory-1.2.3.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''XdgDirectory)+#endif
src/TextShow/System/Locale.hs view
@@ -8,22 +8,14 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' function for old 'TimeLocale's.+'TextShow' instance for the old 'TimeLocale'. /Since: 2/ -}-module TextShow.System.Locale (showbTimeLocalePrec) where+module TextShow.System.Locale () where import System.Locale (TimeLocale)--import TextShow (TextShow(..), Builder) import TextShow.TH (deriveTextShow) --- | Convert a 'TimeLocale' to a 'Builder' with the given precedence.------ /Since: 2/-showbTimeLocalePrec :: Int -> TimeLocale -> Builder-showbTimeLocalePrec = showbPrec-{-# INLINE showbTimeLocalePrec #-}-+-- | /Since: 2/ $(deriveTextShow ''TimeLocale)
src/TextShow/System/Posix.hs view
@@ -13,67 +13,28 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @unix@ library. This module-only exports functions if using a Unix-like operating system (i.e., not Windows).+'TextShow' instances for data types in the @unix@ library.+Only provided if using a Unix-like operating system (i.e., not Windows). /Since: 2/ -}-module TextShow.System.Posix (-#if defined(mingw32_HOST_OS)- ) where-#else- showbRTLDFlags- , showbDLPrec- , showbProcessStatusPrec- , showbGroupEntryPrec- , showbUserEntryPrec- ) where+module TextShow.System.Posix () where +#if !defined(mingw32_HOST_OS) import System.Posix.DynamicLinker (RTLDFlags, DL) import System.Posix.Process (ProcessStatus) import System.Posix.User (GroupEntry, UserEntry) -import TextShow (TextShow(..), Builder) import TextShow.TH (deriveTextShow) --- | Convert an 'RTLDFlags' value to a 'Builder'.------ /Since: 2/-showbRTLDFlags :: RTLDFlags -> Builder-showbRTLDFlags = showb-{-# INLINE showbRTLDFlags #-}---- | Convert a 'DL' value to a 'Builder' with the given precedence.------ /Since: 2/-showbDLPrec :: Int -> DL -> Builder-showbDLPrec = showbPrec-{-# INLINE showbDLPrec #-}---- | Convert a 'ProcessStatus' to a 'Builder' with the given precedence.------ /Since: 2/-showbProcessStatusPrec :: Int -> ProcessStatus -> Builder-showbProcessStatusPrec = showbPrec-{-# INLINE showbProcessStatusPrec #-}---- | Convert a 'GroupEntry' to a 'Builder' with the given precedence.------ /Since: 2/-showbGroupEntryPrec :: Int -> GroupEntry -> Builder-showbGroupEntryPrec = showbPrec-{-# INLINE showbGroupEntryPrec #-}---- | Convert a 'UserEntry' to a 'Builder' with the given precedence.------ /Since: 2/-showbUserEntryPrec :: Int -> UserEntry -> Builder-showbUserEntryPrec = showbPrec-{-# INLINE showbUserEntryPrec #-}-+-- | /Since: 2/ $(deriveTextShow ''RTLDFlags)+-- | /Since: 2/ $(deriveTextShow ''DL)+-- | /Since: 2/ $(deriveTextShow ''ProcessStatus)+-- | /Since: 2/ $(deriveTextShow ''GroupEntry)+-- | /Since: 2/ $(deriveTextShow ''UserEntry) #endif
src/TextShow/System/Random.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module: TextShow.System.Random@@ -8,24 +7,16 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' function for 'StdGen'.+'TextShow' instances for 'StdGen'. /Since: 2/ -}-module TextShow.System.Random (showbStdGenPrec) where+module TextShow.System.Random () where import System.Random (StdGen)-import TextShow (TextShow(..), Builder, FromStringShow(..))--#include "inline.h"---- | Convert a 'StdGen' to a 'Builder' with the given precedence.------ /Since: 2/-showbStdGenPrec :: Int -> StdGen -> Builder-showbStdGenPrec p = showbPrec p . FromStringShow-{-# INLINE showbStdGenPrec #-}+import TextShow (TextShow(..), FromStringShow(..)) +-- | /Since: 2/ instance TextShow StdGen where- showbPrec = showbStdGenPrec- INLINE_INST_FUN(showbPrec)+ showbPrec p = showbPrec p . FromStringShow+ {-# INLINE showbPrec #-}
src/TextShow/System/Time.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -9,66 +8,28 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @old-time@ library.+'TextShow' instances for data types in the @old-time@ library. /Since: 2/ -}-module TextShow.System.Time (- showbClockTime- , showbTimeDiffPrec- , showbCalendarTimePrec- , showbMonth- , showbDay- ) where+module TextShow.System.Time () where import System.IO.Unsafe (unsafePerformIO) import System.Time (ClockTime, TimeDiff, CalendarTime, Month, Day, calendarTimeToString, toCalendarTime) -import TextShow (TextShow(..), Builder, fromString)+import TextShow (TextShow(..), fromString) import TextShow.TH (deriveTextShow) -#include "inline.h"---- | Convert a 'ClockTime' to a 'Builder'.------ /Since: 2/-showbClockTime :: ClockTime -> Builder-showbClockTime = fromString . calendarTimeToString . unsafePerformIO . toCalendarTime---- | Convert a 'TimeDiff' to a 'Builder' with the given precedence.------ /Since: 2/-showbTimeDiffPrec :: Int -> TimeDiff -> Builder-showbTimeDiffPrec = showbPrec-{-# INLINE showbTimeDiffPrec #-}---- | Convert a 'CalendarTime' to a 'Builder' with the given precedence.------ /Since: 2/-showbCalendarTimePrec :: Int -> CalendarTime -> Builder-showbCalendarTimePrec = showbPrec-{-# INLINE showbCalendarTimePrec #-}---- | Convert a 'Month' to a 'Builder'.------ /Since: 2/-showbMonth :: Month -> Builder-showbMonth = showb-{-# INLINE showbMonth #-}---- | Convert a 'Day' to a 'Builder'.------ /Since: 2/-showbDay :: Day -> Builder-showbDay = showb-{-# INLINE showbDay #-}-+-- | /Since: 2/ instance TextShow ClockTime where- showb = showbClockTime- INLINE_INST_FUN(showb)+ showb = fromString . calendarTimeToString . unsafePerformIO . toCalendarTime +-- | /Since: 2/ $(deriveTextShow ''TimeDiff)+-- | /Since: 2/ $(deriveTextShow ''CalendarTime)+-- | /Since: 2/ $(deriveTextShow ''Month)+-- | /Since: 2/ $(deriveTextShow ''Day)
src/TextShow/System/Win32.hs view
@@ -1,7 +1,8 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP #-} #if defined(mingw32_HOST_OS)-{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} #endif @@ -13,113 +14,119 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @Win32@ library.-This module only exports functions if using Windows.+'TextShow' instances for data types in the @Win32@ library.+Only provided if using Windows. /Since: 2/ -}-module TextShow.System.Win32 (-#if !defined(mingw32_HOST_OS)- ) where-#else- showbDebugEventInfoPrec- , showbExceptionPrec- , showb_BY_HANDLE_FILE_INFORMATION_Prec- , showb_WIN32_FILE_ATTRIBUTE_DATA_Prec- , showbProcessorArchitecturePrec- , showb_SYSTEM_INFO_Prec- , showb_FILETIME_Prec- , showb_SYSTEMTIME_Prec- , showb_TIME_ZONE_INFORMATION_Prec- , showbTimeZoneIdPrec- ) where+module TextShow.System.Win32 () where +#if defined(mingw32_HOST_OS) import System.Win32.DebugApi (DebugEventInfo, Exception) import System.Win32.File (BY_HANDLE_FILE_INFORMATION, WIN32_FILE_ATTRIBUTE_DATA) import System.Win32.Info (ProcessorArchitecture, SYSTEM_INFO) import System.Win32.Time (FILETIME, SYSTEMTIME, TIME_ZONE_INFORMATION, TimeZoneId)--import TextShow (TextShow(..), Builder)-import TextShow.TH (deriveTextShow)---- | Convert a 'DebugEventInfo' value to a 'Builder' with the given precedence.------ /Since: 2/-showbDebugEventInfoPrec :: Int -> DebugEventInfo -> Builder-showbDebugEventInfoPrec = showbPrec-{-# INLINE showbDebugEventInfoPrec #-}---- | Convert an 'Exception' to a 'Builder' with the given precedence.------ /Since: 2/-showbExceptionPrec :: Int -> Exception -> Builder-showbExceptionPrec = showbPrec-{-# INLINE showbExceptionPrec #-}---- | Convert a 'BY_HANDLE_FILE_INFORMATION' value to a 'Builder' with the given precedence.------ /Since: 2/-showb_BY_HANDLE_FILE_INFORMATION_Prec :: Int -> BY_HANDLE_FILE_INFORMATION -> Builder-showb_BY_HANDLE_FILE_INFORMATION_Prec = showbPrec-{-# INLINE showb_BY_HANDLE_FILE_INFORMATION_Prec #-}---- | Convert a 'WIN32_FILE_ATTRIBUTE_DATA' value to a 'Builder' with the given precedence.------ /Since: 2/-showb_WIN32_FILE_ATTRIBUTE_DATA_Prec :: Int -> WIN32_FILE_ATTRIBUTE_DATA -> Builder-showb_WIN32_FILE_ATTRIBUTE_DATA_Prec = showbPrec-{-# INLINE showb_WIN32_FILE_ATTRIBUTE_DATA_Prec #-}---- | Convert a 'ProcessorArchitecture' to a 'Builder' with the given precedence.------ /Since: 2/-showbProcessorArchitecturePrec :: Int -> ProcessorArchitecture -> Builder-showbProcessorArchitecturePrec = showbPrec-{-# INLINE showbProcessorArchitecturePrec #-}---- | Convert a 'SYSTEM_INFO' value to a 'Builder' with the given precedence.------ /Since: 2/-showb_SYSTEM_INFO_Prec :: Int -> SYSTEM_INFO -> Builder-showb_SYSTEM_INFO_Prec = showbPrec-{-# INLINE showb_SYSTEM_INFO_Prec #-}---- | Convert a 'FILETIME' to a 'Builder' with the given precedence.------ /Since: 2/-showb_FILETIME_Prec :: Int -> FILETIME -> Builder-showb_FILETIME_Prec = showbPrec-{-# INLINE showb_FILETIME_Prec #-}+# if MIN_VERSION_Win32(2,5,0)+import Data.Monoid.Compat ((<>)) --- | Convert a 'SYSTEMTIME' to a 'Builder' with the given precedence.------ /Since: 2/-showb_SYSTEMTIME_Prec :: Int -> SYSTEMTIME -> Builder-showb_SYSTEMTIME_Prec = showbPrec-{-# INLINE showb_SYSTEMTIME_Prec #-}+import Graphics.Win32.GDI.AlphaBlend (BLENDFUNCTION)+import System.Win32.Automation.Input (HARDWAREINPUT, INPUT)+import System.Win32.Automation.Input.Key (KEYBDINPUT)+import System.Win32.Automation.Input.Mouse (MOUSEINPUT)+import System.Win32.Exception.Unsupported (Unsupported(..))+import System.Win32.Info.Version (ProductType, OSVERSIONINFOEX)+import System.Win32.Mem (MEMORY_BASIC_INFORMATION)+import System.Win32.SimpleMAPI (RecipientClass, Recipient, FileTag, Attachment, Message) --- | Convert a 'TIME_ZONE_INFORMATION' value to a 'Builder' with the given precedence.------ /Since: 2/-showb_TIME_ZONE_INFORMATION_Prec :: Int -> TIME_ZONE_INFORMATION -> Builder-showb_TIME_ZONE_INFORMATION_Prec = showbPrec-{-# INLINE showb_TIME_ZONE_INFORMATION_Prec #-}+import TextShow (TextShow(..), fromString)+# endif --- | Convert a 'TimeZoneId' to a 'Builder'.------ /Since: 2/-showbTimeZoneIdPrec :: TimeZoneId -> Builder-showbTimeZoneIdPrec = showb-{-# INLINE showbTimeZoneIdPrec #-}+import TextShow.TH (deriveTextShow) +-- | /Since: 2/ $(deriveTextShow ''DebugEventInfo)+-- | /Since: 2/ $(deriveTextShow ''Exception)+-- | /Since: 2/ $(deriveTextShow ''BY_HANDLE_FILE_INFORMATION)+-- | /Since: 2/ $(deriveTextShow ''WIN32_FILE_ATTRIBUTE_DATA)+-- | /Since: 2/ $(deriveTextShow ''ProcessorArchitecture)+-- | /Since: 2/ $(deriveTextShow ''SYSTEM_INFO)+-- | /Since: 2/ $(deriveTextShow ''FILETIME)+-- | /Since: 2/ $(deriveTextShow ''SYSTEMTIME)+-- | /Since: 2/ $(deriveTextShow ''TIME_ZONE_INFORMATION)+-- | /Since: 2/ $(deriveTextShow ''TimeZoneId)++# if MIN_VERSION_Win32(2,5,0)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''BLENDFUNCTION)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''KEYBDINPUT)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''MOUSEINPUT)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''HARDWAREINPUT)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''INPUT)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''ProductType)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''OSVERSIONINFOEX)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''MEMORY_BASIC_INFORMATION)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''RecipientClass)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''Recipient)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''FileTag)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''Attachment)+-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+$(deriveTextShow ''Message)++-- | Only available with @Win32-2.5.0.0@ or later.+--+-- /Since: 3.6/+instance TextShow Unsupported where+ showb (MissingLibrary name reason)+ = "Can't load library \"" <> fromString name <> "\". " <> fromString reason+ showb (MissingFunction name reason)+ = "Can't find \"" <> fromString name <> "\" function. " <> fromString reason+ showb (MissingValue name reason)+ = "Can't use \"" <> fromString name <> "\" value. " <> fromString reason+# endif #endif
src/TextShow/Text/PrettyPrint.hs view
@@ -9,7 +9,7 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @pretty@ library.+Provides 'TextShow' instances for data types in the @pretty@ library. /Since: 2/ -}@@ -20,17 +20,6 @@ , renderAnnotB , renderStyleAnnotB #endif- , showbMode- , showbStylePrec- , showbTextDetailsPrec-#if MIN_VERSION_pretty(1,1,2)- , showbPrettyLevelPrec-#endif-#if MIN_VERSION_pretty(1,1,3)- , liftShowbAnnotDetailsPrec- , showbPrettyLevelAnnotPrec- , liftShowbSpanPrec-#endif ) where import Data.Monoid.Compat@@ -52,8 +41,6 @@ import TextShow (TextShow(..), Builder, fromString, singleton) import TextShow.TH (deriveTextShow) -#include "inline.h"- -- | Renders a 'Doc' to a 'Builder' using the default 'style'. -- -- /Since: 2/@@ -79,37 +66,6 @@ txtPrinter (PStr s') b = fromString s' <> b {-# INLINE txtPrinter #-} --- | Convert a 'Mode' to a 'Builder'.------ /Since: 2/-showbMode :: Mode -> Builder-showbMode = showb-{-# INLINE showbMode #-}---- | Convert a 'Style' to a 'Builder' with the given precedence.------ /Since: 2/-showbStylePrec :: Int -> Style -> Builder-showbStylePrec = showbPrec-{-# INLINE showbStylePrec #-}---- | Convert 'TextDetails' to a 'Builder' with the given precedence.------ /Since: 2/-showbTextDetailsPrec :: Int -> TextDetails -> Builder-showbTextDetailsPrec = showbPrec-{-# INLINE showbTextDetailsPrec #-}--#if MIN_VERSION_pretty(1,1,2)--- | Convert a 'PrettyLevel' value to a 'Builder' with the given precedence.--- This function is only available with @pretty-1.1.2.0@ or later.------ /Since: 2/-showbPrettyLevelPrec :: Int -> PrettyLevel -> Builder-showbPrettyLevelPrec = showbPrec-{-# INLINE showbPrettyLevelPrec #-}-#endif- #if MIN_VERSION_pretty(1,1,3) -- | Renders an annotated 'Doc' to a 'Builder' using the default 'Annot.style'. -- This function is only available with @pretty-1.1.3@ or later.@@ -131,57 +87,61 @@ txtPrinter mempty doc---- | Convert an 'AnnotDetais' value to a 'Builder' with the given show function--- and precedence. This function is only available with @pretty-1.1.3@ or later.------ /Since: 3/-liftShowbAnnotDetailsPrec :: (Int -> a -> Builder) -> Int -> AnnotDetails a -> Builder-liftShowbAnnotDetailsPrec sp = liftShowbPrec sp undefined-{-# INLINE liftShowbAnnotDetailsPrec #-}---- | Convert an annotated 'PrettyLevel' value to a 'Builder' with the given precedence.--- This function is only available with @pretty-1.1.3@ or later.------ /Since: 3/-showbPrettyLevelAnnotPrec :: Int -> Annot.PrettyLevel -> Builder-showbPrettyLevelAnnotPrec = showbPrec-{-# INLINE showbPrettyLevelAnnotPrec #-}---- | Convert a 'Span' to a 'Builder' with the given show function and precedence.--- This function is only available with @pretty-1.1.3@ or later.------ /Since: 3/-liftShowbSpanPrec :: (Int -> a -> Builder) -> Int -> Span a -> Builder-liftShowbSpanPrec sp = liftShowbPrec sp undefined-{-# INLINE liftShowbSpanPrec #-} #endif +-- | /Since: 2/ instance TextShow Doc where showb = renderB- INLINE_INST_FUN(showb)+ {-# INLINE showb #-} +-- | /Since: 2/ $(deriveTextShow ''Mode)+-- | /Since: 2/ $(deriveTextShow ''Style)+-- | /Since: 2/ $(deriveTextShow ''TextDetails) #if MIN_VERSION_pretty(1,1,2)+-- | Only available with @pretty-1.1.2.0@ or later.+--+-- /Since: 2/ $(deriveTextShow ''PrettyLevel) #endif #if MIN_VERSION_pretty(1,1,3)+-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ $(deriveTextShow ''AnnotDetails)+-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ $(deriveTextShow1 ''AnnotDetails) +-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ instance TextShow (Annot.Doc a) where showb = renderAnnotB- INLINE_INST_FUN(showb)+ {-# INLINE showb #-}+-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ instance TextShow1 Annot.Doc where liftShowbPrec _ _ = showbPrec- INLINE_INST_FUN(liftShowbPrec)+ {-# INLINE liftShowbPrec #-} +-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ $(deriveTextShow ''Annot.PrettyLevel) +-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ $(deriveTextShow ''Span)+-- | Only available with @pretty-1.1.3@ or later.+--+-- /Since: 3/ $(deriveTextShow1 ''Span) #endif
src/TextShow/Text/XHtml.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -9,17 +8,11 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @xhtml@ library.+'TextShow' instances for data types in the @xhtml@ library. /Since: 2/ -}-module TextShow.Text.XHtml (- showbHtml- , showbHtmlList- , showbHtmlAttr- , showbHotLinkPrec- , showbHtmlTable- ) where+module TextShow.Text.XHtml () where import Data.Monoid.Compat @@ -27,61 +20,27 @@ htmlAttrPair, renderHtmlFragment) import Text.XHtml.Table (HtmlTable) -import TextShow (TextShow(..), Builder, FromStringShow(..), fromString, singleton)-import TextShow.Data.Char (showbString)+import TextShow (TextShow(..), FromStringShow(..), fromString, singleton) import TextShow.TH (deriveTextShow) -#include "inline.h"---- | Convert an 'Html' value to a 'Builder'.------ /Since: 2/-showbHtml :: Html -> Builder-showbHtml = fromString . renderHtmlFragment-{-# INLINE showbHtml #-}---- | Convert a list of 'Html' values to a 'Builder'.------ /Since: 2/-showbHtmlList :: [Html] -> Builder-showbHtmlList = mconcat . map showb-{-# INLINE showbHtmlList #-}---- | Convert an 'HtmlAttr' to a 'Builder'.------ /Since: 2/-showbHtmlAttr :: HtmlAttr -> Builder-showbHtmlAttr ha = case htmlAttrPair ha of- (str, val) -> fromString str <> singleton '=' <> showbString val-{-# INLINE showbHtmlAttr #-}---- | Convert a 'HotLink' to a 'Builder' with the given precedence.------ /Since: 2/-showbHotLinkPrec :: Int -> HotLink -> Builder-showbHotLinkPrec = showbPrec-{-# INLINE showbHotLinkPrec #-}---- | Convert an 'HtmlTable' to a 'Builder'.------ /Since: 2/-showbHtmlTable :: HtmlTable -> Builder-showbHtmlTable = showb . FromStringShow-{-# INLINE showbHtmlTable #-}-+-- | /Since: 2/ instance TextShow Html where- showb = showbHtml- INLINE_INST_FUN(showb)+ showb = fromString . renderHtmlFragment+ {-# INLINE showb #-} - showbList = showbHtmlList- INLINE_INST_FUN(showbList)+ showbList = mconcat . map showb+ {-# INLINE showbList #-} +-- | /Since: 2/ instance TextShow HtmlAttr where- showb = showbHtmlAttr- INLINE_INST_FUN(showb)+ showb ha = case htmlAttrPair ha of+ (str, val) -> fromString str <> singleton '=' <> showb val+ {-# INLINE showb #-} +-- | /Since: 2/ $(deriveTextShow ''HotLink) +-- | /Since: 2/ instance TextShow HtmlTable where- showb = showbHtmlTable- INLINE_INST_FUN(showb)+ showb = showb . FromStringShow+ {-# INLINE showb #-}
src/TextShow/Trace/Hpc.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -9,24 +8,15 @@ Stability: Provisional Portability: GHC -Monomorphic 'TextShow' functions for data types in the @hpc@ library.+'TextShow' instances for data types in the @hpc@ library. /Since: 2/ -}-module TextShow.Trace.Hpc (- showbMixPrec- , showbBoxLabelPrec- , showbCondBox- , showbTixPrec- , showbTixModulePrec- , showbHpcPos- , showbHash- ) where+module TextShow.Trace.Hpc () where import Data.Monoid.Compat -import TextShow (TextShow(..), Builder, FromStringShow(..), singleton)-import TextShow.Data.Integral (showbIntPrec)+import TextShow (TextShow(..), FromStringShow(..), singleton) import TextShow.Data.Time () import TextShow.TH (deriveTextShow) @@ -34,71 +24,27 @@ import Trace.Hpc.Tix (Tix, TixModule) import Trace.Hpc.Util (HpcPos, Hash, fromHpcPos) -#include "inline.h"---- | Convert a 'Mix' value to a 'Builder' with the given precedence.------ /Since: 2/-showbMixPrec :: Int -> Mix -> Builder-showbMixPrec = showbPrec-{-# INLINE showbMixPrec #-}---- | Convert a 'BoxLabel' to a 'Builder' with the given precedence.------ /Since: 2/-showbBoxLabelPrec :: Int -> BoxLabel -> Builder-showbBoxLabelPrec = showbPrec-{-# INLINE showbBoxLabelPrec #-}---- | Convert a 'CondBox' to a 'Builder'.------ /Since: 2/-showbCondBox :: CondBox -> Builder-showbCondBox = showb-{-# INLINE showbCondBox #-}---- | Convert a 'Tix' value to a 'Builder' with the given precedence.------ /Since: 2/-showbTixPrec :: Int -> Tix -> Builder-showbTixPrec = showbPrec-{-# INLINE showbTixPrec #-}---- | Convert a 'TixModule' to a 'Builder' with the given precedence.------ /Since: 2/-showbTixModulePrec :: Int -> TixModule -> Builder-showbTixModulePrec = showbPrec-{-# INLINE showbTixModulePrec #-}---- | Convert a 'HpcPos' to a 'Builder'.------ /Since: 2/-showbHpcPos :: HpcPos -> Builder-showbHpcPos hp = case fromHpcPos hp of- (l1, c1, l2, c2) -> showbIntPrec 0 l1- <> (singleton ':' <> showbIntPrec 0 c1)- <> (singleton '-' <> showbIntPrec 0 l2)- <> (singleton ':' <> showbIntPrec 0 c2)-{-# INLINE showbHpcPos #-}---- | Convert a 'Hash' to a 'Builder'.------ /Since: 2/-showbHash :: Hash -> Builder-showbHash = showb . FromStringShow-{-# INLINE showbHash #-}-+-- | /Since: 2/ $(deriveTextShow ''Mix)+-- | /Since: 2/ $(deriveTextShow ''BoxLabel)+-- | /Since: 2/ $(deriveTextShow ''CondBox)+-- | /Since: 2/ $(deriveTextShow ''Tix)+-- | /Since: 2/ $(deriveTextShow ''TixModule) +-- | /Since: 2/ instance TextShow HpcPos where- showb = showbHpcPos- INLINE_INST_FUN(showb)+ showb hp = case fromHpcPos hp of+ (l1, c1, l2, c2) -> showb l1+ <> (singleton ':' <> showb c1)+ <> (singleton '-' <> showb l2)+ <> (singleton ':' <> showb c2)+ {-# INLINE showb #-} +-- | /Since: 2/ instance TextShow Hash where- showb = showbHash- INLINE_INST_FUN(showb)+ showb = showb . FromStringShow+ {-# INLINE showb #-}
src/TextShow/Utils.hs view
@@ -10,9 +10,16 @@ Miscellaneous utility functions. -}-module TextShow.Utils (showbUnaryListWith) where+module TextShow.Utils (liftShowbUnaryWith, showbUnaryListWith) where -import TextShow (Builder, showbUnaryWith)+import TextShow (Builder, TextShow1(..), showbUnaryWith)++-- | This pattern is used frequently when showing transformer types.+liftShowbUnaryWith :: TextShow1 m+ => (Int -> a -> Builder) -> ([a] -> Builder)+ -> Builder -> Int -> m a -> Builder+liftShowbUnaryWith sp sl = showbUnaryWith (liftShowbPrec sp sl)+{-# INLINE liftShowbUnaryWith #-} -- | This pattern is used frequently when showing container types. showbUnaryListWith :: ([a] -> Builder) -> Int -> [a] -> Builder
+ tests/Instances/Data/Time.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE CPP #-}++#if MIN_VERSION_time(1,8,0)+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE StandaloneDeriving #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}+#endif++{-|+Module: Instances.Data.Time+Copyright: (C) 2014-2017 Ryan Scott+License: BSD-style (see the file LICENSE)+Maintainer: Ryan Scott+Stability: Provisional+Portability: GHC++Provides an 'Arbitrary' instance for 'SystemTime' values.+-}+module Instances.Data.Time () where++#if MIN_VERSION_time(1,8,0)+import Data.Time.Clock.System (SystemTime(..))+import GHC.Generics (Generic)+import Instances.Utils.GenericArbitrary (genericArbitrary)+import Test.QuickCheck (Arbitrary(..))++instance Arbitrary SystemTime where+ arbitrary = genericArbitrary++deriving instance Generic SystemTime+#endif
+ tests/Instances/GHC/ForeignSrcLang/Type.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE CPP #-}++#if defined(MIN_VERSION_ghc_boot_th)+# if MIN_VERSION_ghc_boot_th(8,2,0)+{-# LANGUAGE StandaloneDeriving #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}+# endif+#endif++{-|+Module: Instances.GHC.ForeignSrcLang.Type+Copyright: (C) 2014-2017 Ryan Scott+License: BSD-style (see the file LICENSE)+Maintainer: Ryan Scott+Stability: Provisional+Portability: GHC++Provides an 'Arbitrary' instance for the 'ForeignSrcLang' data type.+-}+module Instances.GHC.ForeignSrcLang.Type () where++#if defined(MIN_VERSION_ghc_boot_th)+# if MIN_VERSION_ghc_boot_th(8,2,0)+import GHC.ForeignSrcLang.Type (ForeignSrcLang(..))+import Test.QuickCheck (Arbitrary(..), arbitraryBoundedEnum)++deriving instance Bounded ForeignSrcLang+deriving instance Enum ForeignSrcLang+instance Arbitrary ForeignSrcLang where+ arbitrary = arbitraryBoundedEnum+# endif+#endif
tests/Instances/Language/Haskell/TH.hs view
@@ -211,6 +211,10 @@ #if MIN_VERSION_template_haskell(2,11,0) , UnboundVarE <$> arbitrary #endif+#if MIN_VERSION_template_haskell(2,12,0)+ , pure $ AppTypeE fExp fType+ , UnboxedSumE fExp <$> arbitrary <*> arbitrary+#endif ] -- arbitrary = oneof [ VarE <$> arbitrary -- , ConE <$> arbitrary@@ -374,6 +378,9 @@ , UInfixP fPat <$> arbitrary <@> fPat , pure $ ParensP fPat #endif+#if MIN_VERSION_template_haskell(2,12,0)+ , UnboxedSumP fPat <$> arbitrary <*> arbitrary+#endif ] -- arbitrary = oneof [ LitP <$> arbitrary -- , VarP <$> arbitrary@@ -460,6 +467,9 @@ , UInfixT fType <$> arbitrary <@> fType , pure $ ParensT fType , pure WildCardT+#endif+#if MIN_VERSION_template_haskell(2,12,0)+ , UnboxedSumT <$> arbitrary #endif ] -- arbitrary = oneof [ ForallT <$> arbitrary <*> arbitrary <*> arbitrary
tests/Instances/Miscellaneous.hs view
@@ -26,12 +26,13 @@ import Prelude.Compat import System.Exit (ExitCode(..))+import System.IO (Handle, stdin, stdout, stderr) -import Test.QuickCheck (Arbitrary(..))+import Test.QuickCheck (Arbitrary(..), oneof) #if MIN_VERSION_base(4,5,0) -import Foreign.C.Types (CInt(..))+import Foreign.C.Types (CInt(..), CUIntPtr(..)) # if defined(HTYPE_GID_T) import System.Posix.Types (CGid(..)) # endif@@ -41,7 +42,7 @@ #else -import Foreign.C.Types (CInt)+import Foreign.C.Types (CInt, CUIntPtr) # if defined(HTYPE_GID_T) import System.Posix.Types (CGid) # endif@@ -55,12 +56,16 @@ instance Arbitrary ExitCode where arbitrary = genericArbitrary +instance Arbitrary Handle where+ arbitrary = oneof $ map pure [stdin, stdout, stderr]+ instance Arbitrary (Ptr a) where arbitrary = plusPtr nullPtr <$> arbitrary #if MIN_VERSION_base(4,5,0) deriving instance Arbitrary CInt+deriving instance Arbitrary CUIntPtr # if defined(HTYPE_GID_T) deriving instance Arbitrary CGid@@ -73,6 +78,9 @@ #else instance Arbitrary CInt where+ arbitrary = arbitrarySizedBoundedIntegral++instance Arbitrary CUIntPtr where arbitrary = arbitrarySizedBoundedIntegral # if defined(HTYPE_GID_T)
tests/Instances/System/Directory.hs view
@@ -25,7 +25,17 @@ import System.Directory (Permissions) import Test.QuickCheck (Arbitrary(..)) +# if MIN_VERSION_directory(1,2,3)+import System.Directory (XdgDirectory(..))+import Test.QuickCheck (arbitraryBoundedEnum)+# endif+ instance Arbitrary Permissions where arbitrary = genericArbitrary $(Generics.deriveAll0 ''Permissions)++# if MIN_VERSION_directory(1,2,3)+instance Arbitrary XdgDirectory where+ arbitrary = arbitraryBoundedEnum+# endif #endif
tests/Instances/System/Win32.hs view
@@ -41,6 +41,18 @@ import System.Win32.Time (FILETIME(..), SYSTEMTIME(..), TIME_ZONE_INFORMATION(..), TimeZoneId(..)) +#if MIN_VERSION_Win32(2,5,0)+import Graphics.Win32.GDI.AlphaBlend (BLENDFUNCTION(..))+import System.Win32.Automation.Input (HARDWAREINPUT(..), INPUT(..))+import System.Win32.Automation.Input.Key (KEYBDINPUT(..))+import System.Win32.Automation.Input.Mouse (MOUSEINPUT(..))+import System.Win32.Exception.Unsupported (Unsupported(..))+import System.Win32.Info.Version (ProductType(..), OSVERSIONINFOEX(..))+import System.Win32.Mem (MEMORY_BASIC_INFORMATION(..))+import System.Win32.SimpleMAPI (RecipientClass(..), Recipient(..), FileTag(..),+ Attachment(..), Message(..))+#endif+ import Test.QuickCheck (Arbitrary(..), arbitraryBoundedEnum) instance Arbitrary DebugEventInfo where@@ -74,6 +86,51 @@ instance Arbitrary TimeZoneId where arbitrary = arbitraryBoundedEnum +#if MIN_VERSION_Win32(2,5,0)+instance Arbitrary BLENDFUNCTION where+ arbitrary = genericArbitrary++instance Arbitrary KEYBDINPUT where+ arbitrary = genericArbitrary++instance Arbitrary MOUSEINPUT where+ arbitrary = genericArbitrary++instance Arbitrary HARDWAREINPUT where+ arbitrary = genericArbitrary++instance Arbitrary INPUT where+ arbitrary = genericArbitrary++instance Arbitrary ProductType where+ arbitrary = genericArbitrary++instance Arbitrary OSVERSIONINFOEX where+ arbitrary = genericArbitrary++instance Arbitrary MEMORY_BASIC_INFORMATION where+ arbitrary = genericArbitrary++deriving instance Bounded RecipientClass+instance Arbitrary RecipientClass where+ arbitrary = arbitraryBoundedEnum++instance Arbitrary Recipient where+ arbitrary = genericArbitrary++instance Arbitrary FileTag where+ arbitrary = genericArbitrary++instance Arbitrary Attachment where+ arbitrary = genericArbitrary++instance Arbitrary Message where+ arbitrary = genericArbitrary++instance Arbitrary Unsupported where+ arbitrary = genericArbitrary+#endif+ # if __GLASGOW_HASKELL__ >= 704 deriving instance Generic DebugEventInfo deriving instance Generic Exception@@ -83,6 +140,22 @@ deriving instance Generic SYSTEM_INFO deriving instance Generic SYSTEMTIME deriving instance Generic TIME_ZONE_INFORMATION+# if MIN_VERSION_Win32(2,5,0)+deriving instance Generic BLENDFUNCTION+deriving instance Generic KEYBDINPUT+deriving instance Generic MOUSEINPUT+deriving instance Generic HARDWAREINPUT+deriving instance Generic INPUT+deriving instance Generic ProductType+deriving instance Generic OSVERSIONINFOEX+deriving instance Generic MEMORY_BASIC_INFORMATION+deriving instance Generic RecipientClass+deriving instance Generic Recipient+deriving instance Generic FileTag+deriving instance Generic Attachment+deriving instance Generic Message+deriving instance Generic Unsupported+# endif # else $(Generics.deriveAll0 ''DebugEventInfo) $(Generics.deriveAll0 ''Exception)
tests/Spec/Data/TimeSpec.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ {-| Module: Spec.Data.TimeSpec Copyright: (C) 2014-2017 Ryan Scott@@ -13,9 +15,17 @@ import Data.Proxy (Proxy(..)) import Data.Time.Calendar (Day) import Data.Time.Clock (DiffTime, UTCTime, NominalDiffTime)+#if MIN_VERSION_time(1,6,0)+import Data.Time (UniversalTime)+#endif+#if MIN_VERSION_time(1,8,0)+import Data.Time.Clock.System (SystemTime)+#endif import Data.Time.Clock.TAI (AbsoluteTime) import Data.Time.LocalTime (TimeZone, TimeOfDay, LocalTime, ZonedTime) +import Instances.Data.Time ()+ import Spec.Utils (matchesTextShowSpec) import Test.Hspec (Spec, describe, hspec, parallel)@@ -46,3 +56,11 @@ matchesTextShowSpec (Proxy :: Proxy LocalTime) describe "ZonedTime" $ matchesTextShowSpec (Proxy :: Proxy ZonedTime)+#if MIN_VERSION_time(1,6,0)+ describe "UniversalTime" $+ matchesTextShowSpec (Proxy :: Proxy UniversalTime)+#endif+#if MIN_VERSION_time(1,8,0)+ describe "SystemTime" $+ matchesTextShowSpec (Proxy :: Proxy SystemTime)+#endif
+ tests/Spec/GHC/ForeignSrcLang/TypeSpec.hs view
@@ -0,0 +1,45 @@+{-# LANGUAGE CPP #-}++{-|+Module: Spec.GHC.ForeignSrcLang.TypeSpec+Copyright: (C) 2014-2017 Ryan Scott+License: BSD-style (see the file LICENSE)+Maintainer: Ryan Scott+Stability: Provisional+Portability: GHC++@hspec@ tests for the 'ForeignSrcLang' data type.+-}+module Spec.GHC.ForeignSrcLang.TypeSpec (main, spec) where++import Prelude ()+import Prelude.Compat++import Test.Hspec (Spec, hspec, parallel)++#if defined(MIN_VERSION_ghc_boot_th)+# if MIN_VERSION_ghc_boot_th(8,2,0)+import Data.Proxy (Proxy(..))+import GHC.ForeignSrcLang.Type (ForeignSrcLang)+import Instances.GHC.ForeignSrcLang.Type ()+import Spec.Utils (matchesTextShowSpec)+import Test.Hspec (describe)+import TextShow.GHC.ForeignSrcLang.Type ()+# endif+#endif++main :: IO ()+main = hspec spec++spec :: Spec+spec = parallel $ do+#if defined(MIN_VERSION_ghc_boot_th)+# if MIN_VERSION_ghc_boot_th(8,2,0)+ describe "ForeignSrcLang" $+ matchesTextShowSpec (Proxy :: Proxy ForeignSrcLang)+# else+ pure ()+# endif+#else+ pure ()+#endif
tests/Spec/System/DirectorySpec.hs view
@@ -18,10 +18,18 @@ #if MIN_VERSION_directory(1,1,0) import Data.Proxy (Proxy(..))+ import Instances.System.Directory ()+ import Spec.Utils (matchesTextShowSpec)+ import System.Directory (Permissions)+# if MIN_VERSION_directory(1,2,3)+import System.Directory (XdgDirectory)+# endif+ import Test.Hspec (describe)+ import TextShow.System.Directory () #endif @@ -29,10 +37,14 @@ main = hspec spec spec :: Spec-spec = parallel $+spec = parallel $ do #if MIN_VERSION_directory(1,1,0) describe "Permissions" $ matchesTextShowSpec (Proxy :: Proxy Permissions)+# if MIN_VERSION_directory(1,2,3)+ describe "XdgDirectory" $+ matchesTextShowSpec (Proxy :: Proxy XdgDirectory)+# endif #else pure () #endif
tests/Spec/System/Win32Spec.hs view
@@ -28,6 +28,17 @@ import System.Win32.Info (ProcessorArchitecture, SYSTEM_INFO) import System.Win32.Time (FILETIME, SYSTEMTIME, TIME_ZONE_INFORMATION, TimeZoneId) +# if MIN_VERSION_Win32(2,5,0)+import Graphics.Win32.GDI.AlphaBlend (BLENDFUNCTION)+import System.Win32.Automation.Input (HARDWAREINPUT, INPUT)+import System.Win32.Automation.Input.Key (KEYBDINPUT)+import System.Win32.Automation.Input.Mouse (MOUSEINPUT)+import System.Win32.Exception.Unsupported (Unsupported(..))+import System.Win32.Info.Version (ProductType, OSVERSIONINFOEX)+import System.Win32.Mem (MEMORY_BASIC_INFORMATION)+import System.Win32.SimpleMAPI (RecipientClass, Recipient, FileTag, Attachment, Message)+# endif+ import Test.Hspec (describe) import TextShow.System.Win32 ()@@ -59,6 +70,36 @@ matchesTextShowSpec (Proxy :: Proxy TIME_ZONE_INFORMATION) describe "TimeZoneId" $ matchesTextShowSpec (Proxy :: Proxy TimeZoneId)+# if MIN_VERSION_Win32(2,5,0)+ describe "BLENDFUNCTION" $+ matchesTextShowSpec (Proxy :: Proxy BLENDFUNCTION)+ describe "KEYBDINPUT" $+ matchesTextShowSpec (Proxy :: Proxy KEYBDINPUT)+ describe "MOUSEINPUT" $+ matchesTextShowSpec (Proxy :: Proxy MOUSEINPUT)+ describe "HARDWAREINPUT" $+ matchesTextShowSpec (Proxy :: Proxy HARDWAREINPUT)+ describe "INPUT" $+ matchesTextShowSpec (Proxy :: Proxy INPUT)+ describe "ProductType" $+ matchesTextShowSpec (Proxy :: Proxy ProductType)+ describe "OSVERSIONINFOEX" $+ matchesTextShowSpec (Proxy :: Proxy OSVERSIONINFOEX)+ describe "MEMORY_BASIC_INFORMATION" $+ matchesTextShowSpec (Proxy :: Proxy MEMORY_BASIC_INFORMATION)+ describe "RecipientClass" $+ matchesTextShowSpec (Proxy :: Proxy RecipientClass)+ describe "Recipient" $+ matchesTextShowSpec (Proxy :: Proxy Recipient)+ describe "FileTag" $+ matchesTextShowSpec (Proxy :: Proxy FileTag)+ describe "Attachment" $+ matchesTextShowSpec (Proxy :: Proxy Attachment)+ describe "Message" $+ matchesTextShowSpec (Proxy :: Proxy Message)+ describe "Unsupported" $+ matchesTextShowSpec (Proxy :: Proxy Unsupported)+# endif #else pure () #endif
text-show-instances.cabal view
@@ -1,5 +1,5 @@ name: text-show-instances-version: 3.5+version: 3.6 synopsis: Additional instances for text-show description: @text-show-instances@ is a supplemental library to @text-show@ that provides additional @Show@ instances for data types in@@ -72,7 +72,7 @@ , GHC == 7.8.4 , GHC == 7.10.3 , GHC == 8.0.2-extra-source-files: CHANGELOG.md, README.md, include/inline.h+extra-source-files: CHANGELOG.md, README.md cabal-version: >=1.10 source-repository head@@ -126,6 +126,9 @@ -- Only exports functions if using ghc-boot-th TextShow.GHC.LanguageExtensions.Type + -- Only exports functions if using ghc-boot-th-8.2 or later+ TextShow.GHC.ForeignSrcLang.Type+ -- Only exports functions if using Windows TextShow.System.Win32 @@ -145,21 +148,19 @@ , old-locale >= 1 && < 1.1 , old-time >= 1 && < 1.2 , pretty >= 1 && < 1.2+ , process >= 1 && < 1.7 , random >= 1.0.1 && < 1.2 , semigroups >= 0.16.2 && < 1 , tagged >= 0.4.4 && < 1 , text >= 0.11.1 && < 1.3 , text-show >= 3.4 && < 4- , time >= 0.1 && < 1.7+ , time >= 0.1 && < 1.9 , unordered-containers >= 0.2 && < 0.3 , vector >= 0.9 && < 0.13 , xhtml >= 3000.2 && < 3000.3 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall- include-dirs: include- includes: inline.h- install-includes: inline.h if flag(base-4-9) build-depends: base >= 4.9 && < 5@@ -181,7 +182,7 @@ build-depends: transformers == 0.4.* if os(windows)- build-depends: Win32 >= 2.1 && < 2.4+ build-depends: Win32 >= 2.1 && < 2.6 else build-depends: terminfo >= 0.3.2 && < 0.5 , unix >= 2 && < 2.8@@ -212,6 +213,12 @@ -- Only defines instances if using ghc-boot-th Instances.GHC.LanguageExtensions.Type + -- Only defines instances if using ghc-boot-th-8.2 or later+ Instances.GHC.ForeignSrcLang.Type++ -- Only defines instances if using time-1.8 or later+ Instances.Data.Time+ -- Only defines instances if using Windows Instances.System.Win32 @@ -243,6 +250,9 @@ -- Only defines tests if using ghc-boot-th Spec.GHC.LanguageExtensions.TypeSpec + -- Only exports functions if using ghc-boot-th-8.2 or later+ Spec.GHC.ForeignSrcLang.TypeSpec+ -- Only defines tests if using Windows Spec.System.Win32Spec @@ -264,6 +274,7 @@ , old-locale >= 1 && < 1.1 , old-time >= 1 && < 1.2 , pretty >= 1 && < 1.2+ , process >= 1 && < 1.7 , QuickCheck >= 2.9 && < 3 , quickcheck-instances >= 0.3.12 && < 0.4 , random >= 1.0.1 && < 1.2@@ -272,7 +283,7 @@ , text >= 0.11.1 && < 1.3 , text-show >= 3.4 && < 4 , th-orphans >= 0.13.3 && < 1- , time >= 0.1 && < 1.7+ , time >= 0.1 && < 1.9 , unordered-containers >= 0.2 && < 0.3 , vector >= 0.9 && < 0.13 , xhtml >= 3000.2 && < 3000.3@@ -299,17 +310,14 @@ if flag(developer) hs-source-dirs: src else- build-depends: text-show-instances == 3.5+ build-depends: text-show-instances hs-source-dirs: tests default-language: Haskell2010 ghc-options: -Wall -threaded -rtsopts- include-dirs: include- includes: inline.h- install-includes: inline.h if os(windows)- build-depends: Win32 >= 2.1 && < 2.4+ build-depends: Win32 >= 2.1 && < 2.6 else build-depends: terminfo >= 0.3.2 && < 0.5 , unix >= 2 && < 2.8