tamarin-prover-utils-1.2.2: Utility library for the tamarin prover.

Safe HaskellNone
LanguageHaskell98

Utils.Misc

Contents

Synopsis

Environment

envIsSet :: String -> Bool #

envIsSet k returns True if there is a v such k=v is in the environment and False otherwise.

getEnvMaybe :: String -> Maybe String #

getEnvMaybe k returns Just v if k=v is in the environment and Nothing otherwise

List operations

subsetOf :: Ord a => [a] -> [a] -> Bool #

subsetOf xs ys return True if set xs is a subset of set ys

noDuplicates :: Ord a => [a] -> Bool #

noDuplicates xs returns True if the list xs contains no duplicates

equivClasses :: (Ord a, Ord b) => [(a, b)] -> Map b (Set a) #

Compute the equality classes given wrto a partial function.

Control

whileTrue :: Monad m => m Bool -> m Int #

whileTrue m iterates m until it returns False. Returns the number of iterations m was run. 0 means m never returned True.

Hashing

stringSHA256 :: String -> String #

The SHA-256 hash of a string in base64 notation.

Set operations

setAny :: (a -> Bool) -> Set a -> Bool #

Map operations

invertMap :: Ord v => Map k v -> Map v k #

Inverts a bijective Map.

unsafeEq

unsafeEq :: a -> a -> Bool #