Package frege.data.NonEmpty

Compiled: Wed Dec 05 00:09:58 PST 2012 from source file: ./frege/data/NonEmpty.fr

Package Documentation

Contributed by Daniel Gronau

Table of Content

Imports

Instances

instance Eq Eq a => NonEmpty a

Member Functions

!= :: Eq α => NonEmpty α -> NonEmpty α -> Bool

inherited from Eq.!=

/= :: Eq α => NonEmpty α -> NonEmpty α -> Bool

inherited from Eq./=

== :: Eq α => NonEmpty α -> NonEmpty α -> Bool

Function generated for derived istance.

hashCode :: Eq α => NonEmpty α -> Int

Function generated for derived istance.

instance Foldable NonEmpty

Member Functions

fold :: Monoid α => NonEmpty α -> α

inherited from Foldable.Foldable.fold

fold1 :: Semigroup α => NonEmpty α -> α

inherited from Foldable.Foldable.fold1

foldMap :: Monoid β => (α->β) -> NonEmpty α -> β

inherited from Foldable.Foldable.foldMap

foldMap1 :: Semigroup β => (α->β) -> NonEmpty α -> β

inherited from Foldable.Foldable.foldMap1

foldl :: (α->β->α) -> α -> NonEmpty β -> α
foldl1 :: (α->α->α) -> NonEmpty α -> α

inherited from Foldable.Foldable.foldl1

foldr :: (α->β->β) -> β -> NonEmpty α -> β
foldr1 :: (α->α->α) -> NonEmpty α -> α

inherited from Foldable.Foldable.foldr1

instance Functor NonEmpty

Member Functions

fmap :: (α->β) -> NonEmpty α -> NonEmpty β
instance ListLike NonEmpty

Member Functions

++ :: NonEmpty α -> NonEmpty α -> NonEmpty α
empty :: NonEmpty α
head :: NonEmpty α -> α
length :: NonEmpty α -> Int
null :: NonEmpty α -> Bool
tail :: NonEmpty α -> NonEmpty α
instance ListSource NonEmpty

Member Functions

toList :: NonEmpty α -> [α]
instance Monad NonEmpty

Member Functions

*> :: NonEmpty α -> NonEmpty β -> NonEmpty β

inherited from Applicative.*>

<* :: NonEmpty α -> NonEmpty β -> NonEmpty α

inherited from Applicative.<*

<*> :: NonEmpty (α->β) -> NonEmpty α -> NonEmpty β

inherited from Monad.<*>

>> :: NonEmpty α -> NonEmpty β -> NonEmpty β

inherited from Monad.>>

>>= :: NonEmpty α -> (α->NonEmpty β) -> NonEmpty β
join :: NonEmpty (NonEmpty α) -> NonEmpty α

inherited from Monad.join

return :: α -> NonEmpty α
instance Ord Ord a => NonEmpty a

Member Functions

< :: Ord α => NonEmpty α -> NonEmpty α -> Bool

inherited from Ord.<

<= :: Ord α => NonEmpty α -> NonEmpty α -> Bool

inherited from Ord.<=

<=> :: Ord α => NonEmpty α -> NonEmpty α -> Ordering

Function generated for derived istance.

> :: Ord α => NonEmpty α -> NonEmpty α -> Bool

inherited from Ord.>

>= :: Ord α => NonEmpty α -> NonEmpty α -> Bool

inherited from Ord.>=

compare :: Ord α => NonEmpty α -> NonEmpty α -> Ordering

inherited from Ord.compare

max :: Ord α => NonEmpty α -> NonEmpty α -> NonEmpty α

inherited from Ord.max

min :: Ord α => NonEmpty α -> NonEmpty α -> NonEmpty α

inherited from Ord.min

instance Semigroup NonEmpty a

Member Functions

mappend :: NonEmpty α -> NonEmpty α -> NonEmpty α
sconcat :: [NonEmpty α] -> NonEmpty α

inherited from Monoid.Semigroup.sconcat

stimes :: Int -> NonEmpty α -> NonEmpty α

inherited from Monoid.Semigroup.stimes

instance Show Show a => NonEmpty a

Member Functions

display :: Show α => NonEmpty α -> String

inherited from Show.display

show :: Show α => NonEmpty α -> String
showList :: Show α => [NonEmpty α] -> String -> String

inherited from Show.showList

showsPrec :: Show α => Int -> NonEmpty α -> String -> String

inherited from Show.showsPrec

showsub :: Show α => NonEmpty α -> String

inherited from Show.showsub

instance Traversable NonEmpty

