Commit 1b22b1ea authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Add SPECIALIZE pragma to parseMorphismPointHelper

Slightly faster again..
parent b3e3fb74
......@@ -32,4 +32,4 @@ sortOn f = V.modify (V.sortBy (comparing f))
hasDuplicates :: Eq a => Vector a -> Bool
hasDuplicates v = V.length (V.uniq v) /= V.length v
{-# INLINE hasDuplicates #-}
......@@ -66,6 +66,9 @@ parseMorphismPointHelper inner weightParser = do
where
edge = (,) <$> inner <* L.colon <*> (L.signed weightParser)
{-# INLINE parseMorphismPointHelper #-}
{-# SPECIALIZE parseMorphismPointHelper :: MonadParser m => m Int -> m Int -> m (Int, Vector (Int, Int)) #-}
{-# SPECIALIZE parseMorphismPointHelper :: MonadParser m => m Int -> m Double -> m (Double, Vector (Int, Double)) #-}
instance ParseMorphism (MonoidValued Int) where
parseMorphismPoint (IntValued inner) = parseMorphismPointHelper inner L.decimal
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment