36
36
4.532ns per iteration / 220663.09 per second.
37
37
-}
38
38
39
- {-# LANGUAGE CPP, ScopedTypeVariables #-}
40
- #if __GLASGOW_HASKELL__ >= 708
39
+ {-# LANGUAGE ScopedTypeVariables #-}
41
40
42
41
import Control.DeepSeq
43
- import Data.Foldable (foldl' )
44
42
import Data.Graph.Inductive.Graph
45
43
import qualified Data.Graph.Inductive.PatriciaTree as Patricia
44
+ import Data.Graph.Inductive.Proxy
46
45
import qualified Data.Graph.Inductive.Tree as AVL
47
- import Data.Proxy
48
46
import Microbench
49
47
50
48
main :: IO ()
@@ -67,17 +65,17 @@ main = do microbench "insNode into AVL tree" insNodeAVL
67
65
microbench " emap on AVL tree" emapAVL
68
66
microbench " emap on PATRICIA tree" emapPatricia
69
67
70
-
71
68
insNodeAVL :: Int -> AVL. UGr
72
69
insNodeAVL = insNodes' empty
73
70
74
71
buildFullPatricia :: Int -> Int -> ()
75
- buildFullPatricia sz i = buildFull (Proxy :: Proxy Patricia. Gr ) sz i
72
+ buildFullPatricia sz i = buildFull (Proxy :: PatriciaTreeP ) sz i
76
73
77
74
insNodePatricia :: Int -> Patricia. UGr
78
75
insNodePatricia = insNodes' empty
79
76
80
- buildFull :: forall gr proxy . (DynGraph gr , NFData (gr Int () )) => proxy gr -> Int -> Int -> ()
77
+ buildFull :: forall gr . (DynGraph gr , NFData (gr Int () ))
78
+ => GraphProxy gr -> Int -> Int -> ()
81
79
buildFull _ sz ntimes = rnf [buildFull' i (empty :: gr Int () ) 0 sz | i <- [0 .. ntimes- 1 ]]
82
80
83
81
buildFull' :: DynGraph gr => a -> gr a () -> Int -> Int -> gr a ()
@@ -164,8 +162,3 @@ emapPatricia n
164
162
f _ = n
165
163
in
166
164
g'
167
-
168
- #else
169
- main :: IO ()
170
- main = putStrLn " Benchmarks are only supported for GHC 7.8 and above."
171
- #endif
0 commit comments