Member Functions

mapM :: Monad β => (γ->β α) -> NonEmpty γ -> β (NonEmpty α)

inherited from Traversable.Traversable.mapM

sequence :: Monad α => NonEmpty (α β) -> α (NonEmpty β)

inherited from Traversable.Traversable.sequence

sequenceA :: Applicative α => NonEmpty (α β) -> α (NonEmpty β)

inherited from Traversable.Traversable.sequenceA

traverse :: Applicative β => (γ->β α) -> NonEmpty γ -> β (NonEmpty α)

Data Types

data NonEmpty a

A NonEmpty is like a list, but never empty.

Constructors

NonEmpty {neHead :: a, neTail :: [a]}

Member Functions

neHead :: NonEmpty α -> α

access field neHead

neTail :: NonEmpty α -> [α]

The head of the non-empty list. The tail of the non-empty list.

Functions and Values

.: :: a -> NonEmpty a -> NonEmpty a

Prepends a value to a NonEmpty.

cycle :: ListSource src => src a -> NonEmpty a

cycle ties a finite NonEmpty into a circular one, or equivalently, the infinite repetition of the original NonEmpty. It is the identity on infinite NonEmptys.

inits :: NonEmpty a -> [NonEmpty a]

The inits function returns all initial segments of the argument, shortest first.

insert :: Ord a => a -> NonEmpty a -> NonEmpty a

The insert function takes an element and a NonEmpty and inserts the element into the NonEmpty at the last position where it is still less than or equal to the next element.

iterate :: (a->a) -> a -> NonEmpty a

iterate f x returns an infinite NonEmpty of repeated applications of f to x

nonEmpty :: a -> [a] -> NonEmpty a

Constructs a non-empty list with the given head and tail.

reverse :: NonEmpty a -> NonEmpty a

Reverses the elements of the (finite) NonEmpty.

scanl :: (b->a->b) -> b -> NonEmpty a -> NonEmpty b

scanl is similar to foldl, but returns a NonEmpty of successive reduced values from the left

scanl1 :: (a->a->a) -> NonEmpty a -> NonEmpty a

scanl1 is similar to foldl1, but returns a NonEmpty of successive reduced values from the left

scanr :: (a->b->b) -> b -> NonEmpty a -> NonEmpty b

scanr is similar to foldr, but returns a NonEmpty of successive reduced values from the right

scanr1 :: (a->a->a) -> NonEmpty a -> NonEmpty a

scanr1 is similar to foldr1, but returns a NonEmpty of successive reduced values from the right

sort :: Ord a => NonEmpty a -> NonEmpty a

The sort function implements a stable sorting algorithm.

tails :: NonEmpty a -> [NonEmpty a]

The tails function returns all final segments of the argument, longest first.

toNonEmpty :: [a] -> Maybe (NonEmpty a)

Tries to convert a list to a NonEmpty returning Maybe.Nothing if the given list is empty.

toNonEmpty' :: NonEmpty a -> [a] -> NonEmpty a

Converts a list to a NonEmpty using the given default value for the empty list case.

unsafeToNonEmpty :: [a] -> NonEmpty a

/WARNING: Fails if given the empty list./

Tries to convert a list to a NonEmpty.

unzip :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b)

unzip transforms a NonEmpty of pairs into a NonEmpty of first components and a NonEmpty of second components.

zip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b)

zip takes two NonEmptys and returns a NonEmpty of corresponding pairs. If one input NonEmptys is short, excess elements of the longer NonEmpty are discarded.

|: :: a -> [a] -> NonEmpty a

Constructs a non-empty list with the given head and tail (an alias for nonEmpty).

Functions and Values by Type

(a->a->a) -> NonEmpty a -> NonEmpty a

scanl1, scanr1

(a->a) -> a -> NonEmpty a

iterate

(α->α->α) -> NonEmpty α -> α

Foldable_NonEmpty.foldl1, Foldable_NonEmpty.foldr1

NonEmpty (NonEmpty α) -> NonEmpty α

Monad_NonEmpty.join

NonEmpty a -> [a] -> NonEmpty a

toNonEmpty'

NonEmpty a -> NonEmpty a

reverse

NonEmpty a -> [NonEmpty a]

inits, tails

NonEmpty α -> ([α]->[α]) -> NonEmpty α

NonEmpty.chg$neTail

NonEmpty α -> (α->α) -> NonEmpty α

NonEmpty.chg$neHead

NonEmpty α -> NonEmpty α -> NonEmpty α

ListLike_NonEmpty.++, Semigroup_NonEmpty.mappend

