butcher 1.3.0.0 → 1.3.0.1
raw patch · 6 files changed
+49/−56 lines, 6 filesdep ~basedep ~bifunctorsdep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, bifunctors, containers, extra, free, mtl, multistate, pretty, transformers, unsafe, void
API changes (from Hackage documentation)
+ UI.Butcher.Monadic.Flag: instance Data.Semigroup.Semigroup (UI.Butcher.Monadic.Flag.Flag p)
+ UI.Butcher.Monadic.Param: instance Data.Semigroup.Semigroup (UI.Butcher.Monadic.Param.Param p)
- UI.Butcher.Monadic: cmd_out :: forall out_af6I. Lens' (CommandDesc out_af6I) (Maybe out_af6I)
+ UI.Butcher.Monadic: cmd_out :: forall out_aiBG. Lens' (CommandDesc out_aiBG) (Maybe out_aiBG)
- UI.Butcher.Monadic.Types: cmd_out :: forall out_af6I. Lens' (CommandDesc out_af6I) (Maybe out_af6I)
+ UI.Butcher.Monadic.Types: cmd_out :: forall out_aiBG. Lens' (CommandDesc out_aiBG) (Maybe out_aiBG)
Files
- ChangeLog.md +5/−0
- butcher.cabal +16/−38
- src/UI/Butcher/Monadic/Flag.hs +12/−6
- src/UI/Butcher/Monadic/Param.hs +12/−9
- src/UI/Butcher/Monadic/Pretty.hs +1/−1
- srcinc/prelude.inc +3/−2
ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for butcher +## 1.3.0.1 -- April 2018++* Support ghc-8.4+* Drop support for ghc<8+ ## 1.3.0.0 -- February 2018 * Experimental: Hidden commandparts (do not appear in help)
butcher.cabal view
@@ -1,12 +1,12 @@ name: butcher-version: 1.3.0.0+version: 1.3.0.1 synopsis: Chops a command or program invocation into digestable pieces. description: See the <https://github.com/lspitzner/butcher/blob/master/README.md README> (it is properly formatted on github). license: BSD3 license-file: LICENSE author: Lennart Spitzner maintainer: Lennart Spitzner <hexagoxel@hexagoxel.de>-copyright: Copyright (C) 2016-2017 Lennart Spitzner+copyright: Copyright (C) 2016-2018 Lennart Spitzner category: UI build-type: Simple Stability: experimental@@ -24,11 +24,6 @@ location: https://github.com/lspitzner/butcher.git } -flag butcher-dev- description: dev options- default: False- manual: True- library exposed-modules: UI.Butcher.Monadic.Types UI.Butcher.Monadic@@ -42,25 +37,21 @@ other-modules: UI.Butcher.Monadic.Internal.Types UI.Butcher.Monadic.Internal.Core build-depends:- { base >=4.8 && <4.11- , free- , unsafe+ { base >=4.9 && <4.12+ , free < 5.1+ , unsafe < 0.1 , microlens <0.5 , microlens-th <0.5- , multistate- , pretty- , containers- , transformers- , mtl- , extra- , void- , bifunctors- , deque+ , multistate >=0.8 && <0.9+ , pretty <1.2+ , containers <0.6+ , transformers <0.6+ , mtl <2.3+ , extra <1.7+ , void <0.8+ , bifunctors <5.6+ , deque <0.3 }- if flag(butcher-dev) {- build-depends:- hspec- } hs-source-dirs: src default-language: Haskell2010 default-extensions: {@@ -93,9 +84,6 @@ -fno-warn-unused-imports -fno-warn-orphans }- if flag(butcher-dev) {- ghc-options: -O0 -Werror -fprof-auto -fprof-cafs- } include-dirs: srcinc @@ -103,7 +91,7 @@ type: exitcode-stdio-1.0 default-language: Haskell2010 build-depends:- { base >=4.8 && <4.11+ { base <999 , butcher , free , unsafe@@ -116,14 +104,8 @@ , mtl , extra , deque+ , hspec }- if flag(butcher-dev) {- buildable: True- build-depends:- hspec- } else {- buildable: False- } ghc-options: -Wall main-is: TestMain.hs other-modules: @@ -149,7 +131,3 @@ -fno-warn-unused-imports -fno-warn-orphans }- if flag(butcher-dev) {- ghc-options: -Werror -fprof-auto -fprof-cafs -O0- }-
src/UI/Butcher/Monadic/Flag.hs view
@@ -80,14 +80,20 @@ , _flag_visibility :: Visibility } +appendFlag :: Flag p -> Flag p -> Flag p+appendFlag (Flag a1 b1 c1) (Flag a2 b2 c2) = Flag (a1 <|> a2)+ (b1 <|> b2)+ (appVis c1 c2)+ where+ appVis Visible Visible = Visible+ appVis _ _ = Hidden++instance Semigroup (Flag p) where+ (<>) = appendFlag+ instance Monoid (Flag p) where mempty = Flag Nothing Nothing Visible- Flag a1 b1 c1 `mappend` Flag a2 b2 c2 = Flag (a1 <|> a2)- (b1 <|> b2)- (appVis c1 c2)- where- appVis Visible Visible = Visible- appVis _ _ = Hidden+ mappend = appendFlag -- | Create a 'Flag' with just a help text. flagHelp :: PP.Doc -> Flag p
src/UI/Butcher/Monadic/Param.hs view
@@ -55,17 +55,20 @@ , _param_suggestions :: Maybe [CompletionItem] } +appendParam :: Param p -> Param p -> Param p+appendParam (Param a1 b1 c1) (Param a2 b2 c2) = Param (a1 `f` a2)+ (b1 `mappend` b2)+ (c1 `mappend` c2)+ where+ f Nothing x = x+ f x _ = x++instance Semigroup (Param p) where+ (<>) = appendParam+ instance Monoid (Param p) where mempty = Param Nothing Nothing Nothing- mappend (Param a1 b1 c1)- (Param a2 b2 c2)- = Param- (a1 `f` a2)- (b1 `mappend` b2)- (c1 `mappend` c2)- where- f Nothing x = x- f x _ = x+ mappend = appendParam -- | Create a 'Param' with just a help text. paramHelpStr :: String -> Param p
src/UI/Butcher/Monadic/Pretty.hs view
@@ -325,7 +325,7 @@ sgsDocs -> PP.parens $ PP.fcat $ PP.punctuate (PP.text "|") $ sgsDocs ++ [d] PartRedirect s _ -> Just $ PP.text s- PartMany p -> rec p <&> (<> PP.text "+")+ PartMany p -> rec p <&> (PP.<> PP.text "+") PartWithHelp _ p -> rec p PartReorder ps -> let flags = [ d | PartMany d <- ps ]
srcinc/prelude.inc view
@@ -123,6 +123,7 @@ import System.IO ( IO ) import Data.Proxy ( Proxy(..) ) import Data.Sequence ( Seq )+import Data.Semigroup ( Semigroup(..) ) import Data.Map ( Map ) import Data.Set ( Set )@@ -336,8 +337,7 @@ import Foreign.ForeignPtr ( ForeignPtr ) -import Data.Monoid ( (<>)- , mconcat+import Data.Monoid ( mconcat , Monoid (..) ) @@ -388,6 +388,7 @@ import Control.Monad.Trans.MultiRWS ( MonadMultiReader(..) , MonadMultiWriter(..) , MonadMultiState(..)+ , MonadMultiGet(..) ) import Control.Monad.Trans.MultiReader ( runMultiReaderTNil