Copyright | (c) Christian Maeder and Uni Bremen 2003-2005 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
utility functions and computations of meaningful positions for various data types of the abstract syntax
- typeUniverseS :: String
- universeId :: Id
- universe :: Kind
- universeWithRange :: Range -> Kind
- unitTypeS :: String
- unitTypeId :: Id
- redStep :: Type -> Maybe Type
- strippedType :: Type -> Type
- eqStrippedType :: Type -> Type -> Bool
- getTypeAppl :: Type -> (Type, [Type])
- getTypeApplAux :: Bool -> Type -> (Type, [Type])
- data Arrow
- arrowIdRange :: Range -> Arrow -> Id
- arrowId :: Arrow -> Id
- isArrow :: Id -> Bool
- isPartialArrow :: Id -> Bool
- productId :: Int -> Range -> Id
- isProductId :: Id -> Bool
- isProductIdWithArgs :: Id -> Int -> Bool
- mapKindV :: (Variance -> Variance) -> (a -> b) -> AnyKind a -> AnyKind b
- mapKind :: (a -> b) -> AnyKind a -> AnyKind b
- nonVarRawKind :: RawKind -> RawKind
- toRaw :: Kind -> RawKind
- rStar :: RawKind
- unitType :: Type
- unitTypeWithRange :: Range -> Type
- lazyTypeId :: Id
- coKind :: Kind
- lazyTypeConstr :: Type
- mkLazyType :: Type -> Type
- mkFunArrType :: Type -> Arrow -> Type -> Type
- mkFunArrTypeWithRange :: Range -> Type -> Arrow -> Type -> Type
- mkProductType :: [Type] -> Type
- mkProductTypeWithRange :: [Type] -> Range -> Type
- simpleTypeScheme :: Type -> TypeScheme
- predType :: Range -> Type -> Type
- predTypeScheme :: Range -> TypeScheme -> TypeScheme
- unPredType :: Type -> (Bool, Type)
- isPredType :: Type -> Bool
- unPredTypeScheme :: TypeScheme -> TypeScheme
- funKindWithRange3 :: Range -> Kind -> Kind -> Kind -> Kind
- funKind3 :: Kind -> Kind -> Kind -> Kind
- funKindWithRange :: Range -> Kind
- funKind :: Kind
- mkFunKind :: Range -> [(Variance, AnyKind a)] -> AnyKind a -> AnyKind a
- prodKind1 :: Int -> Range -> Kind -> Kind
- prodKind :: Int -> Range -> Kind
- toType :: Id -> Type
- toFunTypeRange :: Range -> Arrow -> Type
- toFunType :: Arrow -> Type
- toProdType :: Int -> Range -> Type
- mkBracketToken :: BracketKind -> Range -> [Token]
- mkTupleTerm :: [Term] -> Range -> Term
- getTupleArgs :: Term -> Maybe [Term]
- getAppl :: Term -> Maybe (Id, TypeScheme, [Term])
- splitVars :: [GenVarDecl] -> ([VarDecl], [TypeArg])
- extractVars :: Term -> [VarDecl]
- mkOpTerm :: Id -> TypeScheme -> Term
- mkForall :: [GenVarDecl] -> Term -> Term
- mkApplTerm :: Term -> [Term] -> Term
- addPartiality :: [a] -> Type -> Type
- typeArgToType :: TypeArg -> Type
- patToType :: Id -> [TypeArg] -> RawKind -> Type
- typeArgsListToRawKind :: [TypeArg] -> RawKind -> RawKind
- typeArgsListToKind :: [TypeArg] -> Kind -> Kind
- getFunType :: Type -> Partiality -> [Type] -> Type
- getSelType :: Type -> Partiality -> Type -> Type
- nonVarTypeArg :: TypeArg -> TypeArg
- getTypeVar :: TypeArg -> Id
- mkTypeAppl :: Type -> [Type] -> Type
- toKind :: VarKind -> Kind
- reparseAsId :: Pretty a => a -> Maybe Id
- expected :: Pretty a => a -> a -> String
Documentation
the string for the universe type
universeId :: Id
the id of the universe type
universeWithRange :: Range -> Kind
the type universe
unitTypeId :: Id
the identifier for the Unit type
strippedType :: Type -> Type
eqStrippedType :: Type -> Type -> Bool
getTypeAppl :: Type -> (Type, [Type])
get top-level type constructor and its arguments and beta reduce
getTypeApplAux :: Bool -> Type -> (Type, [Type])
get top-level type constructor and its arguments and beta reduce if True
data Arrow
the builtin function arrows
arrowIdRange :: Range -> Arrow -> Id
isPartialArrow :: Id -> Bool
test for a partial function identifier
isProductId :: Id -> Bool
test for a product identifier
isProductIdWithArgs :: Id -> Int -> Bool
test for a product identifier
nonVarRawKind :: RawKind -> RawKind
ignore variances of raw kinds
unitTypeWithRange :: Range -> Type
the Unit type (name)
lazyTypeId :: Id
the prefix name for lazy types
the lazy type constructor
mkLazyType :: Type -> Type
make a type lazy
mkFunArrType :: Type -> Arrow -> Type -> Type
function type
mkProductType :: [Type] -> Type
construct a product type
mkProductTypeWithRange :: [Type] -> Range -> Type
construct a product type
simpleTypeScheme :: Type -> TypeScheme
convert a type with unbound variables to a scheme
predType :: Range -> Type -> Type
add the unit type as result type or convert a parsed empty tuple to the unit type
predTypeScheme :: Range -> TypeScheme -> TypeScheme
change the type of the scheme to a predType
unPredType :: Type -> (Bool, Type)
check for and remove predicate arrow
isPredType :: Type -> Bool
test if type is a predicate type
unPredTypeScheme :: TypeScheme -> TypeScheme
remove predicate arrow in a type scheme
funKindWithRange :: Range -> Kind
mkFunKind :: Range -> [(Variance, AnyKind a)] -> AnyKind a -> AnyKind a
construct higher order kind from arguments and result kind
toFunTypeRange :: Range -> Arrow -> Type
toProdType :: Int -> Range -> Type
the type name for a function arrow
mkBracketToken :: BracketKind -> Range -> [Token]
the brackets as tokens with positions
mkTupleTerm :: [Term] -> Range -> Term
construct a tuple from non-singleton lists
getTupleArgs :: Term -> Maybe [Term]
try to extract tuple arguments
getAppl :: Term -> Maybe (Id, TypeScheme, [Term])
decompose an ApplTerm
into an application of an operation and a
list of arguments
splitVars :: [GenVarDecl] -> ([VarDecl], [TypeArg])
split the list of generic variables into values and type variables
extractVars :: Term -> [VarDecl]
extract bindings from an analysed pattern
mkOpTerm :: Id -> TypeScheme -> Term
construct term from id
mkForall :: [GenVarDecl] -> Term -> Term
bind a term
mkApplTerm :: Term -> [Term] -> Term
construct application with curried arguments
addPartiality :: [a] -> Type -> Type
make function arrow partial after some arguments
typeArgToType :: TypeArg -> Type
convert a type argument to a type
patToType :: Id -> [TypeArg] -> RawKind -> Type
convert a parameterized type identifier with a result raw kind to a type application
typeArgsListToRawKind :: [TypeArg] -> RawKind -> RawKind
create the (raw if True) kind from type arguments
typeArgsListToKind :: [TypeArg] -> Kind -> Kind
create the kind from type arguments
getFunType :: Type -> Partiality -> [Type] -> Type
get the type of a constructor with given curried argument types
getSelType :: Type -> Partiality -> Type -> Type
get the type of a selector given the data type as first arguemnt
nonVarTypeArg :: TypeArg -> TypeArg
make type argument non-variant
getTypeVar :: TypeArg -> Id
get the type variable
mkTypeAppl :: Type -> [Type] -> Type
construct application left-associative
reparseAsId :: Pretty a => a -> Maybe Id
try to reparse the pretty printed input as an identifier