gedcom-0.2.0.0: Parser for the GEDCOM genealogy file format.

Copyright(c) Callum Lowcay 2017
LicenseBSD3
Maintainercwslowcay@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Data.Gedcom

Contents

Description

 

Synopsis

Functions

parseGedcomString Source #

Arguments

:: Maybe String

The filename from which the string was read

-> ByteString

The string to parse

-> Either GDError (Gedcom, XRefTable)

The Gedcom data and cross reference table, or an error

Parse Gedcom data from a ByteString

parseGedcomFile Source #

Arguments

:: FilePath

The file to read

-> IO (Either GDError (Gedcom, XRefTable))

The Gedcom data and cross reference table, or an error

Parse Gedcom data from a file

data GDError Source #

A parse error.

Constructors

LineFormatError Text

A badly formatted GEDCOM line

UnexpectedRef Text

A reference where a reference wasn't allowed

RequiredRef Text

Missing a reference where a reference was required

DuplicateRef Text

Two targets for the same reference

FormatError Text

A badly formatted field

TagError Text

The wrong tag

gdLookup Source #

Arguments

:: Typeable a 
=> GDRef a

The reference to look up

-> XRefTable

The table to look up in

-> Either GDRefError a

The value or an error

Lookup up a reference in the cross reference table

data GDRef a Source #

A reference to another structure

Instances

Eq a => Eq (GDRef a) Source # 

Methods

(==) :: GDRef a -> GDRef a -> Bool #

(/=) :: GDRef a -> GDRef a -> Bool #

Show a => Show (GDRef a) Source # 

Methods

showsPrec :: Int -> GDRef a -> ShowS #

show :: GDRef a -> String #

showList :: [GDRef a] -> ShowS #

data XRefTable Source #

A table of cross references

data GDRefError Source #

An error arising from dereferencing a GDRef

Constructors

RefNotPresent GDXRefID

The referred structure doesn't exist.

WrongRefType TypeRep TypeRep

Dereferenced structure had the wrong type