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 |
utility functions and computations of meaningful positions for various data types of the abstract syntax
Synopsis
- 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
typeUniverseS :: String Source #
the string for the universe type
universeId :: Id Source #
the id of the universe type
universeWithRange :: Range -> Kind Source #
the type universe
unitTypeId :: Id Source #
the identifier for the Unit type
strippedType :: Type -> Type Source #
eqStrippedType :: Type -> Type -> Bool Source #
getTypeAppl :: Type -> (Type, [Type]) Source #
get top-level type constructor and its arguments and beta reduce
getTypeApplAux :: Bool -> Type -> (Type, [Type]) Source #
get top-level type constructor and its arguments and beta reduce if True
isPartialArrow :: Id -> Bool Source #
test for a partial function identifier
isProductId :: Id -> Bool Source #
test for a product identifier
isProductIdWithArgs :: Id -> Int -> Bool Source #
test for a product identifier
mapKindV :: (Variance -> Variance) -> (a -> b) -> AnyKind a -> AnyKind b Source #
map a kind and its variance
nonVarRawKind :: RawKind -> RawKind Source #
ignore variances of raw kinds
unitTypeWithRange :: Range -> Type Source #
the Unit type (name)
lazyTypeId :: Id Source #
the prefix name for lazy types
lazyTypeConstr :: Type Source #
the lazy type constructor
mkLazyType :: Type -> Type Source #
make a type lazy
mkProductType :: [Type] -> Type Source #
construct a product type
simpleTypeScheme :: Type -> TypeScheme Source #
convert a type with unbound variables to a scheme
predType :: Range -> Type -> Type Source #
add the unit type as result type or convert a parsed empty tuple to the unit type
predTypeScheme :: Range -> TypeScheme -> TypeScheme Source #
change the type of the scheme to a predType
unPredType :: Type -> (Bool, Type) Source #
check for and remove predicate arrow
isPredType :: Type -> Bool Source #
test if type is a predicate type
unPredTypeScheme :: TypeScheme -> TypeScheme Source #
remove predicate arrow in a type scheme
funKindWithRange :: Range -> Kind Source #
mkFunKind :: Range -> [(Variance, AnyKind a)] -> AnyKind a -> AnyKind a Source #
construct higher order kind from arguments and result kind
toProdType :: Int -> Range -> Type Source #
the type name for a function arrow
mkBracketToken :: BracketKind -> Range -> [Token] Source #
the brackets as tokens with positions
getTupleArgs :: Term -> Maybe [Term] Source #
try to extract tuple arguments
getAppl :: Term -> Maybe (Id, TypeScheme, [Term]) Source #
decompose an ApplTerm
into an application of an operation and a
list of arguments
splitVars :: [GenVarDecl] -> ([VarDecl], [TypeArg]) Source #
split the list of generic variables into values and type variables
extractVars :: Term -> [VarDecl] Source #
extract bindings from an analysed pattern
addPartiality :: [a] -> Type -> Type Source #
make function arrow partial after some arguments
typeArgToType :: TypeArg -> Type Source #
convert a type argument to a type
patToType :: Id -> [TypeArg] -> RawKind -> Type Source #
convert a parameterized type identifier with a result raw kind to a type application
typeArgsListToRawKind :: [TypeArg] -> RawKind -> RawKind Source #
create the (raw if True) kind from type arguments
getFunType :: Type -> Partiality -> [Type] -> Type Source #
get the type of a constructor with given curried argument types
getSelType :: Type -> Partiality -> Type -> Type Source #
get the type of a selector given the data type as first arguemnt
nonVarTypeArg :: TypeArg -> TypeArg Source #
make type argument non-variant
getTypeVar :: TypeArg -> Id Source #
get the type variable
reparseAsId :: Pretty a => a -> Maybe Id Source #
try to reparse the pretty printed input as an identifier