{"id":17529581,"url":"https://github.com/nullobject/purescript-digraph","last_synced_at":"2026-04-04T12:57:48.785Z","repository":{"id":58235098,"uuid":"54802396","full_name":"nullobject/purescript-digraph","owner":"nullobject","description":"A directed graph library for PureScript.","archived":false,"fork":false,"pushed_at":"2019-01-12T22:59:01.000Z","size":54,"stargazers_count":11,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-02T08:53:03.190Z","etag":null,"topics":["graph","purescript"],"latest_commit_sha":null,"homepage":null,"language":"PureScript","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/nullobject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-26T22:29:44.000Z","updated_at":"2022-05-06T10:07:28.000Z","dependencies_parsed_at":"2022-08-31T04:22:12.011Z","dependency_job_id":null,"html_url":"https://github.com/nullobject/purescript-digraph","commit_stats":null,"previous_names":["nullobject/purescript-dgraph"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/nullobject/purescript-digraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Fpurescript-digraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Fpurescript-digraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Fpurescript-digraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Fpurescript-digraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullobject","download_url":"https://codeload.github.com/nullobject/purescript-digraph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Fpurescript-digraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31298217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T06:13:15.241Z","status":"ssl_error","status_checked_at":"2026-04-02T06:13:14.499Z","response_time":89,"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":["graph","purescript"],"created_at":"2024-10-20T16:19:54.456Z","updated_at":"2026-04-04T12:57:48.767Z","avatar_url":"https://github.com/nullobject.png","language":"PureScript","readme":"# purescript-digraph\n\n[![Build Status](https://travis-ci.com/nullobject/purescript-digraph.svg?branch=master)](https://travis-ci.com/nullobject/purescript-digraph)\n\nA directed graph library for PureScript.\n\n## Examples\n\n![Graph](https://raw.githubusercontent.com/nullobject/purescript-digraph/master/images/graph.png)\n\n### Adjacency list\n\nThe directed graph pictured above can be represented with an `AdjacencyList`.\nAn adjacency list is a list of tuples that contain a vertex and a list of edges\nto its adjacent vertices. A `Graph` can be constructed from an `AdjacencyList`.\n\n```haskell\nlet edges = fromFoldable $\n  [ Tuple 'A' (fromFoldable [Tuple 'B' 1, Tuple 'C' 2])\n  , Tuple 'B' (fromFoldable [Tuple 'A' 1, Tuple 'D' 3])\n  , Tuple 'C' (fromFoldable [Tuple 'A' 2, Tuple 'D' 4])\n  , Tuple 'D' (fromFoldable [Tuple 'B' 3, Tuple 'C' 4])\n  , Tuple 'E' (fromFoldable [Tuple 'F' 1])\n  , Tuple 'F' (fromFoldable [Tuple 'E' 1])\n  , Tuple 'G' (fromFoldable [])\n  ]\n\nlet graph = fromAdjacencyList edges\n```\n\n### Size\n\nThe `size` function returns the number of vertices in a graph.\n\n```haskell\nsize graph\n-- 7\n```\n\n### Vertices\n\nThe `vertices` function returns a list of the vertices in a graph.\n\n```haskell\nvertices graph\n-- ['A', 'B', 'C', 'D', 'E', 'F', 'G']\n```\n\n### Edges\n\nThe `isAdjacent` function returns true if two vertices are connected by an edge.\n\n```haskell\nisAdjacent 'A' 'B' graph\n-- true\n```\n\nThe `weight` function returns the weight of the edge between two vertices.\n\n```haskell\nweight 'A' 'B' graph\n-- Just 1\n```\n\nThe `adjacent` function returns all vertices connected to a vertex by an edge.\nThe `adjacent'` function will also include the weight of the edges.\n\n```haskell\nadjacent 'A' graph\n-- ['B', 'C']\n\nadjacent' 'A' graph\n-- [Tuple 'B' 1, Tuple 'C' 2]\n```\n\n### Shortest path\n\nThe `shortestPath` function calculates the shortest path between two vertices\nusing [Dijkstra'a\nalgorithm](https://en.wikipedia.org/wiki/Dijkstra's_algorithm).\n\n```haskell\nshortestPath 'A' 'D' graph\n-- ['A', 'B', 'D']\n```\n\n### Connected components\n\nThe `connectedComponents` function calculates a list of connected components in a graph.\n\nA [connected\ncomponent](https://en.wikipedia.org/wiki/Connected_component_(graph_theory)) is\na maximal subgraph in which any two vertices are connected to each other by a\npath.\n\n```haskell\nconnectedComponents graph\n-- [Graph, Graph, Graph]\n```\n\n### Building\n\nAn empty graph can be constructed and updated.\n\n```haskell\n(insertEdge 'A' 'B' 1 \u003c\u003c\u003c insertVertex 'A' \u003c\u003c\u003c insertVertex 'B') empty\n-- Graph\n```\n\n## API\n\n[Data.Graph](https://pursuit.purescript.org/packages/purescript-digraph)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullobject%2Fpurescript-digraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullobject%2Fpurescript-digraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullobject%2Fpurescript-digraph/lists"}