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.Solver.Utils

Description

Synopsis

- splitMins :: Type -> [Type]
- splitVarSummands :: Type -> [(TVar, Type)]
- splitVarSummand :: TVar -> Type -> Maybe Type
- splitConstSummand :: Type -> Maybe (Integer, Type)
- splitConstFactor :: Type -> Maybe (Integer, Type)

# Documentation

splitMins :: Type -> [Type] Source

splitVarSummands :: Type -> [(TVar, Type)] Source

All ways to split a type in the form: `a + t1`, where `a` is a variable.

splitVarSummand :: TVar -> Type -> Maybe Type Source

Check if we can express a type in the form: `a + t1`.

splitConstSummand :: Type -> Maybe (Integer, Type) Source

Check if we can express a type in the form: `k + t1`, where `k` is a constant > 0. This assumes that the type has been simplified already, so that constants are floated to the left.

splitConstFactor :: Type -> Maybe (Integer, Type) Source

Check if we can express a type in the form: `k * t1`, where `k` is a constant > 1 This assumes that the type has been simplified already, so that constants are floated to the left.