-- Fission FileSystem Rough Schema
newtype Raw = Raw ByteString
newtype FileName = FileName Text
{ current :: Natural -- Just an increasing counter of chain length... maybe just calculate at runtime?
, metadata :: Map Text Text
Type Directory = Directory
{ files :: Map Text Content
, metadata :: Map Symbol Text
, public :: Maybe Directory
, tags :: Tags -- Aggregates child tags. What to do in case of conflict? I guess fully qualify them?
= FileContent (Maybe AES) File
| Subdirectory (Maybe AES) Directory
= AddMeta { key :: Symbol
| RemoveMeta { key :: Symbol }
= AttachFile { name :: Text
| DetachFile { target :: Text }
| NewFileVersion { from :: Text
| RevertFileVersion { from :: Text
, tagret_version :: Natural
} -- Or should this just be a new pointer to the old file? Does “revert” need a special place in the ontology?
= AttachDirectory { name :: Text
| DetachDirectory { target :: Text }
| UpdateDirContents { target :: Text
| RenameLink { from :: Text
= AddTag { tag :: Symbol, content :: Text }
| RemoveTag { tag :: Symbol, from :: Text }
= AddToCollection { collection :: Symbol, content :: Text }
| RemoveFromCollection { collection :: Symbol, content :: Text }
| Directory DirectoryEvent
| Collection CollectionEvent
type TagData = Map Symbol (File | Dir | Tags | Collections)
type Tag = TagsSymbol TagData
type CollectionData = [Map FileName (File | Dir | Tag | Collection)]
type Collection = Collection Symbol CollectionData