module Happstack.Data.IxSet
(
IxSet,
Indexable(..),
noCalcs,
inferIxSet,
ixSet,
ixFun,
ixGen,
IndexOp,
change,
insert,
delete,
updateIx,
deleteIx,
fromSet,
fromList,
toSet,
toList,
toAscList,
toDescList,
getOne,
getOneOr,
size,
null,
(&&&),
(|||),
union,
intersection,
(@=),
(@<),
(@>),
(@<=),
(@>=),
(@><),
(@>=<),
(@><=),
(@>=<=),
(@+),
(@*),
getEQ,
getLT,
getGT,
getLTE,
getGTE,
getRange,
groupBy,
groupAscBy,
groupDescBy,
flatten,
flattenWithCalcs,
stats
)
where
import Prelude hiding (null)
import Data.Data
import Data.IxSet hiding (ixGen, toAscList, toDescList, Proxy)
import qualified Data.IxSet as S
import Data.IxSet.Ix (Ix)
import qualified Happstack.Data as H
import Happstack.Data hiding (Proxy)
ixGen :: forall a b . (Data a, Ord b, Typeable b) => H.Proxy b -> Ix a
ixGen _example = S.ixGen (S.Proxy :: S.Proxy b)
toAscList :: forall k a. (Indexable a, Typeable a, Typeable k) => H.Proxy k -> IxSet a -> [a]
toAscList _ ixset = S.toAscList (S.Proxy :: S.Proxy k) ixset
toDescList :: forall k a. (Indexable a, Typeable a, Typeable k) => H.Proxy k -> IxSet a -> [a]
toDescList _ ixset = S.toDescList (S.Proxy :: S.Proxy k) ixset
instance Version (IxSet a)
instance (Serialize a, Ord a, Typeable a, Indexable a) => Serialize (IxSet a) where
putCopy = contain . safePut . toList
getCopy = contain $ fmap fromList safeGet
instance (Indexable a, Ord a,Data a, Default a) => Default (IxSet a) where
defaultValue = empty