haskell / 9 / libraries / text-2.0.1 / data-text-internal-fusion-size.html

Data.Text.Internal.Fusion.Size

Copyright (c) Roman Leshchinskiy 2008
(c) Bryan O'Sullivan 2009
License BSD-style
Maintainer bos@serpentine.com
Stability experimental
Portability portable
Safe Haskell Safe-Inferred
Language Haskell2010

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.

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

Show Size Source
Instance details

Defined in Data.Text.Internal.Fusion.Size

Eq Size Source
Instance details

Defined in Data.Text.Internal.Fusion.Size

Methods

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

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

Sizes

exactSize :: Int -> Size Source

maxSize :: Int -> Size Source

betweenSize :: Int -> Int -> Size Source

unknownSize :: Size Source

unionSize :: Size -> Size -> Size Source

charSize :: Char -> Size Source

The Size of the given code point.

codePointsSize :: Int -> Size Source

The Size of n code points.

Querying sizes

exactly :: Size -> Maybe Int Source

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.

isEmpty :: Size -> Bool Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.4.2/docs/libraries/text-2.0.1/Data-Text-Internal-Fusion-Size.html