module Issue.Meta ( Meta (..), getMeta, ) where import Issue (Issue (..)) import Issue.Tag (Tag, tagValue) data Meta = Meta { referencedBy :: [(Issue, Tag)] } deriving (Show) getMeta :: [Issue] -> Issue -> Meta getMeta issues issue = Meta { referencedBy = concatMap ( \issueOther -> let tagsRelevant = filter (\tag -> tagValue tag == Just issue.id) issueOther.tags in map (\tag -> (issueOther, tag)) tagsRelevant ) issues }