text-1.2.2.2: An efficient packed Unicode text type.

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

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

- data Size
- exactly :: Size -> Maybe Int
- exactSize :: Int -> Size
- maxSize :: Int -> Size
- betweenSize :: Int -> Int -> Size
- unknownSize :: Size
- smaller :: Size -> Size -> Size
- larger :: Size -> Size -> Size
- upperBound :: Int -> Size -> Int
- lowerBound :: Int -> Size -> Int
- compareSize :: Size -> Int -> Maybe Ordering
- isEmpty :: Size -> Bool

# Documentation

data Size #

Instances

Eq Size # |
Methods (==) :: Size -> Size -> Bool # (/=) :: Size -> Size -> Bool #
Num 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 # |
Methods showsPrec :: Int -> Size -> ShowS # show :: Size -> String # showList :: [Size] -> ShowS #

exactly :: Size -> Maybe Int #

exactSize :: Int -> Size #

maxSize :: Int -> Size #

betweenSize :: Int -> Int -> Size #

unknownSize :: Size #

smaller :: Size -> Size -> Size #

Minimum of two size hints.

larger :: Size -> Size -> Size #

Maximum of two size hints.

upperBound :: Int -> Size -> Int #

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

lowerBound :: Int -> Size -> Int #

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

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

isEmpty :: Size -> Bool #