NonEmpty α -> [α] -> NonEmpty α

NonEmpty.upd$neTail

NonEmpty α -> α -> NonEmpty α

NonEmpty.upd$neHead

NonEmpty α -> NonEmpty α

ListLike_NonEmpty.tail

NonEmpty α -> [α]

ListSource_NonEmpty.toList, NonEmpty.neTail

NonEmpty α -> Bool

ListLike_NonEmpty.null

NonEmpty α -> Int

ListLike_NonEmpty.length

NonEmpty α -> α

ListLike_NonEmpty.head, NonEmpty.neHead

[NonEmpty α] -> NonEmpty α

Semigroup_NonEmpty.sconcat

[a] -> NonEmpty a

unsafeToNonEmpty

[a] -> Maybe (NonEmpty a)

toNonEmpty

Int -> NonEmpty α -> NonEmpty α

Semigroup_NonEmpty.stimes

a -> NonEmpty a -> NonEmpty a

.:

a -> [a] -> NonEmpty a

nonEmpty, |:, NonEmpty.NonEmpty

α -> NonEmpty α

Monad_NonEmpty.return

α -> Bool

NonEmpty.has$neHead, NonEmpty.has$neTail

Monoid α => NonEmpty α -> α

Foldable_NonEmpty.fold

Semigroup α => NonEmpty α -> α

Foldable_NonEmpty.fold1

Eq α => NonEmpty α -> NonEmpty α -> Bool

Eq_NonEmpty./=, Eq_NonEmpty.!=, Eq_NonEmpty.==

Eq α => NonEmpty α -> Int

Eq_NonEmpty.hashCode

Ord a => NonEmpty a -> NonEmpty a

sort

Ord a => a -> NonEmpty a -> NonEmpty a

insert

Ord α => NonEmpty α -> NonEmpty α -> NonEmpty α

Ord_NonEmpty.max, Ord_NonEmpty.min

Ord α => NonEmpty α -> NonEmpty α -> Bool

Ord_NonEmpty.>, Ord_NonEmpty.<=, Ord_NonEmpty.<, Ord_NonEmpty.>=

Ord α => NonEmpty α -> NonEmpty α -> Ordering

Ord_NonEmpty.<=>, Ord_NonEmpty.compare

Show α => NonEmpty α -> String

Show_NonEmpty.show, Show_NonEmpty.display, Show_NonEmpty.showsub

Show α => [NonEmpty α] -> String -> String

Show_NonEmpty.showList

Show α => Int -> NonEmpty α -> String -> String

Show_NonEmpty.showsPrec

NonEmpty α

ListLike_NonEmpty.empty

(a->b->b) -> b -> NonEmpty a -> NonEmpty b

scanr

(b->a->b) -> b -> NonEmpty a -> NonEmpty b

scanl

(α->β->α) -> α -> NonEmpty β -> α

Foldable_NonEmpty.foldl

(α->β->β) -> β -> NonEmpty α -> β

Foldable_NonEmpty.foldr

(α->β) -> NonEmpty α -> NonEmpty β

Functor_NonEmpty.fmap

NonEmpty (a, b) -> (NonEmpty a, NonEmpty b)

unzip

NonEmpty (α->β) -> NonEmpty α -> NonEmpty β

Monad_NonEmpty.<*>

NonEmpty a -> NonEmpty b -> NonEmpty (a, b)

zip

NonEmpty α -> (α->NonEmpty β) -> NonEmpty β

Monad_NonEmpty.>>=

NonEmpty α -> NonEmpty β -> NonEmpty α

Monad_NonEmpty.<*

NonEmpty α -> NonEmpty β -> NonEmpty β

Monad_NonEmpty.*>, Monad_NonEmpty.>>

Monoid β => (α->β) -> NonEmpty α -> β

Foldable_NonEmpty.foldMap

Semigroup β => (α->β) -> NonEmpty α -> β

Foldable_NonEmpty.foldMap1

ListSource src => src a -> NonEmpty a

cycle

Applicative α => NonEmpty (α β) -> α (NonEmpty β)

Traversable_NonEmpty.sequenceA

Monad α => NonEmpty (α β) -> α (NonEmpty β)

Traversable_NonEmpty.sequence

Applicative β => (γ->β α) -> NonEmpty γ -> β (NonEmpty α)

Traversable_NonEmpty.traverse

Monad β => (γ->β α) -> NonEmpty γ -> β (NonEmpty α)

Traversable_NonEmpty.mapM

Valid HTML 4.01 Strict