Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
DA.NonEmpty
Type and functions for non-empty lists. This module re-exports many functions with the same name as prelude list functions, so it is expected to import the module qualified. For example, with the following import list you will have access to theNonEmpty type
and any functions on non-empty lists will be qualified, for example as NE.append, NE.map, NE.foldl:
Module Snapshot
Lifecycle
Stable.
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 0
Deprecations: 0
Deprecated since: -Functions
cons
append
map
nonEmpty
None if the input list is empty, and Some otherwise.
singleton
toList
reverse
find
deleteBy
delete
foldl1
foldl1 (+) (NonEmpty 1 [2,3,4]) = ((1 + 2) + 3) + 4.
foldr1
foldr1 (+) (NonEmpty 1 [2,3,4]) = 1 + (2 + (3 + 4)).
foldr
foldr (+) 0 (NonEmpty 1 [2,3,4]) = 1 + (2 + (3 + (4 + 0))).
foldrA
foldr but running an action each time.
foldr1A
foldr1 but running an action each time.
foldl
foldl (+) 0 (NonEmpty 1 [2,3,4]) = (((0 + 1) + 2) + 3) + 4.
foldlA
foldl but running an action each time.
foldl1A
foldl1 but running an action each time.
Orphan Typeclass Instances
-
instance Eq a => Eq (NonEmpty a) -
instance Show a => Show (NonEmpty a) -
instance Ord a => Ord (NonEmpty a) -
instance GetField hd (NonEmpty a) a -
instance SetField hd (NonEmpty a) a -
instance GetField tl (NonEmpty a) [a] -
instance SetField tl (NonEmpty a) [a] -
instance Semigroup (NonEmpty a) -
instance Functor NonEmpty -
instance Applicative NonEmpty -
instance Action NonEmpty -
instance Foldable NonEmpty -
instance Traversable NonEmpty -
instance IsParties (NonEmpty Party)