Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #312

Merged
merged 6 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Adapted from: https://github.com/ndmitchell/hlint/blob/master/.github/workflows/ci.yml
name: ci

on:
push:
pull_request:
Expand All @@ -16,16 +13,16 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc: ['9.6.1', '9.4.4', '9.2.7', '9.0.2', '8.10.7', '8.8.4', '8.6.5']
ghc: ['9.8.2', '9.6.3', '9.4.7', '9.2.8', '9.0.2', '8.10.7', '8.8.4', '8.6.5']
include:
- os: windows-latest
# Testing on MacOS is disabled until GitHub actions support 'allow-failure'
# - os: macOS-latest

steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
- uses: actions/checkout@v3
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
7 changes: 6 additions & 1 deletion .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@
# - group: {name: generalise, enabled: true}

# Ignore some builtin hints
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules

- ignore:
name: Use if
within: Algebra.Graph.Bipartite.AdjacencyMap.Algorithm
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules

- ignore:
name: Avoid NonEmpty.unzip
within: Algebra.Graph.NonEmpty.AdjacencyMap

# Define some custom infix operators
# - fixity: infixr 3 ~^#^~
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016-2023 Andrey Mokhov
Copyright (c) 2016-2024 Andrey Mokhov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions algebraic-graphs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ license-file: LICENSE
author: Andrey Mokhov <andrey.mokhov@gmail.com>, github: @snowleopard
maintainer: Andrey Mokhov <andrey.mokhov@gmail.com>, github: @snowleopard,
Alexandre Moine <alexandre@moine.me>, github: @nobrakal
copyright: Andrey Mokhov, 2016-2023
copyright: Andrey Mokhov, 2016-2024
homepage: https://github.com/snowleopard/alga
bug-reports: https://github.com/snowleopard/alga/issues
category: Algebra, Algorithms, Data Structures, Graphs
build-type: Simple
tested-with: GHC==9.6.1, GHC==9.4.4, GHC==9.2.7, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5
tested-with: GHC==9.8.2, GHC==9.6.3, GHC==9.4.7, GHC==9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5
description:
<https://github.com/snowleopard/alga Alga> is a library for algebraic construction and
manipulation of graphs in Haskell. See <https://github.com/snowleopard/alga-paper this paper>
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Acyclic/AdjacencyMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Acyclic.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/AdjacencyIntMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.AdjacencyIntMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/AdjacencyIntMap/Algorithm.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.AdjacencyIntMap.Algorithm
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : unstable
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/AdjacencyMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
22 changes: 12 additions & 10 deletions src/Algebra/Graph/AdjacencyMap/Algorithm.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.AdjacencyMap.Algorithm
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : unstable
Expand Down Expand Up @@ -380,23 +380,25 @@ gabowSCC g =
-- called when exiting vertex v. if v is the bottom of a scc
-- boundary, we add a new SCC, otherwise v is part of a larger scc
-- being constructed and we continue.
exit v = do newComponent <- (v==).snd.head <$> gets boundaryStack
when newComponent $ insertComponent v
return newComponent
exit v = do boundaryStack <- gets boundaryStack
case boundaryStack of
(p_top, top) : newBoundaryStack | v == top -> do
insertComponent p_top top newBoundaryStack
return True

insertComponent v = modify'
(\(SCC pre scc bnd pth pres sccs gs es_i es_o) ->
_ -> return False

insertComponent p_v v newBoundaryStack = modify'
(\(SCC pre scc _oldBoundaryStack pth pres sccs gs es_i es_o) ->
let (curr,v_pth') = span (/=v) pth
pth' = tail v_pth' -- Here we know that v_pth' starts with v
pth' = drop 1 v_pth' -- Here we know that v_pth' starts with v
(es,es_i') = span ((>=p_v).fst) es_i
g_i | null es = vertex v
| otherwise = edges (snd <$> es)
p_v = fst $ head bnd
scc' = scc + 1
bnd' = tail bnd
sccs' = List.foldl' (\sccs x -> Map.insert x scc sccs) sccs (v:curr)
gs' = g_i:gs
in SCC pre scc' bnd' pth' pres sccs' gs' es_i' es_o)
in SCC pre scc' newBoundaryStack pth' pres sccs' gs' es_i' es_o)

inedge uv = modify'
(\(SCC pre scc bnd pth pres sccs gs es_i es_o) ->
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Bipartite/AdjacencyMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Bipartite.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Bipartite/AdjacencyMap/Algorithm.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Bipartite.AdjacencyMap.Algorithm
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Class.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Class
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Export.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Export
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Export/Dot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Export.Dot
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/HigherKinded/Class.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.HigherKinded.Class
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Internal
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Label.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Label
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Labelled.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Labelled
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Labelled/AdjacencyMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Labelled.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Labelled/Example/Automaton.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Labelled.Example.Automaton
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Labelled/Example/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Labelled.Example.Network
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/NonEmpty.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.NonEmpty
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/NonEmpty/AdjacencyMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.NonEmpty.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Relation.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Relation
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Relation/Preorder.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Relation.Preorder
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Relation/Reflexive.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Relation.Reflexive
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Relation/Symmetric.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Relation.Symmetric
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Relation/Transitive.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Relation.Transitive
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/ToGraph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.ToGraph
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Graph/Undirected.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Undirected
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Graph/Typed.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Data.Graph.Typed
-- Copyright : (c) Anton Lorenzen, Andrey Mokhov 2016-2023
-- Copyright : (c) Anton Lorenzen, Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : anfelor@posteo.de, andrey.mokhov@gmail.com
-- Stability : unstable
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-19.11
resolver: nightly-2024-03-01 # ghc-9.8.1

ghc-options:
'$everything': -haddock
2 changes: 1 addition & 1 deletion test/Algebra/Graph/Test.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Test
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion test/Algebra/Graph/Test/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Test.API
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion test/Algebra/Graph/Test/Acyclic/AdjacencyMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Test.Acyclic.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion test/Algebra/Graph/Test/AdjacencyIntMap.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Test.AdjacencyIntMap
-- Copyright : (c) Andrey Mokhov 2016-2023
-- Copyright : (c) Andrey Mokhov 2016-2024
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
Expand Down
Loading
Loading