Popularity
4.9
Growing
Activity
0.0
Stable
8
3
1
Monthly Downloads: 17
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Latest version: v1.0.1.0
composition-extra alternatives and similar packages
Based on the "Composition" category.
Alternatively, view composition-extra alternatives based on common mentions on social networks and blogs.
-
composition-tree
Composition trees for arbitrary monoids. -
composition
Combinators for unorthodox function composition in Haskell -
invertible
Haskell bidirectional arrows, bijective functions, and invariant functors -
Aoide
A simple music library with the capability of generating .ly and .mid files.
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of composition-extra or a related project?
Popular Comparisons
README
composition-extra
Some handy tools for working with algebraic structures.
Functors
We can fmap
more deeply with Applicative-style syntax:
(+1) <$$> [Just 1, Nothing, Just 2]
> [Just 2, Nothing, Just 3]
Likewise, via contravariant functors:
:t (-2) <-$$$> (Predicate $ (==) Predicate $ (==) Predicate $ (==) 5)
> :: ( Eq b
, Eq (Predicate b)
, Eq (Predicate (Predicate b))
, Num b
, Num (a -> Predicate b)
, Contravariant ((->) (Predicate (Predicate b) -> Bool))
) => Predicate (Predicate a)
(it's not that useful)
Functions
You can slyly prepend unanry functions to arbitrary arguments (contravariant function compositon):
before :: [q] -> d
func2 :: c -> d -> e
func3 :: b -> c -> d -> e
func4 :: a -> b -> c -> d -> e
before -.* func2 :: c -> [q] -> e
before -.** func3 :: b -> c -> [q] -> e
before -.*** func4 :: a -> b -> c -> [q] -> e
Monads
We can also do weird liftM
-ish, applicative-y stuff, too:
import Data.Compositon -- from the `compositon` package
(return .: (+)) ==<< mx =<< my
mx >>==== (return .:: func4) -- apply to 4th arg