Portability | portable |
---|---|
Stability | unstable |
Maintainer | nvd124@gmail.com |
Safe Haskell | None |
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 | |
|
The basic type for a family. Which person is head1 and which is head2 is arbitrary, but try to use a consistent rule
Family | |
|
data FamilyTree Source
The core structure of a family tree.
Other types
type PartialDate = Interval DaySource
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 -> 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
accessFT :: Int -> IndexedTraversal' Int FamilyTree partSource
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
partialDateFromMonth :: Integer -> Int -> PartialDateSource
partialDateFromDay :: Integer -> Int -> Int -> PartialDateSource