Hello community, here is the log from the commit of package ghc-formatting for openSUSE:Factory checked in at 2017-04-25 08:58:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-formatting (Old) and /work/SRC/openSUSE:Factory/.ghc-formatting.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-formatting" Tue Apr 25 08:58:47 2017 rev:2 rq:490238 version:6.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-formatting/ghc-formatting.changes 2017-04-17 10:24:51.574549397 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-formatting.new/ghc-formatting.changes 2017-04-25 08:58:48.297857199 +0200 @@ -1,0 +2,10 @@ +Tue Nov 29 11:30:27 UTC 2016 - [email protected] + +- Update to version 6.2.4 with cabal2obs. + +------------------------------------------------------------------- +Sun Nov 6 21:26:14 UTC 2016 - [email protected] + +- Update to version 6.2.3 with cabal2obs. + +------------------------------------------------------------------- Old: ---- formatting-6.2.2.tar.gz New: ---- formatting-6.2.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-formatting.spec ++++++ --- /var/tmp/diff_new_pack.WEQkpG/_old 2017-04-25 08:58:48.905771241 +0200 +++ /var/tmp/diff_new_pack.WEQkpG/_new 2017-04-25 08:58:48.905771241 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-formatting # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,15 +18,14 @@ %global pkg_name formatting Name: ghc-%{pkg_name} -Version: 6.2.2 +Version: 6.2.4 Release: 0 Summary: Combinator-based type-safe formatting (like printf() or FORMAT) License: BSD-3-Clause -Group: System/Libraries +Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel -# Begin cabal-rpm deps: BuildRequires: ghc-clock-devel BuildRequires: ghc-old-locale-devel BuildRequires: ghc-rpm-macros @@ -35,7 +34,6 @@ BuildRequires: ghc-text-format-devel BuildRequires: ghc-time-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -# End cabal-rpm deps %description Combinator-based type-safe formatting (like printf() or FORMAT), modelled from @@ -55,15 +53,12 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install - %post devel %ghc_pkg_recache ++++++ formatting-6.2.2.tar.gz -> formatting-6.2.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatting-6.2.2/formatting.cabal new/formatting-6.2.4/formatting.cabal --- old/formatting-6.2.2/formatting.cabal 2015-07-13 17:39:25.000000000 +0200 +++ new/formatting-6.2.4/formatting.cabal 2016-11-24 16:17:11.000000000 +0100 @@ -1,5 +1,5 @@ name: formatting -version: 6.2.2 +version: 6.2.4 synopsis: Combinator-based type-safe formatting (like printf() or FORMAT) description: Combinator-based type-safe formatting (like printf() or FORMAT), modelled from the HoleyMonoids package. license: BSD3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatting-6.2.2/src/Formatting/Formatters.hs new/formatting-6.2.4/src/Formatting/Formatters.hs --- old/formatting-6.2.2/src/Formatting/Formatters.hs 2015-07-13 17:39:25.000000000 +0200 +++ new/formatting-6.2.4/src/Formatting/Formatters.hs 2016-11-03 16:37:33.000000000 +0100 @@ -1,5 +1,4 @@ {-# LANGUAGE RankNTypes #-} -{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -Wall #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatting-6.2.2/src/Formatting/Internal.hs new/formatting-6.2.4/src/Formatting/Internal.hs --- old/formatting-6.2.2/src/Formatting/Internal.hs 2015-07-13 17:39:25.000000000 +0200 +++ new/formatting-6.2.4/src/Formatting/Internal.hs 2016-11-24 16:14:07.000000000 +0100 @@ -19,12 +19,34 @@ import Prelude hiding ((.),id) import System.IO --- | A formatter. The @r@ type means the returned value at the --- end. The more formatters you compose, the more this wil build up --- arguments from @r@ to @Int -> r@ to @Char -> (Int -> r)@, etc. +-- | A formatter. When you construct formatters the first type +-- parameter, @r@, will remain polymorphic. The second type +-- parameter, @a@, will change to reflect the types of the data that +-- will be formatted. For example, in +-- +-- @ +-- myFormat :: Formatter r (Text -> Int -> r) +-- myFormat = \"Person's name is \" % text % \", age is \" % hex +-- @ +-- +-- the first type parameter remains polymorphic, and the second type +-- parameter is @Text -> Int -> r@, which indicates that it formats a +-- 'Text' and an 'Int'. +-- +-- When you run the 'Format', for example with 'format', you provide +-- the arguments and they will be formatted into a string. +-- +-- @ +-- \> format (\"Person's name is \" % text % \", age is \" % hex) \"Dave\" 54 +-- \"Person's name is Dave, age is 36\" +-- @ newtype Format r a = Format {runFormat :: (Builder -> r) -> a} +-- | Not particularly useful, but could be. +instance Functor (Format r) where + fmap f (Format k) = Format (\br -> f (k br)) + -- | Useful instance for applying two formatters to the same input -- argument. For example: @format (year <> "/" % month) now@ will -- yield @"2015/01"@. @@ -49,9 +71,38 @@ g `bind` \b -> now (a `mappend` b) --- | Composition operator. 'Format' is an instance of 'Category', but --- that is (at present) inconvenient to use with regular "Prelude". So --- this function is provided as a convenience. +-- | Concatenate two formatters. +-- +-- @formatter1 % formatter2@ is a formatter that accepts arguments for +-- @formatter1@ and @formatter2@ and concatenates their results. For example +-- +-- @ +-- format1 :: Format r (Text -> r) +-- format1 = \"Person's name is \" % text +-- @ +-- +-- @ +-- format2 :: Format r r +-- format2 = \", \" +-- @ +-- +-- @ +-- format3 :: Format r (Int -> r) +-- format3 = \"age is \" % hex +-- @ +-- +-- @ +-- myFormat :: Formatter r (Text -> Int -> r) +-- myFormat = format1 % format2 % format3 +-- @ +-- +-- Notice how the argument types of @format1@ and @format3@ are +-- gathered into the type of @myFormat@. +-- +-- (This is actually the composition operator for 'Format''s +-- 'Category' instance, but that is (at present) inconvenient to use +-- with regular "Prelude". So this function is provided as a +-- convenience.) (%) :: Format r a -> Format r' r -> Format r' a (%) = (.) infixr 9 % @@ -62,7 +113,7 @@ (%.) (Format a) (Format b) = Format (b . a) infixr 8 %. --- | Insert a constant monoidal value. +-- | Don't format any data, just output a constant 'Builder'. now :: Builder -> Format r r now a = Format ($ a) @@ -70,10 +121,13 @@ bind :: Format r a -> (Builder -> Format r' r) -> Format r' a m `bind` f = Format $ \k -> runFormat m (\a -> runFormat (f a) k) --- | Insert a function which accepts some argument and produces a --- 'Builder' which is appended to the output at the end. --- --- @later (f :: Int -> Builder)@ produces @Format r (Int -> r)@. +-- | Functorial map over a formatter's input. Example: @format (mapf (drop 1) string) \"hello\"@ +mapf :: (a -> b) -> Format r (b -> t) -> Format r (a -> t) +mapf f m = Format (\k -> runFormat m k . f) + +-- | Format a value of type @a@ using a function of type @a -> +-- 'Builder'@. For example, @later (f :: Int -> Builder)@ produces +-- @Format r (Int -> r)@. later :: (a -> Builder) -> Format r (a -> r) later f = Format (. f) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatting-6.2.2/src/Formatting/ShortFormatters.hs new/formatting-6.2.4/src/Formatting/ShortFormatters.hs --- old/formatting-6.2.2/src/Formatting/ShortFormatters.hs 2015-07-13 17:39:25.000000000 +0200 +++ new/formatting-6.2.4/src/Formatting/ShortFormatters.hs 2016-11-03 16:37:33.000000000 +0100 @@ -1,5 +1,4 @@ {-# LANGUAGE RankNTypes #-} -{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -Wall #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatting-6.2.2/src/Formatting/Time.hs new/formatting-6.2.4/src/Formatting/Time.hs --- old/formatting-6.2.2/src/Formatting/Time.hs 2015-07-13 17:39:25.000000000 +0200 +++ new/formatting-6.2.4/src/Formatting/Time.hs 2016-11-03 16:37:33.000000000 +0100 @@ -293,3 +293,7 @@ -- | Formatter call. Probably don't want to use this. fmt :: FormatTime a => Text -> a -> Text fmt f = T.pack . formatTime defaultTimeLocale (T.unpack f) + +-- | Helper for creating custom time formatters +customTimeFmt :: FormatTime a => Text -> Format r (a -> r) +customTimeFmt f = later (build . fmt f) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatting-6.2.2/src/Formatting.hs new/formatting-6.2.4/src/Formatting.hs --- old/formatting-6.2.2/src/Formatting.hs 2015-07-13 17:39:25.000000000 +0200 +++ new/formatting-6.2.4/src/Formatting.hs 2016-11-24 16:08:02.000000000 +0100 @@ -1,5 +1,4 @@ {-# LANGUAGE RankNTypes #-} -{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -Wall #-} @@ -26,6 +25,7 @@ (%.), now, later, + mapf, -- * Top-level functions format, sformat, @@ -40,4 +40,3 @@ import Formatting.Formatters import Formatting.Internal -
