mirror of
https://github.com/mrkkrp/megaparsec.git
synced 2024-11-23 10:23:39 +03:00
Fix the benchmarks
This commit is contained in:
parent
7442858124
commit
acf0c08cd8
@ -120,16 +120,15 @@ breachOffset o0 o1 = func
|
||||
f
|
||||
(o0 * 80, o1 * 80)
|
||||
where
|
||||
f :: (Int, Int) -> (SourcePos, PosState Text)
|
||||
f :: (Int, Int) -> PosState Text
|
||||
f (startOffset, targetOffset) =
|
||||
let (x, _, y) = reachOffset targetOffset PosState
|
||||
{ pstateInput = manyAs (targetOffset - startOffset)
|
||||
, pstateOffset = startOffset
|
||||
, pstateSourcePos = initialPos ""
|
||||
, pstateTabWidth = defaultTabWidth
|
||||
, pstateLinePrefix = ""
|
||||
}
|
||||
in (x, y)
|
||||
snd $ reachOffset targetOffset PosState
|
||||
{ pstateInput = manyAs (targetOffset - startOffset)
|
||||
, pstateOffset = startOffset
|
||||
, pstateSourcePos = initialPos ""
|
||||
, pstateTabWidth = defaultTabWidth
|
||||
, pstateLinePrefix = ""
|
||||
}
|
||||
|
||||
-- | Bench the 'reachOffsetNoLine' function.
|
||||
|
||||
@ -142,7 +141,7 @@ breachOffsetNoLine o0 o1 = func
|
||||
f
|
||||
(o0 * 80, o1 * 80)
|
||||
where
|
||||
f :: (Int, Int) -> (SourcePos, PosState Text)
|
||||
f :: (Int, Int) -> PosState Text
|
||||
f (startOffset, targetOffset) =
|
||||
reachOffsetNoLine targetOffset PosState
|
||||
{ pstateInput = manyAs (targetOffset - startOffset)
|
||||
|
@ -117,16 +117,15 @@ breachOffset o0 o1 = bench
|
||||
("reachOffset-" ++ show o0 ++ "-" ++ show o1)
|
||||
(nf f (o0 * 80, o1 * 80))
|
||||
where
|
||||
f :: (Int, Int) -> (SourcePos, PosState Text)
|
||||
f :: (Int, Int) -> PosState Text
|
||||
f (startOffset, targetOffset) =
|
||||
let (x, _, y) = reachOffset targetOffset PosState
|
||||
{ pstateInput = manyAs (targetOffset - startOffset)
|
||||
, pstateOffset = startOffset
|
||||
, pstateSourcePos = initialPos ""
|
||||
, pstateTabWidth = defaultTabWidth
|
||||
, pstateLinePrefix = ""
|
||||
}
|
||||
in (x, y)
|
||||
snd $ reachOffset targetOffset PosState
|
||||
{ pstateInput = manyAs (targetOffset - startOffset)
|
||||
, pstateOffset = startOffset
|
||||
, pstateSourcePos = initialPos ""
|
||||
, pstateTabWidth = defaultTabWidth
|
||||
, pstateLinePrefix = ""
|
||||
}
|
||||
|
||||
-- | Bench the 'reachOffsetNoLine' function.
|
||||
|
||||
@ -138,7 +137,7 @@ breachOffsetNoLine o0 o1 = bench
|
||||
("reachOffsetNoLine-" ++ show o0 ++ "-" ++ show o1)
|
||||
(nf f (o0 * 80, o1 * 80))
|
||||
where
|
||||
f :: (Int, Int) -> (SourcePos, PosState Text)
|
||||
f :: (Int, Int) -> PosState Text
|
||||
f (startOffset, targetOffset) =
|
||||
reachOffsetNoLine targetOffset PosState
|
||||
{ pstateInput = manyAs (targetOffset - startOffset)
|
||||
|
Loading…
Reference in New Issue
Block a user