Fix tile drawing bug
This commit is contained in:
@@ -4,6 +4,7 @@ module Dodge.Graph
|
||||
, incidenceToFunction
|
||||
, pairsToIncidence
|
||||
, graphToEdges
|
||||
, graphToIncidence
|
||||
) where
|
||||
-- this deserves tests
|
||||
import Data.List.Extra
|
||||
@@ -34,3 +35,8 @@ graphToEdges :: forall a b . F.Gr a b -> [(a,a)]
|
||||
graphToEdges g = map (bimap f f) $ F.edges g
|
||||
where
|
||||
f n = fromJust . lookup n $ F.labNodes g
|
||||
|
||||
graphToIncidence :: forall a b . F.Gr a b -> [(a,Int)]
|
||||
graphToIncidence g = map f $ F.labNodes g
|
||||
where
|
||||
f (n,p) = (p,length $ F.neighbors g n)
|
||||
|
||||
Reference in New Issue
Block a user