registry 0.6.1.0 → 0.6.2.0
raw patch · 5 files changed
+19/−22 lines, 5 filesdep ~resourcetdep ~semigroupoidsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: resourcet, semigroupoids
API changes (from Hackage documentation)
- Data.Registry.Registry: (+:) :: Typeable a => Typed a -> Registry ins out -> Registry (Inputs a :++ ins) (Output a : out)
+ Data.Registry.Registry: (+:) :: Typeable a => Typed a -> Registry ins out -> Registry (Inputs a :++ ins) (Output a ': out)
- Data.Registry.Registry: register :: (Typeable a, IsSubset (Inputs a) out a) => Typed a -> Registry ins out -> Registry (Inputs a :++ ins) (Output a : out)
+ Data.Registry.Registry: register :: (Typeable a, IsSubset (Inputs a) out a) => Typed a -> Registry ins out -> Registry (Inputs a :++ ins) (Output a ': out)
- Data.Registry.Registry: registerUnchecked :: Typeable a => Typed a -> Registry ins out -> Registry (Inputs a :++ ins) (Output a : out)
+ Data.Registry.Registry: registerUnchecked :: Typeable a => Typed a -> Registry ins out -> Registry (Inputs a :++ ins) (Output a ': out)
Files
- README.md +4/−7
- registry.cabal +7/−7
- src/Data/Registry/Internal/Reflection.hs +5/−4
- src/Data/Registry/Internal/Types.hs +1/−1
- test/Test/Data/Registry/Internal/TypesSpec.hs +2/−3
README.md view
@@ -1,7 +1,4 @@-# Registry [](https://hackage.haskell.org/package/registry) [](https://github.com/etorreborre/registry/actions)---[](https://gitter.im/etorreborre/registry?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)+# Registry [](https://hackage.haskell.org/package/registry) [](https://github.com/etorreborre/registry/actions) ##### *It's functions all the way down* <img src="https://raw.githubusercontent.com/etorreborre/registry/main/doc/images/unboxed-bottomup.jpg" border="0"/> @@ -13,13 +10,13 @@ - fine tune encoders/decoders (see the [`registry-aeson`][registry-aeson] and the [`registry-messagepack`][registry-messagepack] projects) - create composable data generators for nested datatypes (see the [`registry-hedgehog`][registry-hedgehog] and the [`registry-hedgehog-aeson`][registry-hedgehog-aeson] projects) -You can watch a video presenting the main ideas behind the library [here](https://skillsmatter.com/skillscasts/12299-wire-once-rewire-twice).+You can watch a video presenting the main ideas behind the library [here](https://www.youtube.com/watch?v=xKgII4ggo-4). The following sections introduce in more details the problem that this library is addressing, the concepts behind the solution and various use-cases which can arise on real projects: 1. [what is the problem?][motivation]- 1. the concept of a [Registry][registry] and the resolution algorithm- 1. how does this [compare to monad transformers and effects](https://github.com/etorreborre/effects)?+ 2. the concept of a [Registry][registry] and the resolution algorithm+ 3. how does this [compare to monad transformers and effects](https://github.com/etorreborre/effects)? #### Tutorials
registry.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2.+-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack ----- hash: 58716f09f121c810611a3d1fcee02e0347cc257f2e77c051d7990b4367e346f4+-- hash: 9568d26be6fcc7db8f49f657416e44fd05b1b9edda84e722e6e7f3401c10ad32 name: registry-version: 0.6.1.0+version: 0.6.2.0 synopsis: data structure for assembling components description: This library provides a "Registry" which is a data structure containing a list of functions and values representing dependencies in a directed acyclic graph. A `make` function can then be used to create a value of a specific type out of the registry. You can start with the [README](https://github.com/etorreborre/registry/blob/master/README.md) for a full description of the library.@@ -71,8 +71,8 @@ , mtl >=2.0 && <3 , multimap >=1.0 && <2 , protolude >=0.2 && <0.4- , resourcet >=1.1 && <1.3- , semigroupoids >=5.0 && <5.4+ , resourcet >=1.1 && <2+ , semigroupoids >=5.0 && <7 , semigroups >=0.15 && <0.30 , template-haskell >=2.13 && <3.0 , text >=1.1 && <3@@ -148,8 +148,8 @@ , protolude >=0.2 && <0.4 , random <2.0 , registry- , resourcet >=1.1 && <1.3- , semigroupoids >=5.0 && <5.4+ , resourcet >=1.1 && <2+ , semigroupoids >=5.0 && <7 , semigroups <0.30 , tasty <1.5 , tasty-discover <6
src/Data/Registry/Internal/Reflection.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TypeInType #-}+{-# LANGUAGE PolyKinds #-}+{-# LANGUAGE DataKinds #-} -- | -- Utility functions to display or manipulate types@@ -94,10 +95,10 @@ -- | Tweak some standard module names for better display tweakNested :: Text -> Text-tweakNested "[] Char" = "String"+tweakNested "List Char" = "String" tweakNested n =- if "[] " `isPrefixOf` n- then "[" <> T.drop 3 n <> "]" -- special processing for lists+ if "List " `isPrefixOf` n+ then "[" <> T.drop 5 n <> "]" -- special processing for lists else n -- | This is an attempt to better render "nested" types like IO (Maybe Text)
src/Data/Registry/Internal/Types.hs view
@@ -448,7 +448,7 @@ -- See TypesSpec for some concrete examples. instance Ord SpecializationRange where SpecializationRange s1 e1 <= SpecializationRange s2 e2- | e1 /= s1 && e2 /= s2 = e1 <= e2 || (e1 == e2 && s1 <= s2)+ | e1 /= s1 && e2 /= s2 = e1 < e2 || (e1 == e2 && s1 <= s2) | e1 == s1 && e2 /= s2 = e1 < e2 | otherwise = e1 <= e2
test/Test/Data/Registry/Internal/TypesSpec.hs view
@@ -9,7 +9,7 @@ import Test.Tasty.Extensions -test_specialized_context_order = prop "there are preferrable specializations than other in a given context" $ do+test_specialized_context_order = prop "there are preferable specializations than others in a given context" $ do let c1 = Context (fmap (\t -> (t, Nothing)) $ [f, e, d, c, b, a]) let s1 = specializationRange c1 (Specialization (a :| [c]) (UntypedValue $ createValue A)) let s2 = specializationRange c1 (Specialization (a :| [e]) (UntypedValue $ createValue A))@@ -22,8 +22,7 @@ (s3 < s1) === True (s4 < s1) === True (s3 < s2) === True- (s4 < s2) === True- (s4 < s3) === True+ (s3 < s4) === True (s1 < s5) === True (s6 < s5) === True