antlr-haskell-0.1.0.0: A Haskell implementation of the ANTLR top-down parser generator

Copyright(c) Karl Cronburg 2018
LicenseBSD3
Maintainerkarl@cs.tufts.edu
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Text.ANTLR.MultiMap

Contents

Description

 
Synopsis

Documentation

newtype Map k v Source #

A multi Map is a mapping from keys k to sets of values v. A nice invariant to maintain while using a multi-map is to never have empty sets mapped to by some key.

Constructors

Map (Map k (Set v)) 
Instances
(Eq k, Eq v) => Eq (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

Methods

(==) :: Map k v -> Map k v -> Bool #

(/=) :: Map k v -> Map k v -> Bool #

(Show k, Show v) => Show (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

Methods

showsPrec :: Int -> Map k v -> ShowS #

show :: Map k v -> String #

showList :: [Map k v] -> ShowS #

Generic (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

Associated Types

type Rep (Map k v) :: Type -> Type #

Methods

from :: Map k v -> Rep (Map k v) x #

to :: Rep (Map k v) x -> Map k v #

(Hashable v, Lift k, Lift v, Data k, Data v, Ord k, Ord v) => Lift (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

Methods

lift :: Map k v -> Q Exp #

(Hashable k, Hashable v) => Hashable (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

Methods

hashWithSalt :: Int -> Map k v -> Int #

hash :: Map k v -> Int #

(Prettify k, Prettify v, Hashable v, Eq v) => Prettify (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

Methods

prettify :: Map k v -> Pretty Source #

prettifyList :: [Map k v] -> Pretty Source #

type Rep (Map k v) Source # 
Instance details

Defined in Text.ANTLR.MultiMap

type Rep (Map k v) = D1 (MetaData "Map" "Text.ANTLR.MultiMap" "antlr-haskell-0.1.0.0-I1YLZdM1Y3a3syLrgVdT7Y" True) (C1 (MetaCons "Map" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map k (Set v)))))

singleton :: (Hashable v, Eq v) => k -> v -> Map k v Source #

The singleton multimap, given a single key and a single value.

fromList :: (Hashable v, Ord k, Eq k, Eq v) => [(k, v)] -> Map k v Source #

Construct a multi Map from a list of key-value pairs.

fromList' :: (Ord k, Eq k, Hashable v, Eq v) => [(k, Set v)] -> Map k v Source #

Same as fromList but where the values in the key-value tuples are already in sets.

toList :: Map k v -> [(k, Set v)] Source #

Inverse of 'fromList\''.

union :: (Ord k, Eq k, Hashable v, Eq v) => Map k v -> Map k v -> Map k v Source #

Take the union of two maps.

empty :: Map k v Source #

The empty multi-map.

lookup :: (Ord k, Hashable v, Eq v) => k -> Map k v -> Set v Source #

Get the set of values mapped to by some key k.

size :: Map k v -> Int Source #

Number of keys in the multi-map.

difference :: (Ord k, Eq v, Hashable v) => Map k v -> Map k v -> Map k v Source #

Map difference of two multi-maps, deleting individual key-value pairs rather than deleting the entire key. Invariant maintained is that input maps with non-null value sets will result in an output with non-null value sets.

Orphan instances

(Lift k, Lift v, Data k, Data v, Ord k, Ord v) => Lift (Map k v) Source # 
Instance details

Methods

lift :: Map k v -> Q Exp #