module Data.Measured.Size where
import Control.DeepSeq
import Data.Measured.Class
import GHC.Generics (Generic)
newtype Size = Size Word deriving (Int -> Size -> ShowS
[Size] -> ShowS
Size -> String
(Int -> Size -> ShowS)
-> (Size -> String) -> ([Size] -> ShowS) -> Show Size
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Size] -> ShowS
$cshowList :: [Size] -> ShowS
show :: Size -> String
$cshow :: Size -> String
showsPrec :: Int -> Size -> ShowS
$cshowsPrec :: Int -> Size -> ShowS
Show,ReadPrec [Size]
ReadPrec Size
Int -> ReadS Size
ReadS [Size]
(Int -> ReadS Size)
-> ReadS [Size] -> ReadPrec Size -> ReadPrec [Size] -> Read Size
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Size]
$creadListPrec :: ReadPrec [Size]
readPrec :: ReadPrec Size
$creadPrec :: ReadPrec Size
readList :: ReadS [Size]
$creadList :: ReadS [Size]
readsPrec :: Int -> ReadS Size
$creadsPrec :: Int -> ReadS Size
Read,Size -> Size -> Bool
(Size -> Size -> Bool) -> (Size -> Size -> Bool) -> Eq Size
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Size -> Size -> Bool
$c/= :: Size -> Size -> Bool
== :: Size -> Size -> Bool
$c== :: Size -> Size -> Bool
Eq,Integer -> Size
Size -> Size
Size -> Size -> Size
(Size -> Size -> Size)
-> (Size -> Size -> Size)
-> (Size -> Size -> Size)
-> (Size -> Size)
-> (Size -> Size)
-> (Size -> Size)
-> (Integer -> Size)
-> Num Size
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Size
$cfromInteger :: Integer -> Size
signum :: Size -> Size
$csignum :: Size -> Size
abs :: Size -> Size
$cabs :: Size -> Size
negate :: Size -> Size
$cnegate :: Size -> Size
* :: Size -> Size -> Size
$c* :: Size -> Size -> Size
- :: Size -> Size -> Size
$c- :: Size -> Size -> Size
+ :: Size -> Size -> Size
$c+ :: Size -> Size -> Size
Num,Enum Size
Real Size
Real Size
-> Enum Size
-> (Size -> Size -> Size)
-> (Size -> Size -> Size)
-> (Size -> Size -> Size)
-> (Size -> Size -> Size)
-> (Size -> Size -> (Size, Size))
-> (Size -> Size -> (Size, Size))
-> (Size -> Integer)
-> Integral Size
Size -> Integer
Size -> Size -> (Size, Size)
Size -> Size -> Size
forall a.
Real a
-> Enum a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: Size -> Integer
$ctoInteger :: Size -> Integer
divMod :: Size -> Size -> (Size, Size)
$cdivMod :: Size -> Size -> (Size, Size)
quotRem :: Size -> Size -> (Size, Size)
$cquotRem :: Size -> Size -> (Size, Size)
mod :: Size -> Size -> Size
$cmod :: Size -> Size -> Size
div :: Size -> Size -> Size
$cdiv :: Size -> Size -> Size
rem :: Size -> Size -> Size
$crem :: Size -> Size -> Size
quot :: Size -> Size -> Size
$cquot :: Size -> Size -> Size
$cp2Integral :: Enum Size
$cp1Integral :: Real Size
Integral,Int -> Size
Size -> Int
Size -> [Size]
Size -> Size
Size -> Size -> [Size]
Size -> Size -> Size -> [Size]
(Size -> Size)
-> (Size -> Size)
-> (Int -> Size)
-> (Size -> Int)
-> (Size -> [Size])
-> (Size -> Size -> [Size])
-> (Size -> Size -> [Size])
-> (Size -> Size -> Size -> [Size])
-> Enum Size
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Size -> Size -> Size -> [Size]
$cenumFromThenTo :: Size -> Size -> Size -> [Size]
enumFromTo :: Size -> Size -> [Size]
$cenumFromTo :: Size -> Size -> [Size]
enumFromThen :: Size -> Size -> [Size]
$cenumFromThen :: Size -> Size -> [Size]
enumFrom :: Size -> [Size]
$cenumFrom :: Size -> [Size]
fromEnum :: Size -> Int
$cfromEnum :: Size -> Int
toEnum :: Int -> Size
$ctoEnum :: Int -> Size
pred :: Size -> Size
$cpred :: Size -> Size
succ :: Size -> Size
$csucc :: Size -> Size
Enum,Num Size
Ord Size
Num Size -> Ord Size -> (Size -> Rational) -> Real Size
Size -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: Size -> Rational
$ctoRational :: Size -> Rational
$cp2Real :: Ord Size
$cp1Real :: Num Size
Real,Eq Size
Eq Size
-> (Size -> Size -> Ordering)
-> (Size -> Size -> Bool)
-> (Size -> Size -> Bool)
-> (Size -> Size -> Bool)
-> (Size -> Size -> Bool)
-> (Size -> Size -> Size)
-> (Size -> Size -> Size)
-> Ord Size
Size -> Size -> Bool
Size -> Size -> Ordering
Size -> Size -> Size
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Size -> Size -> Size
$cmin :: Size -> Size -> Size
max :: Size -> Size -> Size
$cmax :: Size -> Size -> Size
>= :: Size -> Size -> Bool
$c>= :: Size -> Size -> Bool
> :: Size -> Size -> Bool
$c> :: Size -> Size -> Bool
<= :: Size -> Size -> Bool
$c<= :: Size -> Size -> Bool
< :: Size -> Size -> Bool
$c< :: Size -> Size -> Bool
compare :: Size -> Size -> Ordering
$ccompare :: Size -> Size -> Ordering
$cp1Ord :: Eq Size
Ord,(forall x. Size -> Rep Size x)
-> (forall x. Rep Size x -> Size) -> Generic Size
forall x. Rep Size x -> Size
forall x. Size -> Rep Size x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Size x -> Size
$cfrom :: forall x. Size -> Rep Size x
Generic,Size -> ()
(Size -> ()) -> NFData Size
forall a. (a -> ()) -> NFData a
rnf :: Size -> ()
$crnf :: Size -> ()
NFData)
instance Semigroup Size where
Size
x <> :: Size -> Size -> Size
<> Size
y = Size
x Size -> Size -> Size
forall a. Num a => a -> a -> a
+ Size
y
instance Monoid Size where
mempty :: Size
mempty = Word -> Size
Size Word
0
newtype Elem a = Elem { Elem a -> a
_unElem :: a }
deriving (Int -> Elem a -> ShowS
[Elem a] -> ShowS
Elem a -> String
(Int -> Elem a -> ShowS)
-> (Elem a -> String) -> ([Elem a] -> ShowS) -> Show (Elem a)
forall a. Show a => Int -> Elem a -> ShowS
forall a. Show a => [Elem a] -> ShowS
forall a. Show a => Elem a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Elem a] -> ShowS
$cshowList :: forall a. Show a => [Elem a] -> ShowS
show :: Elem a -> String
$cshow :: forall a. Show a => Elem a -> String
showsPrec :: Int -> Elem a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Elem a -> ShowS
Show,ReadPrec [Elem a]
ReadPrec (Elem a)
Int -> ReadS (Elem a)
ReadS [Elem a]
(Int -> ReadS (Elem a))
-> ReadS [Elem a]
-> ReadPrec (Elem a)
-> ReadPrec [Elem a]
-> Read (Elem a)
forall a. Read a => ReadPrec [Elem a]
forall a. Read a => ReadPrec (Elem a)
forall a. Read a => Int -> ReadS (Elem a)
forall a. Read a => ReadS [Elem a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Elem a]
$creadListPrec :: forall a. Read a => ReadPrec [Elem a]
readPrec :: ReadPrec (Elem a)
$creadPrec :: forall a. Read a => ReadPrec (Elem a)
readList :: ReadS [Elem a]
$creadList :: forall a. Read a => ReadS [Elem a]
readsPrec :: Int -> ReadS (Elem a)
$creadsPrec :: forall a. Read a => Int -> ReadS (Elem a)
Read,Elem a -> Elem a -> Bool
(Elem a -> Elem a -> Bool)
-> (Elem a -> Elem a -> Bool) -> Eq (Elem a)
forall a. Eq a => Elem a -> Elem a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Elem a -> Elem a -> Bool
$c/= :: forall a. Eq a => Elem a -> Elem a -> Bool
== :: Elem a -> Elem a -> Bool
$c== :: forall a. Eq a => Elem a -> Elem a -> Bool
Eq,Eq (Elem a)
Eq (Elem a)
-> (Elem a -> Elem a -> Ordering)
-> (Elem a -> Elem a -> Bool)
-> (Elem a -> Elem a -> Bool)
-> (Elem a -> Elem a -> Bool)
-> (Elem a -> Elem a -> Bool)
-> (Elem a -> Elem a -> Elem a)
-> (Elem a -> Elem a -> Elem a)
-> Ord (Elem a)
Elem a -> Elem a -> Bool
Elem a -> Elem a -> Ordering
Elem a -> Elem a -> Elem a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Elem a)
forall a. Ord a => Elem a -> Elem a -> Bool
forall a. Ord a => Elem a -> Elem a -> Ordering
forall a. Ord a => Elem a -> Elem a -> Elem a
min :: Elem a -> Elem a -> Elem a
$cmin :: forall a. Ord a => Elem a -> Elem a -> Elem a
max :: Elem a -> Elem a -> Elem a
$cmax :: forall a. Ord a => Elem a -> Elem a -> Elem a
>= :: Elem a -> Elem a -> Bool
$c>= :: forall a. Ord a => Elem a -> Elem a -> Bool
> :: Elem a -> Elem a -> Bool
$c> :: forall a. Ord a => Elem a -> Elem a -> Bool
<= :: Elem a -> Elem a -> Bool
$c<= :: forall a. Ord a => Elem a -> Elem a -> Bool
< :: Elem a -> Elem a -> Bool
$c< :: forall a. Ord a => Elem a -> Elem a -> Bool
compare :: Elem a -> Elem a -> Ordering
$ccompare :: forall a. Ord a => Elem a -> Elem a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Elem a)
Ord,a -> Elem b -> Elem a
(a -> b) -> Elem a -> Elem b
(forall a b. (a -> b) -> Elem a -> Elem b)
-> (forall a b. a -> Elem b -> Elem a) -> Functor Elem
forall a b. a -> Elem b -> Elem a
forall a b. (a -> b) -> Elem a -> Elem b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Elem b -> Elem a
$c<$ :: forall a b. a -> Elem b -> Elem a
fmap :: (a -> b) -> Elem a -> Elem b
$cfmap :: forall a b. (a -> b) -> Elem a -> Elem b
Functor,Elem a -> Bool
(a -> m) -> Elem a -> m
(a -> b -> b) -> b -> Elem a -> b
(forall m. Monoid m => Elem m -> m)
-> (forall m a. Monoid m => (a -> m) -> Elem a -> m)
-> (forall m a. Monoid m => (a -> m) -> Elem a -> m)
-> (forall a b. (a -> b -> b) -> b -> Elem a -> b)
-> (forall a b. (a -> b -> b) -> b -> Elem a -> b)
-> (forall b a. (b -> a -> b) -> b -> Elem a -> b)
-> (forall b a. (b -> a -> b) -> b -> Elem a -> b)
-> (forall a. (a -> a -> a) -> Elem a -> a)
-> (forall a. (a -> a -> a) -> Elem a -> a)
-> (forall a. Elem a -> [a])
-> (forall a. Elem a -> Bool)
-> (forall a. Elem a -> Int)
-> (forall a. Eq a => a -> Elem a -> Bool)
-> (forall a. Ord a => Elem a -> a)
-> (forall a. Ord a => Elem a -> a)
-> (forall a. Num a => Elem a -> a)
-> (forall a. Num a => Elem a -> a)
-> Foldable Elem
forall a. Eq a => a -> Elem a -> Bool
forall a. Num a => Elem a -> a
forall a. Ord a => Elem a -> a
forall m. Monoid m => Elem m -> m
forall a. Elem a -> Bool
forall a. Elem a -> Int
forall a. Elem a -> [a]
forall a. (a -> a -> a) -> Elem a -> a
forall m a. Monoid m => (a -> m) -> Elem a -> m
forall b a. (b -> a -> b) -> b -> Elem a -> b
forall a b. (a -> b -> b) -> b -> Elem a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: Elem a -> a
$cproduct :: forall a. Num a => Elem a -> a
sum :: Elem a -> a
$csum :: forall a. Num a => Elem a -> a
minimum :: Elem a -> a
$cminimum :: forall a. Ord a => Elem a -> a
maximum :: Elem a -> a
$cmaximum :: forall a. Ord a => Elem a -> a
elem :: a -> Elem a -> Bool
$celem :: forall a. Eq a => a -> Elem a -> Bool
length :: Elem a -> Int
$clength :: forall a. Elem a -> Int
null :: Elem a -> Bool
$cnull :: forall a. Elem a -> Bool
toList :: Elem a -> [a]
$ctoList :: forall a. Elem a -> [a]
foldl1 :: (a -> a -> a) -> Elem a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Elem a -> a
foldr1 :: (a -> a -> a) -> Elem a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Elem a -> a
foldl' :: (b -> a -> b) -> b -> Elem a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Elem a -> b
foldl :: (b -> a -> b) -> b -> Elem a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Elem a -> b
foldr' :: (a -> b -> b) -> b -> Elem a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Elem a -> b
foldr :: (a -> b -> b) -> b -> Elem a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Elem a -> b
foldMap' :: (a -> m) -> Elem a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Elem a -> m
foldMap :: (a -> m) -> Elem a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Elem a -> m
fold :: Elem m -> m
$cfold :: forall m. Monoid m => Elem m -> m
Foldable,Functor Elem
Foldable Elem
Functor Elem
-> Foldable Elem
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Elem a -> f (Elem b))
-> (forall (f :: * -> *) a.
Applicative f =>
Elem (f a) -> f (Elem a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Elem a -> m (Elem b))
-> (forall (m :: * -> *) a. Monad m => Elem (m a) -> m (Elem a))
-> Traversable Elem
(a -> f b) -> Elem a -> f (Elem b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Elem (m a) -> m (Elem a)
forall (f :: * -> *) a. Applicative f => Elem (f a) -> f (Elem a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Elem a -> m (Elem b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Elem a -> f (Elem b)
sequence :: Elem (m a) -> m (Elem a)
$csequence :: forall (m :: * -> *) a. Monad m => Elem (m a) -> m (Elem a)
mapM :: (a -> m b) -> Elem a -> m (Elem b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Elem a -> m (Elem b)
sequenceA :: Elem (f a) -> f (Elem a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Elem (f a) -> f (Elem a)
traverse :: (a -> f b) -> Elem a -> f (Elem b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Elem a -> f (Elem b)
$cp2Traversable :: Foldable Elem
$cp1Traversable :: Functor Elem
Traversable)
instance Measured Size (Elem a) where
measure :: Elem a -> Size
measure Elem a
_ = Size
1
data Sized a = Sized {-# UNPACK #-} !Size a
deriving (Int -> Sized a -> ShowS
[Sized a] -> ShowS
Sized a -> String
(Int -> Sized a -> ShowS)
-> (Sized a -> String) -> ([Sized a] -> ShowS) -> Show (Sized a)
forall a. Show a => Int -> Sized a -> ShowS
forall a. Show a => [Sized a] -> ShowS
forall a. Show a => Sized a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Sized a] -> ShowS
$cshowList :: forall a. Show a => [Sized a] -> ShowS
show :: Sized a -> String
$cshow :: forall a. Show a => Sized a -> String
showsPrec :: Int -> Sized a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Sized a -> ShowS
Show,Sized a -> Sized a -> Bool
(Sized a -> Sized a -> Bool)
-> (Sized a -> Sized a -> Bool) -> Eq (Sized a)
forall a. Eq a => Sized a -> Sized a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Sized a -> Sized a -> Bool
$c/= :: forall a. Eq a => Sized a -> Sized a -> Bool
== :: Sized a -> Sized a -> Bool
$c== :: forall a. Eq a => Sized a -> Sized a -> Bool
Eq,Eq (Sized a)
Eq (Sized a)
-> (Sized a -> Sized a -> Ordering)
-> (Sized a -> Sized a -> Bool)
-> (Sized a -> Sized a -> Bool)
-> (Sized a -> Sized a -> Bool)
-> (Sized a -> Sized a -> Bool)
-> (Sized a -> Sized a -> Sized a)
-> (Sized a -> Sized a -> Sized a)
-> Ord (Sized a)
Sized a -> Sized a -> Bool
Sized a -> Sized a -> Ordering
Sized a -> Sized a -> Sized a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Sized a)
forall a. Ord a => Sized a -> Sized a -> Bool
forall a. Ord a => Sized a -> Sized a -> Ordering
forall a. Ord a => Sized a -> Sized a -> Sized a
min :: Sized a -> Sized a -> Sized a
$cmin :: forall a. Ord a => Sized a -> Sized a -> Sized a
max :: Sized a -> Sized a -> Sized a
$cmax :: forall a. Ord a => Sized a -> Sized a -> Sized a
>= :: Sized a -> Sized a -> Bool
$c>= :: forall a. Ord a => Sized a -> Sized a -> Bool
> :: Sized a -> Sized a -> Bool
$c> :: forall a. Ord a => Sized a -> Sized a -> Bool
<= :: Sized a -> Sized a -> Bool
$c<= :: forall a. Ord a => Sized a -> Sized a -> Bool
< :: Sized a -> Sized a -> Bool
$c< :: forall a. Ord a => Sized a -> Sized a -> Bool
compare :: Sized a -> Sized a -> Ordering
$ccompare :: forall a. Ord a => Sized a -> Sized a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Sized a)
Ord,a -> Sized b -> Sized a
(a -> b) -> Sized a -> Sized b
(forall a b. (a -> b) -> Sized a -> Sized b)
-> (forall a b. a -> Sized b -> Sized a) -> Functor Sized
forall a b. a -> Sized b -> Sized a
forall a b. (a -> b) -> Sized a -> Sized b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Sized b -> Sized a
$c<$ :: forall a b. a -> Sized b -> Sized a
fmap :: (a -> b) -> Sized a -> Sized b
$cfmap :: forall a b. (a -> b) -> Sized a -> Sized b
Functor,Sized a -> Bool
(a -> m) -> Sized a -> m
(a -> b -> b) -> b -> Sized a -> b
(forall m. Monoid m => Sized m -> m)
-> (forall m a. Monoid m => (a -> m) -> Sized a -> m)
-> (forall m a. Monoid m => (a -> m) -> Sized a -> m)
-> (forall a b. (a -> b -> b) -> b -> Sized a -> b)
-> (forall a b. (a -> b -> b) -> b -> Sized a -> b)
-> (forall b a. (b -> a -> b) -> b -> Sized a -> b)
-> (forall b a. (b -> a -> b) -> b -> Sized a -> b)
-> (forall a. (a -> a -> a) -> Sized a -> a)
-> (forall a. (a -> a -> a) -> Sized a -> a)
-> (forall a. Sized a -> [a])
-> (forall a. Sized a -> Bool)
-> (forall a. Sized a -> Int)
-> (forall a. Eq a => a -> Sized a -> Bool)
-> (forall a. Ord a => Sized a -> a)
-> (forall a. Ord a => Sized a -> a)
-> (forall a. Num a => Sized a -> a)
-> (forall a. Num a => Sized a -> a)
-> Foldable Sized
forall a. Eq a => a -> Sized a -> Bool
forall a. Num a => Sized a -> a
forall a. Ord a => Sized a -> a
forall m. Monoid m => Sized m -> m
forall a. Sized a -> Bool
forall a. Sized a -> Int
forall a. Sized a -> [a]
forall a. (a -> a -> a) -> Sized a -> a
forall m a. Monoid m => (a -> m) -> Sized a -> m
forall b a. (b -> a -> b) -> b -> Sized a -> b
forall a b. (a -> b -> b) -> b -> Sized a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: Sized a -> a
$cproduct :: forall a. Num a => Sized a -> a
sum :: Sized a -> a
$csum :: forall a. Num a => Sized a -> a
minimum :: Sized a -> a
$cminimum :: forall a. Ord a => Sized a -> a
maximum :: Sized a -> a
$cmaximum :: forall a. Ord a => Sized a -> a
elem :: a -> Sized a -> Bool
$celem :: forall a. Eq a => a -> Sized a -> Bool
length :: Sized a -> Int
$clength :: forall a. Sized a -> Int
null :: Sized a -> Bool
$cnull :: forall a. Sized a -> Bool
toList :: Sized a -> [a]
$ctoList :: forall a. Sized a -> [a]
foldl1 :: (a -> a -> a) -> Sized a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Sized a -> a
foldr1 :: (a -> a -> a) -> Sized a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Sized a -> a
foldl' :: (b -> a -> b) -> b -> Sized a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Sized a -> b
foldl :: (b -> a -> b) -> b -> Sized a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Sized a -> b
foldr' :: (a -> b -> b) -> b -> Sized a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Sized a -> b
foldr :: (a -> b -> b) -> b -> Sized a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Sized a -> b
foldMap' :: (a -> m) -> Sized a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Sized a -> m
foldMap :: (a -> m) -> Sized a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Sized a -> m
fold :: Sized m -> m
$cfold :: forall m. Monoid m => Sized m -> m
Foldable,Functor Sized
Foldable Sized
Functor Sized
-> Foldable Sized
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Sized a -> f (Sized b))
-> (forall (f :: * -> *) a.
Applicative f =>
Sized (f a) -> f (Sized a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Sized a -> m (Sized b))
-> (forall (m :: * -> *) a. Monad m => Sized (m a) -> m (Sized a))
-> Traversable Sized
(a -> f b) -> Sized a -> f (Sized b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Sized (m a) -> m (Sized a)
forall (f :: * -> *) a. Applicative f => Sized (f a) -> f (Sized a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Sized a -> m (Sized b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Sized a -> f (Sized b)
sequence :: Sized (m a) -> m (Sized a)
$csequence :: forall (m :: * -> *) a. Monad m => Sized (m a) -> m (Sized a)
mapM :: (a -> m b) -> Sized a -> m (Sized b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Sized a -> m (Sized b)
sequenceA :: Sized (f a) -> f (Sized a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Sized (f a) -> f (Sized a)
traverse :: (a -> f b) -> Sized a -> f (Sized b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Sized a -> f (Sized b)
$cp2Traversable :: Foldable Sized
$cp1Traversable :: Functor Sized
Traversable,(forall x. Sized a -> Rep (Sized a) x)
-> (forall x. Rep (Sized a) x -> Sized a) -> Generic (Sized a)
forall x. Rep (Sized a) x -> Sized a
forall x. Sized a -> Rep (Sized a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Sized a) x -> Sized a
forall a x. Sized a -> Rep (Sized a) x
$cto :: forall a x. Rep (Sized a) x -> Sized a
$cfrom :: forall a x. Sized a -> Rep (Sized a) x
Generic)
instance NFData a => NFData (Sized a)
instance Semigroup a => Semigroup (Sized a) where
(Sized Size
i a
a) <> :: Sized a -> Sized a -> Sized a
<> (Sized Size
j a
b) = Size -> a -> Sized a
forall a. Size -> a -> Sized a
Sized (Size
i Size -> Size -> Size
forall a. Semigroup a => a -> a -> a
<> Size
j) (a
a a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
b)
instance Monoid a => Monoid (Sized a) where
mempty :: Sized a
mempty = Size -> a -> Sized a
forall a. Size -> a -> Sized a
Sized Size
forall a. Monoid a => a
mempty a
forall a. Monoid a => a
mempty