1 module Hcompta.Model.Transaction.Tag where
3 import qualified Data.List
4 import qualified Data.Map.Strict as Data.Map
6 type Tag = (Name, Value)
12 type By_Name = Data.Map.Map Name [Value]
14 -- | Return a 'Data.Map.Map' associating the 'Value's of the given 'Tag's with their respective 'Name'.
15 from_List :: [Tag] -> By_Name
17 Data.Map.fromListWith (++) $
18 Data.List.map (\(n, v) -> (n, [v])) tags