vector-0.13.1.0: Efficient Arrays
Copyright(c) Roman Leshchinskiy 2008-2010
Alexey Kuleshevich 2020-2022
Aleksey Khudyakov 2020-2022
Andrew Lelechenko 2020-2022
LicenseBSD-style
MaintainerHaskell Libraries Team <libraries@haskell.org>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Vector.Fusion.Bundle.Size

Description

Size hints for streams.

Synopsis

Documentation

data Size #

Size hint

Constructors

Exact !Int

Exact size

Max !Int

Upper bound on the size

Unknown

Unknown size

Instances

Instances details
Num Size # 
Instance details

Defined in Data.Vector.Fusion.Bundle.Size

Methods

(+) :: Size -> Size -> Size

(-) :: Size -> Size -> Size

(*) :: Size -> Size -> Size

negate :: Size -> Size

abs :: Size -> Size

signum :: Size -> Size

fromInteger :: Integer -> Size

Show Size # 
Instance details

Defined in Data.Vector.Fusion.Bundle.Size

Methods

showsPrec :: Int -> Size -> ShowS

show :: Size -> String

showList :: [Size] -> ShowS

Eq Size # 
Instance details

Defined in Data.Vector.Fusion.Bundle.Size

Methods

(==) :: Size -> Size -> Bool

(/=) :: Size -> Size -> Bool

clampedSubtract :: Size -> Size -> Size #

Subtract two sizes with clamping to 0, for drop-like things

smaller :: Size -> Size -> Size #

Minimum of two size hints

smallerThan :: Int -> Size -> Size #

Select a safe smaller than known size.

larger :: Size -> Size -> Size #

Maximum of two size hints

toMax :: Size -> Size #

Convert a size hint to an upper bound

upperBound :: Size -> Maybe Int #

Compute the maximum size from a size hint if possible

lowerBound :: Size -> Int #

Compute the minimum size from a size hint