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