Hets - the Heterogeneous Tool Set

Copyright(c) Christian Maeder, Uni Bremen 2004-2005
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone

Comorphisms.HasCASL2Haskell

Description

The embedding comorphism from HasCASL to Haskell.

Synopsis

Documentation

distinctOpIds :: Int -> [(Id, [OpInfo])] -> [(Id, OpInfo)]

Generates distinct names for overloaded function identifiers.

newName :: Id -> Int -> Id

Adds a number to the name of an identifier.

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.

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]]

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 ...).

toProgPos :: Range -> SrcLoc

mkSName :: String -> SrcLoc -> SN HsName

mkHsIdent :: IdCase -> Id -> SN HsName

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

cleanSig :: [HsDecl] -> [Named HsDecl] -> [HsDecl]

remove dummy decls given by sentences

expUndef :: SrcLoc -> String -> HsExp

functionUndef :: SrcLoc -> SN HsName -> HsDecl

derives :: [SN HsName]