Broken commit (removed loadKeyConfig)

This commit is contained in:
2021-08-27 11:58:11 +01:00
parent c4df048d31
commit 3ff04576ab
25 changed files with 122 additions and 200 deletions
+7 -3
View File
@@ -1,12 +1,16 @@
module Dodge.Graph
where
( pairsToSCC
, incidenceToFunction
, pairsToIncidence
) where
-- this deserves tests
import Data.List.Extra
import Data.Bifunctor (first)
import Data.Graph
import Data.Maybe
pairsToIncidence :: (Eq a,Ord a) => [(a,a)] -> [(a,[a])]
pairsToIncidence :: Ord a => [(a,a)] -> [(a,[a])]
pairsToIncidence
= map (first head . unzip)
. groupOn fst
@@ -18,5 +22,5 @@ incidenceToFunction xs a = fromMaybe [] $ lookup a xs
mkNode :: (a,[a]) -> (a,a,[a])
mkNode (x,xs) = (x,x,xs)
pairsToSCC :: (Eq a, Ord a) => [(a,a)] -> [SCC a]
pairsToSCC :: Ord a => [(a,a)] -> [SCC a]
pairsToSCC = stronglyConnComp . map mkNode . pairsToIncidence