Remove our bool function (#6116)

Data.Bool already provides a bool function identical to this one.
This commit is contained in:
Joseph C. Sible 2020-02-05 01:38:49 -05:00 committed by GitHub
parent fd9c03febe
commit b018028ee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 9 deletions

View file

@ -20,7 +20,6 @@ module Text.Pandoc.Readers.Odt.Generic.Utils
, uncurry6
, swap
, reverseComposition
, bool
, tryToRead
, Lookupable(..)
, readLookupables
@ -59,14 +58,6 @@ composition = F.foldr (<<<) Cat.id
reverseComposition :: (Category cat, F.Foldable f) => f (cat a a) -> cat a a
reverseComposition = F.foldr (>>>) Cat.id
-- | 'Either' has 'either', 'Maybe' has 'maybe'. 'Bool' should have 'bool'.
-- Note that the first value is selected if the boolean value is 'False'.
-- That makes 'bool' consistent with the other two. Also, 'bool' now takes its
-- arguments in the exact opposite order compared to the normal if construct.
bool :: a -> a -> Bool -> a
bool x _ False = x
bool _ x True = x
-- | This function often makes it possible to switch values with the functions
-- that are applied to them.
--

View file

@ -60,6 +60,7 @@ import Control.Applicative hiding ( liftA, liftA2 )
import Control.Monad ( MonadPlus )
import Control.Arrow
import Data.Bool ( bool )
import Data.Either ( rights )
import qualified Data.Map as M
import qualified Data.Text as T