{"id":13687415,"url":"https://github.com/obsidiansystems/dependent-map","last_synced_at":"2025-05-16T14:06:06.616Z","repository":{"id":15804207,"uuid":"1344394","full_name":"obsidiansystems/dependent-map","owner":"obsidiansystems","description":"Dependently-typed finite maps (partial dependent products)","archived":false,"fork":false,"pushed_at":"2025-02-11T20:42:55.000Z","size":174,"stargazers_count":65,"open_issues_count":11,"forks_count":33,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-03T10:11:14.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mokus0/dependent-map","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obsidiansystems.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-02-09T00:35:59.000Z","updated_at":"2025-02-11T20:42:59.000Z","dependencies_parsed_at":"2024-06-18T20:09:20.921Z","dependency_job_id":"2112b16d-391d-4922-a30b-c3fe0a59dc51","html_url":"https://github.com/obsidiansystems/dependent-map","commit_stats":{"total_commits":99,"total_committers":21,"mean_commits":4.714285714285714,"dds":0.6464646464646464,"last_synced_commit":"8e62fa50125ed2388ae3e2a7eee6dbfe25a02af0"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidiansystems%2Fdependent-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidiansystems%2Fdependent-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidiansystems%2Fdependent-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidiansystems%2Fdependent-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obsidiansystems","download_url":"https://codeload.github.com/obsidiansystems/dependent-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248545891,"owners_count":21122240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T15:00:54.336Z","updated_at":"2025-04-12T09:30:19.726Z","avatar_url":"https://github.com/obsidiansystems.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"dependent-map [![Build Status](https://github.com/obsidiansystems/dependent-map/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/obsidiansystems/dependent-map/actions/workflows/haskell-ci.yml) [![Hackage](https://img.shields.io/hackage/v/dependent-map.svg)](http://hackage.haskell.org/package/dependent-map)\n==============\n\nThis library defines a dependently-typed finite map type. It is derived from `Data.Map.Map` in the `containers` package, but rather than (conceptually) storing pairs indexed by the first component, it stores `DSum`s (from the `dependent-sum` package) indexed by tag. For example\n\n```haskell\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE GADTs #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE TemplateHaskell #-}\n{-# LANGUAGE TypeFamilies #-}\nmodule Example where\n\nimport Data.Constraint.Extras.TH (deriveArgDict)\nimport Data.Dependent.Map (DMap, fromList, singleton, union, unionWithKey)\nimport Data.Dependent.Sum ((==\u003e))\nimport Data.Functor.Identity (Identity(..))\nimport Data.GADT.Compare.TH (deriveGCompare, deriveGEq)\nimport Data.GADT.Show.TH (deriveGShow)\n\ndata Tag a where\n  StringKey :: Tag String\n  IntKey    :: Tag Int\n  DoubleKey :: Tag Double\nderiveGEq ''Tag\nderiveGCompare ''Tag\nderiveGShow ''Tag\nderiveArgDict ''Tag\n\nx :: DMap Tag Identity\nx = fromList [DoubleKey ==\u003e pi, StringKey ==\u003e \"hello there\"]\n\ny :: DMap Tag Identity\ny = singleton IntKey (Identity 42)\n\nz :: DMap Tag Identity\nz = y `union` fromList [DoubleKey ==\u003e -1.1415926535897931]\n\naddFoo :: Tag v -\u003e Identity v -\u003e Identity v -\u003e Identity v\naddFoo IntKey (Identity x) (Identity y) = Identity $ x + y\naddFoo DoubleKey (Identity x) (Identity y) = Identity $ x + y\naddFoo _ x _ = x\n\nmain :: IO ()\nmain = mapM_ print\n  [ x, y, z\n  , unionWithKey addFoo x z\n  ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobsidiansystems%2Fdependent-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobsidiansystems%2Fdependent-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobsidiansystems%2Fdependent-map/lists"}