Commit 85311942 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[SPEC] Garg Database Typed as specification.

parent 1b523c37
......@@ -34,12 +34,33 @@ type Ngrams = (Text, Text, Text)
type ErrorMessage = String
-- | TODO add Symbolic Node / Document
-- TODO make instances of Nodes
-- All the Database is structred like a hierachical Tree
data Tree a = Leaf a | Node' [Tree a]
data Tree b a = LeafT a | NodeT b [Tree b a]
deriving (Show, Read, Eq)
-- Garg Database Schema Typed as specification
gargDatabase :: [Tree NodeType NodeType]
gargDatabase = [userTree]
-- | User Tree simplified
userTree :: Tree NodeType NodeType
userTree = NodeT NodeUser [projectTree]
-- | Project Tree
projectTree :: Tree NodeType NodeType
projectTree = NodeT Project [corpusTree]
-- | Corpus Tree simplified
corpusTree :: Tree NodeType NodeType
corpusTree = NodeT Corpus [ LeafT Document
, LeafT Favorites
, LeafT List
, LeafT Score
]
-- | TODO add Symbolic Node / Document
-- TODO make instances of Nodes
data NodeType = NodeUser
| Folder | Project | Corpus | Document
| Favorites
......@@ -52,6 +73,12 @@ data NodeType = NodeUser
-- | NodePoly indicates that Node has a Polymorphism Type
type Node json = NodePoly NodeId NodeTypeId NodeUserId NodeParentId NodeName UTCTime json
-- type Node json = NodePoly NodeId NodeTypeId UserId ParentId NodeName UTCTime json
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment