Checks if all the elements in the list are equal. Assumes that the Eq instance stands for an equivalence relation. O(n).
ModuleAgda-2.8.0.2Haskell2010
Agda.Utils.List1
Non-empty lists.
Better name List1 for non-empty lists, plus missing functionality.
Import: @
{-# LANGUAGE PatternSynonyms #-}
import Agda.Utils.List1 (List1, pattern (:|)) import qualified Agda.Utils.List1 as List1
@
- 3 types
- 1 class
- 101 values
- PackageAgda-2.8.0.2
- Exports106
- LanguageHaskell2010
- LicenceMIT
- SourceList1.hs
Breaks a list just after an element satisfying the predicate is found.
breakAfter even [1,3,5,2,4,7,8](1 :| [3,5,2],[4,7,8])
Like catMaybes.
Concatenate one or more non-empty lists.
Like find.
List Data.List.foldr but with a base case for the singleton list.
fromListSafe Safe version of fromList.
More precise type for Agda.Utils.List.groupBy'.
A variant of groupBy which applies the predicate to consecutive pairs. O(n).
Group consecutive items that share the same first component.
Group consecutive items that share the same first component.
Return the last element and the rest.
Last two elements (safe). O(n).
Like lefts.
Focus on the first element of a non-empty list. O(1).
Focus on the last element of a non-empty list. O(n).
Like mapMaybe.
Non-efficient, monadic nub. O(n²).
Like partitionEithers.
Like rights.
Build a list with one element.
More precise type for snoc.
Like union. Duplicates in the first list are not removed. O(nm).
The more general type Null m => [a] -> (List1 a -> m) -> m
often causes type inference to fail, as we do not in general have
instance Applicative m => Null (m ()).
Like Data.List.unwords.
Like unzipWith.
Update the first element of a non-empty list. O(1).
Update the last element of a non-empty list. O(n).
Split a list into sublists. Generalisation of the prelude function
words.
Same as Data.List.Split.wordsBy and Data.List.Extra.wordsBy,
but with the non-emptyness guarantee on the chunks.
O(n).
words xs == wordsBy isSpace xsLike zipWithM.
Like zipWithM.
xs !! n returns the element of the stream xs at index
n. Note that the head of the stream has index 0.
Beware: a negative or out-of-bounds index will cause an error.
Prepend an element to the stream.
Attach a list at the end of a NonEmpty.
appendList (1 :| [2,3]) []1 :| [2,3]
appendList (1 :| [2,3]) [4,5]1 :| [2,3,4,5]
Use compareLength xs n as a safer and faster alternative
to compare (length xs) n. Similarly, it's better
to write compareLength xs 10 == LT instead of length xs < 10.
While length would force and traverse
the entire spine of xs (which could even diverge if xs is infinite),
compareLength traverses at most n elements to determine its result.
compareLength ('a' :| []) 1EQcompareLength ('a' :| ['b']) 3LTcompareLength (0 :| [1..]) 100GTcompareLength undefined 0GTcompareLength ('a' :| 'b' : undefined) 1GT
Synonym for <|.
cycle xs returns the infinite repetition of xs:
cycle (1 :| [2,3]) = 1 :| [2,3,1,2,3,...]drop n xs drops the first n elements off the front of
the sequence xs.
filter p xs removes any elements from xs that do not satisfy p.
The group function takes a stream and returns a list of streams such that flattening the resulting list is equal to the argument. Moreover, each stream in the resulting list contains only equal elements, and consecutive equal elements of the input end up in the same stream of the output list. For example, in list notation:
group "Mississippi"['M' :| "",'i' :| "",'s' :| "s",'i' :| "",'s' :| "s",'i' :| "",'p' :| "p",'i' :| ""]
groupAllWith operates like groupWith, but sorts the list first so that each equivalence class has, at most, one list in the output
groupAllWith1 is to groupWith1 as groupAllWith is to groupWith
groupWith1 is to group1 as groupWith is to group
Extract the first element of the stream.
Extract everything except the last element of the stream.
insert x xs inserts x into the last position in xs where it
is still less than or equal to the next element. In particular, if the
list is sorted beforehand, the result will also be sorted.
'intersperse x xs' alternates elements of the list with copies of x.
intersperse 0 (1 :| [2,3]) == 1 :| [0,2,0,3]The isPrefixOf function returns True if the first argument is a prefix of the second.
iterate f x produces the infinite sequence
of repeated applications of f to x.
iterate f x = x :| [f x, f (f x), ..]Extract the last element of the stream.
Number of elements in NonEmpty list.
The partition function takes a predicate p and a stream
xs, and returns a pair of lists. The first list corresponds to the
elements of xs for which p holds; the second corresponds to the
elements of xs for which p does not hold.
'partition' p xs = ('filter' p xs, 'filter' (not . p) xs)The permutations function returns the list of all permutations of the argument.
permutations1 operates like permutations, but uses the knowledge that its input is non-empty to produce output where every element is non-empty.
permutations1 = fmap fromList . permutations . toListAttach a list at the beginning of a NonEmpty.
prependList [] (1 :| [2,3])1 :| [2,3]
prependList [negate 1, 0] (1 :| [2, 3])-1 :| [0,1,2,3]
repeat x returns a constant stream, where all elements are
equal to x.
reverse a finite NonEmpty stream.
Construct a NonEmpty list from a single element.
some1 x sequences x one or more times.
Sort a stream.
Sort a NonEmpty on a user-supplied projection of its elements. See sortOn for more detailed information.
Examples
sortOn fst $ (2, "world") :| [(4, "!"), (1, "Hello")](1,"Hello") :| [(2,"world"),(4,"!")]
sortOn List.length ("jim" :| ["creed", "pam", "michael", "dwight", "kevin"])"jim" :| ["pam","creed","kevin","dwight","michael"]
Performance notes
This function minimises the projections performed, by materialising the projections in an intermediate list.
For trivial projections, you should prefer using sortBy with comparing, for example:
sortBy (comparing fst) $ (3, 1) :| [(2, 2), (1, 3)](1,3) :| [(2,2),(3,1)]
Or, for the exact same API as sortOn, you can use `sortBy . comparing`:
(sortBy . comparing) fst $ (3, 1) :| [(2, 2), (1, 3)](1,3) :| [(2,2),(3,1)]
sortWith is an alias for `sortBy . comparing`.
span p xs returns the longest prefix of xs that satisfies
p, together with the remainder of the stream.
'span' p xs == ('takeWhile' p xs, 'dropWhile' p xs)
xs == ys ++ zs where (ys, zs) = 'span' p xssplitAt n xs returns a pair consisting of the prefix of xs
of length n and the remaining stream immediately following this prefix.
'splitAt' n xs == ('take' n xs, 'drop' n xs)
xs == ys ++ zs where (ys, zs) = 'splitAt' n xsExtract the possibly-empty tail of the stream.
take n xs returns the first n elements of xs.
takeWhile p xs returns the longest prefix of the stream
xs for which the predicate p holds.
uncons produces the first element of the stream, and a stream of the remaining elements, if any.
Compute n-ary logic exclusive OR operation on NonEmpty list.
The zip function takes two streams and returns a stream of corresponding pairs.
Map a function over a NonEmpty stream.
Non-empty (and non-strict) list type.
Constructors
a :| [a]infixr 5
Instances111Monad, Functor, MonadFix, IsString, Applicative, Foldable, …
Monad NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.NonEmpty · orphanFunctor NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.NonEmpty · orphanMonadFix NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Monad.FixIsString String1Defined in Agda-2.8.0.2 · Agda.Utils.String · orphanApplicative NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.NonEmpty · orphanFoldable NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.FoldableTraversable NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.TraversableMonadZip NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Monad.ZipFoldable1 NonEmptyDefined in base-4.22.0.0 · Data.Foldable1Eq1 NonEmptyDefined in base-4.22.0.0 · Data.Functor.ClassesOrd1 NonEmptyDefined in base-4.22.0.0 · Data.Functor.ClassesRead1 NonEmptyDefined in base-4.22.0.0 · Data.Functor.ClassesShow1 NonEmptyDefined in base-4.22.0.0 · Data.Functor.ClassesNFData1 NonEmptyDefined in deepseq-1.5.1.0 · Control.DeepSeqArbitrary1 NonEmptyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryHashable1 NonEmptyDefined in hashable-1.5.1.0 · Data.Hashable.ClassComonad NonEmptyDefined in comonad-5.0.10 · Control.ComonadComonadApply NonEmptyDefined in comonad-5.0.10 · Control.ComonadAlt NonEmptyDefined in semigroupoids-6.0.2 · Data.Functor.AltApply NonEmptyDefined in semigroupoids-6.0.2 · Data.Functor.Bind.ClassBind NonEmptyDefined in semigroupoids-6.0.2 · Data.Functor.Bind.ClassExtend NonEmptyDefined in semigroupoids-6.0.2 · Data.Functor.ExtendTraversable1 NonEmptyDefined in semigroupoids-6.0.2 · Data.Semigroup.Traversable.ClassSemialign NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalRepeat NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalUnzip NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalZip NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalFromJSON1 NonEmptyDefined in aeson-2.3.2.0 · Data.Aeson.Types.FromJSONToJSON1 NonEmptyDefined in aeson-2.3.2.0 · Data.Aeson.Types.ToJSONInvariant NonEmptyDefined in invariant-0.6.5 · Data.Functor.Invariantfrom Data.List.NonEmpty
GFunctor NonEmptyDefined in generic-deriving-1.14.7 · Generics.Deriving.FunctorGFoldable NonEmptyDefined in generic-deriving-1.14.7 · Generics.Deriving.FoldableGTraversable NonEmptyDefined in generic-deriving-1.14.7 · Generics.Deriving.TraversableNumHoles NamePartsDefined in Agda-2.8.0.2 · Agda.Syntax.Concrete.NameGeneric1 NonEmptyDefined in ghc-internal-9.1401.0 · GHC.Internal.GenericsFoldableWithIndex Int NonEmptyDefined in indexed-traversable-0.1.5 · WithIndexFoldable1WithIndex Int NonEmptyDefined in indexed-traversable-0.1.5 · WithIndexFunctorWithIndex Int NonEmptyDefined in indexed-traversable-0.1.5 · WithIndexTraversableWithIndex Int NonEmptyDefined in indexed-traversable-0.1.5 · WithIndexRepeatWithIndex Int NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalSemialignWithIndex Int NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalZipWithIndex Int NonEmptyDefined in semialign-1.4 · Data.Semialign.InternalLift a => Lift (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.TH.LiftSingleton a (NonEmpty a)Defined in Agda-2.8.0.2 · Agda.Utils.SingletonIsList (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.IsListEq a => Eq (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.BaseData a => Data (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.DataOrd a => Ord (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.BaseRead a => Read (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.ReadShow a => Show (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.ShowGeneric (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.GenericsSemigroup (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.NonEmpty · orphanNFData a => NFData (NonEmpty a)Defined in deepseq-1.5.1.0 · Control.DeepSeqArbitrary a => Arbitrary (NonEmpty a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (NonEmpty a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (NonEmpty a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary a => Binary (NonEmpty a)Defined in binary-0.8.9.3 · Data.Binary.ClassHashable a => Hashable (NonEmpty a)Defined in hashable-1.5.1.0 · Data.Hashable.ClassFromJSON a => FromJSON (NonEmpty a)Defined in aeson-2.3.2.0 · Data.Aeson.Types.FromJSONToJSON a => ToJSON (NonEmpty a)Defined in aeson-2.3.2.0 · Data.Aeson.Types.ToJSONToMarkup (NonEmpty Char)Defined in blaze-markup-0.8.3.0 · Text.BlazeToValue (NonEmpty Char)Defined in blaze-markup-0.8.3.0 · Text.BlazeGEnum a => GEnum (NonEmpty a)Defined in generic-deriving-1.14.7 · Generics.Deriving.Enum(GEq a, GEnum a, GIx a) => GIx (NonEmpty a)Defined in generic-deriving-1.14.7 · Generics.Deriving.EnumGEq a => GEq (NonEmpty a)Defined in generic-deriving-1.14.7 · Generics.Deriving.EqGShow a => GShow (NonEmpty a)Defined in generic-deriving-1.14.7 · Generics.Deriving.ShowGSemigroup (NonEmpty a)Defined in generic-deriving-1.14.7 · Generics.Deriving.Semigroup.InternalPretty a => Pretty (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Common.PrettySized (List1 a)Defined in Agda-2.8.0.2 · Agda.Utils.SizePretty a => Pretties (List1 a)Defined in Agda-2.8.0.2 · Agda.Compiler.JS.PrettyHasRange a => HasRange (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.PositionPrecondition: The ranges of the list elements must point to the same file (or be empty).
Subst a => Subst (List1 a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Substitute · orphanPrettyTCM a => PrettyTCM (List1 a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.PrettyReify i => Reify (List1 i)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.InternalToAbstractToConcrete a => ToConcrete (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.AbstractToConcreteInstantiate t => Instantiate (List1 t)Defined in Agda-2.8.0.2 · Agda.TypeChecking.ReduceNormalise t => Normalise (List1 t)Defined in Agda-2.8.0.2 · Agda.TypeChecking.ReduceFree t => Free (List1 t)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Free.LazyToAbstract c => ToAbstract (List1 c)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.ConcreteToAbstractHilite a => Hilite (List1 a)Defined in Agda-2.8.0.2 · Agda.Interaction.Highlighting.FromAbstractDeclaredNames a => DeclaredNames (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Abstract.ViewsTermLike a => TermLike (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Internal.GenericBlankVars a => BlankVars (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.InternalToAbstractSubstExpr a => SubstExpr (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.AbstractKillRange a => KillRange (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.PositionBoundAndUsed a => BoundAndUsed (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Abstract.UsedNamesExprLike a => ExprLike (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Abstract.ViewsExprLike a => ExprLike (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Concrete.GenericFoldDecl a => FoldDecl (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Concrete.GenericTraverseDecl a => TraverseDecl (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Concrete.GenericCPatternLike p => CPatternLike (List1 p)Defined in Agda-2.8.0.2 · Agda.Syntax.Concrete.PatternNamesIn a => NamesIn (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Internal.NamesHasRangeWithoutFile a => HasRangeWithoutFile (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.PositionSetBindingSite a => SetBindingSite (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Scope.BaseBinder a => Binder (List1 a)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.InternalToAbstractToAbstract (List1 (QNamed Clause))Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.ReflectedToAbstractInstantiateFull t => InstantiateFull (List1 t)Defined in Agda-2.8.0.2 · Agda.TypeChecking.ReduceSubstWithOrigin a => SubstWithOrigin (List1 a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.DisplayFormEmbPrj a => EmbPrj (List1 a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Serialise.Instances.Common · orphanAddContext (List1 Name, Dom Type)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Monad.ContextAddContext (List1 (Arg Name), Type)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Monad.ContextAddContext (List1 (NamedArg Name), Type)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Monad.ContextAddContext (List1 (WithHiding Name), Dom Type)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Monad.Contexttype Rep (NonEmpty a) = D1 ('MetaDataDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics"NonEmpty"
"GHC.Internal.Base"
"ghc-internal"
'False) (C1 ('MetaCons":|"
('InfixI 'RightAssociative5
) 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))type Rep1 NonEmpty = D1 ('MetaDataDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics"NonEmpty"
"GHC.Internal.Base"
"ghc-internal"
'False) (C1 ('MetaCons":|"
('InfixI 'RightAssociative5
) 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))type Item (NonEmpty a) = aDefined in ghc-internal-9.1401.0 · GHC.Internal.IsListtype SubstArg (List1 a) = SubstArg aDefined in Agda-2.8.0.2 · Agda.TypeChecking.Substitute · orphantype ConOfAbs (List1 a) = List1 (ConOfAbs a)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.AbstractToConcretetype ReifiesTo (List1 i) = List1 (ReifiesTo i)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.InternalToAbstracttype AbsOfCon (List1 c) = List1 (AbsOfCon c)Defined in Agda-2.8.0.2 · Agda.Syntax.Translation.ConcreteToAbstracttype AbsOfRef (List1 (QNamed Clause)) = List1 ClauseDefined in Agda-2.8.0.2 · Agda.Syntax.Translation.ReflectedToAbstract
The IsList class and its methods are intended to be used in conjunction with the OverloadedLists extension.
Associated types
Methods
Instances47IsList, …
IsList CharStringDefined in ListLike-4.7.8.4 · Data.ListLike.CharStringIsList CharStringLazyDefined in ListLike-4.7.8.4 · Data.ListLike.CharStringIsList CharsDefined in ListLike-4.7.8.4 · Data.ListLike.CharsIsList ByteArrayDefined in base-4.22.0.0 · Data.Array.ByteIsList BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalIsList ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeIsList ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalIsList ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalIsList IntSetDefined in containers-0.8 · Data.IntSet.InternalIsList VersionDefined in ghc-internal-9.1401.0 · GHC.Internal.IsListIsList CallStackDefined in ghc-internal-9.1401.0 · GHC.Internal.IsListIsList NEIntSetDefined in nonempty-containers-0.3.6.0 · Data.IntSet.NonEmpty.InternalIsList TextDefined in text-2.1.3 · Data.Text · orphanPerforms replacement on invalid scalar values:
Example2 expressions :set -XOverloadedLists['\55555'] :: Text"\65533"
IsList BuilderDefined in ListLike-4.7.8.4 · Data.ListLike.Text.Builder · orphanIsList TextDefined in text-2.1.3 · Data.Text.Lazy · orphanPerforms replacement on invalid scalar values:
Example2 expressions :set -XOverloadedLists['\55555'] :: Data.Text.Lazy.Text"\65533"
IsList ShortTextDefined in text-short-0.1.6.1 · Data.Text.Short.InternalNote: Surrogate pairs (
[U+D800 .. U+DFFF]) character literals are replaced by U+FFFD.Ord a => IsList (Set a)Defined in containers-0.8 · Data.Set.InternalOrd a => IsList (NESet a)Defined in nonempty-containers-0.3.6.0 · Data.Set.NonEmpty.InternalEnum a => IsList (EnumSet a)Defined in enummapset-0.7.3.0 · Data.EnumSetStorable a => IsList (Vector a)Defined in vector-0.13.2.0 · Data.Vector.StorableIsList (List2 a)Defined in Agda-2.8.0.2 · Agda.Utils.List2fromList is unsafe.
IsList (KeyMap v)Defined in aeson-2.3.2.0 · Data.Aeson.KeyMapIsList (IntMap a)Defined in containers-0.8 · Data.IntMap.InternalIsList (Seq a)Defined in containers-0.8 · Data.Sequence.InternalIsList (DNonEmpty a)Defined in dlist-1.0 · Data.DList.DNonEmpty.InternalIsList (DList a)Defined in dlist-1.0 · Data.DList.InternalIsList (FMList a)Defined in ListLike-4.7.8.4 · Data.ListLike.FMList · orphanIsList (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.IsListIsList (ZipList a)Defined in ghc-internal-9.1401.0 · GHC.Internal.IsListIsList (NEIntMap a)Defined in nonempty-containers-0.3.6.0 · Data.IntMap.NonEmpty.InternalIsList (NESeq a)Defined in nonempty-containers-0.3.6.0 · Data.Sequence.NonEmpty.InternalIsList (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.ArrayIsList (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArrayIsList (UTF8 ByteString)Defined in ListLike-4.7.8.4 · Data.ListLike.UTF8 · orphanIsList (UTF8 ByteString)Defined in ListLike-4.7.8.4 · Data.ListLike.UTF8 · orphanIsList (Vector a)Defined in vector-0.13.2.0 · Data.VectorIsList (Vector a)Defined in vector-0.13.2.0 · Data.Vector.StrictIsList [a]Defined in ghc-internal-9.1401.0 · GHC.Internal.IsListHashable a => IsList (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalPrim a => IsList (PrimArray a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArrayPrim a => IsList (Vector a)Defined in vector-0.13.2.0 · Data.Vector.PrimitiveUnbox e => IsList (Vector e)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphanOrd k => IsList (Map k v)Defined in containers-0.8 · Data.Map.InternalOrd k => IsList (NEMap k a)Defined in nonempty-containers-0.3.6.0 · Data.Map.NonEmpty.InternalEnum k => IsList (EnumMap k a)Defined in enummapset-0.7.3.0 · Data.EnumMap.BaseHashable k => IsList (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal(Integral i, Ix i) => IsList (Array i e)Defined in ListLike-4.7.8.4 · Data.ListLike.Instances · orphan
The Item type function returns the type of items of the structure
l.
Instances47Item, …
type Item CharString = CharDefined in ListLike-4.7.8.4 · Data.ListLike.CharStringtype Item CharStringLazy = CharDefined in ListLike-4.7.8.4 · Data.ListLike.CharStringtype Item Chars = CharDefined in ListLike-4.7.8.4 · Data.ListLike.Charstype Item ByteArray = Word8Defined in base-4.22.0.0 · Data.Array.Bytetype Item Builder = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internaltype Item ByteString = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Internal.Typetype Item ByteString = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internaltype Item ShortByteString = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Short.Internaltype Item IntSet = KeyDefined in containers-0.8 · Data.IntSet.Internaltype Item Version = IntDefined in ghc-internal-9.1401.0 · GHC.Internal.IsListtype Item CallStack = (String, SrcLoc)Defined in ghc-internal-9.1401.0 · GHC.Internal.IsListtype Item NEIntSet = KeyDefined in nonempty-containers-0.3.6.0 · Data.IntSet.NonEmpty.Internaltype Item Text = CharDefined in text-2.1.3 · Data.Text · orphantype Item Builder = CharDefined in ListLike-4.7.8.4 · Data.ListLike.Text.Builder · orphantype Item Text = CharDefined in text-2.1.3 · Data.Text.Lazy · orphantype Item ShortText = CharDefined in text-short-0.1.6.1 · Data.Text.Short.Internaltype Item (List2 a) = aDefined in Agda-2.8.0.2 · Agda.Utils.List2type Item (KeyMap v) = (Key, v)Defined in aeson-2.3.2.0 · Data.Aeson.KeyMaptype Item (IntMap a) = (Key, a)Defined in containers-0.8 · Data.IntMap.Internaltype Item (Map k v) = (k, v)Defined in containers-0.8 · Data.Map.Internaltype Item (Seq a) = aDefined in containers-0.8 · Data.Sequence.Internaltype Item (Set a) = aDefined in containers-0.8 · Data.Set.Internaltype Item (DNonEmpty a) = aDefined in dlist-1.0 · Data.DList.DNonEmpty.Internaltype Item (DList a) = aDefined in dlist-1.0 · Data.DList.Internaltype Item (EnumMap k a) = (k, a)Defined in enummapset-0.7.3.0 · Data.EnumMap.Basetype Item (EnumSet a) = aDefined in enummapset-0.7.3.0 · Data.EnumSettype Item (FMList a) = aDefined in ListLike-4.7.8.4 · Data.ListLike.FMList · orphantype Item (Array i e) = eDefined in ListLike-4.7.8.4 · Data.ListLike.Instances · orphantype Item (NonEmpty a) = aDefined in ghc-internal-9.1401.0 · GHC.Internal.IsListtype Item (ZipList a) = aDefined in ghc-internal-9.1401.0 · GHC.Internal.IsListtype Item (NEIntMap a) = (Key, a)Defined in nonempty-containers-0.3.6.0 · Data.IntMap.NonEmpty.Internaltype Item (NEMap k a) = (k, a)Defined in nonempty-containers-0.3.6.0 · Data.Map.NonEmpty.Internaltype Item (NESeq a) = aDefined in nonempty-containers-0.3.6.0 · Data.Sequence.NonEmpty.Internaltype Item (NESet a) = aDefined in nonempty-containers-0.3.6.0 · Data.Set.NonEmpty.Internaltype Item (Array a) = aDefined in primitive-0.9.1.0 · Data.Primitive.Arraytype Item (PrimArray a) = aDefined in primitive-0.9.1.0 · Data.Primitive.PrimArraytype Item (SmallArray a) = aDefined in primitive-0.9.1.0 · Data.Primitive.SmallArraytype Item (HashMap k v) = (k, v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internaltype Item (HashSet a) = aDefined in unordered-containers-0.2.21 · Data.HashSet.Internaltype Item (UTF8 ByteString) = CharDefined in ListLike-4.7.8.4 · Data.ListLike.UTF8 · orphantype Item (UTF8 ByteString) = CharDefined in ListLike-4.7.8.4 · Data.ListLike.UTF8 · orphantype Item (Vector a) = aDefined in vector-0.13.2.0 · Data.Vectortype Item (Vector a) = aDefined in vector-0.13.2.0 · Data.Vector.Primitivetype Item (Vector a) = aDefined in vector-0.13.2.0 · Data.Vector.Storabletype Item (Vector a) = aDefined in vector-0.13.2.0 · Data.Vector.Stricttype Item (Vector e) = eDefined in vector-0.13.2.0 · Data.Vector.Unboxed · orphantype Item [a] = aDefined in ghc-internal-9.1401.0 · GHC.Internal.IsList
Generalization of Data.List.unzip.
Examples
unzip (Just ("Hello", "World"))(Just "Hello",Just "World")
unzip [("I", "love"), ("really", "haskell")](["I","really"],["love","haskell"])