Module

Data.Array.NonEmpty

Package
purescript-arrays
Repository
purescript/purescript-arrays

#fromArray Source

fromArray :: forall a. Array a -> Maybe (NonEmptyArray a)

#fromNonEmpty Source

#toArray Source

toArray :: forall a. NonEmptyArray a -> Array a

#toNonEmpty Source

#fromFoldable Source

fromFoldable :: forall f a. Foldable f => f a -> Maybe (NonEmptyArray a)

#fromFoldable1 Source

fromFoldable1 :: forall f a. Foldable1 f => f a -> NonEmptyArray a

#toUnfoldable Source

toUnfoldable :: forall f a. Unfoldable f => NonEmptyArray a -> f a

#toUnfoldable1 Source

toUnfoldable1 :: forall f a. Unfoldable1 f => NonEmptyArray a -> f a

#singleton Source

singleton :: forall a. a -> NonEmptyArray a

#(..) Source

Operator alias for Data.Array.NonEmpty.range (non-associative / precedence 8)

#replicate Source

replicate :: forall a. Int -> a -> NonEmptyArray a

Replicate an item at least once

#some Source

some :: forall f a. Alternative f => Lazy (f (Array a)) => f a -> f (NonEmptyArray a)

#length Source

length :: forall a. NonEmptyArray a -> Int

#(:) Source

Operator alias for Data.Array.NonEmpty.cons (right-associative / precedence 6)

#cons Source

cons :: forall a. a -> NonEmptyArray a -> NonEmptyArray a

#cons' Source

cons' :: forall a. a -> Array a -> NonEmptyArray a

#snoc Source

snoc :: forall a. NonEmptyArray a -> a -> NonEmptyArray a

#snoc' Source

snoc' :: forall a. Array a -> a -> NonEmptyArray a

#appendArray Source

appendArray :: forall a. NonEmptyArray a -> Array a -> NonEmptyArray a

#insert Source

insert :: forall a. Ord a => a -> NonEmptyArray a -> NonEmptyArray a

#insertBy Source

insertBy :: forall a. (a -> a -> Ordering) -> a -> NonEmptyArray a -> NonEmptyArray a

#head Source

head :: forall a. NonEmptyArray a -> a

#last Source

last :: forall a. NonEmptyArray a -> a

#tail Source

tail :: forall a. NonEmptyArray a -> Array a

#init Source

init :: forall a. NonEmptyArray a -> Array a

#uncons Source

uncons :: forall a. NonEmptyArray a -> { head :: a, tail :: Array a }

#unsnoc Source

unsnoc :: forall a. NonEmptyArray a -> { init :: Array a, last :: a }

#(!!) Source

Operator alias for Data.Array.NonEmpty.index (left-associative / precedence 8)

#index Source

index :: forall a. NonEmptyArray a -> Int -> Maybe a

#elemIndex Source

elemIndex :: forall a. Eq a => a -> NonEmptyArray a -> Maybe Int

#elemLastIndex Source

elemLastIndex :: forall a. Eq a => a -> NonEmptyArray a -> Maybe Int

#findIndex Source

findIndex :: forall a. (a -> Boolean) -> NonEmptyArray a -> Maybe Int

#findLastIndex Source

findLastIndex :: forall a. (a -> Boolean) -> NonEmptyArray a -> Maybe Int

#insertAt Source

insertAt :: forall a. Int -> a -> NonEmptyArray a -> Maybe (NonEmptyArray a)

#deleteAt Source

deleteAt :: forall a. Int -> NonEmptyArray a -> Maybe (Array a)

#updateAt Source

updateAt :: forall a. Int -> a -> NonEmptyArray a -> Maybe (NonEmptyArray a)

#updateAtIndices Source

updateAtIndices :: forall t a. Foldable t => t (Tuple Int a) -> NonEmptyArray a -> NonEmptyArray a

#modifyAt Source

modifyAt :: forall a. Int -> (a -> a) -> NonEmptyArray a -> Maybe (NonEmptyArray a)

#modifyAtIndices Source

modifyAtIndices :: forall t a. Foldable t => t Int -> (a -> a) -> NonEmptyArray a -> NonEmptyArray a

#alterAt Source

alterAt :: forall a. Int -> (a -> Maybe a) -> NonEmptyArray a -> Maybe (Array a)

#reverse Source

reverse :: forall a. NonEmptyArray a -> NonEmptyArray a

#concatMap Source

concatMap :: forall a b. (a -> NonEmptyArray b) -> NonEmptyArray a -> NonEmptyArray b

#filter Source

filter :: forall a. (a -> Boolean) -> NonEmptyArray a -> Array a

#partition Source

partition :: forall a. (a -> Boolean) -> NonEmptyArray a -> { no :: Array a, yes :: Array a }

