coalpit 0.1.1.0 → 0.1.1.1
raw patch · 5 files changed
+26/−15 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Coalpit.Core: instance (Coalpit.Core.Coalpit a, Coalpit.Core.Coalpit (GHC.Base.Maybe a), GHC.Generics.Selector selA) => Coalpit.Core.GCoalpit (GHC.Generics.S1 selA (GHC.Generics.Rec0 (GHC.Base.Maybe a)))
- Coalpit.Core: instance Coalpit.Core.Coalpit a => Coalpit.Core.Coalpit (Data.List.NonEmpty.NonEmpty a)
- Coalpit.Core: instance Coalpit.Core.Coalpit a => Coalpit.Core.Coalpit (GHC.Base.Maybe a)
+ Coalpit.Core: instance (Coalpit.Core.Coalpit a, Coalpit.Core.Coalpit (GHC.Maybe.Maybe a), GHC.Generics.Selector selA) => Coalpit.Core.GCoalpit (GHC.Generics.S1 selA (GHC.Generics.Rec0 (GHC.Maybe.Maybe a)))
+ Coalpit.Core: instance (Coalpit.Core.GCoalpit a, Coalpit.Core.GCoalpit b) => Coalpit.Core.GCoalpit (a GHC.Generics.:+: b)
+ Coalpit.Core: instance Coalpit.Core.Coalpit a => Coalpit.Core.Coalpit (GHC.Base.NonEmpty a)
+ Coalpit.Core: instance Coalpit.Core.Coalpit a => Coalpit.Core.Coalpit (GHC.Maybe.Maybe a)
- Coalpit.Core: argHelper :: (Coalpit a, (GCoalpit (Rep a))) => Options -> [String] -> Proxy a -> Usage
+ Coalpit.Core: argHelper :: (Coalpit a, GCoalpit (Rep a)) => Options -> [String] -> Proxy a -> Usage
Files
- Coalpit.hs +4/−4
- Coalpit/Core.hs +13/−0
- README.md +4/−6
- coalpit.cabal +4/−4
- test/Test.hs +1/−1
Coalpit.hs view
@@ -4,10 +4,10 @@ Stability : unstable Portability : non-portable (uses GHC extensions) -Coalpit is a library for building "command-line program interfaces":-the goal is to get interfaces between programs quickly and easily,-while keeping them language-agnostic and more user- and shell-scripting-friendly than JSON and similar formats.+Coalpit is a library for building command-line interfaces: the goal is+to get interfaces quickly and easily, while keeping them+language-agnostic and more user- and shell scripting-friendly than+JSON and similar formats. == Example
Coalpit/Core.hs view
@@ -233,6 +233,19 @@ in USum (handleRecCon nameA opt path (Proxy :: Proxy (a p))) (handleRecCon nameB opt path (Proxy :: Proxy (b p))) +instance {-# OVERLAPPABLE #-}+ (GCoalpit a, GCoalpit b) => GCoalpit (a :+: b) where+ gArgParser opt =+ L1 <$> gArgParser opt+ <|>+ R1 <$> gArgParser opt+ gToArgs opt (L1 x) = gToArgs opt x+ gToArgs opt (R1 x) = gToArgs opt x+ gArgHelper opt path (Proxy :: Proxy ((a :+: b) p)) =+ -- let nameA = conName (undefined :: a p)+ -- in+ USum (gArgHelper opt path (Proxy :: Proxy (a p)))+ (gArgHelper opt path (Proxy :: Proxy (b p))) -- Record Selectors
README.md view
@@ -1,11 +1,9 @@ # Coalpit -Coalpit is a library for-building-[command-line program interfaces](https://defanor.uberspace.net/notes/command-line-program-interface.html):-the goal is to get interfaces between programs quickly and easily,-while keeping them language-agnostic and more user- and shell-scripting-friendly than JSON and similar formats.+Coalpit is a library for building command-line interfaces: the goal is+to get interfaces quickly and easily, while keeping them+language-agnostic and more user- and shell scripting-friendly than+JSON and similar formats. Given a type, it derives instances to print and parse it as command-line arguments or DSVs, as well as to compose usage
coalpit.cabal view
@@ -1,12 +1,12 @@ name: coalpit-version: 0.1.1.0+version: 0.1.1.1 synopsis: Command-line options and DSV parsing and printing description: This library generates parsers and printers for given data types, in the form of command-line arguments or DSVs – so that they can be used to- quickly get program interfaces via a shared- library, while being suitable for scripting and- as user interfaces.+ quickly get CLIs via a shared library, while+ being suitable for scripting and as user+ interfaces. license: BSD3 license-file: LICENSE author: defanor
test/Test.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE DeriveGeneric, DeriveAnyClass, RankNTypes #-} import GHC.Generics-import Generic.Random+import Generic.Random (genericArbitraryU) import Test.Tasty import Test.Tasty.QuickCheck as QC import Data.Proxy