words -package:hedgehog -package:dimensional -package:streamly-core -package:base-compat -package:streaming-bytestring
words breaks a string up into a list of words, which were
delimited by white space (as defined by
isSpace). This function
trims any white spaces at the beginning and at the end.
>>> words "Lorem ipsum\ndolor"
["Lorem","ipsum","dolor"]
>>> words " foo bar "
["foo","bar"]
words breaks a ByteString up into a list of words, which were
delimited by Chars representing white space.
words breaks a ByteString up into a list of words, which were
delimited by Chars representing white space. And
tokens isSpace = words
O(n) Breaks a
Text up into a list of words, delimited by
Chars representing white space.
Split an input into word-sized
Docs.
>>> putDoc (tupled (words "Lorem ipsum dolor"))
(Lorem, ipsum, dolor)
Splits a bytestring
InputStream into words. See
splitOn
and
words.
Example:
ghci> is <- Streams.fromList ["Hello, world!"] >>= Streams.words
ghci> replicateM 3 (Streams.read is)
[Just "Hello,", Just "world!", Nothing]
Note that this may increase the chunk size if the input contains
extremely long words.
words takes
Text and splits it into the list by words.
Actual type of this function is the following:
words :: Text -> [Text]
but it was given a more complex type to provide friendlier compile
time errors.
>>> words ""
[]
>>> words "one line"
["one","line"]
>>> words " >_< "
[">_<"]
>>> words ("string words" :: String)
...
... 'words' works with 'Text', not 'String'.
Possible fixes:
1. Make sure OverloadedStrings extension is enabled.
2. Apply 'toText' to a single value.
3. Apply 'map toText' to the list value.
...
>>> words True
...
... 'words' works with 'Text'
But given: 'Bool'
...
rio RIO.List RIO.Prelude,
base-prelude BasePrelude,
numeric-prelude NumericPrelude NumericPrelude.Base,
Cabal-syntax Distribution.Compat.Prelude,
github GitHub.Internal.Prelude,
numhask NumHask.Prelude,
ghc-lib-parser GHC.Prelude.Basic,
rebase Rebase.Prelude,
hledger Hledger.Cli.Script,
mixed-types-num Numeric.MixedTypes.PreludeHiding,
xmonad-contrib XMonad.Config.Prime,
stack Stack.Prelude,
LambdaHack Game.LambdaHack.Core.Prelude Game.LambdaHack.Core.Prelude,
cabal-install-solver Distribution.Solver.Compat.Prelude,
yesod-paginator Yesod.Paginator.Prelude,
distribution-opensuse OpenSuse.Prelude,
faktory Faktory.Prelude,
hledger-web Hledger.Web.Import words breaks a string up into a list of words, which were
delimited by white space.
>>> words "Lorem ipsum\ndolor"
["Lorem","ipsum","dolor"]
Break up a textual sequence into a list of words, which were delimited
by white space.
> words "abc def ghi"
["abc","def","ghi"]
Convert a bytestream to delimited words
Note: This function is purely for demonstration purposes since it
assumes a particular encoding. You should prefer the
Text
equivalent of this function from the
pipes-text library.
Breaks a string into a list of words
Splits the given
YiString into a list of words, where spaces
are determined by
isSpace. No empty strings are in the result
list.
Split a text stream into
FreeT-delimited words. Note that
roundtripping with e.g.
over words id eliminates extra space
characters as with
Prelude.unwords . Prelude.words
The
words function breaks a stream of characters into a stream
of words, which were delimited by white space.
Beware: if the stream of characters
xs does not
contain white space, accessing the tail of
words xs will
loop.
Split words in a string using spaces as separation
words "Hello Foundation"
Split a string into
words.
Split an infinite string into words, by any
isSpace symbol.
Not on Stackage, so not searched.
Cross-platform access to a list of words
Implements word movements.
Copyright (c) Hans-Peter Deifel
Split into "words", with word boundaries indicated by the given
predicate. Satisfies
words === wordsBy isSpace;
equivalent to
split . dropBlanks . dropDelims
. whenElt. For example:
wordsBy (=='x') "dogxxxcatxbirdxx" == ["dog","cat","bird"]