Skip to content

Commit

Permalink
Merge pull request #5 from haskell-works/switch-from-CsPoppy-to-CsPoppy1
Browse files Browse the repository at this point in the history
Switch from CsPoppy to CsPoppy1
  • Loading branch information
newhoggy authored Jul 5, 2019
2 parents 0650f61 + 39abd7c commit d9226c8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/HaskellWorks/Data/Json/Standard/Cursor/Fast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module HaskellWorks.Data.Json.Standard.Cursor.Fast
import Foreign.ForeignPtr
import HaskellWorks.Data.Json.Standard.Cursor.Generic
import HaskellWorks.Data.Json.Standard.Cursor.Specific
import HaskellWorks.Data.RankSelect.CsPoppy
import HaskellWorks.Data.RankSelect.CsPoppy1

import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
Expand All @@ -24,7 +24,7 @@ data Fast
instance SpecificCursor Fast where
type CursorOf Fast = Cursor

type Cursor = GenericCursor BS.ByteString CsPoppy (RM.RangeMin CsPoppy)
type Cursor = GenericCursor BS.ByteString CsPoppy1 (RM.RangeMin CsPoppy1)

fromByteString :: BS.ByteString -> Cursor
fromByteString bs = GenericCursor
Expand Down
8 changes: 4 additions & 4 deletions src/HaskellWorks/Data/Json/Standard/Cursor/Load/Cursor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Data.Word
import HaskellWorks.Data.BalancedParens.Simple
import HaskellWorks.Data.Json.Standard.Cursor.Generic
import HaskellWorks.Data.Json.Standard.Cursor.Load.Raw
import HaskellWorks.Data.RankSelect.CsPoppy
import HaskellWorks.Data.RankSelect.CsPoppy1

import qualified Data.ByteString.Internal as BSI
import qualified Data.Vector.Storable as DVS
Expand All @@ -30,15 +30,15 @@ loadCursorWithIndex filename = do
let cursor = GenericCursor jsonBS jsonIb (SimpleBalancedParens jsonBp) 1
return cursor

loadCursorWithCsPoppyIndex :: String -> IO (GenericCursor BSI.ByteString CsPoppy (SimpleBalancedParens (DVS.Vector Word64)))
loadCursorWithCsPoppyIndex :: String -> IO (GenericCursor BSI.ByteString CsPoppy1 (SimpleBalancedParens (DVS.Vector Word64)))
loadCursorWithCsPoppyIndex filename = do
(jsonBS, jsonIb, jsonBp) <- loadRawWithIndex filename
let cursor = GenericCursor jsonBS (makeCsPoppy jsonIb) (SimpleBalancedParens jsonBp) 1
return cursor

loadCursorWithCsPoppyIndex2 :: String -> IO (GenericCursor BSI.ByteString CsPoppy (SimpleBalancedParens CsPoppy))
loadCursorWithCsPoppyIndex2 :: String -> IO (GenericCursor BSI.ByteString CsPoppy1 (SimpleBalancedParens CsPoppy1))
loadCursorWithCsPoppyIndex2 filename = do
(jsonBS, jsonIb, jsonBp) <- loadRawWithIndex filename
let cursor = GenericCursor jsonBS (makeCsPoppy jsonIb) (SimpleBalancedParens (makeCsPoppy jsonBp)) 1
:: GenericCursor BSI.ByteString CsPoppy (SimpleBalancedParens CsPoppy)
:: GenericCursor BSI.ByteString CsPoppy1 (SimpleBalancedParens CsPoppy1)
return cursor
2 changes: 1 addition & 1 deletion test/HaskellWorks/Data/Json/Standard/Cursor/TypeSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ns = TC.nextSibling
spec :: Spec
spec = describe "HaskellWorks.Data.Json.Succinct.CursorSpec" $ do
genSpec "DVS.Vector Word64" SLOW.fromString
genSpec "CsPoppy" FAST.fromString
genSpec "CsPoppy1" FAST.fromString

genSpec :: forall t u.
( Eq t
Expand Down
2 changes: 1 addition & 1 deletion test/HaskellWorks/Data/Json/Standard/CursorSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ import qualified HaskellWorks.Data.Json.Standard.Cursor.Slow as SLOW
spec :: Spec
spec = describe "HaskellWorks.Data.Json.Succinct.CursorSpec" $ do
genTest "DVS.Vector Word64" SLOW.fromString
genTest "CsPoppy" FAST.fromString
genTest "CsPoppy1" FAST.fromString

0 comments on commit d9226c8

Please sign in to comment.