Commit 124c7fbb authored by Mike Ledger's avatar Mike Ledger

add store instances

parent 9fd41cb5
Pipeline #13950076 passed with stage
in 32 minutes and 46 seconds
......@@ -14,12 +14,13 @@ library
hs-source-dirs: src
exposed-modules: Data.RadixTree
build-depends: base >= 4.7 && < 5
, containers
, containers >= 0.5
, vector
, text
, deepseq
, microlens
, parsers
, parsers >= 0.12
, store >= 0.4
default-language: Haskell2010
benchmark radixtree-parsing
......
......@@ -2,6 +2,7 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.RadixTree
......@@ -21,6 +22,8 @@ import qualified Data.Map.Strict as M
import Data.Monoid
import Data.Sequence (Seq)
import qualified Data.Sequence as Seq
import Data.Store () -- has Text instance
import Data.Store.TH (makeStore)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Vector (Vector)
......@@ -128,6 +131,9 @@ fromTrie = go . compress
fromFoldable :: Foldable f => f Text -> RadixTree
fromFoldable = fromTrie . foldr' (\t -> insert t t) skip
makeStore ''RadixNode
makeStore ''RadixTree
--------------------------------------------------------------------------------
-- Parsers from 'RadixTree's
......
Markdown is supported
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