-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parsers for the standard Haskell data types -- -- Parsers for the standard Haskell data types @package attoparsec-data @version 1 module Attoparsec.Data -- | Any character. char :: Parser Char -- | Consumes all the remaining input. text :: Parser Text -- | Consumes all the remaining input, encoding it using UTF8. utf8Bytes :: Parser ByteString -- | Accepts any string interpretable as a boolean: "1" or "0", "true" or -- "false", "yes" or "no", "y" or "n", "t" or "f". Case-insensitive. bool :: Parser Bool -- | Signed decimal. signedIntegral :: Integral a => Parser a -- | Unsigned decimal. unsignedIntegral :: Integral a => Parser a -- | Parse a rational number. -- -- This parser accepts an optional leading sign character, followed by at -- least one decimal digit. The syntax similar to that accepted by the -- read function, with the exception that a trailing '.' -- or 'e' not followed by a number is not consumed. -- -- Examples with behaviour identical to read, if you feed an empty -- continuation to the first result: -- --
--   rational "3"     == Done 3.0 ""
--   rational "3.1"   == Done 3.1 ""
--   rational "3e4"   == Done 30000.0 ""
--   rational "3.1e4" == Done 31000.0, ""
--   
-- -- Examples with behaviour identical to read: -- --
--   rational ".3"    == Fail "input does not start with a digit"
--   rational "e3"    == Fail "input does not start with a digit"
--   
-- -- Examples of differences from read: -- --
--   rational "3.foo" == Done 3.0 ".foo"
--   rational "3e"    == Done 3.0 "e"
--   
-- -- This function does not accept string representations of "NaN" or -- "Infinity". double :: Parser Double -- | Parse a scientific number. -- -- The syntax accepted by this parser is the same as for double. scientific :: Parser Scientific -- |
--   >>> parseOnly timeOfDayInISO8601 "05:03:58"
--   Right 05:03:58
--   
-- --
--   >>> parseOnly timeOfDayInISO8601 "05:03:58.02"
--   Right 05:03:58.02
--   
-- --
--   >>> parseOnly timeOfDayInISO8601 "05:03:58.020"
--   Right 05:03:58.02
--   
-- -- Checks the elements to be within a proper range: -- --
--   >>> parseOnly timeOfDayInISO8601 "24:00:00"
--   Left "timeOfDayInISO8601 > hour: Failed reading: Validator \"hour\" failed on the following input: 24"
--   
-- --
--   >>> parseOnly timeOfDayInISO8601 "00:00:60"
--   Left "timeOfDayInISO8601 > second: Failed reading: Validator \"second\" failed on the following input: 60.000000000000"
--   
-- -- Checks the elements to be of proper length: -- --
--   >>> parseOnly timeOfDayInISO8601 "1:00:00"
--   Left "timeOfDayInISO8601 > hour: Failed reading: Invalid decimal length"
--   
-- --
--   >>> parseOnly timeOfDayInISO8601 "01:1:00"
--   Left "timeOfDayInISO8601 > minute: Failed reading: Invalid decimal length"
--   
timeOfDayInISO8601 :: Parser TimeOfDay -- |
--   >>> parseOnly dayInISO8601 "2017-02-01"
--   Right 2017-02-01
--   
-- -- Checks the elements to be in proper range: -- --
--   >>> parseOnly dayInISO8601 "2017-13-01"
--   Left "dayInISO8601: Failed reading: Invalid combination of year month and day: (2017,13,1)"
--   
-- -- That is accounting for leap year: -- --
--   >>> parseOnly dayInISO8601 "2017-02-29"
--   Left "dayInISO8601: Failed reading: Invalid combination of year month and day: (2017,2,29)"
--   
-- --
--   >>> parseOnly dayInISO8601 "2016-02-29"
--   Right 2016-02-29
--   
dayInISO8601 :: Parser Day -- |
--   >>> parseOnly timeZoneInISO8601 "+01:00"
--   Right +0100
--   
-- --
--   >>> parseOnly timeZoneInISO8601 "+0100"
--   Right +0100
--   
-- --
--   >>> parseOnly timeZoneInISO8601 "-0100"
--   Right -0100
--   
-- --
--   >>> parseOnly timeZoneInISO8601 "Z"
--   Right UTC
--   
timeZoneInISO8601 :: Parser TimeZone -- |
--   >>> parseOnly utcTimeInISO8601 "2017-02-01T05:03:58+01:00"
--   Right 2017-02-01 04:03:58 UTC
--   
utcTimeInISO8601 :: Parser UTCTime -- | No suffix implies the "seconds" unit: -- --
--   >>> parseOnly diffTime "10"
--   Right 10s
--   
-- -- Various units (seconds, minutes, hours, days): -- --
--   >>> parseOnly diffTime "10s"
--   Right 10s
--   
-- --
--   >>> parseOnly diffTime "10m"
--   Right 600s
--   
-- --
--   >>> parseOnly diffTime "10h"
--   Right 36000s
--   
-- --
--   >>> parseOnly diffTime "10d"
--   Right 864000s
--   
-- -- Metric prefixes to seconds (down to Pico): -- --
--   >>> parseOnly diffTime "10ms"
--   Right 0.01s
--   
-- --
--   >>> parseOnly diffTime "10μs"
--   Right 0.00001s
--   
-- --
--   >>> parseOnly diffTime "10ns"
--   Right 0.00000001s
--   
-- --
--   >>> parseOnly diffTime "10ps"
--   Right 0.00000000001s
--   
-- -- Negative values: -- --
--   >>> parseOnly diffTime "-1s"
--   Right -1s
--   
-- -- Unsupported units: -- --
--   >>> parseOnly diffTime "1k"
--   Left "diffTime: Failed reading: Unsupported unit: \"k\""
--   
diffTime :: Parser DiffTime -- | No suffix implies the "seconds" unit: -- --
--   >>> parseOnly nominalDiffTime "10"
--   Right 10s
--   
-- -- Various units (seconds, minutes, hours, days): -- --
--   >>> parseOnly nominalDiffTime "10s"
--   Right 10s
--   
-- --
--   >>> parseOnly nominalDiffTime "10m"
--   Right 600s
--   
-- --
--   >>> parseOnly nominalDiffTime "10h"
--   Right 36000s
--   
-- --
--   >>> parseOnly nominalDiffTime "10d"
--   Right 864000s
--   
-- -- Metric prefixes to seconds (down to Pico): -- --
--   >>> parseOnly nominalDiffTime "10ms"
--   Right 0.01s
--   
-- --
--   >>> parseOnly nominalDiffTime "10μs"
--   Right 0.00001s
--   
-- --
--   >>> parseOnly nominalDiffTime "10ns"
--   Right 0.00000001s
--   
-- --
--   >>> parseOnly nominalDiffTime "10ps"
--   Right 0.00000000001s
--   
-- -- Negative values: -- --
--   >>> parseOnly nominalDiffTime "-1s"
--   Right -1s
--   
-- -- Unsupported units: -- --
--   >>> parseOnly nominalDiffTime "1k"
--   Left "nominalDiffTime: Failed reading: Unsupported unit: \"k\""
--   
nominalDiffTime :: Parser NominalDiffTime -- | Provides the default lenient parser for a type. -- -- By convention, the parser should not check for the end of input. class LenientParser a lenientParser :: LenientParser a => Parser a -- | Consumes all the remaining input. -- | Consumes all the remaining input, encoding it using UTF8.