{"id":13687210,"url":"https://github.com/srid/unionmount","last_synced_at":"2026-03-03T22:31:25.198Z","repository":{"id":43070950,"uuid":"430495712","full_name":"srid/unionmount","owner":"srid","description":"Union mount in Haskell, with fsnotify","archived":false,"fork":false,"pushed_at":"2025-12-23T23:12:09.000Z","size":78,"stargazers_count":12,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-25T07:41:31.343Z","etag":null,"topics":["filesystem","haskell","unionfs"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srid.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-11-21T22:29:02.000Z","updated_at":"2025-12-23T23:05:45.000Z","dependencies_parsed_at":"2024-01-14T16:10:05.262Z","dependency_job_id":"5a8f4d4e-2840-4691-9fbd-5a3e5edf35a6","html_url":"https://github.com/srid/unionmount","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"srid/haskell-template","purl":"pkg:github/srid/unionmount","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Funionmount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Funionmount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Funionmount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Funionmount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srid","download_url":"https://codeload.github.com/srid/unionmount/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srid%2Funionmount/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30064290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["filesystem","haskell","unionfs"],"created_at":"2024-08-02T15:00:50.353Z","updated_at":"2026-03-03T22:31:25.173Z","avatar_url":"https://github.com/srid.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# unionmount\n\nHaskell library to \"[union mount](https://en.wikipedia.org/wiki/Union_mount)\" a bunch of folders onto an in-memory data structure, and keeping the latter in sync as the files change over time. Used in [Ema](https://ema.srid.ca) and [Emanote](https://emanote.srid.ca).\n\n## Usage\n\nBoth the `mount` and `unionMount` functions return a tuple value of type [Dynamic](https://ema.srid.ca/guide/model/dynamic), giving direct access to the initial value as well as the updater function that may be run in a separate thread. See [how Ema uses it](https://github.com/EmaApps/ema/blob/459d3899e0b9ea13e23c81126279dc62530b994c/src/Ema/App.hs#L72-L84) for an illustration.\n\nHere's a simple example of loading Markdown files onto a TVar of `Map FilePath Text` (file contents keyed by path).\n\n```haskell\nimport System.UnionMount qualified as UM\nimport Data.Map.Strict qualified as Map\n\nmain :: IO ()\nmain = do\n  runStdoutLoggingT $ do\n    let baseDir = \"/Users/srid/Documents/Notebook\"\n    (model0, modelF) \u003c- UM.mount baseDir (one ((), \"*.md\")) [] mempty (const $ handlePathUpdate baseDir)\n    modelVar \u003c- newTVarIO model0\n    modelF $ \\newModel -\u003e do\n      atomically $ writeTVar modelVar newModel\n\nhandlePathUpdate ::\n  (MonadIO m) =\u003e\n  FilePath -\u003e FilePath -\u003e UM.FileAction () -\u003e m (Map FilePath Text -\u003e Map FilePath Text)\nhandlePathUpdate baseDir path action = do\n  case action of\n    UM.Refresh _ _ -\u003e do\n      s \u003c- decodeUtf8 \u003c$\u003e readFileBS (baseDir \u003c/\u003e path)\n      pure $ Map.insert path s\n    UM.Delete -\u003e do\n      pure $ Map.delete path\n```\n\n### Examples\n\nSee [this example](https://github.com/EmaApps/ema/blob/459d3899e0b9ea13e23c81126279dc62530b994c/src/Ema/Route/Lib/Extra/PandocRoute.hs#L132-L139) illustrating mounting a directory of Markdown files into (effectively) a `Map FilePath String`. A [more involved example](https://github.com/EmaApps/emanote/blob/7c49c73cd3b7dbeace72353574f3decfb68929f2/src/Emanote/Source/Dynamic.hs#L58-L64) from Emanote demonstrates the \"union\" aspect of the library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrid%2Funionmount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrid%2Funionmount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrid%2Funionmount/lists"}