ical-0.0.0: iCalendar format parser and org-mode converter.

Safe HaskellNone
LanguageHaskell2010

ICal.Parser

Contents

Description

The basic parser.

Synopsis

Types

data Parser m s a Source

Parser type.

Instances

Monad m => Monad (Parser m s) Source 
Monad m => Functor (Parser m s) Source 
Monad m => Applicative (Parser m s) Source 
Monad m => Alternative (Parser m s) Source

Left branch failing resets the state.

Handy starter functions

parseEither :: Monad m => s -> Parser m s a -> m (Either ParseError a) Source

Parse some iCalendar thing.

Combinators

begin :: Monad m => Text -> Parser m [Object] a -> Parser m Object a Source

Require the given object name to exist and run in that context.

object :: Monad m => Text -> Parser m [Object] a -> Parser m [Object] a Source

Lookup an object with this name in the current object's children, then run with that object as the context.

objects :: Monad m => Text -> Parser m [Object] a -> Parser m [Object] [a] Source

Lookup objects with this name in the current object's children, then run with that object as the context.

property Source

Arguments

:: Monad m 
=> Text

Key

-> Parser m [Object] Text

The value of that property.

Lookup a property.

properties Source

Arguments

:: Monad m 
=> Text

Key

-> Parser m [Object] [Text]

The values of that property.

Get all values of a property.

Parser library

local :: Monad m => t -> Parser m t a -> Parser m s a Source

Use a local state of a different type.

parseError :: Monad m => ParseError -> Parser m o a Source

Throw a parse error.

getState :: Monad m => Parser m s s Source

Get the current state.

putState :: Monad m => s -> Parser m s () Source

Put a new state.