packages feed

simpleconfig 0.0.1 → 0.0.5

raw patch · 4 files changed

+12/−11 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Config.Simple: instance Config.Simple.GLensForMember Config.Simple.CPartial (Data.Monoid.Last a) (GHC.Base.Maybe a)
+ Config.Simple: instance Config.Simple.GLensForMember Config.Simple.CPartial (Data.Monoid.Last a) (Data.Monoid.Last a)

Files

README.md view
@@ -4,4 +4,4 @@  * Install [bumpversion](https://github.com/peritus/bumpversion): `pip install bumpversion`. * Run `bumpversion major|minor|patch`.-* Run `git push --tags`.+* Run `git push --tags && git push`.
simpleconfig.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: d5a310c8f0c4aa16e1b8046c54841213c3110fb60919b3737484fbeb7c5cac12+-- hash: c67d10d1eb1bf920ba6216f194f8ebecca2f446b5969afddc4dcac33138a7283  name:                simpleconfig-version:             0.0.1+version:             0.0.5 synopsis:            Short description of your package homepage:            https://github.com/koterpillar/simpleconfig#readme bug-reports:         https://github.com/koterpillar/simpleconfig/issues
src/Config/Simple.hs view
@@ -49,7 +49,7 @@ type family ConfigLast a k where   ConfigLast a CPartial = Last a   ConfigLast a CComplete = a-  ConfigLast a (CLensFor CPartial root) = LensFor root (Maybe a)+  ConfigLast a (CLensFor CPartial root) = LensFor root (Last a)   ConfigLast a (CLensFor CComplete root) = LensFor root a  type family ConfigBool k where@@ -158,8 +158,8 @@ class GLensForMember k x y where   gLensLeaf :: proxy k -> Lens' x y -instance GLensForMember CPartial (Last a) (Maybe a) where-  gLensLeaf _ = iso getLast Last+instance GLensForMember CPartial (Last a) (Last a) where+  gLensLeaf _ = id  instance GLensForMember CPartial Any Bool where   gLensLeaf _ = iso getAny Any
test/Spec.hs view
@@ -11,12 +11,13 @@ import Control.Lens import Control.Monad +import Data.Foldable+import Data.Monoid (Last(..)) import Data.Set (Set) import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.IO as Text-import Data.Foldable  import Generics.Deriving.Monoid @@ -54,11 +55,11 @@ main :: IO () main = do   let config' =-        mempty & address' <>~ pure "Silverpond" & dryRun' .~ True & widgets' <>~-        Set.singleton "blah"+        mempty & (address' <>~ Last (Just "Silverpond")) & (dryRun' .~ True) &+        (widgets' <>~ Set.singleton "blah") &+        (address' <>~ Last (Just "SEEK"))   print config'   let (Just config) = fromPartialConfig config'   Text.putStrLn $ "Address = " <> config ^. address   when (config ^. dryRun) $ Text.putStrLn "Dry run"-  for_ (config ^. widgets) $ \widget ->-    Text.putStrLn $ "Widget = " <> widget+  for_ (config ^. widgets) $ \widget -> Text.putStrLn $ "Widget = " <> widget