Open danse opened 7 years ago
medusa-gate 'offline' 1 2 3
medusa-gate-add 'study' offline/1
I would just want to have the entry hidden from the main view and duplicated in the two gates, but any modification of the entry in one of the gates should apply to all its locations
type Tags = Map String [Int]
type Entries = [Entry]
tags = singleton 'untagged' []
entries = []
This can be wrapped in a data type: Tagged Tag Entry
IxSet seems overkill for me, i just need Tagged a b
, with lookup :: a -> [b]
Tagged a b
select :: a -> Tagged a b
instance IsList Tagged
This data structure would be useful for me to build a tool to manage links or resources
I started with something like:
module Tagged where
-- | Data structure for overlapping labels (tags)
-- >>> Untagged "value"
-- [("untagged", ["value"])]
-- >>> let t = Untagged "value"
-- >>> tag (select "untagged" t) "new tag"
-- TaggedSelection: "untagged", "new tag" -> "value"
import Data.Map as M
data Tagged b = Tagged {
index :: M.Map Int b,
tags :: M.Map String [Int]
}
data TaggedSelection b = TaggedSelection {
tagged :: Tagged b,
selection :: [Int]
}
untagged = "untagged"
empty = Tagged { index = M.empty, tags = M.singleton untagged []}
But there are some problems: i am not satisfied with the Show/Read implementation and with how to represent a selection
To simplify the design i would use a similar Show/Read interface as in Map, based on an instance of isList, but with a different semantic. In my case, duplicate keys are allowed and duplicate values represent the same entity. This is very inefficient but i hope that it will unlock me
Collected a new starting notes in a folder ready to become a repo
This is an old idea. It might be added in Medusa or anywhere else it's easy to add