htcc-0.0.0.1: The full scratch implementation of tiny C compiler (x86_64)
Copyright(c) roki 2019
LicenseMIT
Maintainerfalgon53@yahoo.co.jp
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Htcc.Utils.Bool

Description

Utilities of boolean

Synopsis

Boolean methods

lor :: [a -> Bool] -> a -> Bool Source #

For mappings \(f_i:X\to B\) to an element \(x\in X\) of a set \(X\), \(\displaystyle\bigvee_{i} f_i(x)\) where \(B\) is the boolean domain. This function will stop evaluation when the result of \(f_i(x)\) is True (short circuit evaluation). This is equivalent to:

f1 x || f2 x || f3 x == lor [f1, f2, f3] x

land :: [a -> Bool] -> a -> Bool Source #

For mappings \(f_i:X\to B\) to an element (xin X) of a set \(X\), \(\displaystyle\bigwedge_{i} f_i(x)\) where \(B\) is the boolean domain. This is equivalent to:

f1 x && f2 x && f3 x == land [f1, f2, f3] x

sop :: [a -> Bool] -> [a] -> Bool Source #

Sum of product form. For mappings \(f_i:X\to B\) to an element \(x\in X\) of a set \(X\), \(\displaystyle\bigwedge_{j}\bigvee_{i} f_i(x_j)\) where \(B\) is the Boolean domain. This function will stop evaluation when the result of \(f_i(x)\) is True (short circuit evaluation).

sopText :: [Char -> Bool] -> Text -> Bool Source #

The Text version of sop.