Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- type TimeUnit = Int
- class Eq a => CalEvent a where
- data Dimension = Dimension {}
- insertEventTree :: CalEvent a => a -> Tree a -> Tree a
- intersects :: CalEvent a => a -> a -> Bool
- treeContains :: CalEvent a => a -> Tree a -> Bool
- insertEventForest :: CalEvent a => a -> Forest a -> Forest a
- mkIntersectionsForest :: CalEvent a => [a] -> Forest a
- populateDepths :: Forest a -> [(a, Int, Int)]
- calculateDimensions :: CalEvent a => Forest a -> [(a, Dimension)]
- getDimensions :: CalEvent a => [a] -> [(a, Dimension)]

# Documentation

Dimension data type.

insertEventTree :: CalEvent a => a -> Tree a -> Tree a Source #

Insert an event into a tree by calculating intersections.

intersects :: CalEvent a => a -> a -> Bool Source #

Given two events, check if they intersect.

treeContains :: CalEvent a => a -> Tree a -> Bool Source #

Given an event and a tree, check if the tree contains it.

mkIntersectionsForest :: CalEvent a => [a] -> Forest a Source #

Make intersections forest by recursively using `insertEvent`

.
we need to provide an initial member since a `Tree`

cannot be empty.

populateDepths :: Forest a -> [(a, Int, Int)] Source #

For a given forest, populate max depth and depth we need those for calculating width/left respectively.

calculateDimensions :: CalEvent a => Forest a -> [(a, Dimension)] Source #

Calculate dimensions for a forest.

getDimensions :: CalEvent a => [a] -> [(a, Dimension)] Source #

Helper wrapper for getting dimensions.