treap-0.0.0.0: Efficient implementation of the implicit treap data structure

Safe HaskellNone
LanguageHaskell2010

Treap.Measured

Description

Typeclass that tells how to measure different values as Monoid.

Synopsis

Documentation

class Monoid m => Measured m a where Source #

This typeclass allows to specify how to convert value of type a into monoidal value of type m.

Methods

measure :: a -> m Source #

Instances
Measured All Bool Source #

Measure boolean value with &&.

Instance details

Defined in Treap.Measured

Methods

measure :: Bool -> All Source #

Measured Any Bool Source #

Measure boolean value with ||.

Instance details

Defined in Treap.Measured

Methods

measure :: Bool -> Any Source #

Monoid m => Measured m (Treap m a) Source #

\( O(1) \). Takes cached value from the root.

Instance details

Defined in Treap.Pure

Methods

measure :: Treap m a -> m Source #

Monoid m => Measured m (RTreap m a) Source #

\( O(1) \). Takes cached value from the root.

Instance details

Defined in Treap.Rand

Methods

measure :: RTreap m a -> m Source #

(Ord a, Bounded a) => Measured (Min a) a Source #

Measure every comparable value with minimum.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Min a Source #

(Ord a, Bounded a) => Measured (Max a) a Source #

Measure every comparable value with maximum.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Max a Source #

Monoid a => Measured (Identity a) a Source #

Measure every Monoid as itself.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Identity a Source #

Measured (First a) a Source #

Measure every value as the First monoid.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> First a Source #

Measured (Last a) a Source #

Measure every value as the Last monoid.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Last a Source #

Monoid a => Measured (Dual a) a Source #

Measure every Monoid as its dual.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Dual a Source #

Num a => Measured (Sum a) a Source #

Measure every numeric value with addition.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Sum a Source #

Num a => Measured (Product a) a Source #

Measure every numeric value with multiplication.

Instance details

Defined in Treap.Measured

Methods

measure :: a -> Product a Source #

Measured (Endo a) (a -> a) Source #

Measure every endomorphic function with compostion.

Instance details

Defined in Treap.Measured

Methods

measure :: (a -> a) -> Endo a Source #