cryptol-2.2.6: Cryptol: The Language of Cryptography

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

Cryptol.TypeCheck.Depends

Description

Synopsis

- data TyDecl
  - = TS TySyn
  - | NT Newtype
- orderTyDecls :: [TyDecl] -> InferM [TyDecl]
- orderBinds :: [Bind] -> [SCC Bind]
- class FromDecl d where
  - toBind :: d -> Maybe Bind
  - toTyDecl :: d -> Maybe TyDecl
  - isTopDecl :: d -> Bool
- mkScc :: [(a, [QName], [QName])] -> [SCC a]
- combineMaps :: [Map QName (Located a)] -> InferM (Map QName (Located a))
- combine :: [(QName, Located a)] -> InferM (Map QName (Located a))
- duplicates :: Ord a => [Located a] -> [(a, [Range])]

# Documentation

data TyDecl Source

Constructors

TS TySyn |
NT Newtype |

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

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

orderBinds :: [Bind] -> [SCC Bind] Source

Associate type signatures with bindings and order bindings by dependency.

class FromDecl d where Source

Methods

toBind :: d -> Maybe Bind Source

toTyDecl :: d -> Maybe TyDecl Source

isTopDecl :: d -> Bool Source

Instances

FromDecl Decl Source |
FromDecl TopDecl Source |

mkScc :: [(a, [QName], [QName])] -> [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 QName (Located a)] -> InferM (Map QName (Located a)) Source

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

combine :: [(QName, Located a)] -> InferM (Map QName (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.