type-settheory-0.1.2: Type-level sets and functions expressed as typesSource codeContentsIndex
Type.Set.Example
Synopsis
newtype SMap set a = SMap (Map (V set) a)
singleton :: (Fact (set :⊆: OrdType), Fact (set :⊆: TypeableType), Fact (set :⊆: EqType)) => (k :∈: set) -> k -> a -> SMap set a
insert :: (Fact (set :⊆: OrdType), Fact (set :⊆: TypeableType), Fact (set :⊆: EqType)) => (k :∈: set) -> k -> a -> SMap set a -> SMap set a
lookup :: (Fact (set :⊆: OrdType), Fact (set :⊆: TypeableType), Fact (set :⊆: EqType)) => (k :∈: set) -> k -> SMap set a -> Maybe a
type ExampleSet = (TypeableType :∩: IntegralType) :∪: Singleton String
stringInExampleSet :: String :∈: ExampleSet
intInExampleSet :: Int :∈: ExampleSet
test :: SMap ExampleSet Integer
Documentation
newtype SMap set a Source
A Map whose keys are taken from any type which is a member of set
Constructors
SMap (Map (V set) a)
singleton :: (Fact (set :⊆: OrdType), Fact (set :⊆: TypeableType), Fact (set :⊆: EqType)) => (k :∈: set) -> k -> a -> SMap set aSource
insert :: (Fact (set :⊆: OrdType), Fact (set :⊆: TypeableType), Fact (set :⊆: EqType)) => (k :∈: set) -> k -> a -> SMap set a -> SMap set aSource
lookup :: (Fact (set :⊆: OrdType), Fact (set :⊆: TypeableType), Fact (set :⊆: EqType)) => (k :∈: set) -> k -> SMap set a -> Maybe aSource
type ExampleSet = (TypeableType :∩: IntegralType) :∪: Singleton StringSource
Either Typeable Integrals, or Strings
stringInExampleSet :: String :∈: ExampleSetSource
intInExampleSet :: Int :∈: ExampleSetSource
test :: SMap ExampleSet IntegerSource
Produced by Haddock version 2.4.2