ixset-typed 0.1.1 → 0.1.2
raw patch · 2 files changed
+25/−4 lines, 2 files
Files
- ixset-typed.cabal +1/−1
- src/Data/IxSet/Typed.hs +24/−3
ixset-typed.cabal view
@@ -1,5 +1,5 @@ name: ixset-typed-version: 0.1.1+version: 0.1.2 synopsis: Efficient relational queries on Haskell sets. description: Create and query sets that are indexed by multiple indices.
src/Data/IxSet/Typed.hs view
@@ -106,15 +106,19 @@ module Data.IxSet.Typed ( -- * Set type- IxSet,+ IxSet(), Indexable(..), All,- noCalcs,- inferIxSet,+ -- ** Declaring indices+ Ix(), ixSet, mkEmpty,+ MkIxSet(), ixFun, ixGen,+ -- ** TH derivation of indices+ noCalcs,+ inferIxSet, -- * Changes to set IndexOp,@@ -276,7 +280,13 @@ -- use this in the 'Indexable' 'empty' method, better use 'mkEmpty' instead. -- -- Note that this function takes a variable number of arguments.+-- Here are some example types at which the function can be used: --+-- > ixSet :: Set a -> Ix ix1 a -> IxSet '[ix1] a+-- > ixSet :: Set a -> Ix ix1 a -> Ix ix2 a -> IxSet '[ix1, ix2] a+-- > ixSet :: Set a -> Ix ix1 a -> Ix ix2 a -> Ix ix3 a -> IxSet '[ix1, ix2, ix3] a+-- > ixSet :: ...+-- ixSet :: MkIxSet ixs ixs a r => Set a -> r ixSet s = ixSet' (IxSet s) @@ -284,7 +294,15 @@ -- 'empty' method. Use 'ixFun' and 'ixGen' for the individual indexes. -- -- Note that this function takes a variable number of arguments.+-- Here are some example types at which the function can be used: --+-- > mkEmpty :: Ix ix1 a -> IxSet '[ix1] a+-- > mkEmpty :: Ix ix1 a -> Ix ix2 a -> IxSet '[ix1, ix2] a+-- > mkEmpty :: Ix ix1 a -> Ix ix2 a -> Ix ix3 a -> IxSet '[ix1, ix2, ix3] a+-- > mkEmpty :: ...+--+-- Concrete example use:+-- -- > instance Indexable '[..., Index1Type, Index2Type] Type where -- > empty = mkEmpty -- > ...@@ -294,6 +312,9 @@ mkEmpty :: MkIxSet ixs ixs a r => r mkEmpty = ixSet Set.empty +-- | Class that allows a variable number of arguments to be passed to the+-- 'ixSet' and 'mkEmpty' functions. See the documentation of these functions+-- for more information. class MkIxSet ixs ixs' a r | r -> a ixs ixs' where ixSet' :: (IxList ixs a -> IxSet ixs' a) -> r