Maintainer | nvd124@gmail.com |
---|---|
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
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.
- data Person = Person {}
- name :: Lens' Person (Maybe Text)
- attributes :: Lens' Person (HashMap Text Text)
- birthdate :: Lens' Person (Maybe PartialDate)
- birthplace :: Lens' Person (Maybe Location)
- deathdate :: Lens' Person (Maybe PartialDate)
- deathplace :: Lens' Person (Maybe Location)
- data Family = Family {}
- head1 :: Lens' Family (Maybe Int)
- head2 :: Lens' Family (Maybe Int)
- children :: Lens' Family IntSet
- relationFrom :: Lens' Family (Maybe PartialDate)
- relationTo :: Lens' Family (Maybe PartialDate)
- relationship :: Lens' Family (Maybe Relationship)
- data FamilyTree = FamilyTree {}
- treeName :: Lens' FamilyTree Text
- people :: Lens' FamilyTree (Table Person)
- families :: Lens' FamilyTree (Table Family)
- type PartialDate = Interval Day
- data Location
- data Relationship
- newTree :: Text -> FamilyTree
- addPerson :: FamilyTree -> (Int, FamilyTree)
- addFamily :: FamilyTree -> (Int, FamilyTree)
- class FamilyTreePart part where
- accessFT :: Int -> IndexedTraversal' Int FamilyTree part
- deletePerson :: Int -> FamilyTree -> FamilyTree
- deleteFamily :: Int -> FamilyTree -> FamilyTree
- partialDateFromYear :: Integer -> PartialDate
- partialDateFromMonth :: Integer -> Int -> PartialDate
- partialDateFromDay :: Integer -> Int -> Int -> PartialDate
Types
Main types
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.
Person | |
|
Eq Person | |
Show Person | |
Generic Person | |
Monoid Person | |
Binary Person | |
Tabular Person | |
FamilyTreePart Person | |
type Rep Person | |
data Tab Person = PersonTab (i Primary Int) (i SupplementalHash (Maybe Text)) (i Supplemental (Maybe PartialDate)) (i SupplementalHash (Maybe Location)) (i Supplemental (Maybe PartialDate)) (i SupplementalHash (Maybe Location)) | |
type PKT Person = Int | |
data Key k Person where
|
The basic type for a family. Which person is head1 and which is head2 is arbitrary, but try to use a consistent rule
Family | |
|
Eq Family | |
Show Family | |
Generic Family | |
Monoid Family | |
Binary Family | |
Tabular Family | |
FamilyTreePart Family | |
type Rep Family | |
data Tab Family = FamilyTab (i Primary Int) (i Supplemental (Maybe Int)) (i Supplemental (Maybe Int)) (i SupplementalHash (Maybe Relationship)) (i Supplemental (Maybe PartialDate)) (i Supplemental (Maybe PartialDate)) (i InvertedInt IntSet) | |
type PKT Family = Int | |
data Key k Family where
|
data FamilyTree Source
The core structure of a family tree.
Other types
type PartialDate = Interval Day Source
The Location type. Either a coordinate or a placename.
data Relationship Source
The Relationship type. Marriage is the default for similarity to GEDCOM.
Functions
Creation
newTree :: Text -> FamilyTree Source
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 where Source
accessFT :: Int -> IndexedTraversal' Int FamilyTree part Source
Destruction
deletePerson :: Int -> FamilyTree -> FamilyTree Source
Deletes a person from the family tree, removing all references to them.
deleteFamily :: Int -> FamilyTree -> FamilyTree Source
Deletes a family from the family tree, removing all references to it.
Utility functions
partialDateFromMonth :: Integer -> Int -> PartialDate Source
partialDateFromDay :: Integer -> Int -> Int -> PartialDate Source