ical-0.0.1: 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 # 

Methods

(>>=) :: Parser m s a -> (a -> Parser m s b) -> Parser m s b #

(>>) :: Parser m s a -> Parser m s b -> Parser m s b #

return :: a -> Parser m s a #

fail :: String -> Parser m s a #

Monad m => Functor (Parser m s) Source # 

Methods

fmap :: (a -> b) -> Parser m s a -> Parser m s b #

(<$) :: a -> Parser m s b -> Parser m s a #

Monad m => Applicative (Parser m s) Source # 

Methods

pure :: a -> Parser m s a #

(<*>) :: Parser m s (a -> b) -> Parser m s a -> Parser m s b #

(*>) :: Parser m s a -> Parser m s b -> Parser m s b #

(<*) :: Parser m s a -> Parser m s b -> Parser m s a #

Monad m => Alternative (Parser m s) Source #

Left branch failing resets the state.

Methods

empty :: Parser m s a #

(<|>) :: Parser m s a -> Parser m s a -> Parser m s a #

some :: Parser m s a -> Parser m s [a] #

many :: Parser m s a -> Parser m s [a] #

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.