function-builder 0.1.0.4 → 0.1.1.0
raw patch · 3 files changed
+16/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.FunctionBuilder: -- | The
+ Data.FunctionBuilder: class HasFunctionBuilder m a where {
+ Data.FunctionBuilder: toFunctionBuilder :: HasFunctionBuilder m a => a -> FunctionBuilder m (ToFunction m a next) next
+ Data.FunctionBuilder: type ToFunction m a next = next;
+ Data.FunctionBuilder: type family ToFunction m a next;
+ Data.FunctionBuilder: }
Files
- CHANGELOG.md +4/−0
- function-builder.cabal +1/−1
- src/Data/FunctionBuilder.hs +11/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.1.1.0++* Add a type class for function builders+ # 0.1.0.4 * Fix reference to the 'formatting' library
function-builder.cabal view
@@ -1,5 +1,5 @@ name: function-builder-version: 0.1.0.4+version: 0.1.1.0 synopsis: Create poly variadic functions for monoidal results description: Please see README.md homepage: https://github.com/sheyll/function-builder#readme
src/Data/FunctionBuilder.hs view
@@ -111,6 +111,7 @@ -- @Int -> (String -> other_next)@. -- (Note: For clarity I renamed the type local type parameter @next@ to @other_next@ from @fb2@) --+-- Also, there is the 'HasFunctionBuilder' type class for types that have function builders. newtype FunctionBuilder acc next f_make_next = FB {runFunctionBuilder :: (acc -> next) -> f_make_next } -- | Compose 'FunctionBuilder's such that the output function first takes all parameters@@ -332,3 +333,13 @@ -- Here the extra parameter @x@ is /pushed down/ into the @a@ of the @add@ 'FunctionBuilder'. mapNext :: (s -> r) -> FunctionBuilder m r a -> FunctionBuilder m s a mapNext outof (FB f) = FB (\k -> f (outof . k))+++-- | A type class for pairs of types that can be turned into 'FunctionBuilder's.+--+-- @since 0.1.1.0+class HasFunctionBuilder m a where+ -- | The+ type ToFunction m a next+ type ToFunction m a next = next+ toFunctionBuilder :: a -> FunctionBuilder m (ToFunction m a next) next