module Fold.ShortcutNonempty.Examples.Boring
(
element, notElement, find, lookup,
sum, product, mean, variance, standardDeviation,
index, findIndex, elementIndex,
length,
and, or, all, any,
maximum, minimum, maximumBy, minimumBy,
last,
magma, semigroup, monoid,
list, reverseList,
)
where
import Data.Maybe (Maybe)
import Fold.ShortcutNonempty.Type (ShortcutNonemptyFold)
import Data.Semigroup (Semigroup)
import Data.Ord (Ord, Ordering)
import Data.Monoid (Monoid)
import Prelude (Floating, Fractional, Num)
import Data.Bool (Bool)
import Data.Eq (Eq)
import Numeric.Natural (Natural)
import qualified Fold.Shortcut.Examples.Interesting as Shortcut
import qualified Fold.Nonempty.Examples.Interesting as Nonempty
import qualified Fold.Pure.Examples.Interesting as Pure
import qualified Fold.ShortcutNonempty.Conversion as Convert
monoid :: Monoid a => ShortcutNonemptyFold a a
monoid :: forall a. Monoid a => ShortcutNonemptyFold a a
monoid = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Monoid a => Fold a a
Pure.monoid
length :: ShortcutNonemptyFold a Natural
length :: forall a. ShortcutNonemptyFold a Natural
length = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Fold a Natural
Pure.length
and :: ShortcutNonemptyFold Bool Bool
and :: ShortcutNonemptyFold Bool Bool
and = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold ShortcutFold Bool Bool
Shortcut.and
or :: ShortcutNonemptyFold Bool Bool
or :: ShortcutNonemptyFold Bool Bool
or = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold ShortcutFold Bool Bool
Shortcut.or
all :: (a -> Bool) -> ShortcutNonemptyFold a Bool
all :: forall a. (a -> Bool) -> ShortcutNonemptyFold a Bool
all a -> Bool
predicate = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. (a -> Bool) -> ShortcutFold a Bool
Shortcut.all a -> Bool
predicate)
any :: (a -> Bool) -> ShortcutNonemptyFold a Bool
any :: forall a. (a -> Bool) -> ShortcutNonemptyFold a Bool
any a -> Bool
predicate = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. (a -> Bool) -> ShortcutFold a Bool
Shortcut.any a -> Bool
predicate)
sum :: Num a => ShortcutNonemptyFold a a
sum :: forall a. Num a => ShortcutNonemptyFold a a
sum = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Num a => Fold a a
Pure.sum
product :: Num a => ShortcutNonemptyFold a a
product :: forall a. Num a => ShortcutNonemptyFold a a
product = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Num a => Fold a a
Pure.product
mean :: Fractional a => ShortcutNonemptyFold a a
mean :: forall a. Fractional a => ShortcutNonemptyFold a a
mean = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Fractional a => Fold a a
Pure.mean
variance :: Fractional a => ShortcutNonemptyFold a a
variance :: forall a. Fractional a => ShortcutNonemptyFold a a
variance = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Fractional a => Fold a a
Pure.variance
standardDeviation :: Floating a => ShortcutNonemptyFold a a
standardDeviation :: forall a. Floating a => ShortcutNonemptyFold a a
standardDeviation = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Floating a => Fold a a
Pure.standardDeviation
element :: Eq a => a -> ShortcutNonemptyFold a Bool
element :: forall a. Eq a => a -> ShortcutNonemptyFold a Bool
element a
a = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. Eq a => a -> ShortcutFold a Bool
Shortcut.element a
a)
notElement :: Eq a => a -> ShortcutNonemptyFold a Bool
notElement :: forall a. Eq a => a -> ShortcutNonemptyFold a Bool
notElement a
a = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. Eq a => a -> ShortcutFold a Bool
Shortcut.notElement a
a)
find :: (a -> Bool) -> ShortcutNonemptyFold a (Maybe a)
find :: forall a. (a -> Bool) -> ShortcutNonemptyFold a (Maybe a)
find a -> Bool
ok = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. (a -> Bool) -> ShortcutFold a (Maybe a)
Shortcut.find a -> Bool
ok)
index :: Natural -> ShortcutNonemptyFold a (Maybe a)
index :: forall a. Natural -> ShortcutNonemptyFold a (Maybe a)
index Natural
i = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. Natural -> ShortcutFold a (Maybe a)
Shortcut.index Natural
i)
elementIndex :: Eq a => a -> ShortcutNonemptyFold a (Maybe Natural)
elementIndex :: forall a. Eq a => a -> ShortcutNonemptyFold a (Maybe Natural)
elementIndex a
a = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. Eq a => a -> ShortcutFold a (Maybe Natural)
Shortcut.elementIndex a
a)
findIndex :: (a -> Bool) -> ShortcutNonemptyFold a (Maybe Natural)
findIndex :: forall a. (a -> Bool) -> ShortcutNonemptyFold a (Maybe Natural)
findIndex a -> Bool
ok = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a. (a -> Bool) -> ShortcutFold a (Maybe Natural)
Shortcut.findIndex a -> Bool
ok)
lookup :: Eq a => a -> ShortcutNonemptyFold (a, b) (Maybe b)
lookup :: forall a b. Eq a => a -> ShortcutNonemptyFold (a, b) (Maybe b)
lookup a
a = forall a b. ShortcutFold a b -> ShortcutNonemptyFold a b
Convert.shortcutFold (forall a b. Eq a => a -> ShortcutFold (a, b) (Maybe b)
Shortcut.lookup a
a)
list :: ShortcutNonemptyFold a [a]
list :: forall a. ShortcutNonemptyFold a [a]
list = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Fold a [a]
Pure.list
reverseList :: ShortcutNonemptyFold a [a]
reverseList :: forall a. ShortcutNonemptyFold a [a]
reverseList = forall a b. Fold a b -> ShortcutNonemptyFold a b
Convert.fold forall a. Fold a [a]
Pure.reverseList
magma :: (a -> a -> a) -> ShortcutNonemptyFold a a
magma :: forall a. (a -> a -> a) -> ShortcutNonemptyFold a a
magma a -> a -> a
step = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold (forall a. (a -> a -> a) -> NonemptyFold a a
Nonempty.magma a -> a -> a
step)
semigroup :: Semigroup a => ShortcutNonemptyFold a a
semigroup :: forall a. Semigroup a => ShortcutNonemptyFold a a
semigroup = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold forall a. Semigroup a => NonemptyFold a a
Nonempty.semigroup
last :: ShortcutNonemptyFold a a
last :: forall a. ShortcutNonemptyFold a a
last = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold forall a. NonemptyFold a a
Nonempty.last
maximum :: Ord a => ShortcutNonemptyFold a a
maximum :: forall a. Ord a => ShortcutNonemptyFold a a
maximum = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold forall a. Ord a => NonemptyFold a a
Nonempty.maximum
maximumBy :: (a -> a -> Ordering) -> ShortcutNonemptyFold a a
maximumBy :: forall a. (a -> a -> Ordering) -> ShortcutNonemptyFold a a
maximumBy a -> a -> Ordering
cmp = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold (forall a. (a -> a -> Ordering) -> NonemptyFold a a
Nonempty.maximumBy a -> a -> Ordering
cmp)
minimum :: Ord a => ShortcutNonemptyFold a a
minimum :: forall a. Ord a => ShortcutNonemptyFold a a
minimum = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold forall a. Ord a => NonemptyFold a a
Nonempty.minimum
minimumBy :: (a -> a -> Ordering) -> ShortcutNonemptyFold a a
minimumBy :: forall a. (a -> a -> Ordering) -> ShortcutNonemptyFold a a
minimumBy a -> a -> Ordering
cmp = forall a b. NonemptyFold a b -> ShortcutNonemptyFold a b
Convert.nonemptyFold (forall a. (a -> a -> Ordering) -> NonemptyFold a a
Nonempty.minimumBy a -> a -> Ordering
cmp)