-- |
-- Module      : Crypto.PubKey.Internal
-- License     : BSD-style
-- Maintainer  : Vincent Hanquez <vincent@snarc.org>
-- Stability   : experimental
-- Portability : Good
--
module Crypto.PubKey.Internal
    ( and'
    , (&&!)
    ) where

import Data.List (foldl')

-- | This is a strict version of and
and' :: [Bool] -> Bool
and' :: [Bool] -> Bool
and' l :: [Bool]
l = (Bool -> Bool -> Bool) -> Bool -> [Bool] -> Bool
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl' Bool -> Bool -> Bool
(&&!) Bool
True [Bool]
l

-- | This is a strict version of &&.
(&&!) :: Bool -> Bool -> Bool
True  &&! :: Bool -> Bool -> Bool
&&! True  = Bool
True
True  &&! False = Bool
False
False &&! True  = Bool
False
False &&! False = Bool
False