packages feed

fmt 0.6.1 → 0.6.1.1

raw patch · 4 files changed

+14/−5 lines, 4 filesdep ~hspecPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: hspec

API changes (from Hackage documentation)

- Fmt.Internal.Core: instance (a ~ ()) => Fmt.Internal.Core.FromBuilder (GHC.Types.IO a)
- Fmt.Internal.Core: instance (a ~ GHC.Types.Char) => Fmt.Internal.Core.FromBuilder [a]
- Fmt.Internal.Generic: instance Fmt.Internal.Generic.Buildable' a => Fmt.Internal.Generic.Buildable' (GHC.Base.Maybe a)
+ Fmt.Internal.Core: instance (a Data.Type.Equality.~ ()) => Fmt.Internal.Core.FromBuilder (GHC.Types.IO a)
+ Fmt.Internal.Core: instance (a Data.Type.Equality.~ GHC.Types.Char) => Fmt.Internal.Core.FromBuilder [a]
+ Fmt.Internal.Generic: instance Fmt.Internal.Generic.Buildable' a => Fmt.Internal.Generic.Buildable' (GHC.Maybe.Maybe a)
- Fmt: (+|) :: (FromBuilder b) => Builder -> Builder -> b
+ Fmt: (+|) :: FromBuilder b => Builder -> Builder -> b
- Fmt: (+||) :: (FromBuilder b) => Builder -> Builder -> b
+ Fmt: (+||) :: FromBuilder b => Builder -> Builder -> b
- Fmt: baseF :: Integral a => Int -> a -> Builder
+ Fmt: baseF :: (HasCallStack, Integral a) => Int -> a -> Builder
- Fmt: format :: FormatType r => Format -> r
+ Fmt: format :: (HasCallStack, FormatType r) => Format -> r
- Fmt: formatLn :: FormatType r => Format -> r
+ Fmt: formatLn :: (HasCallStack, FormatType r) => Format -> r
- Fmt: jsonListF' :: forall f a. (Foldable f) => (a -> Builder) -> f a -> Builder
+ Fmt: jsonListF' :: forall f a. Foldable f => (a -> Builder) -> f a -> Builder
- Fmt: listF' :: (Foldable f) => (a -> Builder) -> f a -> Builder
+ Fmt: listF' :: Foldable f => (a -> Builder) -> f a -> Builder
- Fmt.Internal.Core: (+|) :: (FromBuilder b) => Builder -> Builder -> b
+ Fmt.Internal.Core: (+|) :: FromBuilder b => Builder -> Builder -> b
- Fmt.Internal.Core: (+||) :: (FromBuilder b) => Builder -> Builder -> b
+ Fmt.Internal.Core: (+||) :: FromBuilder b => Builder -> Builder -> b
- Fmt.Internal.Formatters: jsonListF' :: forall f a. (Foldable f) => (a -> Builder) -> f a -> Builder
+ Fmt.Internal.Formatters: jsonListF' :: forall f a. Foldable f => (a -> Builder) -> f a -> Builder
- Fmt.Internal.Formatters: listF' :: (Foldable f) => (a -> Builder) -> f a -> Builder
+ Fmt.Internal.Formatters: listF' :: Foldable f => (a -> Builder) -> f a -> Builder
- Fmt.Internal.Numeric: baseF :: Integral a => Int -> a -> Builder
+ Fmt.Internal.Numeric: baseF :: (HasCallStack, Integral a) => Int -> a -> Builder
- Fmt.Internal.Template: format :: FormatType r => Format -> r
+ Fmt.Internal.Template: format :: (HasCallStack, FormatType r) => Format -> r
- Fmt.Internal.Template: formatLn :: FormatType r => Format -> r
+ Fmt.Internal.Template: formatLn :: (HasCallStack, FormatType r) => Format -> r

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.6.1.1++* Added `HasCallStack` to partial functions.+ # 0.6.1  * Added `instance FromBuilder ByteString` (for both lazy and strict
fmt.cabal view
@@ -1,5 +1,5 @@ name:                fmt-version:             0.6.1+version:             0.6.1.1 synopsis:            A new formatting library description:   A new formatting library that tries to be simple to understand while still@@ -46,7 +46,7 @@ maintainer:          yom@artyom.me -- copyright: category:            Text-tested-with:         GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.1+tested-with:         GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.2 build-type:          Simple extra-source-files:  CHANGELOG.md                      tests/doctest-config.json@@ -70,6 +70,7 @@   build-depends:       base >=4.6 && <5,                        base64-bytestring,                        bytestring,+                       call-stack,                        containers,                        formatting >= 6.3.4,                        microlens >= 0.3,
lib/Fmt/Internal/Numeric.hs view
@@ -1,10 +1,12 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE CPP #-}   module Fmt.Internal.Numeric where  +import           Data.CallStack #if __GLASGOW_HASKELL__ < 804 import           Data.Monoid ((<>)) #endif@@ -51,7 +53,7 @@ >>> baseF 36 10000 "7ps" -}-baseF :: Integral a => Int -> a -> Builder+baseF :: (HasCallStack, Integral a) => Int -> a -> Builder baseF numBase = build . atBase numBase  ----------------------------------------------------------------------------
lib/Fmt/Internal/Template.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-}  @@ -9,6 +10,7 @@ module Fmt.Internal.Template where  +import Data.CallStack import Data.String (IsString(..)) import Data.Text (Text, splitOn) import Data.Text.Lazy.Builder hiding (fromString)@@ -35,13 +37,13 @@ >>> format "0x{} + 0x{} = 0x{}" (hexF 130) (hexF 270) (hexF (130+270)) 0x82 + 0x10e = 0x190 -}-format :: FormatType r => Format -> r+format :: (HasCallStack, FormatType r) => Format -> r format f = format' f [] {-# INLINE format #-}  {- | Like 'format', but adds a newline. -}-formatLn :: FormatType r => Format -> r+formatLn :: (HasCallStack, FormatType r) => Format -> r formatLn f = format' (f <> "\n") [] {-# INLINE formatLn #-}