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