cryptol-2.6.0: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2016 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Cryptol.TypeCheck.Depends

Description

Synopsis

- data TyDecl
  - = TS (TySyn Name) (Maybe String)
  - | NT (Newtype Name) (Maybe String)
  - | AT (ParameterType Name) (Maybe String)
  - | PS (PropSyn Name) (Maybe String)
- setDocString :: Maybe String -> TyDecl -> TyDecl
- orderTyDecls :: [TyDecl] -> InferM [TyDecl]
- orderBinds :: [Bind Name] -> [SCC (Bind Name)]
- class FromDecl d where
  - toBind :: d -> Maybe (Bind Name)
  - toParamFun :: d -> Maybe (ParameterFun Name)
  - toParamConstraints :: d -> [Located (Prop Name)]
  - toTyDecl :: d -> Maybe TyDecl
  - isTopDecl :: d -> Bool
- mkScc :: [(a, [Name], [Name])] -> [SCC a]
- combineMaps :: [Map Name (Located a)] -> InferM (Map Name (Located a))
- combine :: [(Name, Located a)] -> InferM (Map Name (Located a))
- duplicates :: Ord a => [Located a] -> [(a, [Range])]

# Documentation

data TyDecl Source #

Constructors

TS (TySyn Name) (Maybe String) | Type synonym
NT (Newtype Name) (Maybe String) | Newtype
AT (ParameterType Name) (Maybe String) | Parameter type
PS (PropSyn Name) (Maybe String) | Property synonym

setDocString :: Maybe String -> TyDecl -> TyDecl Source #

orderTyDecls :: [TyDecl] -> InferM [TyDecl] Source #

Check for duplicate and recursive type synonyms. Returns the type-synonyms in dependency order.

orderBinds :: [Bind Name] -> [SCC (Bind Name)] Source #

Associate type signatures with bindings and order bindings by dependency.

class FromDecl d where Source #

Methods

toBind :: d -> Maybe (Bind Name) Source #

toParamFun :: d -> Maybe (ParameterFun Name) Source #

toParamConstraints :: d -> [Located (Prop Name)] Source #

toTyDecl :: d -> Maybe TyDecl Source #

isTopDecl :: d -> Bool Source #

Instances

FromDecl (Decl Name) Source # |
Instance details Defined in Cryptol.TypeCheck.Depends Methods toBind :: Decl Name -> Maybe (Bind Name) Source # toParamFun :: Decl Name -> Maybe (ParameterFun Name) Source # toParamConstraints :: Decl Name -> [Located (Prop Name)] Source # toTyDecl :: Decl Name -> Maybe TyDecl Source # isTopDecl :: Decl Name -> Bool Source #
FromDecl (TopDecl Name) Source # |
Instance details Defined in Cryptol.TypeCheck.Depends Methods toBind :: TopDecl Name -> Maybe (Bind Name) Source # toParamFun :: TopDecl Name -> Maybe (ParameterFun Name) Source # toParamConstraints :: TopDecl Name -> [Located (Prop Name)] Source # toTyDecl :: TopDecl Name -> Maybe TyDecl Source # isTopDecl :: TopDecl Name -> Bool Source #

mkScc :: [(a, [Name], [Name])] -> [SCC a] Source #

Given a list of declarations, annoted with (i) the names that they define, and (ii) the names that they use, we compute a list of strongly connected components of the declarations. The SCCs are in dependency order.

combineMaps :: [Map Name (Located a)] -> InferM (Map Name (Located a)) Source #

Combine a bunch of definitions into a single map. Here we check that each name is defined only onces.

combine :: [(Name, Located a)] -> InferM (Map Name (Located a)) Source #

Combine a bunch of definitions into a single map. Here we check that each name is defined only onces.

duplicates :: Ord a => [Located a] -> [(a, [Range])] Source #

Identify multiple occurances of something.