SizeCompare-0.1: Fast size comparison for standard containers.

Data.SizeCompare

Synopsis

Documentation

(|==|) :: (Sizeable a, Sizeable b) => a -> b -> BoolSource

Equality on the size of containers

(|<|) :: (Sizeable a, Sizeable b) => a -> b -> BoolSource

Defines Smaller Than on the size of containers

(|<=|) :: (Sizeable a, Sizeable b) => a -> b -> BoolSource

Defines Smaller Than or Equal on the size of containers

(|>|) :: (Sizeable a, Sizeable b) => a -> b -> BoolSource

Defines Greater Than on the size of containers

(|>=|) :: (Sizeable a, Sizeable b) => a -> b -> BoolSource

Defines Greate Than or Equal on the size of containers

class Sizeable a whereSource

Provides functionality for smartly measuring the size of a container

Methods

cSize :: a -> Maybe IntSource

Returns (Just size) for containers with O(1) size lookup, otherwise Nothing

reduce :: a -> Maybe aSource

Reduces a container by 1 element, resulting in Nothing when finished

Instances

Sizeable Int

Sizeable instance for Int, make sure to add typing to integer constants, like: (0::Int).

Sizeable [a]

Sizeable for Lists

Sizeable (Set a)

Sizeable for Sets

Sizeable (Map a b)

Sizeable for Maps