ListLike 4.7.7 → 4.7.8
raw patch · 3 files changed
+15/−6 lines, 3 filesdep ~bytestringPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: bytestring
API changes (from Hackage documentation)
- Data.ListLike.Instances: instance GHC.Exts.IsList Data.ByteString.Internal.ByteString
- Data.ListLike.Instances: instance GHC.Exts.IsList Data.ByteString.Lazy.Internal.ByteString
Files
- ListLike.cabal +2/−2
- src/Data/ListLike/Base.hs +5/−4
- src/Data/ListLike/DList.hs +8/−0
ListLike.cabal view
@@ -1,5 +1,5 @@ Name: ListLike-Version: 4.7.7+Version: 4.7.8 License: BSD3 Maintainer: David Fox <dsf@seereason.com>, Andreas Abel Author: John Goerzen@@ -69,7 +69,7 @@ ,bytestring >= 0.9.1 && < 0.12 ,array >= 0.3 && < 0.6 ,text >= 0.11 && < 1.3 || == 2.0.*- ,vector >= 0.5 && < 0.13+ ,vector >= 0.5 && < 0.14 ,dlist >= 0.7 && < 1.1 ,fmlist >= 0.8 && < 0.10 ,utf8-string >= 0.3.1 && < 1.1
src/Data/ListLike/Base.hs view
@@ -513,10 +513,11 @@ {- | Like 'insert', but with a custom comparison function -} insertBy :: (item -> item -> Ordering) -> item -> full -> full- insertBy cmp x ys- | null ys = singleton x- | otherwise = case cmp x (head ys) of- GT -> cons (head ys) (insertBy cmp x (tail ys))+ insertBy cmp x ys =+ case uncons ys of+ Nothing -> singleton x+ Just (ys_head,ys_tail) -> case cmp x ys_head of+ GT -> cons ys_head (insertBy cmp x ys_tail) _ -> cons x ys ------------------------------ Generic Operations
src/Data/ListLike/DList.hs view
@@ -6,6 +6,8 @@ module Data.ListLike.DList () where +import qualified Prelude+ import Data.ListLike.Base import Data.ListLike.FoldableLL import Data.ListLike.String@@ -21,6 +23,7 @@ import Control.Category import Data.Char (Char) + instance FoldableLL (DList a) a where foldl = F.foldl foldr = D.foldr@@ -56,6 +59,11 @@ --toList = D.toList --fromList = D.fromList replicate = D.replicate+ uncons xs = case xs of+ D.Nil -> Prelude.Nothing+ D.Cons d_head l_tail -> Prelude.Just (d_head,fromList l_tail)+ _ -> Prelude.error "Workaround for missing COMPLETE pragma on dlist patterns"+ instance StringLike (DList Char) where toString = D.toList