From 820798fd1bca2fdc01c9dbaaf4ecd8d6911cc94b Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Tue, 30 Oct 2018 21:52:34 +0000 Subject: [PATCH] Add INLINE pragmas for hasEdgeP and hasVertexP Thanks Alexandre Moine! --- src/Algebra/Graph.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Algebra/Graph.hs b/src/Algebra/Graph.hs index 04ba6615f..cb8804b50 100644 --- a/src/Algebra/Graph.hs +++ b/src/Algebra/Graph.hs @@ -475,6 +475,7 @@ size = foldg 1 (const 1) (+) (+) -- | Check if a graph contains a vertex which satisfied the supplied predicate. -- Complexity: /O(s)/ time. -- +{-# INLINE [1] hasVertexP #-} hasVertexP :: (a -> Bool) -> Graph a -> Bool hasVertexP pred = foldg False pred (||) (||) @@ -495,6 +496,7 @@ hasVertex x = hasVertexP (==x) -- predicates. -- Complexity: /O(s)/ time. -- +{-# INLINE [1] hasEdgeP #-} hasEdgeP :: (a -> Bool) -> (a -> Bool) -> Graph a -> Bool hasEdgeP predFrom predTo g = hit g == Edge where