git.iko.soy/typeable/pandoc
on master help sign in
Remove our bool function (#6116)

Data.Bool already provides a bool function identical to this one.

commitb018028ee9f733d5c6907e4ef362794e75b8c38c authorJoseph C. Sible <josephcsible@users.noreply.github.com> dateWed 5 Feb 2020, 01:38 (7 years ago) parentfd9c03f
2 files changed+1−9
src/Text/Pandoc/Readers/Odt/Generic/Utils.hs−9 src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs+1
src/Text/Pandoc/Readers/Odt/Generic/Utils.hs−9
@@ -20,7 +20,6 @@ module Text.Pandoc.Readers.Odt.Generic.Utils
2020, uncurry6
2121, swap
2222, reverseComposition
23−, bool
2423, tryToRead
2524, Lookupable(..)
2625, readLookupables
@@ -59,14 +58,6 @@ composition = F.foldr (<<<) Cat.id
5958reverseComposition :: (Category cat, F.Foldable f) => f (cat a a) -> cat a a
6059reverseComposition = F.foldr (>>>) Cat.id
6160
62−-- | 'Either' has 'either', 'Maybe' has 'maybe'. 'Bool' should have 'bool'.
63−-- Note that the first value is selected if the boolean value is 'False'.
64−-- That makes 'bool' consistent with the other two. Also, 'bool' now takes its
65−-- arguments in the exact opposite order compared to the normal if construct.
66−bool :: a -> a -> Bool -> a
67−bool x _ False = x
68−bool _ x True = x
69−
7061-- | This function often makes it possible to switch values with the functions
7162-- that are applied to them.
7263--
src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs+1
@@ -60,6 +60,7 @@ import Control.Applicative hiding ( liftA, liftA2 )
6060import Control.Monad ( MonadPlus )
6161import Control.Arrow
6262
63+import Data.Bool ( bool )
6364import Data.Either ( rights )
6465import qualified Data.Map as M
6566import qualified Data.Text as T