Safe Haskell | Safe-Infered |
---|
Type classes and the standard reduction instances. A part of the code was taken from the paper Typing Haskell in Haskell.
- type Predicates = [Predicate]
- data Predicate = Predicate String Tp
- type ClassEnvironment = Map String Class
- type Class = ([String], Instances)
- type Instances = [Instance]
- type Instance = (Predicate, Predicates)
- emptyClassEnvironment :: ClassEnvironment
- matchPredicates :: OrderedTypeSynonyms -> Predicate -> Predicate -> Maybe MapSubstitution
- insertInstance :: String -> Instance -> ClassEnvironment -> ClassEnvironment
- inClassEnvironment :: String -> ClassEnvironment -> Bool
- superclassPaths :: String -> String -> ClassEnvironment -> [[String]]
- superclasses :: String -> ClassEnvironment -> [String]
- instances :: String -> ClassEnvironment -> Instances
- inHeadNormalForm :: Predicate -> Bool
- listToHeadNormalForm :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> Maybe Predicates
- toHeadNormalForm :: OrderedTypeSynonyms -> ClassEnvironment -> Predicate -> Maybe Predicates
- bySuperclass :: ClassEnvironment -> Predicate -> Predicates
- byInstance :: OrderedTypeSynonyms -> ClassEnvironment -> Predicate -> Maybe Predicates
- entail :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> Predicate -> Bool
- entailList :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> Predicates -> Bool
- scEntail :: ClassEnvironment -> Predicates -> Predicate -> Bool
- newtype ReductionError a = ReductionError a
- contextReduction :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> (Predicates, [ReductionError Predicate])
- associatedContextReduction :: OrderedTypeSynonyms -> ClassEnvironment -> [(Predicate, a)] -> ([(Predicate, a)], [ReductionError (Predicate, a)])
- standardClasses :: ClassEnvironment
Class predicates
type Predicates = [Predicate]Source
Class environments and instances
type ClassEnvironment = Map String ClassSource
type Instance = (Predicate, Predicates)Source
emptyClassEnvironment :: ClassEnvironmentSource
The empty class environment
Class environment
superclassPaths :: String -> String -> ClassEnvironment -> [[String]]Source
superclasses :: String -> ClassEnvironment -> [String]Source
For example, Eq is a superclass of Ord
instances :: String -> ClassEnvironment -> InstancesSource
Head normal form
listToHeadNormalForm :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> Maybe PredicatesSource
Entailment
entail :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> Predicate -> BoolSource
entailList :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> Predicates -> BoolSource
scEntail :: ClassEnvironment -> Predicates -> Predicate -> BoolSource
Context reduction
contextReduction :: OrderedTypeSynonyms -> ClassEnvironment -> Predicates -> (Predicates, [ReductionError Predicate])Source
associatedContextReduction :: OrderedTypeSynonyms -> ClassEnvironment -> [(Predicate, a)] -> ([(Predicate, a)], [ReductionError (Predicate, a)])Source