Copyright | (c) Uni Bremen 2006 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Injective maps
Synopsis
- data InjMap a b
- unsafeConstructInjMap :: Map a b -> Map b a -> InjMap a b
- getAToB :: InjMap a b -> Map a b
- getBToA :: InjMap a b -> Map b a
- empty :: InjMap a b
- member :: (Ord a, Ord b) => a -> b -> InjMap a b -> Bool
- insert :: (Ord a, Ord b) => a -> b -> InjMap a b -> InjMap a b
- delete :: (Ord a, Ord b) => a -> b -> InjMap a b -> InjMap a b
- deleteA :: (Ord a, Ord b) => a -> InjMap a b -> InjMap a b
- deleteB :: (Ord a, Ord b) => b -> InjMap a b -> InjMap a b
- lookupWithA :: (Ord a, Ord b) => a -> InjMap a b -> Maybe b
- lookupWithB :: (Ord a, Ord b) => b -> InjMap a b -> Maybe a
- updateBWithA :: (Ord a, Ord b) => a -> b -> InjMap a b -> InjMap a b
- updateAWithB :: (Ord a, Ord b) => b -> a -> InjMap a b -> InjMap a b
Documentation
the data type of injective maps
Instances
(Eq a, Eq b) => Eq (InjMap a b) Source # | |
(Data a, Data b, Ord a, Ord b) => Data (InjMap a b) Source # | |
Defined in Common.InjMap gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> InjMap a b -> c (InjMap a b) gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (InjMap a b) toConstr :: InjMap a b -> Constr dataTypeOf :: InjMap a b -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (InjMap a b)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (InjMap a b)) gmapT :: (forall b0. Data b0 => b0 -> b0) -> InjMap a b -> InjMap a b gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InjMap a b -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InjMap a b -> r gmapQ :: (forall d. Data d => d -> u) -> InjMap a b -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> InjMap a b -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> InjMap a b -> m (InjMap a b) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InjMap a b -> m (InjMap a b) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InjMap a b -> m (InjMap a b) | |
(Ord a, Ord b) => Ord (InjMap a b) Source # | |
Defined in Common.InjMap | |
(Show a, Show b) => Show (InjMap a b) Source # | |
Generic (InjMap a b) Source # | |
(Ord a, FromJSON a, Ord b, FromJSON b, FromJSONKey a, FromJSONKey b) => FromJSON (InjMap a b) | |
Defined in Common.Json.ConvInstances parseJSON :: Value -> Parser (InjMap a b) parseJSONList :: Value -> Parser [InjMap a b] | |
(Ord a, ToJSON a, Ord b, ToJSON b, ToJSONKey a, ToJSONKey b) => ToJSON (InjMap a b) | |
Defined in Common.Json.ConvInstances toEncoding :: InjMap a b -> Encoding toJSONList :: [InjMap a b] -> Value toEncodingList :: [InjMap a b] -> Encoding | |
(Ord a, ShATermConvertible a, Ord b, ShATermConvertible b) => ShATermConvertible (InjMap a b) | |
Defined in Common.ATerm.ConvInstances toShATermAux :: ATermTable -> InjMap a b -> IO (ATermTable, Int) toShATermList' :: ATermTable -> [InjMap a b] -> IO (ATermTable, Int) fromShATermAux :: Int -> ATermTable -> (ATermTable, InjMap a b) fromShATermList' :: Int -> ATermTable -> (ATermTable, [InjMap a b]) | |
type Rep (InjMap a b) Source # | |
Defined in Common.InjMap type Rep (InjMap a b) = D1 ('MetaData "InjMap" "Common.InjMap" "main" 'False) (C1 ('MetaCons "InjMap" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAToB") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map a b)) :*: S1 ('MetaSel ('Just "getBToA") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map b a)))) |
unsafeConstructInjMap :: Map a b -> Map b a -> InjMap a b Source #
for serialization only
member :: (Ord a, Ord b) => a -> b -> InjMap a b -> Bool Source #
check membership of an injective pair
insert :: (Ord a, Ord b) => a -> b -> InjMap a b -> InjMap a b Source #
insert a pair into the given injective map. An existing key and the corresponding content will be overridden.
delete :: (Ord a, Ord b) => a -> b -> InjMap a b -> InjMap a b Source #
delete the pair with the given key in the injective map. Possibly two pairs may be deleted if the pair is not a member.
lookupWithA :: (Ord a, Ord b) => a -> InjMap a b -> Maybe b Source #
look up the content at domain
lookupWithB :: (Ord a, Ord b) => b -> InjMap a b -> Maybe a Source #
look up the content at codomain
updateBWithA :: (Ord a, Ord b) => a -> b -> InjMap a b -> InjMap a b Source #
update codomain at domain value that must be defined
updateAWithB :: (Ord a, Ord b) => b -> a -> InjMap a b -> InjMap a b Source #
update domain at codomain value that must be defined