packages feed

chorale 0.1.2 → 0.1.3

raw patch · 2 files changed

+8/−1 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Chorale.Common: infixr 8 .***
+ Chorale.Common: lookupBy :: Eq b => (a -> b) -> b -> [a] -> Maybe a

Files

chorale.cabal view
@@ -1,5 +1,5 @@ name:           chorale-version:        0.1.2+version:        0.1.3 homepage:       https://github.com/mocnik-science/chorale bug-reports:    https://github.com/mocnik-science/chorale/issues synopsis:       A module containing basic functions that the prelude does not offer
src/Chorale/Common.hs view
@@ -114,6 +114,7 @@     sortAndGroup,     sortAndGroupBy,     sortAndGroupLookupBy,+    lookupBy,     -- * List Operations     notNull,     takeWhileList,@@ -580,6 +581,12 @@ -- | sort and than group to a lookup table sortAndGroupLookupBy :: Ord b => (a -> b) -> [a] -> [(b, [a])] sortAndGroupLookupBy f = map (map21 (f . head, id)) . sortAndGroupBy f++-- | lookup by using a function+--+-- @lookupBy f b xs@ finds the element @x@ which satisfies @f x = b@+lookupBy :: Eq b => (a -> b) -> b -> [a] -> Maybe a+lookupBy f b = lookup b . map (map21 (f, id))  -- --== LIST OPERATIONS