#filterA Source

filterA :: forall a f. Applicative f => (a -> f Boolean) -> NonEmptyArray a -> f (Array a)

#mapMaybe Source

mapMaybe :: forall a b. (a -> Maybe b) -> NonEmptyArray a -> Array b

#catMaybes Source

catMaybes :: forall a. NonEmptyArray (Maybe a) -> Array a

#sort Source

sort :: forall a. Ord a => NonEmptyArray a -> NonEmptyArray a

#sortBy Source

sortBy :: forall a. (a -> a -> Ordering) -> NonEmptyArray a -> NonEmptyArray a

#sortWith Source

sortWith :: forall a b. Ord b => (a -> b) -> NonEmptyArray a -> NonEmptyArray a

#slice Source

slice :: forall a. Int -> Int -> NonEmptyArray a -> Array a

#take Source

take :: forall a. Int -> NonEmptyArray a -> Array a

#takeEnd Source

takeEnd :: forall a. Int -> NonEmptyArray a -> Array a

#takeWhile Source

takeWhile :: forall a. (a -> Boolean) -> NonEmptyArray a -> Array a

#drop Source

drop :: forall a. Int -> NonEmptyArray a -> Array a

#dropEnd Source

dropEnd :: forall a. Int -> NonEmptyArray a -> Array a

#dropWhile Source

dropWhile :: forall a. (a -> Boolean) -> NonEmptyArray a -> Array a

#span Source

span :: forall a. (a -> Boolean) -> NonEmptyArray a -> { init :: Array a, rest :: Array a }

#nub Source

nub :: forall a. Ord a => NonEmptyArray a -> NonEmptyArray a

#nubBy Source

nubBy :: forall a. (a -> a -> Ordering) -> NonEmptyArray a -> NonEmptyArray a

#nubEq Source

nubEq :: forall a. Eq a => NonEmptyArray a -> NonEmptyArray a

#nubByEq Source

nubByEq :: forall a. (a -> a -> Boolean) -> NonEmptyArray a -> NonEmptyArray a

#union Source

union :: forall a. Eq a => NonEmptyArray a -> NonEmptyArray a -> NonEmptyArray a

#union' Source

union' :: forall a. Eq a => NonEmptyArray a -> Array a -> NonEmptyArray a

#unionBy Source

unionBy :: forall a. (a -> a -> Boolean) -> NonEmptyArray a -> NonEmptyArray a -> NonEmptyArray a

#unionBy' Source

unionBy' :: forall a. (a -> a -> Boolean) -> NonEmptyArray a -> Array a -> NonEmptyArray a

#delete Source

delete :: forall a. Eq a => a -> NonEmptyArray a -> Array a

#deleteBy Source

deleteBy :: forall a. (a -> a -> Boolean) -> a -> NonEmptyArray a -> Array a

#(\\) Source

Operator alias for Data.Array.NonEmpty.difference (non-associative / precedence 5)

#difference Source

difference :: forall a. Eq a => NonEmptyArray a -> NonEmptyArray a -> Array a

#difference' Source

difference' :: forall a. Eq a => NonEmptyArray a -> Array a -> Array a

#intersect Source

intersect :: forall a. Eq a => NonEmptyArray a -> NonEmptyArray a -> Array a

#intersect' Source

intersect' :: forall a. Eq a => NonEmptyArray a -> Array a -> Array a

#intersectBy Source

intersectBy :: forall a. (a -> a -> Boolean) -> NonEmptyArray a -> NonEmptyArray a -> Array a

#intersectBy' Source

intersectBy' :: forall a. (a -> a -> Boolean) -> NonEmptyArray a -> Array a -> Array a

#zipWith Source

zipWith :: forall a b c. (a -> b -> c) -> NonEmptyArray a -> NonEmptyArray b -> NonEmptyArray c

#zipWithA Source

zipWithA :: forall m a b c. Applicative m => (a -> b -> m c) -> NonEmptyArray a -> NonEmptyArray b -> m (NonEmptyArray c)

#zip Source

zip :: forall a b. NonEmptyArray a -> NonEmptyArray b -> NonEmptyArray (Tuple a b)

#unzip Source

unzip :: forall a b. NonEmptyArray (Tuple a b) -> Tuple (NonEmptyArray a) (NonEmptyArray b)

#foldM Source

foldM :: forall m a b. Monad m => (a -> b -> m a) -> a -> NonEmptyArray b -> m a

#foldRecM Source

foldRecM :: forall m a b. MonadRec m => (a -> b -> m a) -> a -> NonEmptyArray b -> m a

#unsafeIndex Source

unsafeIndex :: forall a. Partial => NonEmptyArray a -> Int -> a

Re-exports from Data.Array.NonEmpty.Internal