Data.List.NonEmpty
#toUnfoldable
toUnfoldable :: forall f. Unfoldable f => NonEmptyList ~> f#fromFoldable
fromFoldable :: forall f a. Foldable f => f a -> Maybe (NonEmptyList a)#fromList
fromList :: forall a. List a -> Maybe (NonEmptyList a)#toList
toList :: NonEmptyList ~> List#singleton
singleton :: forall a. a -> NonEmptyList a#length
length :: forall a. NonEmptyList a -> Int#cons
cons :: forall a. a -> NonEmptyList a -> NonEmptyList a#cons'
cons' :: forall a. a -> List a -> NonEmptyList a#snoc
snoc :: forall a. NonEmptyList a -> a -> NonEmptyList a#snoc'
snoc' :: forall a. List a -> a -> NonEmptyList a#head
head :: forall a. NonEmptyList a -> a#last
last :: forall a. NonEmptyList a -> a#tail
tail :: NonEmptyList ~> List#init
init :: NonEmptyList ~> List#uncons
uncons :: forall a. NonEmptyList a -> { head :: a, tail :: List a }#unsnoc
unsnoc :: forall a. NonEmptyList a -> { init :: List a, last :: a }#(!!)
Operator alias for Data.List.NonEmpty.index (left-associative / precedence 8)
#index
index :: forall a. NonEmptyList a -> Int -> Maybe a#elemLastIndex
elemLastIndex :: forall a. Eq a => a -> NonEmptyList a -> Maybe Int#findLastIndex
findLastIndex :: forall a. (a -> Boolean) -> NonEmptyList a -> Maybe Int#insertAt
insertAt :: forall a. Int -> a -> NonEmptyList a -> Maybe (NonEmptyList a)#updateAt
updateAt :: forall a. Int -> a -> NonEmptyList a -> Maybe (NonEmptyList a)#modifyAt
modifyAt :: forall a. Int -> (a -> a) -> NonEmptyList a -> Maybe (NonEmptyList a)#reverse
reverse :: forall a. NonEmptyList a -> NonEmptyList a#concat
concat :: forall a. NonEmptyList (NonEmptyList a) -> NonEmptyList a#concatMap
concatMap :: forall a b. (a -> NonEmptyList b) -> NonEmptyList a -> NonEmptyList b#filter
filter :: forall a. (a -> Boolean) -> NonEmptyList a -> List a#mapMaybe
mapMaybe :: forall a b. (a -> Maybe b) -> NonEmptyList a -> List b#catMaybes
catMaybes :: forall a. NonEmptyList (Maybe a) -> List a#appendFoldable
appendFoldable :: forall t a. Foldable t => NonEmptyList a -> t a -> NonEmptyList a#mapWithIndex
mapWithIndex :: forall a b. (Int -> a -> b) -> NonEmptyList a -> NonEmptyList bApply a function to each element and its index in a list starting at 0.
Deprecated. Use Data.FunctorWithIndex instead.
#sort
sort :: forall a. Ord a => NonEmptyList a -> NonEmptyList a#sortBy
sortBy :: forall a. (a -> a -> Ordering) -> NonEmptyList a -> NonEmptyList a#take
take :: forall a. Int -> NonEmptyList a -> List a#takeWhile
takeWhile :: forall a. (a -> Boolean) -> NonEmptyList a -> List a#drop
drop :: forall a. Int -> NonEmptyList a -> List a#dropWhile
dropWhile :: forall a. (a -> Boolean) -> NonEmptyList a -> List a#group
group :: forall a. Eq a => NonEmptyList a -> NonEmptyList (NonEmptyList a)#groupAll
groupAll :: forall a. Ord a => NonEmptyList a -> NonEmptyList (NonEmptyList a)#group'
group' :: forall a. Warn (Text "\'group\'\' is deprecated, use groupAll instead") => Ord a => NonEmptyList a -> NonEmptyList (NonEmptyList a)#groupBy
groupBy :: forall a. (a -> a -> Boolean) -> NonEmptyList a -> NonEmptyList (NonEmptyList a)#groupAllBy
groupAllBy :: forall a. Ord a => (a -> a -> Boolean) -> NonEmptyList a -> NonEmptyList (NonEmptyList a)#partition
partition :: forall a. (a -> Boolean) -> NonEmptyList a -> { no :: List a, yes :: List a }#nub
nub :: forall a. Ord a => NonEmptyList a -> NonEmptyList a#nubBy
nubBy :: forall a. (a -> a -> Ordering) -> NonEmptyList a -> NonEmptyList a#nubEq
nubEq :: forall a. Eq a => NonEmptyList a -> NonEmptyList a#nubByEq
nubByEq :: forall a. (a -> a -> Boolean) -> NonEmptyList a -> NonEmptyList a#union
union :: forall a. Eq a => NonEmptyList a -> NonEmptyList a -> NonEmptyList a#unionBy
unionBy :: forall a. (a -> a -> Boolean) -> NonEmptyList a -> NonEmptyList a -> NonEmptyList a#intersect
intersect :: forall a. Eq a => NonEmptyList a -> NonEmptyList a -> NonEmptyList a#intersectBy
intersectBy :: forall a. (a -> a -> Boolean) -> NonEmptyList a -> NonEmptyList a -> NonEmptyList a#zipWith
zipWith :: forall a b c. (a -> b -> c) -> NonEmptyList a -> NonEmptyList b -> NonEmptyList c#zipWithA
zipWithA :: forall m a b c. Applicative m => (a -> b -> m c) -> NonEmptyList a -> NonEmptyList b -> m (NonEmptyList c)#zip
zip :: forall a b. NonEmptyList a -> NonEmptyList b -> NonEmptyList (Tuple a b)#unzip
unzip :: forall a b. NonEmptyList (Tuple a b) -> Tuple (NonEmptyList a) (NonEmptyList b)#foldM
foldM :: forall m a b. Monad m => (b -> a -> m b) -> b -> NonEmptyList a -> m bRe-exports from Data.Foldable
#notElem
#intercalate
intercalate :: forall f m. Foldable f => Monoid m => m -> f m -> mFold a data structure, accumulating values in some Monoid,
combining adjacent elements using the specified separator.
For example:
> intercalate ", " ["Lorem", "ipsum", "dolor"]
= "Lorem, ipsum, dolor"
> intercalate "*" ["a", "b", "c"]
= "a*b*c"
> intercalate [1] [[2, 3], [4, 5], [6, 7]]
= [2, 3, 1, 4, 5, 1, 6, 7]
#fold
#findMap
#find
#elem
#any
any :: forall a b f. Foldable f => HeytingAlgebra b => (a -> b) -> f a -> bany f is the same as or <<< map f; map a function over the structure,
and then get the disjunction of the results.
#all
all :: forall a b f. Foldable f => HeytingAlgebra b => (a -> b) -> f a -> ball f is the same as and <<< map f; map a function over the structure,
and then get the conjunction of the results.
Re-exports from Data.List.Types
#NonEmptyList
newtype NonEmptyList aConstructors
NonEmptyList (NonEmpty List a)
Instances
Newtype (NonEmptyList a) _(Eq a) => Eq (NonEmptyList a)(Ord a) => Ord (NonEmptyList a)Eq1 NonEmptyListOrd1 NonEmptyList(Show a) => Show (NonEmptyList a)Functor NonEmptyListApply NonEmptyListApplicative NonEmptyListBind NonEmptyListMonad NonEmptyListAlt NonEmptyListExtend NonEmptyListComonad NonEmptyListSemigroup (NonEmptyList a)Foldable NonEmptyListTraversable NonEmptyListFoldable1 NonEmptyListUnfoldable1 NonEmptyListFunctorWithIndex Int NonEmptyListFoldableWithIndex Int NonEmptyListTraversableWithIndex Int NonEmptyListTraversable1 NonEmptyList
Re-exports from Data.Semigroup.Foldable
#traverse1_
traverse1_ :: forall t f a b. Foldable1 t => Apply f => (a -> f b) -> t a -> f UnitTraverse a data structure, performing some effects encoded by an
Apply instance at each value, ignoring the final result.
#sequence1_
sequence1_ :: forall t f a. Foldable1 t => Apply f => t (f a) -> f UnitPerform all of the effects in some data structure in the order
given by the Foldable1 instance, ignoring the final result.
#for1_
#fold1
Re-exports from Data.Semigroup.Traversable
#sequence1
sequence1 :: forall t b f. Traversable1 t => Apply f => t (f b) -> f (t b)#traverse1
traverse1 :: forall t a b f. Traversable1 t => Apply f => (a -> f b) -> t a -> f (t b)#traverse1Default
traverse1Default :: forall t a b m. Traversable1 t => Apply m => (a -> m b) -> t a -> m (t b)A default implementation of traverse1 using sequence1.
Re-exports from Data.Traversable
#scanr
scanr :: forall a b f. Traversable f => (a -> b -> b) -> b -> f a -> f bFold a data structure from the right, keeping all intermediate results
instead of only the final result. Note that the initial value does not
appear in the result (unlike Haskell's Prelude.scanr).
scanr (+) 0 [1,2,3] = [6,5,3]
scanr (flip (-)) 10 [1,2,3] = [4,5,7]
#scanl
scanl :: forall a b f. Traversable f => (b -> a -> b) -> b -> f a -> f bFold a data structure from the left, keeping all intermediate results
instead of only the final result. Note that the initial value does not
appear in the result (unlike Haskell's Prelude.scanl).
scanl (+) 0 [1,2,3] = [1,3,6]
scanl (-) 10 [1,2,3] = [9,7,4]
Modules
- Ansi.Codes
- Ansi.Output
- Ch5
- Ch6
- Ch7a
- Ch7b
- Ch9
- Control.Alt
- Control.Alternative
- Control.Applicative
- Control.Apply
- Control.Biapplicative
- Control.Biapply
- Control.Bind
- Control.Category
- Control.Comonad
- Control.Comonad.Cofree
- Control.Comonad.Cofree.Class
- Control.Comonad.Env
- Control.Comonad.Env.Class
- Control.Comonad.Env.Trans
- Control.Comonad.Store
- Control.Comonad.Store.Class
- Control.Comonad.Store.Trans
- Control.Comonad.Traced
- Control.Comonad.Traced.Class
- Control.Comonad.Traced.Trans
- Control.Comonad.Trans.Class
- Control.Extend
- Control.Lazy
- Control.Monad
- Control.Monad.Cont
- Control.Monad.Cont.Class
- Control.Monad.Cont.Trans
- Control.Monad.Error.Class
- Control.Monad.Except
- Control.Monad.Except.Trans
- Control.Monad.Fork.Class
- Control.Monad.Free
- Control.Monad.Free.Class
- Control.Monad.Gen
- Control.Monad.Gen.Class
- Control.Monad.Gen.Common
- Control.Monad.Identity.Trans
- Control.Monad.List.Trans
- Control.Monad.Maybe.Trans
- Control.Monad.Morph
- Control.Monad.RWS
- Control.Monad.RWS.Trans
- Control.Monad.Reader
- Control.Monad.Reader.Class
- Control.Monad.Reader.Trans
- Control.Monad.Rec.Class
- Control.Monad.ST
- Control.Monad.ST.Class
- Control.Monad.ST.Global
- Control.Monad.ST.Internal
- Control.Monad.ST.Ref
- Control.Monad.State
- Control.Monad.State.Class
- Control.Monad.State.Trans
- Control.Monad.Trampoline
- Control.Monad.Trans.Class
- Control.Monad.Writer
- Control.Monad.Writer.Class
- Control.Monad.Writer.Trans
- Control.MonadPlus
- Control.MonadZero
- Control.Parallel
- Control.Parallel.Class
- Control.Plus
- Control.Semigroupoid
- Data.Array
- Data.Array.NonEmpty
- Data.Array.NonEmpty.Internal
- Data.Array.Partial
- Data.Array.ST
- Data.Array.ST.Iterator
- Data.Array.ST.Partial
- Data.Bifoldable
- Data.Bifunctor
- Data.Bifunctor.Join
- Data.Bitraversable
- Data.Boolean
- Data.BooleanAlgebra
- Data.Bounded
- Data.Bounded.Generic
- Data.CatList
- Data.CatQueue
- Data.Char
- Data.Char.Gen
- Data.CommutativeRing
- Data.Comparison
- Data.Const
- Data.Coyoneda
- Data.Date
- Data.Date.Component
- Data.Date.Component.Gen
- Data.Date.Gen
- Data.DateTime
- Data.DateTime.Gen
- Data.DateTime.Instant
- Data.Decidable
- Data.Decide
- Data.Distributive
- Data.Divide
- Data.Divisible
- Data.DivisionRing
- Data.Either
- Data.Either.Inject
- Data.Either.Nested
- Data.Enum
- Data.Enum.Gen
- Data.Enum.Generic
- Data.Eq
- Data.Eq.Generic
- Data.Equivalence
- Data.EuclideanRing
- Data.Exists
- Data.Field
- Data.Foldable
- Data.FoldableWithIndex
- Data.Function
- Data.Function.Uncurried
- Data.Functor
- Data.Functor.App
- Data.Functor.Clown
- Data.Functor.Compose
- Data.Functor.Contravariant
- Data.Functor.Coproduct
- Data.Functor.Coproduct.Inject
- Data.Functor.Coproduct.Nested
- Data.Functor.Costar
- Data.Functor.Flip
- Data.Functor.Invariant
- Data.Functor.Joker
- Data.Functor.Product
- Data.Functor.Product.Nested
- Data.Functor.Product2
- Data.FunctorWithIndex
- Data.Generic.Rep
- Data.HeytingAlgebra
- Data.HeytingAlgebra.Generic
- Data.Identity
- Data.Int
- Data.Int.Bits
- Data.Interval
- Data.Interval.Duration
- Data.Interval.Duration.Iso
- Data.Lazy
- Data.List
- Data.List.Internal
- Data.List.Lazy
- Data.List.Lazy.NonEmpty
- Data.List.Lazy.Types
- Data.List.NonEmpty
- Data.List.Partial
- Data.List.Types
- Data.List.ZipList
- Data.Map
- Data.Map.Gen
- Data.Map.Internal
- Data.Maybe
- Data.Maybe.First
- Data.Maybe.Last
- Data.Monoid
- Data.Monoid.Additive
- Data.Monoid.Alternate
- Data.Monoid.Conj
- Data.Monoid.Disj
- Data.Monoid.Dual
- Data.Monoid.Endo
- Data.Monoid.Generic
- Data.Monoid.Multiplicative
- Data.NaturalTransformation
- Data.Newtype
- Data.NonEmpty
- Data.Number
- Data.Number.Approximate
- Data.Number.Format
- Data.Op
- Data.Ord
- Data.Ord.Down
- Data.Ord.Generic
- Data.Ord.Max
- Data.Ord.Min
- Data.Ordering
- Data.Predicate
- Data.Profunctor
- Data.Profunctor.Choice
- Data.Profunctor.Closed
- Data.Profunctor.Cochoice
- Data.Profunctor.Costrong
- Data.Profunctor.Join
- Data.Profunctor.Split
- Data.Profunctor.Star
- Data.Profunctor.Strong
- Data.Ring
- Data.Ring.Generic
- Data.Semigroup
- Data.Semigroup.First
- Data.Semigroup.Foldable
- Data.Semigroup.Generic
- Data.Semigroup.Last
- Data.Semigroup.Traversable
- Data.Semiring
- Data.Semiring.Generic
- Data.Set
- Data.Set.NonEmpty
- Data.Show
- Data.Show.Generic
- Data.String
- Data.String.CaseInsensitive
- Data.String.CodePoints
- Data.String.CodeUnits
- Data.String.Common
- Data.String.Gen
- Data.String.NonEmpty
- Data.String.NonEmpty.CaseInsensitive
- Data.String.NonEmpty.CodePoints
- Data.String.NonEmpty.CodeUnits
- Data.String.NonEmpty.Internal
- Data.String.Pattern
- Data.String.Regex
- Data.String.Regex.Flags
- Data.String.Regex.Unsafe
- Data.String.Unsafe
- Data.Symbol
- Data.Time
- Data.Time.Component
- Data.Time.Component.Gen
- Data.Time.Duration
- Data.Time.Duration.Gen
- Data.Time.Gen
- Data.Traversable
- Data.Traversable.Accum
- Data.Traversable.Accum.Internal
- Data.TraversableWithIndex
- Data.Tuple
- Data.Tuple.Nested
- Data.Unfoldable
- Data.Unfoldable1
- Data.Unit
- Data.Void
- Data.Yoneda
- Effect
- Effect.AVar
- Effect.Aff
- Effect.Aff.AVar
- Effect.Aff.Class
- Effect.Aff.Compat
- Effect.Class
- Effect.Class.Console
- Effect.Console
- Effect.Exception
- Effect.Exception.Unsafe
- Effect.Now
- Effect.Ref
- Effect.Uncurried
- Effect.Unsafe
- Main
- Math
- PSCI.Support
- Partial
- Partial.Unsafe
- Pipes
- Pipes.Core
- Pipes.Internal
- Pipes.ListT
- Pipes.Prelude
- Prelude
- Prim
- Prim.Boolean
- Prim.Coerce
- Prim.Ordering
- Prim.Row
- Prim.RowList
- Prim.Symbol
- Prim.TypeError
- Record.Unsafe
- Safe.Coerce
- Test.Main
- Test.Spec
- Test.Spec.Assertions
- Test.Spec.Assertions.String
- Test.Spec.Console
- Test.Spec.Reporter
- Test.Spec.Reporter.Base
- Test.Spec.Reporter.Console
- Test.Spec.Reporter.Dot
- Test.Spec.Reporter.Spec
- Test.Spec.Reporter.Tap
- Test.Spec.Result
- Test.Spec.Runner
- Test.Spec.Runner.Event
- Test.Spec.Speed
- Test.Spec.Style
- Test.Spec.Summary
- Test.Spec.Tree
- Type.Data.Row
- Type.Data.RowList
- Type.Equality
- Type.Proxy
- Unsafe.Coerce