From 28044d64448e533bcf79737e3a0a03ab83bf4d21 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 6c0977af0..14709aa57 100644 --- a/src/Algebra/Graph.hs +++ b/src/Algebra/Graph.hs @@ -471,6 +471,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 (||) (||) @@ -491,6 +492,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