diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/CMark/Extra.hs | 23 | ||||
-rw-r--r-- | app/Issue.hs | 9 |
2 files changed, 24 insertions, 8 deletions
diff --git a/app/CMark/Extra.hs b/app/CMark/Extra.hs new file mode 100644 index 0000000..1d7d553 --- /dev/null +++ b/app/CMark/Extra.hs @@ -0,0 +1,23 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} + +module CMark.Extra where + +import CMark +import Data.Binary (Binary) + +-- TODO Generic-derived Binary instances might be slow +-- +-- https://github.com/kolmodin/binary/issues/200 +-- +-- @backlog +instance Binary Node + +instance Binary PosInfo + +instance Binary NodeType + +instance Binary ListAttributes + +instance Binary ListType + +instance Binary DelimType diff --git a/app/Issue.hs b/app/Issue.hs index 4c5cc97..124b0d7 100644 --- a/app/Issue.hs +++ b/app/Issue.hs @@ -10,6 +10,7 @@ module Issue where import CMark qualified as D +import CMark.Extra () import Comment qualified as G import Data.Binary (Binary (..)) import Data.List.NonEmpty (NonEmpty) @@ -21,7 +22,6 @@ import GHC.Records (HasField (..)) import Git (Author (..), Commit (..)) import Issue.Provenance (Provenance (..)) import Issue.Tag (Tag (..)) -import Render qualified as P import Prelude hiding (id) data Issue = Issue @@ -40,13 +40,6 @@ data Issue = Issue } deriving (Show, Binary, Generic, Eq) --- TODO Resolve Binary D.Node instance --- --- @related reduce-cached-data-size -instance Binary D.Node where - put = put . T.pack . show . P.render - get = D.commonmarkToNode [] <$> get - id :: Issue -> T.Text id issue = toSpinalCase issue.title where |