Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
H
haskell-igraph
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 1
    • Issues 1
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-igraph
  • Issues
  • #4

Closed
Open
Opened May 14, 2025 by Grégoire Locqueville@glocqueville
  • Report abuse
  • New issue
Report abuse New issue

`mkGraph` requires the user to know about its underlying implementation

The Graph type has two type parameters, v for node labels and one for edge labels. Internally, though, it represents nodes using Ints.*

The function mkGraph takes as input a [v] (for nodes) and a [((Int, Int), e)]* (for edges): the user needs to specify the edges in the form of (labelled) pairs of Ints, even though they specified nodes in the form of elements of the label type v. This requires them to know in advance which Int each v will be mapped to.

In other words, the user is supposed to know how the graph's underlying representation will be constructed (before it even exists), which 1. is more work than should be required of them, and 2. can lead to breakages should the underlying implementation change.

Note : The documentation for the function's first argument does specify that "each [node] will be assigned a ID from 0 to N", but it is not clear whether that assignment is in the order of the input list, in increasing order (v is required to be Ord), or in some other arbitrary order.

* Node is just a type alias for Int, and LEdge a is a type alias for ((Int, Int), a).

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: gargantext/haskell-igraph#4