family-tree-0.5: A family tree library for the Haskell programming language.

Portabilityportable
Stabilityunstable
Maintainernvd124@gmail.com
Safe HaskellNone

Data.FamilyTree

Contents

Description

This module is for Family Trees.

It uses lenses for the manipulation of people. For the usage of lenses, see Control.Lens

It is reccomended to use Data.Binary to do saving and loading.

Synopsis

Types

Main types

data Person Source

The basic type for a person. Nothing meaning unknown (or otherwise non-existent, for intance a death date for someone still alive) is a convention used throughout this library.

data Family Source

The basic type for a family. Which person is head1 and which is head2 is arbitrary, but try to use a consistent rule

data FamilyTree Source

The core structure of a family tree.

Other types

data Location Source

The Location type. Either a coordinate or a placename.

data Relationship Source

The Relationship type. Marriage is the default for similarity to GEDCOM.

Constructors

Marriage 
Other Text 

Functions

Creation

newTree :: Text -> FamilyTreeSource

Creates a new tree with a given name.

addPerson :: FamilyTree -> (Int, FamilyTree)Source

Adds a person with minimal information, returning the updated family tree and the ID of the new person.

addFamily :: FamilyTree -> (Int, FamilyTree)Source

Adds a family with minimal information, returning the updated family tree and the ID of the new family.

Manipulation

class FamilyTreePart part whereSource

Methods

accessFT :: Int -> IndexedTraversal' Int FamilyTree partSource

accessFT is a Traversal to the part of the family tree (either a Person or a Family)

Destruction

deletePerson :: Int -> FamilyTree -> FamilyTreeSource

Deletes a person from the family tree, removing all references to them.

deleteFamily :: Int -> FamilyTree -> FamilyTreeSource

Deletes a family from the family tree, removing all references to it.

Utility functions