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

Description

Synopsis

- tryDefault :: [TVar] -> [Goal] -> ([TVar], [Goal], Subst, [Warning])
- tryDefaultWith :: OrdFacts -> [TVar] -> [Goal] -> ([TVar], [Goal], Subst, [Warning])
- defaultExpr :: Range -> Expr -> Schema -> Maybe ([(TParam, Type)], Expr)

# Documentation

tryDefault :: [TVar] -> [Goal] -> ([TVar], [Goal], Subst, [Warning]) Source

tryDefaultWith :: OrdFacts -> [TVar] -> [Goal] -> ([TVar], [Goal], Subst, [Warning]) Source

defaultExpr :: Range -> Expr -> Schema -> Maybe ([(TParam, Type)], Expr) Source

Try to pick a reasonable instantiation for an expression, with the given type. This is useful when we do evaluation at the REPL. The resaulting types should satisfy the constraints of the schema.