Copyright | (c) Christian Maeder, Uni Bremen 2004-2005 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
The embedding comorphism from HasCASL to Haskell.
- data HasCASL2Haskell = HasCASL2Haskell
- mapSingleSentence :: Env -> Sentence -> Result (TiDecl PNT)
- mapTheory :: (Env, [Named Sentence]) -> Result (Sign, [Named (TiDecl PNT)])
- distinctOpIds :: Int -> [(Id, [OpInfo])] -> [(Id, OpInfo)]
- newName :: Id -> Int -> Id
- findUniqueId :: Env -> Id -> TypeScheme -> Maybe (Id, OpInfo)
- translateSig :: Env -> [HsDecl]
- translateTypeInfo :: Env -> (Id, TypeInfo) -> [HsDecl]
- isSameId :: Id -> Type -> Bool
- typeSynonym :: SrcLoc -> HsType -> Type -> HsDecl
- kindToTypeArgs :: Int -> RawKind -> [HsType]
- getAliasArgs :: Type -> [HsType]
- getArg :: TypeArg -> HsType
- getAliasType :: Type -> HsType
- translateAltDefn :: Env -> DataPat -> AltDefn -> [HsConDecl HsType [HsType]]
- translateDt :: Env -> DataEntry -> Named HsDecl
- translateAssump :: (Id, OpInfo) -> [HsDecl]
- translateTypeScheme :: TypeScheme -> HsType
- translateType :: Type -> HsType
- toProgPos :: Range -> SrcLoc
- mkSName :: String -> SrcLoc -> SN HsName
- mkHsIdent :: IdCase -> Id -> SN HsName
- translateId :: Env -> Id -> TypeScheme -> (IdCase, SN HsName)
- translateTerm :: Env -> Term -> HsExp
- translatePattern :: Env -> Term -> HsPat
- translateCaseProgEq :: Env -> ProgEq -> HsAlt HsExp HsPat [HsDecl]
- translateLetProgEq :: Env -> ProgEq -> HsDecl
- translateProgEq :: Env -> ProgEq -> HsDecl
- cleanSig :: [HsDecl] -> [Named HsDecl] -> [HsDecl]
- expUndef :: SrcLoc -> String -> HsExp
- functionUndef :: SrcLoc -> SN HsName -> HsDecl
- translateSentence :: Env -> Named Sentence -> [Named HsDecl]
- derives :: [SN HsName]
Documentation
data HasCASL2Haskell
The identity of the comorphism
distinctOpIds :: Int -> [(Id, [OpInfo])] -> [(Id, OpInfo)]
Generates distinct names for overloaded function identifiers.
findUniqueId :: Env -> Id -> TypeScheme -> Maybe (Id, OpInfo)
Searches for the real name of an overloaded identifier.
translateSig :: Env -> [HsDecl]
Converts an abstract syntax of HasCASL (after the static analysis) to the top datatype of the abstract syntax of haskell.
translateTypeInfo :: Env -> (Id, TypeInfo) -> [HsDecl]
Converts one type to a data or type declaration in Haskell.
typeSynonym :: SrcLoc -> HsType -> Type -> HsDecl
kindToTypeArgs :: Int -> RawKind -> [HsType]
getAliasArgs :: Type -> [HsType]
getAliasType :: Type -> HsType
translateAltDefn :: Env -> DataPat -> AltDefn -> [HsConDecl HsType [HsType]]
Translation of an alternative constructor for a datatype definition.
translateDt :: Env -> DataEntry -> Named HsDecl
translateAssump :: (Id, OpInfo) -> [HsDecl]
Converts one distinct named function in HasCASL to the corresponding haskell declaration. Generates a definition (Prelude.undefined) for functions that are not defined in HasCASL.
translateTypeScheme :: TypeScheme -> HsType
Translation of the result type of a typescheme to a haskell type.
Uses translateType
.
translateType :: Type -> HsType
Translation of types (e.g. product type, type application ...).
translateId :: Env -> Id -> TypeScheme -> (IdCase, SN HsName)
translateTerm :: Env -> Term -> HsExp
Converts a term in HasCASL to an expression in haskell
translatePattern :: Env -> Term -> HsPat
Conversion of patterns form HasCASL to haskell.
translateCaseProgEq :: Env -> ProgEq -> HsAlt HsExp HsPat [HsDecl]
Translation of a program equation of a case term in HasCASL
translateLetProgEq :: Env -> ProgEq -> HsDecl
Translation of a program equation of a let term in HasCASL
translateProgEq :: Env -> ProgEq -> HsDecl
Translation of a toplevel program equation
functionUndef :: SrcLoc -> SN HsName -> HsDecl
translateSentence :: Env -> Named Sentence -> [Named HsDecl]
derives :: [SN HsName]