packages feed

text-format-heavy 0.1.5.1 → 0.1.5.2

raw patch · 2 files changed

+28/−3 lines, 2 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Data.Text.Format.Heavy: DefaultValue :: Variable -> DefaultValue
+ Data.Text.Format.Heavy: Several :: [a] -> Several a
+ Data.Text.Format.Heavy: Shown :: a -> Shown a
+ Data.Text.Format.Heavy: Single :: a -> Single a
+ Data.Text.Format.Heavy: ThenCheck :: c1 -> c2 -> ThenCheck c1 c2
+ Data.Text.Format.Heavy: [getSeveral] :: Several a -> [a]
+ Data.Text.Format.Heavy: [getSingle] :: Single a -> a
+ Data.Text.Format.Heavy: [shown] :: Shown a -> a
+ Data.Text.Format.Heavy: data DefaultValue
+ Data.Text.Format.Heavy: data Several a
+ Data.Text.Format.Heavy: data Shown a
+ Data.Text.Format.Heavy: data Single a
+ Data.Text.Format.Heavy: data ThenCheck c1 c2
+ Data.Text.Format.Heavy: format :: VarContainer vars => Format -> vars -> Text
+ Data.Text.Format.Heavy: optional :: VarContainer c => c -> WithDefault c
+ Data.Text.Format.Heavy: type WithDefault c = ThenCheck c DefaultValue
+ Data.Text.Format.Heavy: withDefault :: VarContainer c => c -> Variable -> WithDefault c
+ Data.Text.Format.Heavy.Types: appendFormat :: Format -> Format -> Format
+ Data.Text.Format.Heavy.Types: instance GHC.Base.Semigroup Data.Text.Format.Heavy.Types.Format

Files

Data/Text/Format/Heavy/Types.hs view
@@ -1,9 +1,17 @@-{-# LANGUAGE ExistentialQuantification, TypeFamilies, FlexibleContexts, OverloadedStrings #-}+{-# LANGUAGE ExistentialQuantification, TypeFamilies, FlexibleContexts, OverloadedStrings, CPP #-} -- | This module contains basic type definitions module Data.Text.Format.Heavy.Types where  import Data.Default++#if MIN_VERSION_base(4,9,0)+import Data.Monoid (Monoid)+import Data.Semigroup ((<>))+import qualified Data.Semigroup as Semigroup+#else import Data.Monoid+#endif+ import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Builder as B@@ -35,9 +43,26 @@ instance Show Format where   show (Format lst) = concat $ map show lst +appendFormat :: Format -> Format -> Format+appendFormat (Format xs) (Format ys) = Format (xs ++ ys)++#if MIN_VERSION_base(4,9,0)+instance Semigroup.Semigroup Format where+  (<>) = appendFormat+#endif+ instance Monoid Format where   mempty = Format []-  mappend (Format xs) (Format ys) = Format (xs ++ ys)++#if MIN_VERSION_base(4,11,0)+  -- starting with base-4.11, mappend definitions are redundant;+#elif MIN_VERSION_base(4,9,0)+  -- this is redundant starting with base-4.11 / GHC 8.4+  mappend = (Semigroup.<>)+#else+  -- prior to GHC 8.0 / base-4.9 where no `Semigroup` class existed+  mappend = appendFormat+#endif  -- | Can be used for different data types describing formats of specific types. class (Default f, Show f) => IsVarFormat f where
text-format-heavy.cabal view
@@ -1,5 +1,5 @@ name:                text-format-heavy-version:             0.1.5.1+version:             0.1.5.2 synopsis:            Full-weight string formatting library, analog of Python's string.format description:         This package contains full-featured string formatting function, similar to                      Python's string.format. Features include: