par package:rebase

Parses a time value given a format string. Missing information will be derived from 1970-01-01 00:00 UTC (which was a Thursday). Supports the same %-codes as formatTime, including %-, %_ and %0 modifiers, however padding widths are not supported. Case is not significant in the input string. Some variations in the input are accepted:
  • %z %Ez accepts any of ±HHMM or ±HH:MM.
  • %Z %EZ accepts any string of letters, or any of the formats accepted by %z.
  • %0Y accepts exactly four digits.
  • %0G accepts exactly four digits.
  • %0C accepts exactly two digits.
  • %0f accepts exactly two digits.
For example, to parse a date in YYYY-MM-DD format, while allowing the month and date to have optional leading zeros (notice the - modifier used for %m and %d):
Prelude Data.Time> parseTimeM True defaultTimeLocale "%Y-%-m-%-d" "2010-3-04" :: Maybe Day
Just 2010-03-04
Parses a time value given a list of pairs of format and input. Resulting value is constructed from all provided specifiers.
Parse a time value given a format string. Fails if the input could not be parsed using the given format. See parseTimeM for details.
A parser for versions in the format produced by showVersion.
The partition function takes a predicate and a list, and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e.,
partition p xs == (filter p xs, filter (not . p) xs)
>>> partition (`elem` "aeiou") "Hello World!"
("eoo","Hll Wrld!")
Partitions a list of Either into two lists. All the Left elements are extracted, in order, to the first component of the output. Similarly the Right elements are extracted to the second component of the output.

Examples

Basic usage:
>>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]

>>> partitionEithers list
(["foo","bar","baz"],[3,7])
The pair returned by partitionEithers x should be the same pair as (lefts x, rights x):
>>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]

>>> partitionEithers list == (lefts list, rights list)
True
Zp: Separator, Paragraph
The class of types which can be parsed given a UNIX-style time format string.
Defines a total ordering on a type as per compare. This condition is not checked by the types. You must ensure that the supplied values are valid total orderings yourself.
Zl: Separator, Line
Lift the standard compare function through the type constructor.
Lift the standard compare function through the type constructor.
comparing p x y = compare (p x) (p y)
Useful combinator for use in conjunction with the xxxBy family of functions from Data.List, for example:
... sortBy (comparing fst) ...
Compare using compare.
Extracts the imaginary part of a complex number.
An Arrow with the same input and output types can be seen as an Invariant functor.
Selects Unicode space and separator characters. This function returns True if its argument has one of the following GeneralCategorys, or False otherwise: These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Separator".

Examples

Basic usage:
>>> isSeparator 'a'
False

>>> isSeparator '6'
False

>>> isSeparator ' '
True
Warning: newlines and tab characters are not considered separators.
>>> isSeparator '\n'
False

>>> isSeparator '\t'
False
But some more exotic characters are (like HTML's  ):
>>> isSeparator '\160'
True
Parse the most commonly used ISO 8601 format.
Lift a compare function through the type constructor. The function will usually be applied to a comparison function, but the more general type ensures that the implementation uses it to compare elements of the first container with elements of the second.