-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple Data Processing -- -- SDP provides generalized interface for simple data operations. @package sdp @version 0.2.1 -- | Control.Exception.SDP - service module that provide some useful -- exceptions. Note that SDP.SafePrelude doesn't export this -- module. module Control.Exception.SDP -- | A UnreachableException is used as an exception that should -- never be thrown. -- -- Example: newArray# requires a default value to fill the newly -- created array. If the array is guaranteed to be filled with values -- (for example, in the replicate function), then this value -- will never be needed and, therefore, calculated. -- UnreachableException in this case will be a marker of -- unreachability of this expression. data UnreachableException UnreachableException :: String -> UnreachableException -- | IndexException replaces the less informative -- ArrayException and has more neutral names. -- -- -- -- If the error type may depend on the check order, it should be -- indicated in the documentation. For example: overflow is checked -- first, and then underflow. But if an overflow is detected, underflow -- may not be noticed. IndexException constructor order is the -- recommended order. data IndexException UnacceptableExpansion :: String -> IndexException UndefinedValue :: String -> IndexException UnexpectedRank :: String -> IndexException IndexUnderflow :: String -> IndexException IndexOverflow :: String -> IndexException EmptyRange :: String -> IndexException instance GHC.Classes.Eq Control.Exception.SDP.IndexException instance GHC.Classes.Eq Control.Exception.SDP.UnreachableException instance GHC.Show.Show Control.Exception.SDP.UnreachableException instance GHC.Exception.Type.Exception Control.Exception.SDP.UnreachableException instance GHC.Show.Show Control.Exception.SDP.IndexException instance GHC.Exception.Type.Exception Control.Exception.SDP.IndexException -- | SDP.Comparing provide common comparators and combinators. module SDP.Comparing -- | Equal is just synonym of (e -> e -> Bool). type Equal e = e -> e -> Bool -- | Compare is just synonym of (e -> e -> Ordering). type Compare e = e -> e -> Ordering -- | Spaceship operator - infix version of compare. (<=>) :: Ord o => Compare o infixl 4 <=> -- | Compare tuples by first elements. eqfst :: Eq e => Equal (e, s) -- | Compare tuples by second elements. eqsnd :: Eq e => Equal (f, e) -- | Compare tuples by first elements. cmpfst :: Ord o => Compare (o, s) -- | Compare tuples by second elements. cmpsnd :: Ord o => Compare (f, o) -- | Common compare combinator invertcmp :: Compare e -> Compare e -- | SDP.Estimate provides Estimate class, type synonyms and -- some common comparators. This module is exported by -- SDP.SafePrelude. module SDP.Estimate -- | Estimate class provides the lazy comparsion structures by -- length. -- -- For some types (e.g., lists), this allows you to speed up the -- comparison or make it finite. For others (e.g., arrays), it may be -- convenient abbreviation. class Estimate e -- | Compare structure length with given number. (<.=>) :: Estimate e => e -> Int -> Ordering -- | Compare pair of structures by length. (<==>) :: Estimate e => Compare e -- | Compare structure length with given number. (.==) :: Estimate e => e -> Int -> Bool -- | Compare structure length with given number. (./=) :: Estimate e => e -> Int -> Bool -- | Compare structure length with given number. (.<=) :: Estimate e => e -> Int -> Bool -- | Compare structure length with given number. (.>=) :: Estimate e => e -> Int -> Bool -- | Compare structure length with given number. (.<) :: Estimate e => e -> Int -> Bool -- | Compare structure length with given number. (.>) :: Estimate e => e -> Int -> Bool -- | Compare pair of structures by length. (.<.) :: Estimate e => e -> e -> Bool -- | Compare pair of structures by length. (.>.) :: Estimate e => e -> e -> Bool -- | Compare pair of structures by length. (.<=.) :: Estimate e => e -> e -> Bool -- | Compare pair of structures by length. (.>=.) :: Estimate e => e -> e -> Bool -- | Compare pair of structures by length. (.==.) :: Estimate e => e -> e -> Bool -- | Compare pair of structures by length. (./=.) :: Estimate e => e -> e -> Bool infixl 4 <==> infixl 4 .<. infixl 4 .>. infixl 4 .<=. infixl 4 .>=. infixl 4 .==. infixl 4 ./=. infixl 4 <.=> infixl 4 .< infixl 4 .> infixl 4 .<= infixl 4 .>= infixl 4 .== infixl 4 ./= -- | (Type -> Type) kind Estimate. type Estimate1 rep e = Estimate (rep e) -- | (Type -> Type -> Type) kind Estimate. type Estimate2 rep i e = Estimate (rep i e) -- | Estimate quantified contraint for (Type -> -- Type)-kind types. type Estimate' rep = forall e. Estimate (rep e) -- | Estimate quantified contraint for (Type -> Type -> -- Type)-kind types. type Estimate'' rep = forall i e. Estimate (rep i e) -- | Compare given number with structure length. (<=.>) :: Estimate e => Int -> e -> Ordering infixl 4 <=.> -- | Compare given number with structure length. (<.) :: Estimate e => Int -> e -> Bool infixl 4 <. -- | Compare given number with structure length. (>.) :: Estimate e => Int -> e -> Bool infixl 4 >. -- | Compare given number with structure length. (<=.) :: Estimate e => Int -> e -> Bool infixl 4 <=. -- | Compare given number with structure length. (>=.) :: Estimate e => Int -> e -> Bool infixl 4 >=. -- | Compare given number with structure length. (==.) :: Estimate e => Int -> e -> Bool infixl 4 ==. -- | Compare given number with structure length. (/=.) :: Estimate e => Int -> e -> Bool infixl 4 /=. instance SDP.Estimate.Estimate [a] -- | SDP.Nullable provides Nullable - class of types with -- empty values. module SDP.Nullable -- | Nullable is class of types which have empty values. -- -- Nullable instances must follow some rules: -- --
--   isNull Z === True
--   x == Z ==> isNull x == True
--   x == y === isNull x == isNull y
--   
--   -- For Foldable instances
--   toList Z === []
--   fold   Z === mempty
--   isNull x === null x
--   isNull x === length x == 0
--   
--   sum      Z === 0
--   product  Z === 1
--   elem   x Z === False
--   foldr  f Z === foldl  f Z === id
--   foldr1 f Z === foldl1 f Z === undefined
--   
--   
class Nullable e -- | Empty value. lzero :: Nullable e => e -- | Empty value. lzero :: (Nullable e, Monoid e) => e -- | Is value empty? isNull :: Nullable e => e -> Bool -- | Is value empty? isNull :: (Nullable e, Eq e) => e -> Bool -- | Nullable contraint for (Type -> Type)-kind types. type Nullable1 rep e = Nullable (rep e) -- | Nullable contraint for (Type -> Type -> -- Type)-kind types. type Nullable2 rep i e = Nullable (rep i e) -- | Nullable contraint for (Type -> Type)-kind types. type Nullable' rep = forall e. Nullable (rep e) -- | Nullable contraint for (Type -> Type -> -- Type)-kind types. type Nullable'' rep = forall i e. Nullable (rep i e) -- | Originally defined in sdp-ctypes (now sdp-foreign), -- same as Z now. pattern NULL :: Nullable e => e -- | Other empty value pattern: Z === NULL. -- -- Defined in SDP.Nullable since sdp-0.2.1, earlier - in -- SDP.Linear. pattern Z :: Nullable e => e instance SDP.Nullable.Nullable (GHC.Maybe.Maybe e) instance SDP.Nullable.Nullable [e] instance SDP.Nullable.Nullable (GHC.Ptr.Ptr e) instance SDP.Nullable.Nullable (GHC.ForeignPtr.ForeignPtr e) instance SDP.Nullable.Nullable (GHC.Stable.StablePtr e) instance SDP.Nullable.Nullable (GHC.Ptr.FunPtr e) -- | SDP.Ratio provides (:%) pattern for -- Ratio. module SDP.Ratio -- | Crutch pattern: real (:%) is closed Ratio constructor. pattern (:%) :: Integral a => a -> a -> Ratio a infixl 7 :% -- | SDP.SafePrelude module re-exports common Prelude -- definitions except those overridden in this library and its extensions -- (e.g. sdp-io). -- -- In addition, this module re-exports the most common definitions from -- other base and sdp modules -- (Control.Applicative, Data.Bifunctor, -- SDP.Estimate, etc.) and some useful combinators that were used -- in this library and may be useful to its users. -- -- Import Prelude without conflicting functions, may require -- additional imports for functions overridden in other modules: -- --
--   import Prelude ()
--   import SDP.SafePrelude
--   
module SDP.SafePrelude -- | Ternary operator. -- --
--   (odd 1 ? "is True" $ "is False") == "is True"
--   
(?) :: Bool -> a -> a -> a infixr 1 ? -- | p ?+ f $ a returns Just (f a) if (p -- a) and Nothing otherwise. (?+) :: (a -> Bool) -> (a -> b) -> a -> Maybe b infixl 8 ?+ -- | p ?- f $ a returns Nothing if (p a) and -- Just (f a) otherwise. (?-) :: (a -> Bool) -> (a -> b) -> a -> Maybe b infixl 8 ?- -- | Prepends Maybe to list. (?:) :: Maybe a -> [a] -> [a] -- | Short version of fromMaybe. (+?) :: a -> Maybe a -> a -- | (...) = (.) . (.). (...) :: (c -> d) -> (a -> b -> c) -> a -> b -> d infixr 0 ... -- | Lifted (?). (?^) :: Monad m => m Bool -> m a -> m a -> m a infixr 1 ?^ -- | Monadic version of (...). (<=<<) :: Monad m => (c -> m d) -> (a -> b -> m c) -> a -> b -> m d -- | Monadic vesion of (...) with reversed arguments. (>>=>) :: Monad m => (a -> b -> m c) -> (c -> m d) -> a -> b -> m d -- | ma >>=<< mb is composition of join and -- liftM2. (>>=<<) :: Monad m => m a -> m b -> (a -> b -> m c) -> m c -- | Very useful combinator. liftA4 :: Applicative t => (a -> b -> c -> d -> e) -> t a -> t b -> t c -> t d -> t e -- | Very very useful combinator liftA5 :: Applicative t => (a -> b -> c -> d -> e -> f) -> t a -> t b -> t c -> t d -> t e -> t f -- | An even more useful combinator. liftA6 :: Applicative t => (a -> b -> c -> d -> e -> f -> g) -> t a -> t b -> t c -> t d -> t e -> t f -> t g -- | See liftA6. liftM6 :: Monad m => (a -> b -> c -> d -> e -> f -> g) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -- | stToMIO is just liftIO . stToIO. stToMIO :: MonadIO io => ST RealWorld e -> io e -- | SDP.Finite provide generalized finite-dimensional index type -- (:&) based on repa (:.). -- -- Since sdp-0.2, for (:&) available -- OverloadedLists-based syntactic sugar. For example, instead -- of the inconvenient es!(ind4 0 1 2 3) or just awful -- es!(E:&0:&1:&1:&2:&3) you can write: -- es![0, 1, 2, 3]. -- -- Note that OverloadedLists instances requires a strictly -- defined number of subindexes. module SDP.Finite -- | Service type, that represents zero-dimensional index. data E E :: E -- | N-dimensional index type. The type (head :& tail) allows working -- with any finite dimension number. data tail :& head (:&) :: !tail -> !head -> (:&) tail head -- | 1-dimensional index ((E :& i) without -- TypeOperators). type I1 i = E :& i -- | 2-dimensional index type I2 i = E :& i :& i -- | 3-dimensional index type I3 i = (I2 i) :& i -- | 4-dimensional index type I4 i = (I3 i) :& i -- | 5-dimensional index type I5 i = (I4 i) :& i -- | 6-dimensional index type I6 i = (I5 i) :& i -- | 7-dimensional index type I7 i = (I6 i) :& i -- | 8-dimensional index type I8 i = (I7 i) :& i -- | 9-dimensional index type I9 i = (I8 i) :& i -- | 10-dimensional index type I10 i = (I9 i) :& i -- | 11-dimensional index type I11 i = (I10 i) :& i -- | 12-dimensional index type I12 i = (I11 i) :& i -- | 13-dimensional index type I13 i = (I12 i) :& i -- | 14-dimensional index type I14 i = (I13 i) :& i -- | 15-dimensional index type I15 i = (I14 i) :& i -- | 2-dimensional index constructor. ind2 :: i -> i -> I2 i -- | 3-dimensional index constructor. ind3 :: i -> i -> i -> I3 i -- | 4-dimensional index constructor. ind4 :: i -> i -> i -> i -> I4 i -- | 5-dimensional index constructor. ind5 :: i -> i -> i -> i -> i -> I5 i -- | 6-dimensional index constructor. ind6 :: i -> i -> i -> i -> i -> i -> I6 i -- | 7-dimensional index constructor. ind7 :: i -> i -> i -> i -> i -> i -> i -> I7 i -- | 8-dimensional index constructor. ind8 :: i -> i -> i -> i -> i -> i -> i -> i -> I8 i -- | 9-dimensional index constructor. ind9 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> I9 i -- | 10-dimensional index constructor. ind10 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> I10 i -- | 11-dimensional index constructor. ind11 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> I11 i -- | 12-dimensional index constructor. ind12 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> I12 i -- | 13-dimensional index constructor. ind13 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> I13 i -- | 14-dimensional index constructor. ind14 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> I14 i -- | 15-dimensional index constructor. ind15 :: i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> i -> I15 i instance GHC.Read.Read SDP.Finite.E instance GHC.Show.Show SDP.Finite.E instance GHC.Classes.Ord SDP.Finite.E instance GHC.Classes.Eq SDP.Finite.E instance (GHC.Classes.Ord tail, GHC.Classes.Ord head) => GHC.Classes.Ord (tail SDP.Finite.:& head) instance (GHC.Classes.Eq tail, GHC.Classes.Eq head) => GHC.Classes.Eq (tail SDP.Finite.:& head) instance GHC.Enum.Enum i => GHC.Enum.Enum (SDP.Finite.E SDP.Finite.:& i) instance (Data.Default.Class.Default d, Data.Default.Class.Default d') => Data.Default.Class.Default (d SDP.Finite.:& d') instance (GHC.Exts.IsList (i' SDP.Finite.:& i), GHC.Exts.Item (i' SDP.Finite.:& i) ~ i, GHC.Show.Show i) => GHC.Show.Show (i' SDP.Finite.:& i) instance (GHC.Exts.IsList (i' SDP.Finite.:& i), GHC.Exts.Item (i' SDP.Finite.:& i) ~ i, GHC.Read.Read i) => GHC.Read.Read (i' SDP.Finite.:& i) instance GHC.Exts.IsList (SDP.Finite.E SDP.Finite.:& i) instance (GHC.Exts.Item (i' SDP.Finite.:& i) ~ i, GHC.Exts.IsList (i' SDP.Finite.:& i)) => GHC.Exts.IsList ((i' SDP.Finite.:& i) SDP.Finite.:& i) instance Data.Default.Class.Default SDP.Finite.E instance GHC.Exts.IsList SDP.Finite.E instance SDP.Nullable.Nullable SDP.Finite.E -- | SDP.SortM provides SortM - class of sortable mutable -- structures. module SDP.SortM -- | SortM is class of sortable mutable structures. class SortM m s e | s -> m, s -> e -- | Checks if structure is already sorted. Should always return -- True for structures with less than 2 elements. sortedMBy :: SortM m s e => (e -> e -> Bool) -> s -> m Bool -- | sortMBy is common sorting algorithm. sortMBy :: SortM m s e => Compare e -> s -> m () -- | SortM contraint for (Type -> Type)-kind types. type SortM1 m s e = SortM m (s e) e -- | SortM contraint for (Type -> Type -> Type)-kind -- types. type SortM2 m s i e = SortM m (s i e) -- | SortM quantified contraint for (Type -> Type)-kind -- types. type SortM' m s = forall e. SortM m (s e) e -- | SortM quantified contraint for (Type -> Type -> -- Type)-kind types. type SortM'' m s = forall i e. SortM m (s i e) -- | sortM is just sortMBy compare sortM :: (SortM m s e, Ord e) => s -> m () -- | Sort by comparing the results of a key function applied to each -- element. sortMOn :: (SortM m s e, Ord o) => (e -> o) -> s -> m () -- | Checks if the structure is sorted. sortedM :: (SortM m s e, Ord e) => s -> m Bool -- | Sort by comparing the results of a given function applied to each -- element. sortedMOn :: (SortM m s e, Ord o) => (e -> o) -> s -> m Bool -- | SDP.Tuple provides tuple type synonyms. module SDP.Tuple -- | Tuple synonym type T2 i = (i, i) -- | Tuple synonym type T3 i = (i, i, i) -- | Tuple synonym type T4 i = (i, i, i, i) -- | Tuple synonym type T5 i = (i, i, i, i, i) -- | Tuple synonym type T6 i = (i, i, i, i, i, i) -- | Tuple synonym type T7 i = (i, i, i, i, i, i, i) -- | Tuple synonym type T8 i = (i, i, i, i, i, i, i, i) -- | Tuple synonym type T9 i = (i, i, i, i, i, i, i, i, i) -- | Tuple synonym type T10 i = (i, i, i, i, i, i, i, i, i, i) -- | Tuple synonym type T11 i = (i, i, i, i, i, i, i, i, i, i, i) -- | Tuple synonym type T12 i = (i, i, i, i, i, i, i, i, i, i, i, i) -- | Tuple synonym type T13 i = (i, i, i, i, i, i, i, i, i, i, i, i, i) -- | Tuple synonym type T14 i = (i, i, i, i, i, i, i, i, i, i, i, i, i, i) -- | Tuple synonym type T15 i = (i, i, i, i, i, i, i, i, i, i, i, i, i, i, i) -- | Return all first elements in pairs. fsts :: Functor f => f (a, b) -> f a -- | Return all first elements in pairs. snds :: Functor f => f (a, b) -> f b -- | Applies function to both elements of pair. both :: (a -> b) -> (a, a) -> (b, b) -- | SDP.Shape module provides Shape - class of generalized -- indices. module SDP.Shape -- | Shape is service class that constraints Index. -- -- Rules: -- --
--   rank i == rank   (j `asTypeOf` i)
--   rank i == length (sizes (i, i))
--   
-- --
--   rank (lastDim E) = 0
--   rank (lastDim i) = 1
--   rank (initDim E) = 0
--   rank (lastDim i) = rank i - 1
--   
-- --
--   fromGIndex . toGIndex = id
--   toGIndex . fromGIndex = id
--   
class Shape i where { -- | Type of index top dimension. type family DimLast i :: Type; -- | The type of subspace of rank n - 1, where n -- is the rank of the space specified by this Index type. type family DimInit i :: Type; type DimLast i = i; type DimInit i = E; } -- | Create index from generalized index. fromGIndex :: (Shape i, RANK1 i) => GIndex i -> i -- | Create index from generalized index. fromGIndex :: Shape i => GIndex i -> i -- | Create generalized index from index. toGIndex :: (Shape i, RANK1 i) => i -> GIndex i -- | Create generalized index from index. toGIndex :: Shape i => i -> GIndex i -- | Count of dimensions in represented space (must be finite and -- constant). rank :: Shape i => i -> Int -- | Add new dimension. consDim :: (Shape i, DimLast i ~~ i) => DimInit i -> DimLast i -> i -- | Add new dimension. consDim :: Shape i => DimInit i -> DimLast i -> i initDim :: (Shape i, DimInit i ~~ E) => i -> DimInit i initDim :: Shape i => i -> DimInit i lastDim :: (Shape i, DimLast i ~~ i) => i -> DimLast i lastDim :: Shape i => i -> DimLast i unconsDim :: Shape i => i -> (DimInit i, DimLast i) -- | Type operator GIndex returns generalized equivalent of index. type family GIndex i -- | Convert any index type bounds to generalized index bounds. toGBounds :: Shape i => (i, i) -> (GIndex i, GIndex i) -- | Convert generalized index bounds to any index type bounds. fromGBounds :: Shape i => (GIndex i, GIndex i) -> (i, i) -- | A constraint corresponding to rank 0 indices (E). type RANK0 i = i ~~ E -- | The restriction corresponding to rank indices 1 (сhecks -- GIndex). type RANK1 i = GIndex i ~~ (E :& i) -- | The restriction corresponding to rank indices 2 (сhecks -- GIndex). type RANK2 i = GIndex i ~~ I2 i -- | The restriction corresponding to rank indices 3 (сhecks -- GIndex). type RANK3 i = GIndex i ~~ I3 i -- | The restriction corresponding to rank indices 4 (сhecks -- GIndex). type RANK4 i = GIndex i ~~ I4 i -- | The restriction corresponding to rank indices 5 (сhecks -- GIndex). type RANK5 i = GIndex i ~~ I5 i -- | The restriction corresponding to rank indices 6 (сhecks -- GIndex). type RANK6 i = GIndex i ~~ I6 i -- | The restriction corresponding to rank indices 7 (сhecks -- GIndex). type RANK7 i = GIndex i ~~ I7 i -- | The restriction corresponding to rank indices 8 (сhecks -- GIndex). type RANK8 i = GIndex i ~~ I8 i -- | The restriction corresponding to rank indices 9 (сhecks -- GIndex). type RANK9 i = GIndex i ~~ I9 i -- | The restriction corresponding to rank indices 10 (сhecks -- GIndex). type RANK10 i = GIndex i ~~ I10 i -- | The restriction corresponding to rank indices 11 (сhecks -- GIndex). type RANK11 i = GIndex i ~~ I11 i -- | The restriction corresponding to rank indices 12 (сhecks -- GIndex). type RANK12 i = GIndex i ~~ I12 i -- | The restriction corresponding to rank indices 13 (сhecks -- GIndex). type RANK13 i = GIndex i ~~ I13 i -- | The restriction corresponding to rank indices 14 (сhecks -- GIndex). type RANK14 i = GIndex i ~~ I14 i -- | The restriction corresponding to rank indices 15 (сhecks -- GIndex). type RANK15 i = GIndex i ~~ I15 i instance SDP.Shape.Shape SDP.Finite.E instance SDP.Shape.Shape () instance SDP.Shape.Shape GHC.Types.Char instance SDP.Shape.Shape GHC.Integer.Type.Integer instance SDP.Shape.Shape GHC.Types.Int instance SDP.Shape.Shape GHC.Int.Int8 instance SDP.Shape.Shape GHC.Int.Int16 instance SDP.Shape.Shape GHC.Int.Int32 instance SDP.Shape.Shape GHC.Int.Int64 instance SDP.Shape.Shape GHC.Types.Word instance SDP.Shape.Shape GHC.Word.Word8 instance SDP.Shape.Shape GHC.Word.Word16 instance SDP.Shape.Shape GHC.Word.Word32 instance SDP.Shape.Shape GHC.Word.Word64 instance SDP.Shape.Shape Foreign.C.Types.CChar instance SDP.Shape.Shape Foreign.C.Types.CUChar instance SDP.Shape.Shape Foreign.C.Types.CSChar instance SDP.Shape.Shape Foreign.C.Types.CWchar instance SDP.Shape.Shape Foreign.C.Types.CShort instance SDP.Shape.Shape Foreign.C.Types.CUShort instance SDP.Shape.Shape Foreign.C.Types.CInt instance SDP.Shape.Shape Foreign.C.Types.CUInt instance SDP.Shape.Shape Foreign.C.Types.CLong instance SDP.Shape.Shape Foreign.C.Types.CLLong instance SDP.Shape.Shape Foreign.C.Types.CULong instance SDP.Shape.Shape Foreign.C.Types.CULLong instance SDP.Shape.Shape Foreign.C.Types.CIntPtr instance SDP.Shape.Shape Foreign.C.Types.CUIntPtr instance SDP.Shape.Shape Foreign.C.Types.CIntMax instance SDP.Shape.Shape Foreign.C.Types.CUIntMax instance SDP.Shape.Shape Foreign.C.Types.CSize instance SDP.Shape.Shape Foreign.C.Types.CBool instance SDP.Shape.Shape Foreign.C.Types.CPtrdiff instance SDP.Shape.Shape Foreign.C.Types.CSigAtomic instance SDP.Shape.Shape i => SDP.Shape.Shape (SDP.Finite.E SDP.Finite.:& i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i, SDP.Shape.Shape (i' SDP.Finite.:& i)) => SDP.Shape.Shape ((i' SDP.Finite.:& i) SDP.Finite.:& i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T2 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T3 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T4 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T5 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T6 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T7 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T8 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T9 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T10 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T11 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T12 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T13 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T14 i) instance (SDP.Shape.Shape i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Shape.Shape (SDP.Tuple.T15 i) -- | The Index class is an alternative to Ix with a richer -- interface, generalized indexes and more convenient function names. module SDP.Index -- | (:|:) is closed type family of shape differences. type family i :|: j -- | SubIndex is service constraint that corresponds closed -- (internal) class Sub. SubIndex i j matches -- if Index type i is subspace of Index type -- j. type SubIndex = Sub -- | Take some dimensions. -- --
--   >>> takeDim ([1, 2, 3, 4] :: I4 Int) :: I1 Int
--   [1]
--   
--   >>> takeDim ([1, 2, 3, 4] :: I4 Int) :: E
--   E
--   
takeDim :: Sub i j => i -> j -- | Drop some dimensions (second argument used as type variable). -- --
--   >>> dropDim ([1, 2, 3, 4] :: I4 Int) ([] :: E)
--   [1, 2, 3, 4]
--   
--   >>> dropDim ([1, 2, 3, 4] :: I4 Int) ([1, 2] :: I2 Int)
--   [3, 4]
--   
dropDim :: Sub i j => i -> j -> i :|: j -- | Join some dimensions. -- --
--   >>> joinDim ([1, 2] :: I2 Int) [3] :: I3 Int
--   [1, 2, 3]
--   
--   >>> joinDim ([1, 2] :: I2 Int) [3, 4] :: I4 Int
--   [1, 2, 3, 4]
--   
joinDim :: Sub i j => j -> (i :|: j) -> i -- | splitDim returns pair of shape difference and subshape. splitDim :: Sub i j => i -> (i :|: j, j) -- | Index is service class based on base Ix and repa -- Shape. -- -- Basic rules: -- --
--   size bnds >= 0
--   size bnds == product (sizes bnds)
--   
-- --
--   isEmpty bnds == (size bnds == 0)
--   isEmpty bnds == inRange bnds (safeElem bnds i)
--   
-- --
--   isEmpty bnds => isOverflow  bnds i
--   isEmpty bnds => isUnderflow bnds i
--   
-- --
--   inRange bnds i /= isEmpty     bnds
--   inRange bnds i /= isOverflow  bnds i
--   inRange bnds i /= isUnderflow bnds i
--   inRange bnds i == (safeElem bnds i == i)
--   
-- -- Note: -- -- class (Ord i, Shape i, Shape (DimLast i), Shape (DimInit i), Shape (GIndex i)) => Index i -- | Returns the size of range. size :: Index i => (i, i) -> Int -- | Returns the size of range. size :: (Index i, Enum i) => (i, i) -> Int -- | Returns the sizes of range dimensionwise. sizes :: Index i => (i, i) -> [Int] -- | Returns the sizes of range dimensionwise. sizes :: (Index i, Index (GIndex i)) => (i, i) -> [Int] -- | Returns the index belonging to the given range. safeElem :: Index i => (i, i) -> i -> i -- | Returns bounds of nonempty range (swaps bounds in each empty -- subshape). ordBounds :: Index i => (i, i) -> (i, i) -- | Returns size of biggest range, that may be represented by this type. defLimit :: Index i => i -> Integer -- | Returns size of biggest range, that may be represented by this type. defLimit :: (Index i, Integral i, Bounded i) => i -> Integer -- | Returns default range by size. defaultBounds :: Index i => Int -> (i, i) -- | Returns index by offset in default range. unsafeIndex :: Index i => Int -> i -- | Returns index by offset in default range. unsafeIndex :: (Index i, Enum i) => Int -> i -- | Checks if the bounds is empty. isEmpty :: Index i => (i, i) -> Bool -- | Checks the index status in bounds. inBounds :: Index i => (i, i) -> i -> InBounds -- | Checks if the index is overflow. isOverflow :: Index i => (i, i) -> i -> Bool -- | Checks if the index is underflow. isUnderflow :: Index i => (i, i) -> i -> Bool -- | Checks if the index is in range. inRange :: Index i => (i, i) -> i -> Bool -- | Returns previous index in range. prev :: Index i => (i, i) -> i -> i -- | Returns previous index in range. prev :: (Index i, Enum i) => (i, i) -> i -> i -- | Returns next index in range. next :: Index i => (i, i) -> i -> i -- | Returns next index in range. next :: (Index i, Enum i) => (i, i) -> i -> i -- | Returns offset (indent) of index in range. offset :: Index i => (i, i) -> i -> Int -- | Returns offset (indent) of index in range. offset :: (Index i, Enum i) => (i, i) -> i -> Int -- | Returns index by this offset (indent) in range. index :: Index i => (i, i) -> Int -> i -- | Returns index by this offset (indent) in range. index :: (Index i, Enum i) => (i, i) -> Int -> i -- | Returns the ordered list of indices in this range. range :: Index i => (i, i) -> [i] -- | Returns the ordered list of indices in this range. range :: (Index i, Enum i) => (i, i) -> [i] -- | subshape bnds ij returns subshape of bnds. -- -- Checks if ij in bnds subshape, may throw -- IndexException. subshape :: (Index i, Sub i j, Index (i :|: j)) => (i, i) -> (i :|: j) -> (j, j) slice :: (Index i, Sub i j, ij ~~ (i :|: j), Index j) => (i, i) -> ij -> ((ij, ij), (j, j)) -- | InBounds - service type that specifies index and bounds status. data InBounds -- | Empty range ER :: InBounds -- | Underflow range UR :: InBounds -- | Index in range IN :: InBounds -- | Overflow range OR :: InBounds -- | Default offset for Integral types. offsetIntegral :: (Index i, Integral i) => (i, i) -> i -> Int -- | Default defaultBounds for unsigned types. defaultBoundsUnsign :: (Index i, Bounded i) => Int -> (i, i) instance GHC.Enum.Enum SDP.Index.InBounds instance GHC.Read.Read SDP.Index.InBounds instance GHC.Show.Show SDP.Index.InBounds instance GHC.Classes.Eq SDP.Index.InBounds instance (SDP.Index.Index i, SDP.Finite.E ~ (i SDP.Index.:|: i)) => SDP.Index.Sub i i instance (ij ~ (i SDP.Index.:|: j), SDP.Shape.DimInit ij ~ (SDP.Shape.DimInit i SDP.Index.:|: j), SDP.Shape.DimLast ij ~ SDP.Shape.DimLast i, SDP.Index.Index i, SDP.Index.Index j, SDP.Index.Index ij, SDP.Index.Sub (SDP.Shape.DimInit i) j) => SDP.Index.Sub i j instance SDP.Index.Index i => SDP.Estimate.Estimate (i, i) instance SDP.Index.Index i => SDP.Nullable.Nullable (i, i) instance SDP.Index.Index SDP.Finite.E instance SDP.Index.Index () instance SDP.Index.Index GHC.Types.Char instance SDP.Index.Index GHC.Integer.Type.Integer instance SDP.Index.Index GHC.Types.Int instance SDP.Index.Index GHC.Int.Int8 instance SDP.Index.Index GHC.Int.Int16 instance SDP.Index.Index GHC.Int.Int32 instance SDP.Index.Index GHC.Int.Int64 instance SDP.Index.Index GHC.Types.Word instance SDP.Index.Index GHC.Word.Word8 instance SDP.Index.Index GHC.Word.Word16 instance SDP.Index.Index GHC.Word.Word32 instance SDP.Index.Index GHC.Word.Word64 instance SDP.Index.Index Foreign.C.Types.CChar instance SDP.Index.Index Foreign.C.Types.CSChar instance SDP.Index.Index Foreign.C.Types.CWchar instance SDP.Index.Index Foreign.C.Types.CShort instance SDP.Index.Index Foreign.C.Types.CInt instance SDP.Index.Index Foreign.C.Types.CLong instance SDP.Index.Index Foreign.C.Types.CLLong instance SDP.Index.Index Foreign.C.Types.CIntPtr instance SDP.Index.Index Foreign.C.Types.CIntMax instance SDP.Index.Index Foreign.C.Types.CPtrdiff instance SDP.Index.Index Foreign.C.Types.CSigAtomic instance SDP.Index.Index Foreign.C.Types.CBool instance SDP.Index.Index Foreign.C.Types.CSize instance SDP.Index.Index Foreign.C.Types.CUChar instance SDP.Index.Index Foreign.C.Types.CUShort instance SDP.Index.Index Foreign.C.Types.CUInt instance SDP.Index.Index Foreign.C.Types.CULong instance SDP.Index.Index Foreign.C.Types.CULLong instance SDP.Index.Index Foreign.C.Types.CUIntPtr instance SDP.Index.Index Foreign.C.Types.CUIntMax instance SDP.Index.Index i => SDP.Index.Index (SDP.Finite.E SDP.Finite.:& i) instance (SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i, SDP.Index.Index (i' SDP.Finite.:& i)) => SDP.Index.Index ((i' SDP.Finite.:& i) SDP.Finite.:& i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T2 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T3 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T4 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T5 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T6 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T7 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T8 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T9 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T10 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T11 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T12 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T13 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T14 i) instance (GHC.Classes.Ord i, SDP.Index.Index i, GHC.Enum.Enum i, GHC.Enum.Bounded i) => SDP.Index.Index (SDP.Tuple.T15 i) -- | SDP.Unboxed provide service class Unboxed, that needed -- for SDP.Prim.SBytes-based structures. module SDP.Unboxed -- | Unboxed is a layer between untyped raw data and parameterized -- unboxed data structures. Also it prevents direct interaction with -- primitives. class (Eq e) => Unboxed e -- | sizeof e n returns the length (in bytes) of primitive, where -- n - count of elements, e - type parameter. sizeof :: Unboxed e => e -> Int -> Int -- | sizeof# is unboxed sizeof. sizeof# :: Unboxed e => e -> Int# -> Int# -- | Unsafe ByteArray# reader with overloaded result type. (!#) :: Unboxed e => ByteArray# -> Int# -> e -- | Unsafe MutableByteArray# reader with overloaded result type. (!>#) :: Unboxed e => MutableByteArray# s -> Int# -> State# s -> (# State# s, e #) -- | Unsafe MutableByteArray# writer. writeByteArray# :: Unboxed e => MutableByteArray# s -> Int# -> e -> State# s -> State# s -- | Procedure for filling the array with the default value (like calloc). fillByteArray# :: Unboxed e => MutableByteArray# s -> Int# -> e -> State# s -> State# s -- | newUnboxed creates new MutableByteArray# of given count -- of elements. First argument used as type variable. newUnboxed :: Unboxed e => e -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | newUnboxed' is version of newUnboxed, that use first -- argument as initial value. May fail when trying to write error -- or undefined. newUnboxed' :: Unboxed e => e -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | copyUnboxed# e bytes# o1# mbytes# o2# n# unsafely -- writes elements from bytes# to mbytes#, where o1# -- and o2# - offsets (element count), n# - count of elements to -- copy. copyUnboxed# :: Unboxed e => e -> ByteArray# -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s -- | copyUnboxedM# e msrc# o1# mbytes# o2# n# unsafely -- writes elements from msrc# to mbytes#, where o1# and -- o2# - offsets (element count), n# - count of elements to -- copy. copyUnboxedM# :: Unboxed e => e -> MutableByteArray# s -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s -- | hashUnboxedWith e len bytes# salt returns -- bytes# FNV-1 hash, where off# and -- len# is offset and length (in elements). -- -- Note: the standard definition of this function is written in Haskell -- using low-level functions, but this implementation mayn't be as -- efficient as the foreign procedure in the hashable package. hashUnboxedWith :: Unboxed e => e -> Int# -> Int# -> ByteArray# -> Int# -> Int# -- | cloneUnboxed o creates new c#-element length -- immutable slice of bytes# beginning from o#-th -- element. cloneUnboxed# :: Unboxed e => e -> ByteArray# -> Int# -> Int# -> ByteArray# -- | cloneUnboxedM o creates new c#-element length -- mutable slice of bytes# beginning from o#-th -- element. cloneUnboxedM# :: Unboxed e => e -> MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | thawUnboxed# e bytes creates new sizeof bytes -- length MutableByteArray# and copy bytes# to it. thawUnboxed# :: Unboxed e => e -> ByteArray# -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | freezeUnboxed# e mbytes creates new sizeof -- bytes length ByteArray# and copy mbytes# to it. freezeUnboxed# :: Unboxed e => e -> MutableByteArray# s -> Int# -> State# s -> (# State# s, ByteArray# #) -- | Returns undefined of suitable type. fromProxy :: proxy e -> e -- | psizeof# is proxy version of sizeof#. psizeof# :: Unboxed e => proxy e -> Int# -> Int# -- | psizeof is proxy version of sizeof. psizeof :: Unboxed e => proxy e -> Int -> Int -- | Kind (Type -> Type) proxy version of newUnboxed. pnewUnboxed :: Unboxed e => proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | Kind (Type -> Type) proxy version if copyUnboxed#. pcopyUnboxed :: Unboxed e => proxy e -> ByteArray# -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s -- | Kind (Type -> Type) proxy version if copyUnboxedM#. pcopyUnboxedM :: Unboxed e => proxy e -> MutableByteArray# s -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s -- | Same as sdp-0.2 cloneUnboxed1#. Use only if you don't -- need sdp-0.2 compatibility. pcloneUnboxed :: Unboxed e => proxy e -> ByteArray# -> Int# -> Int# -> ByteArray# -- | Kind (Type -> Type) proxy version of cloneUnboxed#. pcloneUnboxedM :: Unboxed e => proxy e -> MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | Kind (Type -> Type) proxy version of thawUnboxed#. pthawUnboxed :: Unboxed e => proxy e -> ByteArray# -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | Kind (Type -> Type) proxy version of -- pfreezeUnboxed. pfreezeUnboxed :: Unboxed e => proxy e -> MutableByteArray# s -> Int# -> State# s -> (# State# s, ByteArray# #) -- | Returns undefined of suitable type. fromProxy1 :: m (proxy e) -> e -- | Kind (Type -> Type -> Type) proxy version of -- newUnboxed. pnewUnboxed1 :: Unboxed e => p (proxy e) -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | Kind (Type -> Type -> Type) proxy version of -- cloneUnboxed#. pcloneUnboxed1 :: Unboxed e => p (proxy e) -> ByteArray# -> Int# -> Int# -> ByteArray# -- | Kind (Type -> Type -> Type) proxy version of -- copyUnboxed#. pcopyUnboxed1 :: Unboxed e => p (proxy e) -> ByteArray# -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s -- | Kind (Type -> Type -> Type) proxy version of -- copyUnboxedM#. pcopyUnboxedM1 :: Unboxed e => p (proxy e) -> MutableByteArray# s -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s -- | Kind (Type -> Type) proxy version of cloneUnboxed#. cloneUnboxed1# :: Unboxed e => proxy e -> ByteArray# -> Int# -> Int# -> ByteArray# -- | Kind (Type -> Type -> Type) proxy version of -- cloneUnboxed#. pcloneUnboxedM1 :: Unboxed e => p (proxy e) -> MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, MutableByteArray# s #) -- | ByteArray# wrapper. data Wrap Wrap :: ByteArray# -> Wrap [unwrap] :: Wrap -> ByteArray# -- | Wrapped empty ByteArray#. lzero# :: Wrap -- | ByteArray# singleton. single# :: Unboxed e => e -> ByteArray# -- | Create immutable Unboxed array from given list. fromList# :: Unboxed e => [e] -> ByteArray# -- | Create immutable Unboxed array from Foldable stream. fromFoldable# :: (Foldable f, Unboxed e) => f e -> (# Int, ByteArray# #) -- | Create immutable Unboxed array from known size list. fromListN# :: Unboxed e => Int# -> [e] -> ByteArray# -- | Create mutable Unboxed array from given list. newLinear# :: Unboxed e => [e] -> State# s -> (# State# s, MutableByteArray# s #) -- | Create mutable Unboxed array from known size list. newLinearN# :: Unboxed e => Int# -> [e] -> State# s -> (# State# s, MutableByteArray# s #) -- | Create mutable Unboxed array from Foldable stream. fromFoldableM# :: (Foldable f, Unboxed e) => f e -> State# s -> (# State# s, Int, MutableByteArray# s #) -- | Concatenation of two Unboxed arrays. concat# :: Unboxed e => e -> ByteArray# -> Int# -> Int# -> ByteArray# -> Int# -> Int# -> State# s -> (# State# s, Int#, MutableByteArray# s #) -- | Proxy concatenation of two byte arrays representing Unboxed -- structures. pconcat :: Unboxed e => proxy e -> ByteArray# -> Int# -> Int# -> ByteArray# -> Int# -> Int# -> State# s -> (# State# s, Int#, MutableByteArray# s #) instance SDP.Unboxed.Unboxed GHC.Types.Int instance SDP.Unboxed.Unboxed GHC.Int.Int8 instance SDP.Unboxed.Unboxed GHC.Int.Int16 instance SDP.Unboxed.Unboxed GHC.Int.Int32 instance SDP.Unboxed.Unboxed GHC.Int.Int64 instance SDP.Unboxed.Unboxed GHC.Types.Word instance SDP.Unboxed.Unboxed GHC.Word.Word8 instance SDP.Unboxed.Unboxed GHC.Word.Word16 instance SDP.Unboxed.Unboxed GHC.Word.Word32 instance SDP.Unboxed.Unboxed GHC.Word.Word64 instance SDP.Unboxed.Unboxed GHC.Types.Float instance SDP.Unboxed.Unboxed GHC.Types.Double instance (SDP.Unboxed.Unboxed a, GHC.Real.Integral a) => SDP.Unboxed.Unboxed (GHC.Real.Ratio a) instance (SDP.Unboxed.Unboxed a, GHC.Num.Num a) => SDP.Unboxed.Unboxed (Data.Complex.Complex a) instance SDP.Unboxed.Unboxed (GHC.Ptr.Ptr a) instance SDP.Unboxed.Unboxed (GHC.Ptr.FunPtr a) instance SDP.Unboxed.Unboxed (GHC.Stable.StablePtr a) instance SDP.Unboxed.Unboxed Foreign.C.Types.CChar instance SDP.Unboxed.Unboxed Foreign.C.Types.CSChar instance SDP.Unboxed.Unboxed Foreign.C.Types.CWchar instance SDP.Unboxed.Unboxed Foreign.C.Types.CShort instance SDP.Unboxed.Unboxed Foreign.C.Types.CUShort instance SDP.Unboxed.Unboxed Foreign.C.Types.CInt instance SDP.Unboxed.Unboxed Foreign.C.Types.CUInt instance SDP.Unboxed.Unboxed Foreign.C.Types.CLong instance SDP.Unboxed.Unboxed Foreign.C.Types.CULong instance SDP.Unboxed.Unboxed Foreign.C.Types.CLLong instance SDP.Unboxed.Unboxed Foreign.C.Types.CULLong instance SDP.Unboxed.Unboxed Foreign.C.Types.CIntPtr instance SDP.Unboxed.Unboxed Foreign.C.Types.CUIntPtr instance SDP.Unboxed.Unboxed Foreign.C.Types.CIntMax instance SDP.Unboxed.Unboxed Foreign.C.Types.CUIntMax instance SDP.Unboxed.Unboxed Foreign.C.Types.CPtrdiff instance SDP.Unboxed.Unboxed Foreign.C.Types.CTime instance SDP.Unboxed.Unboxed Foreign.C.Types.CClock instance SDP.Unboxed.Unboxed Foreign.C.Types.CUSeconds instance SDP.Unboxed.Unboxed Foreign.C.Types.CSUSeconds instance SDP.Unboxed.Unboxed Foreign.C.Types.CSize instance SDP.Unboxed.Unboxed Foreign.C.Types.CBool instance SDP.Unboxed.Unboxed Foreign.C.Types.CFloat instance SDP.Unboxed.Unboxed Foreign.C.Types.CDouble instance SDP.Unboxed.Unboxed Foreign.C.Types.CSigAtomic instance SDP.Unboxed.Unboxed GHC.Types.Bool instance SDP.Unboxed.Unboxed GHC.Types.Char instance SDP.Unboxed.Unboxed SDP.Finite.E instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Finite.I1 e) instance (GHC.Enum.Enum e, SDP.Shape.Shape e, GHC.Enum.Bounded e, SDP.Unboxed.Unboxed e, SDP.Shape.Shape (e' SDP.Finite.:& e), SDP.Unboxed.Unboxed (e' SDP.Finite.:& e)) => SDP.Unboxed.Unboxed ((e' SDP.Finite.:& e) SDP.Finite.:& e) instance SDP.Unboxed.Unboxed () instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T2 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T3 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T4 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T5 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T6 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T7 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T8 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T9 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T10 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T11 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T12 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T13 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T14 e) instance SDP.Unboxed.Unboxed e => SDP.Unboxed.Unboxed (SDP.Tuple.T15 e) -- | SDP.Unboxed.IntAs provides additional Int instances for -- Unboxed. module SDP.Unboxed.IntAs -- | Int value as 1 byte. newtype IntAs8 IntAs8 :: Int -> IntAs8 -- | Int value as 2 bytes. newtype IntAs16 IntAs16 :: Int -> IntAs16 -- | Int value as 4 bytes. newtype IntAs32 IntAs32 :: Int -> IntAs32 -- | Int value as 8 bytes. newtype IntAs64 IntAs64 :: Int -> IntAs64 instance GHC.Real.Integral SDP.Unboxed.IntAs.IntAs8 instance GHC.Real.Real SDP.Unboxed.IntAs.IntAs8 instance GHC.Num.Num SDP.Unboxed.IntAs.IntAs8 instance GHC.Enum.Bounded SDP.Unboxed.IntAs.IntAs8 instance GHC.Enum.Enum SDP.Unboxed.IntAs.IntAs8 instance GHC.Classes.Ord SDP.Unboxed.IntAs.IntAs8 instance GHC.Classes.Eq SDP.Unboxed.IntAs.IntAs8 instance GHC.Real.Integral SDP.Unboxed.IntAs.IntAs16 instance GHC.Real.Real SDP.Unboxed.IntAs.IntAs16 instance GHC.Num.Num SDP.Unboxed.IntAs.IntAs16 instance GHC.Enum.Bounded SDP.Unboxed.IntAs.IntAs16 instance GHC.Enum.Enum SDP.Unboxed.IntAs.IntAs16 instance GHC.Classes.Ord SDP.Unboxed.IntAs.IntAs16 instance GHC.Classes.Eq SDP.Unboxed.IntAs.IntAs16 instance GHC.Real.Integral SDP.Unboxed.IntAs.IntAs32 instance GHC.Real.Real SDP.Unboxed.IntAs.IntAs32 instance GHC.Num.Num SDP.Unboxed.IntAs.IntAs32 instance GHC.Enum.Bounded SDP.Unboxed.IntAs.IntAs32 instance GHC.Enum.Enum SDP.Unboxed.IntAs.IntAs32 instance GHC.Classes.Ord SDP.Unboxed.IntAs.IntAs32 instance GHC.Classes.Eq SDP.Unboxed.IntAs.IntAs32 instance GHC.Real.Integral SDP.Unboxed.IntAs.IntAs64 instance GHC.Real.Real SDP.Unboxed.IntAs.IntAs64 instance GHC.Num.Num SDP.Unboxed.IntAs.IntAs64 instance GHC.Enum.Bounded SDP.Unboxed.IntAs.IntAs64 instance GHC.Enum.Enum SDP.Unboxed.IntAs.IntAs64 instance GHC.Classes.Ord SDP.Unboxed.IntAs.IntAs64 instance GHC.Classes.Eq SDP.Unboxed.IntAs.IntAs64 instance SDP.Shape.Shape SDP.Unboxed.IntAs.IntAs64 instance SDP.Index.Index SDP.Unboxed.IntAs.IntAs64 instance GHC.Show.Show SDP.Unboxed.IntAs.IntAs64 instance GHC.Read.Read SDP.Unboxed.IntAs.IntAs64 instance SDP.Unboxed.Unboxed SDP.Unboxed.IntAs.IntAs64 instance Foreign.Storable.Storable SDP.Unboxed.IntAs.IntAs64 instance SDP.Shape.Shape SDP.Unboxed.IntAs.IntAs32 instance SDP.Index.Index SDP.Unboxed.IntAs.IntAs32 instance GHC.Show.Show SDP.Unboxed.IntAs.IntAs32 instance GHC.Read.Read SDP.Unboxed.IntAs.IntAs32 instance SDP.Unboxed.Unboxed SDP.Unboxed.IntAs.IntAs32 instance Foreign.Storable.Storable SDP.Unboxed.IntAs.IntAs32 instance SDP.Shape.Shape SDP.Unboxed.IntAs.IntAs16 instance SDP.Index.Index SDP.Unboxed.IntAs.IntAs16 instance GHC.Show.Show SDP.Unboxed.IntAs.IntAs16 instance GHC.Read.Read SDP.Unboxed.IntAs.IntAs16 instance SDP.Unboxed.Unboxed SDP.Unboxed.IntAs.IntAs16 instance Foreign.Storable.Storable SDP.Unboxed.IntAs.IntAs16 instance SDP.Shape.Shape SDP.Unboxed.IntAs.IntAs8 instance SDP.Index.Index SDP.Unboxed.IntAs.IntAs8 instance GHC.Show.Show SDP.Unboxed.IntAs.IntAs8 instance GHC.Read.Read SDP.Unboxed.IntAs.IntAs8 instance SDP.Unboxed.Unboxed SDP.Unboxed.IntAs.IntAs8 instance Foreign.Storable.Storable SDP.Unboxed.IntAs.IntAs8 -- | SDP.Unboxed.WordAs provides additional Word instances -- for Unboxed. module SDP.Unboxed.WordAs -- | Word value as 1 byte. newtype WordAs8 WordAs8 :: Word -> WordAs8 -- | Word value as 2 bytes. newtype WordAs16 WordAs16 :: Word -> WordAs16 -- | Word value as 4 bytes. newtype WordAs32 WordAs32 :: Word -> WordAs32 -- | Word value as 8 bytes. newtype WordAs64 WordAs64 :: Word -> WordAs64 instance GHC.Real.Integral SDP.Unboxed.WordAs.WordAs8 instance GHC.Real.Real SDP.Unboxed.WordAs.WordAs8 instance GHC.Num.Num SDP.Unboxed.WordAs.WordAs8 instance GHC.Enum.Bounded SDP.Unboxed.WordAs.WordAs8 instance GHC.Enum.Enum SDP.Unboxed.WordAs.WordAs8 instance GHC.Classes.Ord SDP.Unboxed.WordAs.WordAs8 instance GHC.Classes.Eq SDP.Unboxed.WordAs.WordAs8 instance GHC.Real.Integral SDP.Unboxed.WordAs.WordAs16 instance GHC.Real.Real SDP.Unboxed.WordAs.WordAs16 instance GHC.Num.Num SDP.Unboxed.WordAs.WordAs16 instance GHC.Enum.Bounded SDP.Unboxed.WordAs.WordAs16 instance GHC.Enum.Enum SDP.Unboxed.WordAs.WordAs16 instance GHC.Classes.Ord SDP.Unboxed.WordAs.WordAs16 instance GHC.Classes.Eq SDP.Unboxed.WordAs.WordAs16 instance GHC.Real.Integral SDP.Unboxed.WordAs.WordAs32 instance GHC.Real.Real SDP.Unboxed.WordAs.WordAs32 instance GHC.Num.Num SDP.Unboxed.WordAs.WordAs32 instance GHC.Enum.Bounded SDP.Unboxed.WordAs.WordAs32 instance GHC.Enum.Enum SDP.Unboxed.WordAs.WordAs32 instance GHC.Classes.Ord SDP.Unboxed.WordAs.WordAs32 instance GHC.Classes.Eq SDP.Unboxed.WordAs.WordAs32 instance GHC.Real.Integral SDP.Unboxed.WordAs.WordAs64 instance GHC.Real.Real SDP.Unboxed.WordAs.WordAs64 instance GHC.Num.Num SDP.Unboxed.WordAs.WordAs64 instance GHC.Enum.Bounded SDP.Unboxed.WordAs.WordAs64 instance GHC.Enum.Enum SDP.Unboxed.WordAs.WordAs64 instance GHC.Classes.Ord SDP.Unboxed.WordAs.WordAs64 instance GHC.Classes.Eq SDP.Unboxed.WordAs.WordAs64 instance SDP.Shape.Shape SDP.Unboxed.WordAs.WordAs64 instance SDP.Index.Index SDP.Unboxed.WordAs.WordAs64 instance GHC.Show.Show SDP.Unboxed.WordAs.WordAs64 instance GHC.Read.Read SDP.Unboxed.WordAs.WordAs64 instance SDP.Unboxed.Unboxed SDP.Unboxed.WordAs.WordAs64 instance Foreign.Storable.Storable SDP.Unboxed.WordAs.WordAs64 instance SDP.Shape.Shape SDP.Unboxed.WordAs.WordAs32 instance SDP.Index.Index SDP.Unboxed.WordAs.WordAs32 instance GHC.Show.Show SDP.Unboxed.WordAs.WordAs32 instance GHC.Read.Read SDP.Unboxed.WordAs.WordAs32 instance SDP.Unboxed.Unboxed SDP.Unboxed.WordAs.WordAs32 instance Foreign.Storable.Storable SDP.Unboxed.WordAs.WordAs32 instance SDP.Shape.Shape SDP.Unboxed.WordAs.WordAs16 instance SDP.Index.Index SDP.Unboxed.WordAs.WordAs16 instance GHC.Show.Show SDP.Unboxed.WordAs.WordAs16 instance GHC.Read.Read SDP.Unboxed.WordAs.WordAs16 instance SDP.Unboxed.Unboxed SDP.Unboxed.WordAs.WordAs16 instance Foreign.Storable.Storable SDP.Unboxed.WordAs.WordAs16 instance SDP.Shape.Shape SDP.Unboxed.WordAs.WordAs8 instance SDP.Index.Index SDP.Unboxed.WordAs.WordAs8 instance GHC.Show.Show SDP.Unboxed.WordAs.WordAs8 instance GHC.Read.Read SDP.Unboxed.WordAs.WordAs8 instance SDP.Unboxed.Unboxed SDP.Unboxed.WordAs.WordAs8 instance Foreign.Storable.Storable SDP.Unboxed.WordAs.WordAs8 -- | SDP.Zip provides Zip - class of -- Control.Applicative.ZipList-like structures. module SDP.Zip -- | Zip is generalization of ZipList applicative semantics (but without -- pure). class (Functor z) => Zip z -- | ZipList-like (<*>). zap :: Zip z => z (a -> b) -> z a -> z b all2 :: Zip z => (a -> b -> Bool) -> z a -> z b -> Bool all3 :: Zip z => (a -> b -> c -> Bool) -> z a -> z b -> z c -> Bool all4 :: Zip z => (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z d -> Bool all5 :: Zip z => (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z e -> Bool all6 :: Zip z => (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z f -> Bool any2 :: Zip z => (a -> b -> Bool) -> z a -> z b -> Bool any3 :: Zip z => (a -> b -> c -> Bool) -> z a -> z b -> z c -> Bool any4 :: Zip z => (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z d -> Bool any5 :: Zip z => (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z e -> Bool any6 :: Zip z => (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z f -> Bool zip :: Zip z => z a -> z b -> z (a, b) zip3 :: Zip z => z a -> z b -> z c -> z (a, b, c) zip4 :: Zip z => z a -> z b -> z c -> z d -> z (a, b, c, d) zip5 :: Zip z => z a -> z b -> z c -> z d -> z e -> z (a, b, c, d, e) zip6 :: Zip z => z a -> z b -> z c -> z d -> z e -> z f -> z (a, b, c, d, e, f) zipWith :: Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith3 :: Zip z => (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith4 :: Zip z => (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith5 :: Zip z => (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith6 :: Zip z => (a -> b -> c -> d -> e -> f -> g) -> z a -> z b -> z c -> z d -> z e -> z f -> z g instance SDP.Zip.Zip [] -- | SDP.Sort provides Sort - class of sortable immutable -- structures. module SDP.Sort -- | Sort is class of types that can be sorted. class Sort s e | s -> e -- | Checks if structure is already sorted. Should always return -- True for structures with less than 2 elements. sortedBy :: Sort s e => (e -> e -> Bool) -> s -> Bool -- | sortBy function is common sorting algorithm. sortBy :: Sort s e => Compare e -> s -> s -- | Sort contraint for (Type -> Type)-kind types. type Sort1 rep e = Sort (rep e) -- | Sort contraint for (Type -> Type -> Type)-kind -- types. type Sort2 rep i e = Sort (rep i e) -- | Sort quantified contraint for (Type -> Type)-kind -- types. type Sort' rep = forall e. Sort (rep e) -- | Sort quantified contraint for (Type -> Type -> -- Type)-kind types. type Sort'' rep = forall i e. Sort (rep i e) -- | sort is just sortBy compare sort :: (Sort s e, Ord e) => s -> s -- | Sort by comparing the results of a given function applied to each -- element. sortOn :: (Sort s e, Ord o) => (e -> o) -> s -> s -- | Checks if the structure is sorted. sorted :: (Sort s e, Ord e) => s -> Bool -- | Sort by comparing the results of a given function applied to each -- element. sortedOn :: (Sort s e, Ord o) => (e -> o) -> s -> Bool instance SDP.Sort.Sort [a] a -- | SDP.Linear is a module that provides several convenient -- interfaces for working with various linear data structures. module SDP.Linear -- | Class of bordered data structures. class (Index i, Estimate b) => Bordered b i | b -> i -- | Returns the exact upper and lower bounds of given -- structure. If the structure doesn't have explicitly defined boundaries -- (list, for example), use the defaultBounds . -- sizeOf. bounds :: Bordered b i => b -> (i, i) -- | Returns lower bound of structure lower :: Bordered b i => b -> i -- | Returns upper bound of structure upper :: Bordered b i => b -> i -- | Returns actual size of structure. sizeOf :: Bordered b i => b -> Int -- | Returns actual sizes of structure. sizesOf :: Bordered b i => b -> [Int] -- | Checks if an index falls within the boundaries of the structure. indexIn :: Bordered b i => b -> i -> Bool -- | Returns index range list. indices :: Bordered b i => b -> [i] -- | Returns index by offset in structure. indexOf :: Bordered b i => b -> Int -> i -- | Returns index offset in structure bounds. offsetOf :: Bordered b i => b -> i -> Int -- | Bordered contraint for (Type -> Type)-kind types. type Bordered1 l i e = Bordered (l e) i -- | Bordered contraint for (Type -> Type -> -- Type)-kind types. type Bordered2 l i e = Bordered (l i e) i -- | Class of list-like data structures, which -- -- class (Nullable l) => Linear l e | l -> e -- | Separates line to head and tail, deconstructor for -- :> pattern. uncons :: Linear l e => l -> (e, l) -- | Same as isNull ?- uncons uncons' :: Linear l e => l -> Maybe (e, l) -- | Prepends element to line, constructor for :> pattern. toHead :: Linear l e => e -> l -> l -- | Returns first element of line, may fail. head :: Linear l e => l -> e -- | Returns line except first, may fail. tail :: Linear l e => l -> l -- | Separates line to init and last, deconstructor for -- :< pattern. unsnoc :: Linear l e => l -> (l, e) -- | Same as isNull ?- unsnoc unsnoc' :: Linear l e => l -> Maybe (l, e) -- | Appends element to line, constructor for :< pattern. toLast :: Linear l e => l -> e -> l -- | Returns line except last element, may fail. init :: Linear l e => l -> l -- | Returns last element, may fail. last :: Linear l e => l -> e -- | Just singleton. single :: Linear l e => e -> l -- | Concatenation of two lines. (++) :: Linear l e => l -> l -> l -- | replicate n e returns a line of n repetitions of the -- element e. replicate :: Linear l e => Int -> e -> l -- | Creates line from list. fromList :: Linear l e => [e] -> l -- | Create finite line from (possibly infinite) list. fromListN :: Linear l e => Int -> [e] -> l -- | Right to left view of line. listR :: Linear l e => l -> [e] -- | Left to right view of line, same to toList. listL :: Linear l e => l -> [e] -- | Generalized fromList. fromFoldable :: (Linear l e, Foldable f) => f e -> l -- | Returns the element of a sequence by offset, may be completely unsafe. -- This is an optimistic read function and shouldn't perform checks for -- efficiency reasons. -- -- If you need safety, use (!) or (!?). The generalization of this -- function by index type (.!). -- --
--   es !^ i = listL es !! i
--   
(!^) :: Linear l e => l -> Int -> e -- | write es n e writes value e in position n -- (offset), returns new structure. If n is out of range, -- returns equal structure (es or copy). write :: Linear l e => l -> Int -> e -> l -- | Generalized concat. concat :: (Linear l e, Foldable f) => f l -> l -- | Generalized concatMap. concatMap :: (Linear l e, Foldable f) => (a -> l) -> f a -> l -- | Generalized intersperse. intersperse :: Linear l e => e -> l -> l -- | Generalized filter. filter :: Linear l e => (e -> Bool) -> l -> l -- | Inverted filter. except :: Linear l e => (e -> Bool) -> l -> l -- | Generalization of partition. partition :: Linear l e => (e -> Bool) -> l -> (l, l) -- | Generalization of partition, that select sublines by predicates. partitions :: (Linear l e, Foldable f) => f (e -> Bool) -> l -> [l] -- | select f es is selective map of es elements to new -- list. select :: Linear l e => (e -> Maybe a) -> l -> [a] -- | select' f es is selective map of es elements to new -- line. select' :: (Linear l e, t e ~ l, Linear1 t a) => (e -> Maybe a) -> l -> t a -- | extract f es returns a selective map of es elements -- to new list and the remaining elements of the line. extract :: Linear l e => (e -> Maybe a) -> l -> ([a], l) -- | extract' f es returns a selective map of es elements -- to new line and the remaining elements of the line. extract' :: (Linear l e, t e ~ l, Linear1 t a) => (e -> Maybe a) -> l -> (t a, l) -- | selects fs es sequentially applies the functions from -- fs to the remainder of es, returns a list of -- selections and the remainder of the last selection. selects :: (Linear l e, Foldable f) => f (e -> Maybe a) -> l -> ([[a]], l) -- | selects' fs es sequentially applies the functions from -- fs to the remainder of es, returns a line of -- selections and the remainder of the last selection. selects' :: (Linear l e, Foldable f, t e ~ l, Linear1 t a) => f (e -> Maybe a) -> l -> ([t a], l) -- | The isSubseqOf xs ys checks if all the elements of the -- xs occur, in order, in the ys. The elements don't -- have to occur consecutively. isSubseqOf :: (Linear l e, Eq e) => l -> l -> Bool -- | Generalized reverse. reverse :: Linear l e => l -> l -- | O(1) force, same as id. force :: Linear l e => l -> l -- | before es i e insert e to es before -- element with offset i. If i goes beyond the lower or -- upper bounds, e is prepended or appended to es -- respectively. -- --
--   before [0 .. 5] (-1) 7 == [7,0,1,2,3,4,5]
--   before [0 .. 5]   0  7 == [7,0,1,2,3,4,5]
--   before [0 .. 5]   3  7 == [0,1,2,7,3,4,5]
--   before [0 .. 5]   5  7 == [0,1,2,3,4,7,5]
--   before [0 .. 5]  19  7 == [0,1,2,3,4,5,7]
--   
before :: Linear l e => l -> Int -> e -> l -- | after es i e insert e to es after -- element with offset i. -- --
--   after es i e == before es (i + 1) e
--   
after :: Linear l e => l -> Int -> e -> l -- | remove es i delete element with offset i from -- es. -- --
--   remove (-1) [0 .. 5] == [0 .. 5]
--   remove   6  [0 .. 5] == [0 .. 5]
--   remove   0  [0 .. 5] == [1,2,3,4,5]
--   remove   3  [0 .. 5] == [0,1,2,4,5]
--   remove   5  [0 .. 5] == [0,1,2,3,4]
--   
remove :: Linear l e => Int -> l -> l -- | Generalized subsequences. subsequences :: Linear l e => l -> [l] -- | iterate n f x returns sequence of n applications of -- f to x. -- -- Note that iterate returns finite sequence, instead -- Prelude prototype. iterate :: Linear l e => Int -> (e -> e) -> e -> l -- | Same as nubBy (==). nub :: (Linear l e, Eq e) => l -> l -- | Generalization of nubBy. nubBy :: Linear l e => Equal e -> l -> l -- | ofoldr is right fold with offset. ofoldr :: Linear l e => (Int -> e -> b -> b) -> b -> l -> b -- | ofoldl is left fold with offset. ofoldl :: Linear l e => (Int -> b -> e -> b) -> b -> l -> b -- | ofoldr' is strict version of ofoldr. ofoldr' :: Linear l e => (Int -> e -> b -> b) -> b -> l -> b -- | ofoldl' is strict version of ofoldl. ofoldl' :: Linear l e => (Int -> b -> e -> b) -> b -> l -> b -- | o_foldr is just foldr in Linear context. o_foldr :: Linear l e => (e -> b -> b) -> b -> l -> b -- | o_foldl is just foldl in Linear context. o_foldl :: Linear l e => (b -> e -> b) -> b -> l -> b -- | o_foldr' is just foldr' in Linear context. o_foldr' :: Linear l e => (e -> b -> b) -> b -> l -> b -- | o_foldl' is just foldl' in Linear context. o_foldl' :: Linear l e => (b -> e -> b) -> b -> l -> b -- | o_foldr1 is just foldr1 in Linear context. o_foldr1 :: Linear l e => (e -> e -> e) -> l -> e -- | o_foldl1 is just foldl1 in Linear context. o_foldl1 :: Linear l e => (e -> e -> e) -> l -> e -- | o_foldr1' is just strict foldr1 in Linear -- context. o_foldr1' :: Linear l e => (e -> e -> e) -> l -> e -- | o_foldl1' is just foldl1' in Linear context. o_foldl1' :: Linear l e => (e -> e -> e) -> l -> e infix 8 `filter` infixr 5 ++ infix 8 `except` infixl 9 !^ -- | Linear contraint for (Type -> Type)-kind types. type Linear1 l e = Linear (l e) e -- | Linear contraint for (Type -> Type -> Type)-kind -- types. type Linear2 l i e = Linear (l i e) e -- | Pattern (:>) is left-size view of line. Same as -- uncons and toHead. pattern (:>) :: Linear l e => e -> l -> l infixr 5 :> -- | Pattern (:<) is right-size view of line. Same as -- unsnoc and toLast. pattern (:<) :: Linear l e => l -> e -> l infixl 5 :< -- | Bordered contraint for (Type -> Type)-kind types. type Bordered' l i = forall e. Bordered (l e) i -- | Bordered contraint for (Type -> Type -> -- Type)-kind types. type Bordered'' l = forall i e. Bordered (l i e) i -- | Linear contraint for (Type -> Type)-kind types. type Linear' l = forall e. Linear (l e) e -- | Linear contraint for (Type -> Type -> Type)-kind -- types. type Linear'' l = forall i e. Linear (l i e) e -- | Split - class of splittable data structures. class (Linear s e) => Split s e | s -> e -- | take n es takes first n elements of es. take :: Split s e => Int -> s -> s -- | take n es takes first n elements of es. take :: (Split s e, Bordered s i) => Int -> s -> s -- | drop n es drops first n elements of es. drop :: Split s e => Int -> s -> s -- | drop n es drops first n elements of es. drop :: (Split s e, Bordered s i) => Int -> s -> s -- | keep n es takes last n elements of es. keep :: Split s e => Int -> s -> s -- | keep n es takes last n elements of es. keep :: (Split s e, Bordered s i) => Int -> s -> s -- | sans n es drops last n elements of es. sans :: Split s e => Int -> s -> s -- | sans n es drops last n elements of es. sans :: (Split s e, Bordered s i) => Int -> s -> s -- | save n es takes first n elements of es if -- n > 0 and last -n elements otherwise. save :: Split s e => Int -> s -> s -- | skip n es drops first n elements of es if -- n > 0 and last -n elements otherwise. skip :: Split s e => Int -> s -> s -- | split n es is same to (take n es, drop n es). split :: Split s e => Int -> s -> (s, s) -- | divide n es is same to (sans n es, keep n es). divide :: Split s e => Int -> s -> (s, s) -- | Splits line into sequences of given sizes (left to right). -- --
--   splits [5, 3, 12] ['a'..'z'] = ["abcde","fgh","ijklmnopqrst","uvwxyz"]
--   
splits :: (Split s e, Foldable f) => f Int -> s -> [s] -- | Splits line into sequences of given sizes (right to left). -- --
--   divides [5,3,12] ['a'..'z'] == ["abcdef","ghijk","lmn","opqrstuvwxyz"]
--   
divides :: (Split s e, Foldable f) => f Int -> s -> [s] -- | Splits structures into parts by given offsets. -- --
--   parts [0,5,6,12,26] ['a'..'z'] = ["","abcde","f","ghijkl","mnopqrstuvwxyz",""]
--   -- if previous offset is equal or greater, subline is empty and next
--   begins from previous:
--   parts [0, 5, 4, 12, 26] ['a' .. 'z'] = ["","abcde","","fghijklm","nopqrstuvwxyz",""]
--   
parts :: (Split s e, Foldable f) => f Int -> s -> [s] -- | Splits structures into chunks of size n and the rest. -- --
--   chunks x [] = [] -- forall x
--   chunks 0 es = [] -- forall es
--   
-- --
--   chunks 3 [1 .. 10] == [[1,2,3],[4,5,6],[7,8,9],[10]]
--   
chunks :: Split s e => Int -> s -> [s] -- | Split line by first (left) separation element. If there is no such -- element, splitBy es = (es, Z). -- --
--   splitBy (== '.') "foo" == ("foo","")
--   splitBy (== '.') "foo." == ("foo","")
--   splitBy (== '.') ".foo" == ("","foo")
--   splitBy (== '.') "foo.bar" == ("foo","bar")
--   splitBy (== '.') "foo.bar.baz" == ("foo","bar.baz")
--   
splitBy :: Split s e => (e -> Bool) -> s -> (s, s) -- | Split line by last (right) separation element. If there is no such -- element, divide es = (Z, es). -- --
--   divideBy (== '.') "foo" == ("","foo")
--   divideBy (== '.') ".foo" == ("","foo")
--   divideBy (== '.') "foo." == ("foo","")
--   divideBy (== '.') "foo.bar" == ("foo","bar")
--   divideBy (== '.') "foo.bar.baz" == ("foo.bar","baz")
--   
divideBy :: Split s e => (e -> Bool) -> s -> (s, s) -- | Splits line by separation elements. splitsBy :: Split s e => (e -> Bool) -> s -> [s] -- | splitsOn sub line splits line by sub. -- --
--   splitsOn "fo" "foobar bazfoobar1" == ["","obar baz","obar1"]
--   
splitsOn :: (Split s e, Eq e) => s -> s -> [s] -- | replaceBy sub new line replace every non-overlapping -- occurrence of sub in line with new. -- --
--   replaceBy "foo" "bar" "foobafoorbaz" == "barbabarrbaz"
--   
replaceBy :: (Split s e, Eq e) => s -> s -> s -> s -- | Removes every non-overlapping occurrence of sub with -- Z. -- --
--   removeAll = concat ... splitsOn
--   (`replaceBy` Z) = removeAll
--   
removeAll :: (Split s e, Eq e) => s -> s -> s -- | combo f es returns the length of the es subsequence -- (left to tight) whose elements are in order f. -- --
--   combo (<) [] == 0
--   combo (<) [1] == 1
--   combo (<) [7, 4, 12] == 1
--   combo (<) [1, 7, 3, 12] == 2
--   
combo :: Split s e => Equal e -> s -> Int -- | justifyL n e es appends e elements if the -- es is shorter than n, justifyL n e es -- prepends (n - sizeOf es) elements e to es -- from the takes n elements if longer. left side if (sizeOf -- es < n). Otherwise returns the first n elements of -- es, like take n es do. justifyL :: Split s e => Int -> e -> s -> s -- | justifyR n e es appends (n - sizeOf es) elements -- e to es from the right side if (sizeOf es < -- n). Otherwise returns the first n elements of -- es, like keep n es do. justifyR :: Split s e => Int -> e -> s -> s -- | each n es returns each n-th element of structure. If -- n == 1, returns es. If n < 1, returns -- Z. each :: Split s e => Int -> s -> s -- | eachFrom o n es returns each nth element of structure, -- beginning from o. -- --
--   eachFrom o n = each n . drop o
--   
-- --
--   eachFrom 0 2 [1 .. 20] == [2, 4 .. 20]
--   eachFrom 1 2 [1 .. 20] == [3, 5 .. 19]
--   
eachFrom :: Split s e => Int -> Int -> s -> s -- | sub `isPrefixOf` es checks if sub is -- beginning of es. isPrefixOf :: (Split s e, Eq e) => s -> s -> Bool -- | sub `isSuffixOf` es checks if sub is ending -- of es. isSuffixOf :: (Split s e, Eq e) => s -> s -> Bool -- | isInfixOf checks whether the first line is the substring of the second isInfixOf :: (Split s e, Eq e) => s -> s -> Bool -- | prefix gives length of init, satisfying preducate. prefix :: Split s e => (e -> Bool) -> s -> Int -- | suffix gives length of tail, satisfying predicate. suffix :: Split s e => (e -> Bool) -> s -> Int -- | infixes inf es returns a list of inf positions in -- es, without intersections. -- --
--   "" `infixes` es = []
--   "abba" `infixes` "baababba" == [4]
--   "abab" `infixes` "baababab" == [2]
--   "aaaa" `infixes` "aaaaaaaa" == [0, 4]
--   
infixes :: (Split s e, Eq e) => s -> s -> [Int] -- | dropSide f = dropWhile f . dropEnd f. dropSide :: Split s e => (e -> Bool) -> s -> s -- | Takes the longest init by predicate. takeWhile :: Split s e => (e -> Bool) -> s -> s -- | Drops the longest init by predicate. dropWhile :: Split s e => (e -> Bool) -> s -> s -- | Takes the longest suffix by predicate. takeEnd :: Split s e => (e -> Bool) -> s -> s -- | Drops the longest prefix by predicate. dropEnd :: Split s e => (e -> Bool) -> s -> s -- | Left-side span. spanl :: Split s e => (e -> Bool) -> s -> (s, s) -- | Left-side break. breakl :: Split s e => (e -> Bool) -> s -> (s, s) -- | Right-side span. spanr :: Split s e => (e -> Bool) -> s -> (s, s) -- | Right-side break. breakr :: Split s e => (e -> Bool) -> s -> (s, s) -- | selectWhile f es selects results of applying f to -- es (left to right) untill first fail. selectWhile :: Split s e => (e -> Maybe a) -> s -> [a] -- | selectEnd f es selects results of applying f to -- es (right to left) untill first fail. selectEnd :: Split s e => (e -> Maybe a) -> s -> [a] -- | extractWhile f es selects results of applying f to -- es (left to right) untill first fail. Returns selected -- results and rest of line. extractWhile :: Split s e => (e -> Maybe a) -> s -> ([a], s) -- | extractEnd f es selects results of applying f to -- es (right to left) untill first fail. Returns rest of line -- and selected results. extractEnd :: Split s e => (e -> Maybe a) -> s -> (s, [a]) -- | selectWhile' is selectWhile version for generalized -- structures. selectWhile' :: (Split s e, t e ~ l, Split1 t a) => (e -> Maybe a) -> s -> t a -- | selectEnd' is selectEnd version for generalized -- structures. selectEnd' :: (Split s e, t e ~ l, Split1 t a) => (e -> Maybe a) -> s -> t a -- | extractWhile' is extractWhile version for generalized -- structures. extractWhile' :: (Split s e, t e ~ l, Split1 t a) => (e -> Maybe a) -> s -> (t a, s) -- | extractEnd' is extractEnd version for generalized -- structures. extractEnd' :: (Split s e, t e ~ l, Split1 t a) => (e -> Maybe a) -> s -> (s, t a) -- | Kind (Type -> Type) Split structure. type Split1 s e = Split (s e) e -- | stripPrefix sub line strips prefix sub of -- line (if any). stripPrefix :: (Split s e, Bordered s i, Eq e) => s -> s -> s -- | stripSuffix sub line strips suffix sub of -- line (if any). stripSuffix :: (Split s e, Bordered s i, Eq e) => s -> s -> s -- | stripPrefix' sub line strips prefix sub of -- line or returns Nothing. stripPrefix' :: (Split s e, Bordered s i, Eq e) => s -> s -> Maybe s -- | stripSuffix sub line strips suffix sub of -- line or returns Nothing. stripSuffix' :: (Split s e, Bordered s i, Eq e) => s -> s -> Maybe s -- | intercalate is generalization of intercalate intercalate :: (Foldable f, Linear1 f l, Linear l e) => l -> f l -> l -- | tails es returns sequence of es tails. tails :: Linear l e => l -> [l] -- | tails is generalization of inits. inits :: Linear l e => l -> [l] -- | ascending es lengths checks if the subsequences of -- es of lengths lengths is sorted. ascending :: (Split s e, Sort s e, Ord e) => s -> [Int] -> Bool instance SDP.Linear.Linear [e] e instance SDP.Linear.Split [e] e instance SDP.Index.Index i => SDP.Linear.Bordered (i, i) i instance SDP.Linear.Bordered [e] GHC.Types.Int -- | SDP.Shaped provides advanced operations on Indexed -- structures, generalized by Index type. module SDP.Shaped -- | Service class for structures with arbitrary bounds. Allows you to -- extract subsequences corresponding to index subranges. class Shaped s e -- | rebound with defaultBounds. defaultRebound :: (Shaped s e, Index i, Index j, Bordered2 s i e) => s i e -> s j e -- | Set new bounds of same type, may shrink. rebound :: (Shaped s e, Index i) => s i e -> (i, i) -> s i e -- | Set new bounds, may shrink. reshape :: (Shaped s e, Index i, Index j) => s i e -> (j, j) -> s j e -- | es !! ij returns subshape ij of es. (!!) :: (Shaped s e, SubIndex i j) => s i e -> (i :|: j) -> s j e -- | Returns list of es subshapes. slices :: (Shaped s e, SubIndex i j) => s i e -> [s j e] -- | Unslice subshapes. unslice :: (Shaped s e, Foldable f, SubIndex i j) => f (s j e) -> s i e -- | SDP.Set provides Set - class for basic set operations. module SDP.Set -- | SetWith is a class of data structures, that can represent sets. -- -- SetWith doesn't provide data protection/validation before each -- first action. All functions (except setWith) works correctly -- only with correct sets. SetWith guarantee only that the -- returned data is correct. So if you need maximum reliability and -- security, use containers. But if you want simplicity, -- openness and a lot of non-set functions without extra conversions, -- then you are at the right place. -- -- Note that function of type Compare o must follow basic order -- laws (comparability, transitivity, reflexivity and antisymmetry). With -- wrong comparator, the result may become implementation-dependent. class (Nullable s) => SetWith s o | s -> o -- | Creates ordered set from linear structure. setWith :: (SetWith s o, Linear s o) => Compare o -> s -> s -- | Creates ordered set from linear structure. setWith :: SetWith s o => Compare o -> s -> s -- | Creates set from linear structure using additional function for -- choice/merge equal elements. groupSetWith :: (SetWith s o, Linear s o) => Compare o -> (o -> o -> o) -> s -> s -- | Creates set from linear structure using additional function for -- choice/merge equal elements. groupSetWith :: SetWith s o => Compare o -> (o -> o -> o) -> s -> s -- | Adding element to set. insertWith :: (SetWith s o, Linear s o) => Compare o -> o -> s -> s -- | Adding element to set. insertWith :: SetWith s o => Compare o -> o -> s -> s -- | Deleting element from set. deleteWith :: (SetWith s o, Linear s o) => Compare o -> o -> s -> s -- | Deleting element from set. deleteWith :: SetWith s o => Compare o -> o -> s -> s -- | Intersection of two sets. intersectionWith :: SetWith s o => Compare o -> s -> s -> s -- | Difference (relative complement, aka A / B) of two sets. differenceWith :: SetWith s o => Compare o -> s -> s -> s -- | Symmetric difference of two sets. symdiffWith :: SetWith s o => Compare o -> s -> s -> s -- | Union of two sets. unionWith :: SetWith s o => Compare o -> s -> s -> s -- | Fold by intersectionWith. intersectionsWith :: (SetWith s o, Foldable f) => Compare o -> f s -> s -- | Fold by differenceWith. differencesWith :: (SetWith s o, Foldable f) => Compare o -> f s -> s -- | Fold by unionWith. unionsWith :: (SetWith s o, Foldable f) => Compare o -> f s -> s -- | Fold by symdiffWith. symdiffsWith :: (SetWith s o, Foldable f) => Compare o -> f s -> s -- | Compares sets on intersection. isIntersectsWith :: SetWith s o => Compare o -> s -> s -> Bool -- | Compares sets on disjoint. isDisjointWith :: SetWith s o => Compare o -> s -> s -> Bool -- | Same as elem, but can work faster. By default, uses -- find. memberWith :: (SetWith s o, t o ~~ s, Foldable t) => Compare o -> o -> s -> Bool -- | Same as elem, but can work faster. By default, uses -- find. memberWith :: SetWith s o => Compare o -> o -> s -> Bool -- | Сhecks whether a first set is a subset of second. isSubsetWith :: (SetWith s o, t o ~~ s, Foldable t) => Compare o -> s -> s -> Bool -- | Сhecks whether a first set is a subset of second. isSubsetWith :: SetWith s o => Compare o -> s -> s -> Bool -- | Generates a list of different subsets (including empty and -- equivalent). subsets :: (SetWith s o, Linear s o, Ord o) => s -> [s] -- | Generates a list of different subsets (including empty and -- equivalent). subsets :: (SetWith s o, Ord o) => s -> [s] -- | lookupLTWith trying to find lesser element in set. lookupLTWith :: SetWith s o => Compare o -> o -> s -> Maybe o -- | lookupGTWith trying to find greater element in set. lookupGTWith :: SetWith s o => Compare o -> o -> s -> Maybe o -- | lookupGEWith trying to find greater or equal element in set. lookupGEWith :: SetWith s o => Compare o -> o -> s -> Maybe o -- | lookupLEWith trying to find lesser or equal element in set. lookupLEWith :: SetWith s o => Compare o -> o -> s -> Maybe o -- | SetWith contraint for (Type -> Type)-kind types. type SetWith1 s o = SetWith (s o) o -- | SetWith contraint for (Type -> Type -> -- Type)-kind types. type SetWith2 s i o = SetWith (s i o) o -- | Set is a class of data structures, that can represent any sets. -- Set is intended for more specific sets than ordered linear -- structures. In particular, it may not work with an arbitrary -- comparator, and also (unlike the early implementation) does not impose -- restrictions on the element type. -- -- Set, as well as SetWith, doesn't provide data -- protection/validation. class (Nullable s) => Set s o | s -> o -- | The same as setWith compare. set :: (Set s o, SetWith s o, Ord o) => s -> s -- | The same as setWith compare. set :: Set s o => s -> s -- | Same as insert compare. insert :: (Set s o, SetWith s o, Ord o) => o -> s -> s -- | Same as insert compare. insert :: Set s o => o -> s -> s -- | Same as deleteWith compare. delete :: (Set s o, SetWith s o, Ord o) => o -> s -> s -- | Same as deleteWith compare. delete :: Set s o => o -> s -> s -- | Same as intersectionWith compare. (/\) :: (Set s o, SetWith s o, Ord o) => s -> s -> s -- | Same as intersectionWith compare. (/\) :: Set s o => s -> s -> s -- | Same as unionWith compare. (\/) :: (Set s o, SetWith s o, Ord o) => s -> s -> s -- | Same as unionWith compare. (\/) :: Set s o => s -> s -> s -- | Same as differenceWith compare. (\\) :: (Set s o, SetWith s o, Ord o) => s -> s -> s -- | Same as differenceWith compare. (\\) :: Set s o => s -> s -> s -- | Same as symdiffWith compare. (\^/) :: (Set s o, SetWith s o, Ord o) => s -> s -> s -- | Same as symdiffWith compare. (\^/) :: Set s o => s -> s -> s -- | Same as isDisjointWith compare. (/?\) :: (Set s o, SetWith s o, Ord o) => s -> s -> Bool -- | Same as isDisjointWith compare. (/?\) :: Set s o => s -> s -> Bool -- | Same as isIntersectsWith compare. (\?/) :: (Set s o, SetWith s o, Ord o) => s -> s -> Bool -- | Same as isIntersectsWith compare. (\?/) :: Set s o => s -> s -> Bool -- | Same as isSubsetWith compare. (\+/) :: (Set s o, SetWith s o, Ord o) => s -> s -> Bool -- | Same as isSubsetWith compare. (\+/) :: Set s o => s -> s -> Bool -- | Same as intersectionsWith compare. intersections :: (Set s o, Foldable f, SetWith s o, Ord o) => f s -> s -- | Same as intersectionsWith compare. intersections :: (Set s o, Foldable f) => f s -> s -- | Same as unionsWith compare. unions :: (Set s o, Foldable f, SetWith s o, Ord o) => f s -> s -- | Same as unionsWith compare. unions :: (Set s o, Foldable f) => f s -> s -- | Same as differencesWith compare. differences :: (Set s o, Foldable f, SetWith s o, Ord o) => f s -> s -- | Same as differencesWith compare. differences :: (Set s o, Foldable f) => f s -> s -- | Same as symdiffsWith compare'. symdiffs :: (Set s o, Foldable f, SetWith s o, Ord o) => f s -> s -- | Same as symdiffsWith compare'. symdiffs :: (Set s o, Foldable f) => f s -> s -- | Same as memberWith compare. member :: (Set s o, SetWith s o, Ord o) => o -> s -> Bool -- | Same as memberWith compare. member :: Set s o => o -> s -> Bool -- | Same as lookupLTWith compare. lookupLT :: (Set s o, SetWith s o, Ord o) => o -> s -> Maybe o -- | Same as lookupLTWith compare. lookupLT :: (Set s o, Ord o) => o -> s -> Maybe o -- | Same as lookupGTWith compare. lookupGT :: (Set s o, SetWith s o, Ord o) => o -> s -> Maybe o -- | Same as lookupGTWith compare. lookupGT :: (Set s o, Ord o) => o -> s -> Maybe o -- | Same as lookupLEWith compare. lookupLE :: (Set s o, SetWith s o, Ord o) => o -> s -> Maybe o -- | Same as lookupLEWith compare. lookupLE :: (Set s o, Ord o) => o -> s -> Maybe o -- | Same as lookupGEWith compare. lookupGE :: (Set s o, SetWith s o, Ord o) => o -> s -> Maybe o -- | Same as lookupGEWith compare. lookupGE :: (Set s o, Ord o) => o -> s -> Maybe o -- | Set contraint for (Type -> Type)-kind types. type Set1 s o = Set (s o) o -- | Set contraint for (Type -> Type -> Type)-kind -- types. type Set2 s i o = Set (s i o) o -- | SetWith quantified contraint for (Type -> -- Type)-kind types. type SetWith' s = forall o. SetWith (s o) o -- | SetWith quantified contraint for (Type -> Type -> -- Type)-kind types. type SetWith'' s = forall i o. SetWith (s i o) o -- | Set quantified contraint for (Type -> Type)-kind -- types. type Set' s = forall o. Set (s o) o -- | Set quantified contraint for (Type -> Type -> -- Type)-kind types. type Set'' s = forall i o. Set (s i o) o instance GHC.Classes.Ord o => SDP.Set.Set [o] o instance SDP.Set.SetWith [o] o -- | SDP.Scan provides Scan - class for overloaded scans. -- Scan needed for generalization and not so useful is practice as -- other sdp classes. module SDP.Scan -- | Scan is class of scans. class (Linear s a) => Scan s a scanl :: Scan s a => (b -> a -> b) -> b -> s -> [b] scanl' :: Scan s a => (b -> a -> b) -> b -> s -> [b] scanr :: Scan s a => (a -> b -> b) -> b -> s -> [b] scanr' :: Scan s a => (a -> b -> b) -> b -> s -> [b] scanl1 :: Scan s a => (a -> a -> a) -> s -> [a] scanr1 :: Scan s a => (a -> a -> a) -> s -> [a] instance SDP.Scan.Scan [a] a -- | SDP.Map provides Map - class of immutable associative -- arrays. module SDP.Map -- | Map is a class of dictionaries (associative arrays). -- -- Map provides a set of operations on associative arrays that -- aren't specific to Linear data structures and aren't limited by -- the Bordered context (doesn't restrict key type). class (Nullable map) => Map map key e | map -> key, map -> e -- | Returns list of associations (index, element). assocs :: (Map map key e, Bordered map key, Linear map e) => map -> [(key, e)] -- | Returns list of associations (index, element). assocs :: Map map key e => map -> [(key, e)] -- | A less specific version of "SDP.Indexed.Indexed.assoc" that creates a -- new associative array. For Linear structures without gaps, it -- may be less effective. -- --
--   Z // ascs = toMap -- forall ascs
--   
toMap :: Map map key e => [(key, e)] -> map -- | Strict version of toMap with default value. -- -- Note that the default value is set only for elements included in the -- range of the created structure and will not be set for values outside -- its range (when expanding, concatenating, etc.) for most structures -- since they don't store it. toMap' :: Map map key e => e -> [(key, e)] -> map -- | insert' key e map inserts e with key -- to map. If map already contains an element with -- key, the element will be overwritten. -- -- If map doesn't allow gaps, then the missing elements should -- be filled with default values. insert' :: Map map key e => key -> e -> map -> map -- | delete' removes element with given key. -- -- If the structure has boundaries, when removed from the beginning -- (end), they should change accordingly. If the structure doesn't allow -- gaps, then when removed from the middle, the actual value should be -- replaced with the default value. delete' :: Map map key e => key -> map -> map -- | delete' removes element with given key. -- -- If the structure has boundaries, when removed from the beginning -- (end), they should change accordingly. If the structure doesn't allow -- gaps, then when removed from the middle, the actual value should be -- replaced with the default value. delete' :: (Map map key e, Eq key) => key -> map -> map -- | member' key map checks if key in -- map. member' :: (Map map key e, Bordered map key) => key -> map -> Bool -- | member' key map checks if key in -- map. member' :: Map map key e => key -> map -> Bool -- | Update elements of immutable structure (by copying). (//) :: Map map key e => map -> [(key, e)] -> map -- | (.!) is unsafe reader, can be faster -- (!) by skipping checks. (.!) :: Map map key e => map -> key -> e -- | (!) is well-safe reader, may throw -- IndexException. (!) :: Map map key e => map -> key -> e -- | (!) is well-safe reader, may throw -- IndexException. (!) :: (Map map key e, Bordered map key) => map -> key -> e -- | (!?) is completely safe, but very boring function. (!?) :: Map map key e => map -> key -> Maybe e -- | Filter with key. filter' :: Map map key e => (key -> e -> Bool) -> map -> map -- | union' is groupSetWith for maps but works with real -- groups of elements, not with consequentive equal elements. -- -- union' merges/chooses elements with equal keys from two maps. union' :: (Map map key e, Ord key) => (e -> e -> e) -> map -> map -> map -- | difference' f mx my applies comb to values -- with equal keys. If f x y (where (k1, x) <- mx, -- (k2, y) <- my, k1 == k2) is Nothing, -- element isn't included to result map. -- -- Note that difference' is poorer than a similar functions in -- containers. difference' :: (Map map key e, Ord key) => (e -> e -> Maybe e) -> map -> map -> map -- | intersection' f mx my combines elements of -- intersection' by f: if isJust (f x y) (where -- (k1, x) <- mx, (k2, y) <- my, k1 == k2), then element -- is added to result map. intersection' :: (Map map key e, Ord key) => (e -> e -> e) -> map -> map -> map -- | Update function, by default uses (//). update :: Map map key e => map -> (key -> e -> e) -> map -- | lookupLT' k map finds pair (key, value) with -- smallest key, where key < k (if any). k -- may not be a map element. lookupLT' :: (Map map key e, Ord key) => key -> map -> Maybe (key, e) -- | lookupGT' k map finds pair (key, value) with -- greatest key, where key > k (if any). k -- may not be a map element. lookupGT' :: (Map map key e, Ord key) => key -> map -> Maybe (key, e) -- | lookupLE' k map finds pair (key, value) with -- smallest key, where key <= k (if any). If -- k is a map element, returns (k, e). lookupLE' :: (Map map key e, Ord key) => key -> map -> Maybe (key, e) -- | lookupGE' k map finds pair (key, value) with -- key, where key >= k (if any). lookupGE' :: (Map map key e, Ord key) => key -> map -> Maybe (key, e) -- | Returns list of map keys. keys :: Map map key e => map -> [key] -- | Searches the key of first matching element. (.$) :: Map map key e => (e -> Bool) -> map -> Maybe key -- | Searches the keys of all matching elements. (*$) :: Map map key e => (e -> Bool) -> map -> [key] -- | kfoldr is foldr with key. kfoldr :: Map map key e => (key -> e -> b -> b) -> b -> map -> b -- | kfoldl is foldl with key. kfoldl :: Map map key e => (key -> b -> e -> b) -> b -> map -> b -- | kfoldr' is strict version of kfoldr. kfoldr' :: Map map key e => (key -> e -> b -> b) -> b -> map -> b -- | kfoldl' is strict version of kfoldl. kfoldl' :: Map map key e => (key -> b -> e -> b) -> b -> map -> b infixl 9 ! infixl 9 .! infixl 9 !? -- | Map contraint for (Type -> Type)-kind types. type Map1 map key e = Map (map e) key e -- | Map contraint for (Type -> Type -> Type)-kind -- types. type Map2 map key e = Map (map key e) key e -- | Map contraint for (Type -> Type)-kind types. type Map' map key = forall e. Map (map e) key e -- | Map contraint for (Type -> Type -> Type)-kind -- types. type Map'' map = forall key e. Map (map key e) key e instance SDP.Map.Map [e] GHC.Types.Int e -- | SDP.LinearM is a module that provides BorderedM and -- LinearM classes. module SDP.LinearM -- | BorderedM is Bordered version for mutable data -- structures. class (Monad m, Index i) => BorderedM m b i | b -> m, b -> i -- | getBounds returns bounds of mutable data structure. getBounds :: BorderedM m b i => b -> m (i, i) -- | getLower returns lower bound of mutable data structure. getLower :: BorderedM m b i => b -> m i -- | getUpper returns upper bound of mutable data structure. getUpper :: BorderedM m b i => b -> m i -- | getSizeOf returns size of mutable data structure. getSizeOf :: BorderedM m b i => b -> m Int -- | getSizesOf returns sizes of mutable data structure. getSizesOf :: BorderedM m b i => b -> m [Int] -- | nowIndexIn is indexIn version for mutable structures. nowIndexIn :: BorderedM m b i => b -> i -> m Bool -- | getOffsetOf is offsetOf version for mutable structures. getOffsetOf :: BorderedM m b i => b -> i -> m Int -- | getIndexOf is indexOf version for mutable structures. getIndexOf :: BorderedM m b i => b -> Int -> m i -- | getIndices returns indices of mutable data structure. getIndices :: BorderedM m b i => b -> m [i] -- | BorderedM contraint for (Type -> Type)-kind types. type BorderedM1 m l i e = BorderedM m (l e) i -- | BorderedM contraint for (Type -> Type -> -- Type)-kind types. type BorderedM2 m l i e = BorderedM m (l i e) i -- | LinearM is Linear version for mutable data structures. -- This class is designed with the possibility of in-place -- implementation, so many operations from Linear have no -- analogues here. class (Monad m) => LinearM m l e | l -> m, l -> e -- | Monadic single. newNull :: LinearM m l e => m l -- | Monadic isNull. nowNull :: LinearM m l e => l -> m Bool -- | Monadic single. singleM :: LinearM m l e => e -> m l -- | getHead is monadic version of head. This procedure -- mustn't modify the source structure or return references to its -- mutable fields. getHead :: LinearM m l e => l -> m e -- | getLast is monadic version of last. This procedure -- mustn't modify the source structure or return references to its -- mutable fields. getLast :: LinearM m l e => l -> m e -- | Prepends new element to the start of the structure (monadic -- toHead). Like most size-changing operations, prepend -- doesn't guarantee the correctness of the original structure after -- conversion. prepend :: LinearM m l e => e -> l -> m l -- | Appends new element to the end of the structure (monadic -- toLast). Like most size-changing operations, append -- doesn't guarantee the correctness of the original structure after -- conversion. append :: LinearM m l e => l -> e -> m l -- | Monadic fromList. newLinear :: LinearM m l e => [e] -> m l -- | Monadic fromListN. newLinearN :: LinearM m l e => Int -> [e] -> m l -- | Monadic fromFoldable. fromFoldableM :: (LinearM m l e, Foldable f) => f e -> m l -- | Left view of line. getLeft :: LinearM m l e => l -> m [e] -- | Right view of line. getRight :: LinearM m l e => l -> m [e] -- | (!#>) is unsafe monadic offset-based reader. (!#>) :: LinearM m l e => l -> Int -> m e -- | Unsafe monadic offset-based writer. writeM :: LinearM m l e => l -> Int -> e -> m () -- | Create copy. copied :: LinearM m l e => l -> m l -- | copied' es l n returns the slice of es from -- l of length n. copied' :: LinearM m l e => l -> Int -> Int -> m l -- | Monadic reverse, returns new structure. reversed :: LinearM m l e => l -> m l -- | Monadic in-place reverse, reverse elements of given structure. reversed' :: LinearM m l e => l -> m () -- | Monadic concat. merged :: (LinearM m l e, Foldable f) => f l -> m l -- | Monadic version of replicate. filled :: LinearM m l e => Int -> e -> m l -- | removed n es removes element with offset n -- from es. removed :: LinearM m l e => Int -> l -> m l -- | lshiftM es i j cyclically shifts the elements with -- offsets between i and j (i < j) one -- position to the left (the j-th element is in the -- i-th position, the i-th in the (i+1)th, -- etc.) If i >= j, does nothing. lshiftM :: LinearM m l e => l -> Int -> Int -> m () -- | copyTo source soff target toff count writes count -- elements of source from soff to target -- starting with toff. copyTo :: LinearM m l e => l -> Int -> l -> Int -> Int -> m () -- | ofoldrM is right monadic fold with offset. ofoldrM :: LinearM m l e => (Int -> e -> r -> m r) -> r -> l -> m r -- | ofoldlM is left monadic fold with offset. ofoldlM :: LinearM m l e => (Int -> r -> e -> m r) -> r -> l -> m r -- | ofoldrM' is strict version of ofoldrM. ofoldrM' :: LinearM m l e => (Int -> e -> r -> m r) -> r -> l -> m r -- | ofoldrM' is strict version of ofoldrM. ofoldlM' :: LinearM m l e => (Int -> r -> e -> m r) -> r -> l -> m r -- | foldrM is just ofoldrM in Linear context. foldrM :: LinearM m l e => (e -> r -> m r) -> r -> l -> m r -- | foldlM is just ofoldlM in Linear context. foldlM :: LinearM m l e => (r -> e -> m r) -> r -> l -> m r -- | foldrM' is strict version of foldrM. foldrM' :: LinearM m l e => (e -> r -> m r) -> r -> l -> m r -- | foldlM' is strict version of foldlM. foldlM' :: LinearM m l e => (r -> e -> m r) -> r -> l -> m r -- | foldrM1 is foldrM version with last element as -- base. foldrM1 :: LinearM m l e => (e -> e -> m e) -> l -> m e -- | foldlM1 is foldlM version with head element as -- base. foldlM1 :: LinearM m l e => (e -> e -> m e) -> l -> m e -- | Just swap two elements. swapM :: LinearM m l e => l -> Int -> Int -> m () infixl 5 !#> -- | LinearM contraint for (Type -> Type)-kind types. type LinearM1 m l e = LinearM m (l e) e -- | LinearM contraint for (Type -> Type -> -- Type)-kind types. type LinearM2 m l i e = LinearM m (l i e) e -- | (:+=) is fmr-compatible prepend -- element pattern for LinearM fields. pattern (:+=) :: (Typeable record, Typeable field, Typeable m, Typeable l, Typeable e, LinearM m l e, FieldGet field, FieldSet field) => e -> field m record l -> Prop m field record -- | (:=+) is fmr-compatible append element -- pattern for LinearM fields. pattern (:=+) :: (Typeable record, Typeable field, Typeable m, Typeable l, Typeable e, LinearM m l e, FieldGet field, FieldSet field) => field m record l -> e -> Prop m field record -- | (:~=) is fmr-compatible delete element -- pattern for LinearM fields, see removed. pattern (:~=) :: (Typeable record, Typeable field, Typeable m, Typeable l, Typeable e, LinearM m l e, FieldGet field, FieldSet field) => Int -> field m record l -> Prop m field record -- | BorderedM contraint for (Type -> Type)-kind types. type BorderedM' m l i = forall e. BorderedM m (l e) i -- | BorderedM contraint for (Type -> Type -> -- Type)-kind types. type BorderedM'' m l = forall i e. BorderedM m (l i e) i -- | LinearM contraint for (Type -> Type)-kind types. type LinearM' m l = forall e. LinearM m (l e) e -- | LinearM contraint for (Type -> Type -> -- Type)-kind types. type LinearM'' m l = forall i e. LinearM m (l i e) e -- | SplitM is Split version for mutable data structures. -- This class is designed with the possibility of in-place -- implementation, so many operations from Split have no analogues -- here. class (LinearM m s e) => SplitM m s e -- | takeM n es returns a reference to the es, keeping -- first n elements. Changes in the source and result must be -- synchronous. takeM :: SplitM m s e => Int -> s -> m s -- | takeM n es returns a reference to the es, keeping -- first n elements. Changes in the source and result must be -- synchronous. takeM :: (SplitM m s e, BorderedM m s i) => Int -> s -> m s -- | dropM n es returns a reference to the es, discarding -- first n elements. Changes in the source and result must be -- synchronous. dropM :: SplitM m s e => Int -> s -> m s -- | dropM n es returns a reference to the es, discarding -- first n elements. Changes in the source and result must be -- synchronous. dropM :: (SplitM m s e, BorderedM m s i) => Int -> s -> m s -- | keepM n es returns a reference to the es, keeping -- last n elements. Changes in the source and result must be -- synchronous. keepM :: SplitM m s e => Int -> s -> m s -- | keepM n es returns a reference to the es, keeping -- last n elements. Changes in the source and result must be -- synchronous. keepM :: (SplitM m s e, BorderedM m s i) => Int -> s -> m s -- | sansM n es returns a reference to the es, discarding -- last n elements. Changes in the source and result must be -- synchronous. sansM :: SplitM m s e => Int -> s -> m s -- | sansM n es returns a reference to the es, discarding -- last n elements. Changes in the source and result must be -- synchronous. sansM :: (SplitM m s e, BorderedM m s i) => Int -> s -> m s -- | splitM n es returns pair of references to the es: -- keeping and discarding first n elements. Changes in the -- source and result must be synchronous. splitM :: SplitM m s e => Int -> s -> m (s, s) -- | divideM n es returns pair of references to the es: -- discarding and keeping last n elements. Changes in the source -- and results must be synchronous. divideM :: SplitM m s e => Int -> s -> m (s, s) -- | splitM ns es returns the sequence of es prefix -- references of length n <- ns. Changes in the source and -- results must be synchronous. splitsM :: (SplitM m s e, Foldable f) => f Int -> s -> m [s] -- | dividesM ns es returns the sequence of es suffix -- references of length n <- ns. Changes in the source and -- results must be synchronous. dividesM :: (SplitM m s e, Foldable f) => f Int -> s -> m [s] -- | partsM n es returns the sequence of es prefix -- references, splitted by offsets in es. Changes in the source -- and results must be synchronous. partsM :: (SplitM m s e, Foldable f) => f Int -> s -> m [s] -- | chunksM n es returns the sequence of es prefix -- references of length n. Changes in the source and results -- must be synchronous. chunksM :: SplitM m s e => Int -> s -> m [s] -- | eachM n es returns new sequence of es elements with -- step n. eachM shouldn't return references to es. eachM :: SplitM m s e => Int -> s -> m s -- | prefixM p es returns the longest es prefix size, -- satisfying p. prefixM :: SplitM m s e => (e -> Bool) -> s -> m Int -- | suffixM p es returns the longest es suffix size, -- satisfying p. suffixM :: SplitM m s e => (e -> Bool) -> s -> m Int -- | mprefix p es returns the longest es prefix size, -- satisfying p. mprefix :: SplitM m s e => (e -> m Bool) -> s -> m Int -- | msuffix p es returns the longest es suffix size, -- satisfying p. msuffix :: SplitM m s e => (e -> m Bool) -> s -> m Int -- | Kind (Type -> Type) SplitM structure. type SplitM1 m l e = SplitM m (l e) e instance Data.Property.IsProp (SDP.LinearM.FieldLinearM l e) -- | SDP.MapM provides MapM - class of mutable associative -- arrays. module SDP.MapM -- | MapM is class of mutable associative arrays. class (Monad m) => MapM m map key e | map -> m, map -> key, map -> e -- | Create new mutable map from list of (key, element) -- associations. newMap :: MapM m map key e => [(key, e)] -> m map -- | Create new mutable map from list of (key, element) -- associations. newMap' :: MapM m map key e => e -> [(key, e)] -> m map -- | getAssocs is version of assocs for mutable maps. getAssocs :: (MapM m map key e, LinearM m map e) => map -> m [(key, e)] -- | getAssocs is version of assocs for mutable maps. getAssocs :: MapM m map key e => map -> m [(key, e)] -- | (>!) is unsafe monadic reader. (>!) :: MapM m map key e => map -> key -> m e -- | (!>) is well-safe monadic reader. (!>) :: (MapM m map key e, BorderedM m map key) => map -> key -> m e -- | (!>) is well-safe monadic reader. (!>) :: MapM m map key e => map -> key -> m e -- | (!?>) is completely safe monadic reader. (!?>) :: MapM m map key e => map -> key -> m (Maybe e) -- | Update elements by mapping with indices. updateM :: MapM m map key e => map -> (key -> e -> e) -> m map -- | This function designed to overwrite large enough fragments of the -- structure (unlike writeM and writeM') -- -- In addition to write operations, overwrite can move and clean, -- optimize data presentation, etc. of a particular structure. Since the -- reference to the original structure may not be the same as reference -- to the result (which implementation is undesirable, but acceptable), -- the original reference (argument) shouldn't be used after -- overwrite. -- -- All standard sdp structures support safe in-place -- overwrite. -- -- If the structure uses unmanaged memory, then all unused fragments in -- the resulting structure must be deallocated, regardless of -- reachability by original reference (argument). -- -- Please note that overwrite require a list of associations -- with indices in the current structure bounds and ignore any other, -- therefore: -- --
--   fromAssocs bnds ascs /= (fromAssocs bnds ascs >>= flip overwrite ascs)
--   
overwrite :: MapM m map key e => map -> [(key, e)] -> m map -- | Checks if key in map. memberM' :: (MapM m map key e, BorderedM m map key) => map -> key -> m Bool -- | Checks if key in map. memberM' :: MapM m map key e => map -> key -> m Bool -- | Returns list of map keys. getKeys :: (MapM m map key e, BorderedM m map key) => map -> m [key] -- | Returns list of map keys. getKeys :: MapM m map key e => map -> m [key] -- | (.?) is monadic version of (.$). (.?) :: MapM m map key e => (e -> Bool) -> map -> m (Maybe key) -- | (*?) is monadic version of (*$). (*?) :: MapM m map key e => (e -> Bool) -> map -> m [key] -- | kfoldrM is right monadic fold with key. kfoldrM :: MapM m map key e => (key -> e -> acc -> m acc) -> acc -> map -> m acc -- | kfoldlM is left monadic fold with key. kfoldlM :: MapM m map key e => (key -> acc -> e -> m acc) -> acc -> map -> m acc -- | kfoldrM' is strict version of kfoldrM. kfoldrM' :: MapM m map key e => (key -> e -> acc -> m acc) -> acc -> map -> m acc -- | kfoldlM' is strict version of kfoldlM. kfoldlM' :: MapM m map key e => (key -> acc -> e -> m acc) -> acc -> map -> m acc infixl 5 >! infixl 5 !> infixl 5 !?> -- | MapM contraint for (Type -> Type)-kind types. type MapM1 m map key e = MapM m (map e) key e -- | MapM contraint for (Type -> Type -> Type)-kind -- types. type MapM2 m map key e = MapM m (map key e) key e -- | MapM contraint for (Type -> Type)-kind types. type MapM' m map key = forall e. MapM m (map e) key e -- | MapM contraint for (Type -> Type -> Type)-kind -- types. type MapM'' m map = forall key e. MapM m (map key e) key e -- | SDP.Indexed provides Indexed and Freeze classes. module SDP.Indexed -- | Indexed is class of ordered associative arrays with static -- bounds. class (Linear v e, Bordered v i, Map v i e) => Indexed v i e | v -> i, v -> e -- | assoc bnds ascs create new structure from list of -- associations, without default element. Note that bnds is -- ascs bounds and may not match with the result bounds (not -- always possible). assoc :: Indexed v i e => (i, i) -> [(i, e)] -> v -- | assoc' bnds def ascs creates new structure from list of -- associations with default element. Note that bnds is -- ascs bounds and may not match with the result bounds (not -- always possible). assoc' :: Indexed v i e => (i, i) -> e -> [(i, e)] -> v -- | fromIndexed converts this indexed structure to another one. fromIndexed :: (Indexed v i e, Indexed m j e) => m -> v -- | Safe index-based immutable writer. -- | Warning: will be moved to SDP.Map.Map class in sdp-0.3 write' :: Indexed v i e => v -> i -> e -> v -- | Update element by given function. -- | Warning: will be moved to SDP.Map.Map class in sdp-0.3 update' :: Indexed v i e => v -> (e -> e) -> i -> v -- | Create new structure from old by mapping with index. -- | Warning: deprecated in favor of update, will be removed in -- sdp-0.3 updates' :: Indexed v i e => v -> (i -> e -> e) -> v -- | accum f es ies create a new structure from es -- elements selectively updated by function f and ies -- associations list. accum :: Indexed v i e => (e -> e' -> e) -> v -> [(i, e')] -> v -- | imap creates new indexed structure from old with reshaping. imap :: (Indexed v i e, Map m j e) => (i, i) -> m -> (i -> j) -> v -- | Indexed contraint for (Type -> Type)-kind types. type Indexed1 v i e = Indexed (v e) i e -- | Indexed contraint for (Type -> Type -> -- Type)-kind types. type Indexed2 v i e = Indexed (v i e) i e -- | binaryContain checks that sorted structure has equal element. binaryContain :: (Linear v e, Bordered v i) => Compare e -> e -> v -> Bool -- | Service class of mutable to immutable conversions. class (Monad m) => Freeze m v' v | v' -> m -- | freeze is a safe way to convert a mutable structure to a -- immutable. freeze should copy the old structure or ensure -- that it will not be used after calling the procedure. freeze :: Freeze m v' v => v' -> m v -- | unsafeFreeze is unsafe version of freeze. -- unsafeFreeze doesn't guarantee that the structure will be -- copied or locked. It only guarantees that if the old structure isn't -- used, no error will occur. unsafeFreeze :: Freeze m v' v => v' -> m v -- | Freeze contraint for (Type -> Type)-kind types. type Freeze1 m v' v e = Freeze m (v' e) (v e) -- | Freeze contraint for (Type -> Type -> Type)-kind -- types. type Freeze2 m v' v i e = Freeze m (v' i e) (v i e) -- | Indexed contraint for (Type -> Type)-kind types. type Indexed' v i = forall e. Indexed (v e) i e -- | Indexed contraint for (Type -> Type -> -- Type)-kind types. type Indexed'' v = forall i e. Indexed (v i e) i e -- | Freeze contraint for (Type -> Type)-kind types. type Freeze' m v' v = forall e. Freeze m (v' e) (v e) -- | Freeze contraint for (Type -> Type -> Type)-kind -- types. type Freeze'' m v' v = forall i e. Freeze m (v' i e) (v i e) instance SDP.Indexed.Indexed [e] GHC.Types.Int e -- | SDP.IndexedM provides IndexedM and Thaw classes. module SDP.IndexedM -- | Class for work with mutable indexed structures. class (LinearM m v e, BorderedM m v i, MapM m v i e) => IndexedM m v i e -- | fromAssocs bnds ascs creates new structure from list of -- associations, without default element. Note that bnds is -- ascs bounds and may not match with the result bounds (not -- always possible). fromAssocs :: IndexedM m v i e => (i, i) -> [(i, e)] -> m v -- | fromAssocs' bnds defvalue ascs creates new structure from -- list of associations, with default element. Note that bnds is -- ascs bounds and may not match with the result bounds (not -- always possible). fromAssocs' :: IndexedM m v i e => (i, i) -> e -> [(i, e)] -> m v -- | writeM map key e writes element e to -- key position safely (if key is out of map -- range, do nothing). The writeM function is intended to -- overwrite only existing values, so its behavior is identical for -- structures with both static and dynamic boundaries. -- | Warning: will be moved to SDP.MapM.MapM class in sdp-0.3 writeM' :: IndexedM m v i e => v -> i -> e -> m () -- | Just swap two elements. swapM' :: IndexedM m v i e => v -> i -> i -> m () -- | fromIndexed' is overloaded version of thaw. fromIndexed' :: (IndexedM m v i e, Indexed v' j e) => v' -> m v -- | fromIndexed converts one mutable structure to other. fromIndexedM :: (IndexedM m v i e, IndexedM m v' j e) => v' -> m v -- | reshaped creates new indexed structure from old with reshaping -- function. reshaped :: (IndexedM m v i e, IndexedM m v' j e) => (i, i) -> v' -> (i -> j) -> m v -- | fromAccum f es ies create a new structure from -- es elements selectively updated by function f and -- ies associations list. fromAccum :: IndexedM m v i e => (e -> e' -> e) -> v -> [(i, e')] -> m v -- | Update element by given function. -- | Warning: will be moved to SDP.MapM.MapM class in sdp-0.3 updateM' :: IndexedM m v i e => v -> (e -> e) -> i -> m () -- | IndexedM contraint for (Type -> Type)-kind types. type IndexedM1 m v i e = IndexedM m (v e) i e -- | IndexedM contraint for (Type -> Type -> -- Type)-kind types. type IndexedM2 m v i e = IndexedM m (v i e) i e -- | Service class of immutable to mutable conversions. class (Monad m) => Thaw m v v' | v' -> m -- | thaw is safe way to convert a immutable structure to a -- mutable. thaw should copy the old structure or ensure that it -- will not be used after the procedure calling. thaw :: Thaw m v v' => v -> m v' -- | unsafeThaw is unsafe version of thaw. -- unsafeThaw doesn't guarantee that the structure will be -- copied or locked. It only guarantees that if the old structure isn't -- used, no error will occur. unsafeThaw :: Thaw m v v' => v -> m v' -- | Thaw contraint for (Type -> Type)-kind types. type Thaw1 m v v' e = Thaw m (v e) (v' e) -- | Thaw contraint for (Type -> Type -> Type)-kind -- types. type Thaw2 m v v' i e = Thaw m (v i e) (v' i e) -- | IndexedM contraint for (Type -> Type)-kind types. type IndexedM' m v i = forall e. IndexedM m (v e) i e -- | IndexedM contraint for (Type -> Type -> -- Type)-kind types. type IndexedM'' m v = forall i e. IndexedM m (v i e) i e -- | Thaw contraint for (Type -> Type)-kind types. type Thaw' m v v' = forall e. Thaw m (v e) (v' e) -- | Thaw contraint for (Type -> Type -> Type)-kind -- types. type Thaw'' m v v' = forall i e. Thaw m (v i e) (v' i e) -- | SDP.SortM.Insertion provides insertion sort - simple sorting -- algorithm. module SDP.SortM.Insertion -- | insertionSort is just synonym for insertionSortBy -- compare. insertionSort :: (LinearM m v e, BorderedM m v i, Ord e) => v -> m () -- | insertionSortBy is naive service sorting procedure, that have -- O(n^2) complexity in all cases. insertionSortBy :: (LinearM m v e, BorderedM m v i) => Compare e -> v -> m () -- | insertionSortOn is a version of insertionSortBy that -- uses a cast function to compare elements. insertionSortOn :: (LinearM m v e, BorderedM m v i, Ord o) => (e -> o) -> v -> m () -- | unsafeInsertionSort cmp es b s e is internal sorting -- procedure, where cmp - compare function, es - data -- structure, [b .. s] - sorted range, [b .. e] - -- sortable range. unsafeInsertionSort :: LinearM m v e => Compare e -> v -> Int -> Int -> Int -> m () -- | SDP.SortM.Tim provides InsertionSort and -- TimSort algorithms. module SDP.SortM.Tim -- | timSort is just synonym for timSortBy -- compare. timSort :: (LinearM m v e, BorderedM m v i, Ord e) => v -> m () -- | timSortBy is a sorting procedure for mutable random access data -- structures using any comparison function and having O(nlogn) -- complexity in the worst case. timSortBy :: (LinearM m v e, BorderedM m v i) => Compare e -> v -> m () -- | timSortOn is a version of timSortBy that uses a -- conversion function to compare elements. timSortOn :: (LinearM m v e, BorderedM m v i, Ord o) => (e -> o) -> v -> m () -- | minrunTS returns TimSort chunk size by given length. minrunTS :: Int -> Int -- | SDP.Prim.SBytes provides strict unboxed array pseudo-primitive -- types SBytes#, STBytes# and IOBytes#. module SDP.Prim.SBytes -- | MIOBytes# is mutable pseudo-primitive Int-indexed strict -- unboxed array. newtype MIOBytes# (io :: Type -> Type) e MIOBytes# :: STBytes# RealWorld e -> MIOBytes# (io :: Type -> Type) e -- | IOBytes# is mutable pseudo-primitive Int-indexed strict -- unboxed array. type IOBytes# = MIOBytes# IO -- | STBytes# is mutable pseudo-primitive Int-indexed strict -- unboxed array type. data STBytes# s e -- | SBytes# is immutable pseudo-primitive Int-indexed strict -- unboxed array type. -- -- SBytes# isn't real Haskell primitive (like GHC.Exts -- types) but for reliability and stability, I made it inaccessible to -- direct work. data SBytes# e -- | fromSBytes# returns new ByteArray#. fromSBytes# :: Unboxed e => SBytes# e -> ByteArray# -- | packSBytes# creates new SBytes# from sized -- ByteArray#. packSBytes# :: Unboxed e => Int -> ByteArray# -> SBytes# e -- | unpackSBytes# returns ByteArray# field of -- SBytes#. unpackSBytes# :: Unboxed e => SBytes# e -> ByteArray# -- | offsetSBytes# returns SBytes# offset in elements. offsetSBytes# :: Unboxed e => SBytes# e -> Int -- | fromSTBytes# returns new MutableByteArray#. fromSTBytes# :: Unboxed e => STBytes# s e -> State# s -> (# State# s, MutableByteArray# s #) -- | packSTBytes# creates new STBytes# from sized -- MutableByteArray#. packSTBytes# :: Unboxed e => Int -> MutableByteArray# s -> STBytes# s e -- | unpackSTBytes# returns MutableByteArray# field of -- STBytes#. unpackSTBytes# :: Unboxed e => STBytes# s e -> MutableByteArray# s -- | offsetSTBytes# returns STBytes# offset in bytes. offsetSTBytes# :: Unboxed e => STBytes# s e -> Int# -- | unsafeCoerceSBytes# is unsafe low-lowel coerce of an array with -- recounting the number of elements and offset (with possible rounding). unsafeCoerceSBytes# :: (Unboxed a, Unboxed b) => SBytes# a -> SBytes# b -- | unsafeCoerceSTBytes# is unsafe low-lowel coerce of an mutable -- array with recounting the number of elements and offset (with possible -- rounding). unsafeCoerceSTBytes# :: (Unboxed a, Unboxed b) => STBytes# s a -> STBytes# s b -- | unsafeSBytesToPtr# es byte-wise stores SBytes# -- content to Ptr. Returns the number of overwritten elements and -- a pointer to psizeof es (sizeOf es) bytes of allocated -- memory. unsafeSBytesToPtr# :: Unboxed e => SBytes# e -> IO (Int, Ptr e) -- | unsafePtrToSBytes# n ptr byte-wise stores n -- elements of Ptr ptr to SBytes#. unsafePtrToSBytes# :: Unboxed e => (Int, Ptr e) -> IO (SBytes# e) -- | Calculate hash SBytes# using hashUnboxedWith. hashSBytesWith# :: Unboxed e => Int -> SBytes# e -> Int instance GHC.Classes.Eq (SDP.Prim.SBytes.MIOBytes# io e) instance SDP.Estimate.Estimate (SDP.Prim.SBytes.MIOBytes# io e) instance SDP.Linear.Bordered (SDP.Prim.SBytes.MIOBytes# io e) GHC.Types.Int instance Control.Monad.IO.Class.MonadIO io => SDP.LinearM.BorderedM io (SDP.Prim.SBytes.MIOBytes# io e) GHC.Types.Int instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.LinearM.LinearM io (SDP.Prim.SBytes.MIOBytes# io e) e instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.LinearM.SplitM io (SDP.Prim.SBytes.MIOBytes# io e) e instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.MapM.MapM io (SDP.Prim.SBytes.MIOBytes# io e) GHC.Types.Int e instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.IndexedM.IndexedM io (SDP.Prim.SBytes.MIOBytes# io e) GHC.Types.Int e instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.SortM.SortM io (SDP.Prim.SBytes.MIOBytes# io e) e instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.IndexedM.Thaw io (SDP.Prim.SBytes.SBytes# e) (SDP.Prim.SBytes.MIOBytes# io e) instance (Control.Monad.IO.Class.MonadIO io, SDP.Unboxed.Unboxed e) => SDP.Indexed.Freeze io (SDP.Prim.SBytes.MIOBytes# io e) (SDP.Prim.SBytes.SBytes# e) instance (Foreign.Storable.Storable e, SDP.Unboxed.Unboxed e) => SDP.Indexed.Freeze GHC.Types.IO (GHC.Types.Int, GHC.Ptr.Ptr e) (SDP.Prim.SBytes.SBytes# e) instance SDP.Unboxed.Unboxed e => SDP.Linear.Linear (SDP.Prim.SBytes.SBytes# e) e instance SDP.Unboxed.Unboxed e => SDP.IndexedM.Thaw (GHC.ST.ST s) (SDP.Prim.SBytes.SBytes# e) (SDP.Prim.SBytes.STBytes# s e) instance SDP.Unboxed.Unboxed e => SDP.Indexed.Freeze (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) (SDP.Prim.SBytes.SBytes# e) instance GHC.Classes.Eq (SDP.Prim.SBytes.STBytes# s e) instance SDP.Estimate.Estimate (SDP.Prim.SBytes.STBytes# s e) instance SDP.Linear.Bordered (SDP.Prim.SBytes.STBytes# s e) GHC.Types.Int instance SDP.LinearM.BorderedM (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) GHC.Types.Int instance SDP.Unboxed.Unboxed e => SDP.LinearM.LinearM (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) e instance SDP.Unboxed.Unboxed e => SDP.LinearM.SplitM (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) e instance SDP.Unboxed.Unboxed e => SDP.MapM.MapM (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) GHC.Types.Int e instance SDP.Unboxed.Unboxed e => SDP.IndexedM.IndexedM (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) GHC.Types.Int e instance SDP.Unboxed.Unboxed e => SDP.SortM.SortM (GHC.ST.ST s) (SDP.Prim.SBytes.STBytes# s e) e instance SDP.Unboxed.Unboxed e => GHC.Classes.Eq (SDP.Prim.SBytes.SBytes# e) instance (SDP.Unboxed.Unboxed e, GHC.Classes.Ord e) => GHC.Classes.Ord (SDP.Prim.SBytes.SBytes# e) instance (SDP.Unboxed.Unboxed e, GHC.Show.Show e) => GHC.Show.Show (SDP.Prim.SBytes.SBytes# e) instance (SDP.Unboxed.Unboxed e, GHC.Read.Read e) => GHC.Read.Read (SDP.Prim.SBytes.SBytes# e) instance Data.String.IsString (SDP.Prim.SBytes.SBytes# GHC.Types.Char) instance SDP.Unboxed.Unboxed e => GHC.Exts.IsList (SDP.Prim.SBytes.SBytes# e) instance SDP.Nullable.Nullable (SDP.Prim.SBytes.SBytes# e) instance SDP.Unboxed.Unboxed e => GHC.Base.Semigroup (SDP.Prim.SBytes.SBytes# e) instance SDP.Unboxed.Unboxed e => GHC.Base.Monoid (SDP.Prim.SBytes.SBytes# e) instance Data.Default.Class.Default (SDP.Prim.SBytes.SBytes# e) instance SDP.Estimate.Estimate (SDP.Prim.SBytes.SBytes# e) instance SDP.Unboxed.Unboxed e => SDP.Linear.Split (SDP.Prim.SBytes.SBytes# e) e instance SDP.Linear.Bordered (SDP.Prim.SBytes.SBytes# e) GHC.Types.Int instance (SDP.Unboxed.Unboxed e, GHC.Classes.Ord e) => SDP.Set.Set (SDP.Prim.SBytes.SBytes# e) e instance SDP.Unboxed.Unboxed e => SDP.Set.SetWith (SDP.Prim.SBytes.SBytes# e) e instance SDP.Unboxed.Unboxed e => SDP.Scan.Scan (SDP.Prim.SBytes.SBytes# e) e instance SDP.Unboxed.Unboxed e => SDP.Sort.Sort (SDP.Prim.SBytes.SBytes# e) e instance SDP.Unboxed.Unboxed e => SDP.Map.Map (SDP.Prim.SBytes.SBytes# e) GHC.Types.Int e instance SDP.Unboxed.Unboxed e => SDP.Indexed.Indexed (SDP.Prim.SBytes.SBytes# e) GHC.Types.Int e instance (Foreign.Storable.Storable e, SDP.Unboxed.Unboxed e) => SDP.IndexedM.Thaw GHC.Types.IO (SDP.Prim.SBytes.SBytes# e) (GHC.Types.Int, GHC.Ptr.Ptr e) -- | SDP.Prim.SArray provides lazy boxed array pseudo-primitive -- types SArray#, STArray# and IOArray#. module SDP.Prim.SArray -- | MIOArray# is mutable preudo-primitive Int-indexed lazy -- boxed array. newtype MIOArray# (io :: Type -> Type) e MIOArray# :: STArray# RealWorld e -> MIOArray# (io :: Type -> Type) e -- | IOArray# is mutable preudo-primitive Int-indexed lazy -- boxed array. type IOArray# = MIOArray# IO -- | STArray# is mutable preudo-primitive Int-indexed lazy -- boxed array type. data STArray# s e -- | SArray# is immutable pseudo-primitive Int-indexed lazy -- boxed array type. -- -- SArray# isn't real Haskell primitive (like GHC.Exts -- types) but for reliability and stability, I made it inaccessible to -- direct work. data SArray# e -- | fromSArray# returns new Array# (uses -- cloneArray#). fromSArray# :: SArray# e -> Array# e -- | fromSTArray# returns new MutableArray#. fromSTArray# :: STArray# s e -> State# s -> (# State# s, MutableArray# s e #) -- | unpackSArray# returns MutableArray# field of -- SArray#. unpackSArray# :: SArray# e -> Array# e -- | offsetSArray# returns SArray# offset in elements. offsetSArray# :: SArray# e -> Int# -- | unpackSTArray# returns MutableArray# field of -- STArray# or fails. unpackSTArray# :: STArray# s e -> MutableArray# s e -- | offsetSTArray# returns STArray# offset in elements. offsetSTArray# :: STArray# s e -> Int# -- | packSArray# creates new SArray# from sized -- Array#. packSArray# :: Int -> Array# e -> SArray# e -- | packSTArray# creates new STArray# from sized -- MutableArray#. packSTArray# :: Int -> MutableArray# s e -> STArray# s e -- | coerceSArray# is coerce alias. coerceSArray# :: Coercible a b => SArray# a -> SArray# b -- | coerceSTArray# is coerce alias. coerceSTArray# :: Coercible a b => STArray# s a -> STArray# s b instance GHC.Classes.Eq (SDP.Prim.SArray.MIOArray# io e) instance SDP.Estimate.Estimate (SDP.Prim.SArray.MIOArray# io e) instance SDP.Linear.Bordered (SDP.Prim.SArray.MIOArray# io e) GHC.Types.Int instance Control.Monad.IO.Class.MonadIO io => SDP.LinearM.BorderedM io (SDP.Prim.SArray.MIOArray# io e) GHC.Types.Int instance Control.Monad.IO.Class.MonadIO io => SDP.LinearM.LinearM io (SDP.Prim.SArray.MIOArray# io e) e instance Control.Monad.IO.Class.MonadIO io => SDP.LinearM.SplitM io (SDP.Prim.SArray.MIOArray# io e) e instance Control.Monad.IO.Class.MonadIO io => SDP.MapM.MapM io (SDP.Prim.SArray.MIOArray# io e) GHC.Types.Int e instance Control.Monad.IO.Class.MonadIO io => SDP.IndexedM.IndexedM io (SDP.Prim.SArray.MIOArray# io e) GHC.Types.Int e instance Control.Monad.IO.Class.MonadIO io => SDP.SortM.SortM io (SDP.Prim.SArray.MIOArray# io e) e instance Control.Monad.IO.Class.MonadIO io => SDP.IndexedM.Thaw io (SDP.Prim.SArray.SArray# e) (SDP.Prim.SArray.MIOArray# io e) instance Control.Monad.IO.Class.MonadIO io => SDP.Indexed.Freeze io (SDP.Prim.SArray.MIOArray# io e) (SDP.Prim.SArray.SArray# e) instance Foreign.Storable.Storable e => SDP.Indexed.Freeze GHC.Types.IO (GHC.Types.Int, GHC.Ptr.Ptr e) (SDP.Prim.SArray.SArray# e) instance SDP.Linear.Linear (SDP.Prim.SArray.SArray# e) e instance SDP.IndexedM.Thaw (GHC.ST.ST s) (SDP.Prim.SArray.SArray# e) (SDP.Prim.SArray.STArray# s e) instance SDP.Indexed.Freeze (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) (SDP.Prim.SArray.SArray# e) instance GHC.Classes.Eq (SDP.Prim.SArray.STArray# s e) instance SDP.Estimate.Estimate (SDP.Prim.SArray.STArray# s e) instance SDP.Linear.Bordered (SDP.Prim.SArray.STArray# s e) GHC.Types.Int instance SDP.LinearM.BorderedM (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) GHC.Types.Int instance SDP.LinearM.LinearM (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) e instance SDP.LinearM.SplitM (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) e instance SDP.MapM.MapM (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) GHC.Types.Int e instance SDP.IndexedM.IndexedM (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) GHC.Types.Int e instance SDP.SortM.SortM (GHC.ST.ST s) (SDP.Prim.SArray.STArray# s e) e instance GHC.Classes.Eq e => GHC.Classes.Eq (SDP.Prim.SArray.SArray# e) instance Data.Functor.Classes.Eq1 SDP.Prim.SArray.SArray# instance GHC.Classes.Ord e => GHC.Classes.Ord (SDP.Prim.SArray.SArray# e) instance Data.Functor.Classes.Ord1 SDP.Prim.SArray.SArray# instance GHC.Show.Show e => GHC.Show.Show (SDP.Prim.SArray.SArray# e) instance GHC.Read.Read e => GHC.Read.Read (SDP.Prim.SArray.SArray# e) instance Data.String.IsString (SDP.Prim.SArray.SArray# GHC.Types.Char) instance GHC.Exts.IsList (SDP.Prim.SArray.SArray# e) instance SDP.Nullable.Nullable (SDP.Prim.SArray.SArray# e) instance GHC.Base.Semigroup (SDP.Prim.SArray.SArray# e) instance GHC.Base.Monoid (SDP.Prim.SArray.SArray# e) instance Data.Default.Class.Default (SDP.Prim.SArray.SArray# e) instance SDP.Estimate.Estimate (SDP.Prim.SArray.SArray# e) instance GHC.Base.Functor SDP.Prim.SArray.SArray# instance SDP.Zip.Zip SDP.Prim.SArray.SArray# instance GHC.Base.Applicative SDP.Prim.SArray.SArray# instance Data.Foldable.Foldable SDP.Prim.SArray.SArray# instance Data.Traversable.Traversable SDP.Prim.SArray.SArray# instance SDP.Linear.Split (SDP.Prim.SArray.SArray# e) e instance SDP.Linear.Bordered (SDP.Prim.SArray.SArray# e) GHC.Types.Int instance GHC.Classes.Ord e => SDP.Set.Set (SDP.Prim.SArray.SArray# e) e instance SDP.Set.SetWith (SDP.Prim.SArray.SArray# e) e instance SDP.Scan.Scan (SDP.Prim.SArray.SArray# e) e instance SDP.Sort.Sort (SDP.Prim.SArray.SArray# e) e instance SDP.Map.Map (SDP.Prim.SArray.SArray# e) GHC.Types.Int e instance SDP.Indexed.Indexed (SDP.Prim.SArray.SArray# e) GHC.Types.Int e instance Foreign.Storable.Storable e => SDP.IndexedM.Thaw GHC.Types.IO (SDP.Prim.SArray.SArray# e) (GHC.Types.Int, GHC.Ptr.Ptr e) -- | SDP.Prim.TArray provides lazy boxed array of stm -- TVars. Note that TArray# stores each element in -- TVar. module SDP.Prim.TArray -- | SArray# of stm TVars. newtype TArray# e TArray# :: SArray# (TVar e) -> TArray# e -- | A monad supporting atomic memory transactions. data STM a -- | Shared memory locations that support atomic memory transactions. data TVar a instance GHC.Classes.Eq (SDP.Prim.TArray.TArray# e) instance SDP.Nullable.Nullable (SDP.Prim.TArray.TArray# e) instance SDP.Estimate.Estimate (SDP.Prim.TArray.TArray# e) instance SDP.Linear.Bordered (SDP.Prim.TArray.TArray# e) GHC.Types.Int instance SDP.LinearM.BorderedM GHC.Conc.Sync.STM (SDP.Prim.TArray.TArray# e) GHC.Types.Int instance SDP.LinearM.LinearM GHC.Conc.Sync.STM (SDP.Prim.TArray.TArray# e) e instance SDP.LinearM.SplitM GHC.Conc.Sync.STM (SDP.Prim.TArray.TArray# e) e instance SDP.MapM.MapM GHC.Conc.Sync.STM (SDP.Prim.TArray.TArray# e) GHC.Types.Int e instance SDP.IndexedM.IndexedM GHC.Conc.Sync.STM (SDP.Prim.TArray.TArray# e) GHC.Types.Int e instance SDP.IndexedM.Thaw GHC.Conc.Sync.STM (SDP.Prim.SArray.SArray# e) (SDP.Prim.TArray.TArray# e) instance SDP.Indexed.Freeze GHC.Conc.Sync.STM (SDP.Prim.TArray.TArray# e) (SDP.Prim.SArray.SArray# e) -- | SDP.ZipM provides ZipM - class of monadic zips. module SDP.ZipM -- | ZipM is monadic version of Zip. class (Monad m) => ZipM m z | z -> m -- | Monadic zip. zipM :: ZipM m z => z a -> z b -> m (z (a, b)) -- | Monadic zip3. zipM3 :: ZipM m z => z a -> z b -> z c -> m (z (a, b, c)) -- | Monadic zip4. zipM4 :: ZipM m z => z a -> z b -> z c -> z d -> m (z (a, b, c, d)) -- | Monadic zip5. zipM5 :: ZipM m z => z a -> z b -> z c -> z d -> z e -> m (z (a, b, c, d, e)) -- | Monadic zip6. zipM6 :: ZipM m z => z a -> z b -> z c -> z d -> z e -> z f -> m (z (a, b, c, d, e, f)) -- | Pure to monadic lifted zipWith. mzipWith :: ZipM m z => (a -> b -> r) -> z a -> z b -> m (z r) -- | Pure to monadic lifted zipWith3. mzipWith3 :: ZipM m z => (a -> b -> c -> r) -> z a -> z b -> z c -> m (z r) -- | Pure to monadic lifted zipWith4. mzipWith4 :: ZipM m z => (a -> b -> c -> d -> r) -> z a -> z b -> z c -> z d -> m (z r) -- | Pure to monadic lifted zipWith5. mzipWith5 :: ZipM m z => (a -> b -> c -> d -> e -> r) -> z a -> z b -> z c -> z d -> z e -> m (z r) -- | Pure to monadic lifted zipWith6. mzipWith6 :: ZipM m z => (a -> b -> c -> d -> e -> f -> r) -> z a -> z b -> z c -> z d -> z e -> z f -> m (z r) -- | Monadic zipWith. zipWithM :: ZipM m z => (a -> b -> m r) -> z a -> z b -> m (z r) -- | Monadic zipWith3. zipWithM3 :: ZipM m z => (a -> b -> c -> m r) -> z a -> z b -> z c -> m (z r) -- | Monadic zipWith4. zipWithM4 :: ZipM m z => (a -> b -> c -> d -> m r) -> z a -> z b -> z c -> z d -> m (z r) -- | Monadic zipWith5. zipWithM5 :: ZipM m z => (a -> b -> c -> d -> e -> m r) -> z a -> z b -> z c -> z d -> z e -> m (z r) -- | Monadic zipWith6. zipWithM6 :: ZipM m z => (a -> b -> c -> d -> e -> f -> m r) -> z a -> z b -> z c -> z d -> z e -> z f -> m (z r) -- | Text.Read.SDP provides common ReadPrec parsers and -- related stuff. module Text.Read.SDP expect :: Lexeme -> ReadP () appPrec :: Int -- | linearPrec ident is common parser of Linear -- structure with name ident: -- --
--   read "Z" == read "[]" == []
--   read "['l','g','p','l']" == fromList "lgpl"
--   read "4 [1,5,-1,45,12,6,0,0,12]" == fromListN 4 [1,5,-1,45,12,6,0,0,12]
--   
linearPrec :: (Linear l e, Read e) => String -> ReadPrec l -- | indexedPrec ident is common parser of Indexed -- structure with name ident: -- --
--   read "ident (0,1) [(0,0),(1,1)]" == read "(0,1) [(0,0),(1,1)]" == assoc (0,1) [(0,0),(1,1)]
--   
indexedPrec :: (Indexed v i e, Read i, Read e) => String -> ReadPrec v -- | indexedPrec' is common Linear and Indexed parser -- (recommended). indexedPrec' :: (Indexed v i e, Read i, Read e) => String -> ReadPrec v -- | readZeroPrec is just Z parser, see linearPrec. readZeroPrec :: Linear l e => ReadPrec l -- | readAsList is fromList-based parser, see -- linearPrec. readAsList :: (Linear l e, Read e) => ReadPrec l -- | readAsListN is fromListN-based parser, see -- linearPrec. readAsListN :: (Linear l e, Read e) => ReadPrec l -- | readAssocsPrec is sdp recommended format -- ReadPrec parser for Indexed. readAssocsPrec :: (Indexed v i e, Read i, Read e) => ReadPrec v -- | allPrec is just allPrecWith readPrec allPrec :: Read e => ReadPrec [e] -- | allPrecWith is manyTill-based combinator, which reads a -- sequence of elements without any separators: -- --
--   readBy allPrecWith readPrec "1 2 3 4 5 6 7" :: [Int] == [1 .. 7]
--   
allPrecWith :: ReadPrec e -> ReadPrec [e] -- | Just lifted expect. expectPrec :: Lexeme -> ReadPrec () -- | namedPrec readprec name is readPrec with -- optional name prefix. namedPrec :: ReadPrec e -> String -> ReadPrec e -- | read with implicit default value. readDef :: (Read e, Default e) => String -> e -- | readBy is generalized read. readBy :: ReadPrec e -> String -> e -- | readMaybeBy is generalized readMaybe. readMaybeBy :: ReadPrec e -> String -> Maybe e -- | readEitherBy is generalized readEither. readEitherBy :: ReadPrec e -> String -> Either String e -- | readBy with implicit default value. readDefBy :: Default e => ReadPrec e -> String -> e -- | Common Enum parser. readAsEnum :: (Linear l e, Read e, Enum e) => ReadPrec l -- | enumFrom parser: -- --
--   take 5 (readBy enumFromPrec "[1 ..]") == take 5 [1 ..] = [1,2,3,4,5]
--   
enumFromPrec :: (Linear l e, Read e, Enum e) => ReadPrec l -- | enumFromTo parser: -- --
--   readBy enumFromToPrec "[9 .. 12]" == [9 .. 12] == [9,10,11,12]
--   
enumFromToPrec :: (Linear l e, Read e, Enum e) => ReadPrec l -- | enumFromThen parser: -- --
--   take 4 (readBy enumFromThenPrec "[17, -6 .. ]") == take 4 [17, -6 ..] == [17,-6,-29,-52]
--   
enumFromThenPrec :: (Linear l e, Read e, Enum e) => ReadPrec l -- | enumFromThenTo parser: -- --
--   take 4 (readBy enumFromThenToPrec "[17, -6 .. 4]") == [17, -6 .. 4] == [17]
--   
enumFromThenToPrec :: (Linear l e, Read e, Enum e) => ReadPrec l -- | Text.Show.SDP provides common ShowS stuff. module Text.Show.SDP -- | assocsPrec is showsPrec template. assocsPrec :: (Indexed v i e, Show i, Show e) => String -> Int -> v -> ShowS -- | showsRaw is a primitive list-to-string conversion pattern. -- -- Note that attempting to parse the resulting string with standard -- ReadS-based functions will cause an error (ambiguous parse). -- To properly parse a string, use the readRawSequence function -- from the SDP.Text.Read module. showsRaw :: Show e => Int -> [e] -> ShowS -- | Just showsRaw version for Linear. showsRawLinear :: (Linear l e, Show e) => Int -> l -> ShowS -- | SDP.Templates.AnyChunks provides AnyChunks - list of -- data chunks. module SDP.Templates.AnyChunks -- | AnyChunks is list of data chunks. AnyChunks shouldn't contain -- empty chunks, so the AnyChunks constructor is made private (see -- fromChunks and fromChunksM). -- -- data AnyChunks rep e -- | Construct immutable AnyChunks safely. fromChunks :: Nullable (rep e) => [rep e] -> AnyChunks rep e -- | Construct mutable AnyChunks safely. fromChunksM :: BorderedM1 m rep Int e => [rep e] -> m (AnyChunks rep e) -- | Extract immutable AnyChunks chunks safely. toChunks :: AnyChunks rep e -> [rep e] instance GHC.Generics.Generic (SDP.Templates.AnyChunks.AnyChunks rep e) instance (Data.Typeable.Internal.Typeable rep, Data.Typeable.Internal.Typeable e, Data.Data.Data (rep e)) => Data.Data.Data (SDP.Templates.AnyChunks.AnyChunks rep e) instance (GHC.Classes.Eq (rep e), SDP.Linear.Bordered1 rep GHC.Types.Int e, SDP.Linear.Split1 rep e) => GHC.Classes.Eq (SDP.Templates.AnyChunks.AnyChunks rep e) instance (GHC.Classes.Ord (rep e), SDP.Linear.Bordered1 rep GHC.Types.Int e, SDP.Linear.Split1 rep e) => GHC.Classes.Ord (SDP.Templates.AnyChunks.AnyChunks rep e) instance (SDP.Indexed.Indexed1 rep GHC.Types.Int e, GHC.Show.Show e) => GHC.Show.Show (SDP.Templates.AnyChunks.AnyChunks rep e) instance SDP.Indexed.Indexed1 rep GHC.Types.Int GHC.Types.Char => GHC.Show.Show (SDP.Templates.AnyChunks.AnyChunks rep GHC.Types.Char) instance (SDP.Indexed.Indexed1 rep GHC.Types.Int e, GHC.Read.Read e) => GHC.Read.Read (SDP.Templates.AnyChunks.AnyChunks rep e) instance SDP.Nullable.Nullable (SDP.Templates.AnyChunks.AnyChunks rep e) instance GHC.Base.Semigroup (SDP.Templates.AnyChunks.AnyChunks rep e) instance GHC.Base.Monoid (SDP.Templates.AnyChunks.AnyChunks rep e) instance Data.Default.Class.Default (SDP.Templates.AnyChunks.AnyChunks rep e) instance SDP.Linear.Bordered1 rep GHC.Types.Int e => SDP.Estimate.Estimate (SDP.Templates.AnyChunks.AnyChunks rep e) instance SDP.Linear.Linear1 (SDP.Templates.AnyChunks.AnyChunks rep) GHC.Types.Char => Data.String.IsString (SDP.Templates.AnyChunks.AnyChunks rep GHC.Types.Char) instance SDP.Linear.Linear1 (SDP.Templates.AnyChunks.AnyChunks rep) e => GHC.Exts.IsList (SDP.Templates.AnyChunks.AnyChunks rep e) instance GHC.Base.Functor rep => GHC.Base.Functor (SDP.Templates.AnyChunks.AnyChunks rep) instance GHC.Base.Applicative rep => GHC.Base.Applicative (SDP.Templates.AnyChunks.AnyChunks rep) instance Data.Foldable.Foldable rep => Data.Foldable.Foldable (SDP.Templates.AnyChunks.AnyChunks rep) instance Data.Traversable.Traversable rep => Data.Traversable.Traversable (SDP.Templates.AnyChunks.AnyChunks rep) instance SDP.Linear.Bordered1 rep GHC.Types.Int e => SDP.Linear.Bordered (SDP.Templates.AnyChunks.AnyChunks rep e) GHC.Types.Int instance (SDP.Linear.Bordered1 rep GHC.Types.Int e, SDP.Linear.Linear1 rep e) => SDP.Linear.Linear (SDP.Templates.AnyChunks.AnyChunks rep e) e instance (SDP.Linear.Bordered1 rep GHC.Types.Int e, SDP.Linear.Split1 rep e) => SDP.Linear.Split (SDP.Templates.AnyChunks.AnyChunks rep e) e instance SDP.LinearM.BorderedM1 m rep GHC.Types.Int e => SDP.LinearM.BorderedM m (SDP.Templates.AnyChunks.AnyChunks rep e) GHC.Types.Int instance (SDP.LinearM.BorderedM1 m rep GHC.Types.Int e, SDP.LinearM.SplitM1 m rep e) => SDP.LinearM.LinearM m (SDP.Templates.AnyChunks.AnyChunks rep e) e instance (SDP.LinearM.BorderedM1 m rep GHC.Types.Int e, SDP.LinearM.SplitM1 m rep e) => SDP.LinearM.SplitM m (SDP.Templates.AnyChunks.AnyChunks rep e) e instance (SDP.Nullable.Nullable (SDP.Templates.AnyChunks.AnyChunks rep e), SDP.Set.SetWith1 (SDP.Templates.AnyChunks.AnyChunks rep) e, GHC.Classes.Ord e) => SDP.Set.Set (SDP.Templates.AnyChunks.AnyChunks rep e) e instance (SDP.Set.SetWith1 rep e, SDP.Linear.Linear1 rep e, GHC.Classes.Ord (rep e), SDP.Linear.Bordered1 rep GHC.Types.Int e) => SDP.Set.SetWith (SDP.Templates.AnyChunks.AnyChunks rep e) e instance SDP.Linear.Linear1 (SDP.Templates.AnyChunks.AnyChunks rep) e => SDP.Scan.Scan (SDP.Templates.AnyChunks.AnyChunks rep e) e instance SDP.Indexed.Indexed1 rep GHC.Types.Int e => SDP.Map.Map (SDP.Templates.AnyChunks.AnyChunks rep e) GHC.Types.Int e instance SDP.Indexed.Indexed1 rep GHC.Types.Int e => SDP.Indexed.Indexed (SDP.Templates.AnyChunks.AnyChunks rep e) GHC.Types.Int e instance (SDP.LinearM.SplitM1 m rep e, SDP.MapM.MapM1 m rep GHC.Types.Int e, SDP.LinearM.BorderedM1 m rep GHC.Types.Int e) => SDP.MapM.MapM m (SDP.Templates.AnyChunks.AnyChunks rep e) GHC.Types.Int e instance (SDP.LinearM.SplitM1 m rep e, SDP.IndexedM.IndexedM1 m rep GHC.Types.Int e) => SDP.IndexedM.IndexedM m (SDP.Templates.AnyChunks.AnyChunks rep e) GHC.Types.Int e instance (SDP.LinearM.BorderedM1 m rep GHC.Types.Int e, SDP.SortM.SortM1 m rep e, SDP.LinearM.SplitM1 m rep e, SDP.LinearM.LinearM1 m rep e) => SDP.SortM.SortM m (SDP.Templates.AnyChunks.AnyChunks rep e) e instance (SDP.Linear.Linear1 imm e, SDP.IndexedM.Thaw1 m imm mut e) => SDP.IndexedM.Thaw m (SDP.Templates.AnyChunks.AnyChunks imm e) (mut e) instance SDP.IndexedM.Thaw1 m imm mut e => SDP.IndexedM.Thaw m (imm e) (SDP.Templates.AnyChunks.AnyChunks mut e) instance SDP.IndexedM.Thaw1 m imm mut e => SDP.IndexedM.Thaw m (SDP.Templates.AnyChunks.AnyChunks imm e) (SDP.Templates.AnyChunks.AnyChunks mut e) instance SDP.Indexed.Freeze1 m mut imm e => SDP.Indexed.Freeze m (mut e) (SDP.Templates.AnyChunks.AnyChunks imm e) instance (SDP.LinearM.LinearM1 m mut e, SDP.Indexed.Freeze1 m mut imm e) => SDP.Indexed.Freeze m (SDP.Templates.AnyChunks.AnyChunks mut e) (imm e) instance SDP.Indexed.Freeze1 m mut imm e => SDP.Indexed.Freeze m (SDP.Templates.AnyChunks.AnyChunks mut e) (SDP.Templates.AnyChunks.AnyChunks imm e) -- | SDP.Unrolled.Unlist provides Unlist - immutable lazy -- boxed unrolled linked list. module SDP.Unrolled.Unlist -- | Unlist is unrolled linked list of boxed values. type Unlist = AnyChunks SArray# instance Data.Functor.Classes.Eq1 SDP.Unrolled.Unlist.Unlist instance Data.Functor.Classes.Ord1 SDP.Unrolled.Unlist.Unlist instance SDP.Zip.Zip SDP.Unrolled.Unlist.Unlist instance SDP.Sort.Sort (SDP.Unrolled.Unlist.Unlist e) e -- | SDP.Unrolled.STUnlist provides STUnlist - mutable boxed -- lazy bordered unrolled linked list. module SDP.Unrolled.STUnlist -- | STUnlist is mutable version of Unlist. type STUnlist s = AnyChunks (STArray# s) -- | SDP.Unrolled.IOUnlist provides IOUnlist - mutable lazy -- boxed unrolled linked list. module SDP.Unrolled.IOUnlist -- | MIOUnlist is mutable version of Unlist. type MIOUnlist io = AnyChunks (MIOArray# io) -- | IOUnlist is mutable version of Unlist. type IOUnlist = AnyChunks IOArray# -- | SDP.ByteList.Ublist provides Ublist - strict boxed -- unrolled linked list. module SDP.ByteList.Ublist -- | Ublist is unrolled linked list of unboxed values. type Ublist = AnyChunks SBytes# instance SDP.Unboxed.Unboxed e => SDP.Sort.Sort (SDP.ByteList.Ublist.Ublist e) e -- | SDP.ByteList.STUblist provides STUblist - mutable -- unboxed strict unrolled linked list. module SDP.ByteList.STUblist -- | This STUblist is mutable version of Ublist. type STUblist s = AnyChunks (STBytes# s) -- | SDP.ByteList.IOUblist provides IOUblist - mutable strict -- unboxed unrolled linked list. module SDP.ByteList.IOUblist -- | MIOUblist is mutable version of Ublist. type MIOUblist io = AnyChunks (MIOBytes# io) -- | IOUblist is mutable version of Ublist. type IOUblist = AnyChunks IOBytes# -- | Control.Concurrent.SDP.TUnlist provides lazy boxed unrolled -- linked list of stm TVars. module Control.Concurrent.SDP.TUnlist -- | Lazy boxed unrolled linked list. type TUnlist = AnyChunks TArray# -- | A monad supporting atomic memory transactions. data STM a -- | Shared memory locations that support atomic memory transactions. data TVar a -- | Control.Concurent.SDP.TUnlist provides lazy boxed unrolled -- linked list of stm TVars. -- | Warning: This module is the result of a typo in the word -- concurrent and will be removed in sdp-0.3 module Control.Concurent.SDP.TUnlist -- | SDP.Plate.AnyBorder provides AnyBorder - template of -- generalized by index type structure, based on Int-indexed -- primitive. module SDP.Templates.AnyBorder -- | AnyBorder is template, that appends arbitrary bounds to any -- structure. -- -- data AnyBorder rep i e AnyBorder :: !i -> !i -> !rep e -> AnyBorder rep i e instance GHC.Generics.Generic (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (Data.Typeable.Internal.Typeable rep, Data.Typeable.Internal.Typeable e, Data.Data.Data i, Data.Data.Data (rep e)) => Data.Data.Data (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, GHC.Classes.Eq (rep e)) => GHC.Classes.Eq (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, Data.Functor.Classes.Eq1 rep) => Data.Functor.Classes.Eq1 (SDP.Templates.AnyBorder.AnyBorder rep i) instance (SDP.Index.Index i, GHC.Classes.Ord (rep e)) => GHC.Classes.Ord (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, Data.Functor.Classes.Ord1 rep) => Data.Functor.Classes.Ord1 (SDP.Templates.AnyBorder.AnyBorder rep i) instance (SDP.Indexed.Indexed1 rep GHC.Types.Int e, SDP.Index.Index i, GHC.Show.Show i, GHC.Show.Show e) => GHC.Show.Show (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Indexed.Indexed1 rep GHC.Types.Int GHC.Types.Char, SDP.Index.Index i, GHC.Show.Show i) => GHC.Show.Show (SDP.Templates.AnyBorder.AnyBorder rep i GHC.Types.Char) instance (SDP.Index.Index i, GHC.Read.Read i, GHC.Read.Read e, SDP.Indexed.Indexed1 rep GHC.Types.Int e) => GHC.Read.Read (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, Data.String.IsString (rep GHC.Types.Char), SDP.Linear.Bordered1 rep GHC.Types.Int GHC.Types.Char) => Data.String.IsString (SDP.Templates.AnyBorder.AnyBorder rep i GHC.Types.Char) instance (SDP.Index.Index i, GHC.Exts.IsList (rep e), SDP.Linear.Bordered1 rep GHC.Types.Int e) => GHC.Exts.IsList (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, SDP.Linear.Bordered (rep e) GHC.Types.Int, SDP.Nullable.Nullable (rep e)) => SDP.Nullable.Nullable (SDP.Templates.AnyBorder.AnyBorder rep i e) instance SDP.Linear.Linear1 (SDP.Templates.AnyBorder.AnyBorder rep i) e => GHC.Base.Semigroup (SDP.Templates.AnyBorder.AnyBorder rep i e) instance SDP.Linear.Linear1 (SDP.Templates.AnyBorder.AnyBorder rep i) e => GHC.Base.Monoid (SDP.Templates.AnyBorder.AnyBorder rep i e) instance SDP.Linear.Linear1 (SDP.Templates.AnyBorder.AnyBorder rep i) e => Data.Default.Class.Default (SDP.Templates.AnyBorder.AnyBorder rep i e) instance SDP.Index.Index i => SDP.Estimate.Estimate (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, GHC.Base.Functor rep) => GHC.Base.Functor (SDP.Templates.AnyBorder.AnyBorder rep i) instance (SDP.Index.Index i, SDP.Zip.Zip rep) => SDP.Zip.Zip (SDP.Templates.AnyBorder.AnyBorder rep i) instance (SDP.Index.Index i, GHC.Base.Applicative rep) => GHC.Base.Applicative (SDP.Templates.AnyBorder.AnyBorder rep i) instance (SDP.Index.Index i, Data.Foldable.Foldable rep) => Data.Foldable.Foldable (SDP.Templates.AnyBorder.AnyBorder rep i) instance (SDP.Index.Index i, Data.Traversable.Traversable rep) => Data.Traversable.Traversable (SDP.Templates.AnyBorder.AnyBorder rep i) instance SDP.Index.Index i => SDP.Linear.Bordered (SDP.Templates.AnyBorder.AnyBorder rep i e) i instance (SDP.Index.Index i, SDP.Linear.Linear1 rep e, SDP.Linear.Bordered1 rep GHC.Types.Int e) => SDP.Linear.Linear (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.Linear.Split1 rep e, SDP.Linear.Bordered1 rep GHC.Types.Int e) => SDP.Linear.Split (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.LinearM.BorderedM1 m rep GHC.Types.Int e) => SDP.LinearM.BorderedM m (SDP.Templates.AnyBorder.AnyBorder rep i e) i instance (SDP.Index.Index i, SDP.LinearM.LinearM1 m rep e, SDP.LinearM.BorderedM1 m rep GHC.Types.Int e) => SDP.LinearM.LinearM m (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.LinearM.BorderedM1 m rep GHC.Types.Int e, SDP.LinearM.SplitM1 m rep e) => SDP.LinearM.SplitM m (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Set.SetWith1 (SDP.Templates.AnyBorder.AnyBorder rep i) e, SDP.Nullable.Nullable (SDP.Templates.AnyBorder.AnyBorder rep i e), GHC.Classes.Ord e) => SDP.Set.Set (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.Set.SetWith1 rep e, SDP.Linear.Linear1 rep e, SDP.Linear.Bordered1 rep GHC.Types.Int e) => SDP.Set.SetWith (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance SDP.Linear.Linear1 (SDP.Templates.AnyBorder.AnyBorder rep i) e => SDP.Scan.Scan (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.Sort.Sort (rep e) e) => SDP.Sort.Sort (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.Indexed.Indexed1 rep GHC.Types.Int e) => SDP.Map.Map (SDP.Templates.AnyBorder.AnyBorder rep i e) i e instance (SDP.Index.Index i, SDP.Indexed.Indexed1 rep GHC.Types.Int e) => SDP.Indexed.Indexed (SDP.Templates.AnyBorder.AnyBorder rep i e) i e instance (SDP.Linear.Bordered1 rep GHC.Types.Int e, SDP.Linear.Split1 rep e) => SDP.Shaped.Shaped (SDP.Templates.AnyBorder.AnyBorder rep) e instance (SDP.Index.Index i, SDP.MapM.MapM1 m rep GHC.Types.Int e, SDP.LinearM.LinearM1 m rep e, SDP.LinearM.BorderedM1 m rep GHC.Types.Int e) => SDP.MapM.MapM m (SDP.Templates.AnyBorder.AnyBorder rep i e) i e instance (SDP.Index.Index i, SDP.IndexedM.IndexedM1 m rep GHC.Types.Int e) => SDP.IndexedM.IndexedM m (SDP.Templates.AnyBorder.AnyBorder rep i e) i e instance (SDP.Index.Index i, SDP.SortM.SortM1 m rep e) => SDP.SortM.SortM m (SDP.Templates.AnyBorder.AnyBorder rep i e) e instance (SDP.Index.Index i, SDP.IndexedM.Thaw m (rep e) mut) => SDP.IndexedM.Thaw m (SDP.Templates.AnyBorder.AnyBorder rep i e) mut instance (SDP.Index.Index i, SDP.IndexedM.Thaw m imm (rep e), SDP.Linear.Bordered1 rep GHC.Types.Int e) => SDP.IndexedM.Thaw m imm (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, SDP.IndexedM.Thaw1 m imm mut e) => SDP.IndexedM.Thaw m (SDP.Templates.AnyBorder.AnyBorder imm i e) (SDP.Templates.AnyBorder.AnyBorder mut i e) instance (SDP.Index.Index i, SDP.Indexed.Freeze m (rep e) imm) => SDP.Indexed.Freeze m (SDP.Templates.AnyBorder.AnyBorder rep i e) imm instance (SDP.Index.Index i, SDP.Indexed.Freeze m mut (rep e), SDP.Linear.Bordered1 rep GHC.Types.Int e) => SDP.Indexed.Freeze m mut (SDP.Templates.AnyBorder.AnyBorder rep i e) instance (SDP.Index.Index i, SDP.Indexed.Freeze1 m mut imm e) => SDP.Indexed.Freeze m (SDP.Templates.AnyBorder.AnyBorder mut i e) (SDP.Templates.AnyBorder.AnyBorder imm i e) -- | SDP.Unrolled.ST provides STUnrolled - mutable boxed lazy -- bordered unrolled linked list. module SDP.Unrolled.ST -- | STUnrolled is mutable version Unrolled. type STUnrolled s = AnyBorder (STUnlist s) -- | SDP.Unrolled.IO provides IOUnrolled - mutable lazy boxed -- bordered unrolled linked list type. module SDP.Unrolled.IO -- | MIOUnrolled is mutable version of Unrolled. type MIOUnrolled io = AnyBorder (MIOUnlist io) -- | IOUnrolled is mutable version of Unrolled. type IOUnrolled = AnyBorder IOUnlist -- | SDP.Unrolled provides Unrolled - immutable lazy boxed -- bordered unrolled linked list. module SDP.Unrolled -- | Unrolled is bordered unrolled linked list. type Unrolled = AnyBorder Unlist -- | Unlist is unrolled linked list of boxed values. type Unlist = AnyChunks SArray# -- | SDP.Bytes.ST provides STBytes - mutable strict unboxed -- array type. module SDP.Bytes.ST -- | STBytes is mutable version of Bytes. type STBytes s = AnyBorder (STBytes# s) -- | SDP.Bytes.IO provides IOBytes - mutable strict unboxed -- array type. module SDP.Bytes.IO -- | MIOBytes is mutable version of Bytes. type MIOBytes io = AnyBorder (MIOBytes# io) -- | IOBytes is mutable version of Bytes. type IOBytes = AnyBorder IOBytes# -- | SDP.Bytes provides Bytes - immutable strict unboxed -- array type. module SDP.Bytes -- | Bytes - unboxed array. type Bytes = AnyBorder SBytes# -- | SDP.ByteList.ST provides STByteList - mutable unboxed -- strict bordered unrolled linked list. module SDP.ByteList.ST -- | STByteList is mutable version of ByteList. type STByteList s = AnyBorder (STUblist s) -- | SDP.ByteList.IO provides IOByteList - mutable strict -- unboxed bordered unrolled linked list type. module SDP.ByteList.IO -- | MIOByteList is mutable version of ByteList. type MIOByteList io = AnyBorder (MIOUblist io) -- | IOByteList is mutable version of ByteList. type IOByteList = AnyBorder IOUblist -- | SDP.ByteList provides ByteList - immutable strict -- bordered unboxed unrolled linked list. module SDP.ByteList -- | ByteList is bordered strict unboxed unrolled linked list. type ByteList = AnyBorder Ublist -- | Ublist is unrolled linked list of unboxed values. type Ublist = AnyChunks SBytes# -- | SDP.Array.ST provides STArray - mutable lazy boxed array -- type. module SDP.Array.ST -- | STArray is mutable version of Array. type STArray s = AnyBorder (STArray# s) -- | SDP.Array.IO provides IOArray - mutable lazy boxed array -- type. module SDP.Array.IO -- | MIOArray is mutable version of Array. type MIOArray io = AnyBorder (MIOArray# io) -- | IOArray is mutable version of Array. type IOArray = AnyBorder IOArray# -- | SDP.Array provides Array - immutable lazy boxed array -- type. module SDP.Array -- | Array - lazy boxed array. type Array = AnyBorder SArray# -- | Control.Concurrent.SDP.TUnrolled provides lazy boxed unrolled -- linked list of stm TVars. module Control.Concurrent.SDP.TUnrolled -- | Lazy boxed unrolled libked list. type TUnrolled = AnyBorder TUnlist -- | A monad supporting atomic memory transactions. data STM a -- | Shared memory locations that support atomic memory transactions. data TVar a -- | Control.Concurent.SDP.TUnrolled provides mutable lazy boxed -- bordered unrolled linked list. -- | Warning: This module is the result of a typo in the word -- concurrent and will be removed in sdp-0.3 module Control.Concurent.SDP.TUnrolled -- | Control.Concurrent.SDP.TArray provides lazy boxed array of -- stm TVars. module Control.Concurrent.SDP.TArray -- | Lazy boxed array. type TArray = AnyBorder TArray# -- | A monad supporting atomic memory transactions. data STM a -- | Shared memory locations that support atomic memory transactions. data TVar a -- | Control.Concurent.SDP.TArray provides lazy boxed array of -- stm TVars. -- | Warning: This module is the result of a typo in the word -- concurrent and will be removed in sdp-0.3 module Control.Concurent.SDP.TArray