hodatime-0.2.2.1: A fully featured date/time library based on Nodatime
Copyright(C) 2016 Jason Johnson
LicenseBSD-style (see the file LICENSE)
MaintainerJason Johnson <jason.johnson.081@gmail.com>
Stabilityexperimental
PortabilityTBD
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HodaTime.Pattern

Description

A Pattern is used to parse and format types in this library.

Synopsis

Types

data Pattern a b r Source #

Pattern for the data type which is used by the parse, format and 'parse'' functions

Constructors

Pattern 

Fields

Instances

Instances details
Semigroup (Pattern (a -> a) (b -> r) r) Source # 
Instance details

Defined in Data.HodaTime.Pattern.Internal

Methods

(<>) :: Pattern (a -> a) (b -> r) r -> Pattern (a -> a) (b -> r) r -> Pattern (a -> a) (b -> r) r #

sconcat :: NonEmpty (Pattern (a -> a) (b -> r) r) -> Pattern (a -> a) (b -> r) r #

stimes :: Integral b0 => b0 -> Pattern (a -> a) (b -> r) r -> Pattern (a -> a) (b -> r) r #

Parsing / Formatting

parse :: (MonadThrow m, DefaultForParse a) => Pattern (a -> a) b String -> SourceName -> m a Source #

Parse a String given by Pattern for the data type a. Will call throwM on failure. NOTE: A default a will be used to determine what happens for fields which do not appear in the parse

parse' :: MonadThrow m => Pattern (a -> a) b String -> SourceName -> a -> m a Source #

Like parse above but lets the user provide an a as the default to use

format :: Pattern a r String -> r Source #

Use the given Pattern to format the data type a into a String

Standard Patterns

Custom Patterns

Used to create specialized patterns

(<%) :: Pattern a b r -> Pattern c r r -> Pattern a b r Source #

Merge a pattern that operates on a data type with a static pattern

Exceptions