text-2.1: An efficient packed Unicode text type.
Copyright(c) Roman Leshchinskiy 2008
(c) Bryan O'Sullivan 2009
LicenseBSD-style
Maintainerbos@serpentine.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Text.Internal.Fusion.Size

Description

Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk!

Size hints.

Synopsis

Documentation

data Size Source #

A size in UTF-8 code units (which is bytes).

Instances

Instances details
Num Size Source # 
Instance details

Defined in Data.Text.Internal.Fusion.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 Source # 
Instance details

Defined in Data.Text.Internal.Fusion.Size

Methods

showsPrec :: Int -> Size -> ShowS #

show :: Size -> String #

showList :: [Size] -> ShowS #

Eq Size Source # 
Instance details

Defined in Data.Text.Internal.Fusion.Size

Methods

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

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

Sizes

charSize :: Char -> Size Source #

The Size of the given code point.

codePointsSize :: Int -> Size Source #

The Size of n code points.

Querying sizes

smaller :: Size -> Size -> Size Source #

Minimum of two size hints.

larger :: Size -> Size -> Size Source #

Maximum of two size hints.

upperBound :: Int -> Size -> Int Source #

Compute the maximum size from a size hint, if possible.

lowerBound :: Int -> Size -> Int Source #

Compute the minimum size from a size hint, if possible.

compareSize :: Size -> Size -> Maybe Ordering Source #

Determine the ordering relationship between two Sizes, or Nothing in the indeterminate case.