cryptol-2.6.0: Cryptol: The Language of Cryptography

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

Cryptol.Utils.Misc

Description

Synopsis

- anyJust :: Traversable t => (a -> Maybe a) -> t a -> Maybe (t a)
- anyJust2 :: (a -> Maybe a) -> (b -> Maybe b) -> (a, b) -> Maybe (a, b)

# Documentation

anyJust :: Traversable t => (a -> Maybe a) -> t a -> Maybe (t a) Source #

Apply a function to all elements of a container. Returns `Nothing` if nothing changed, and `Just container` otherwise.

anyJust2 :: (a -> Maybe a) -> (b -> Maybe b) -> (a, b) -> Maybe (a, b) Source #

Apply functions to both elements of a pair. Returns `Nothing` if neither changed, and `Just pair` otherwise.