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