Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
157
Issues
157
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
85311942
Commit
85311942
authored
Jan 26, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPEC] Garg Database Typed as specification.
parent
1b523c37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
Main.hs
src/Data/Gargantext/Types/Main.hs
+31
-4
No files found.
src/Data/Gargantext/Types/Main.hs
View file @
85311942
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment