Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added MonoPointed instance for bytestring Builder #219

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mono-traversable/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog for mono-traversable

## 1.0.16.0

* Added MonoPointed instance for bytestring Builder
[#219](https://github.com/snoyberg/mono-traversable/pull/219#pullrequestreview-1879553961)

## 1.0.15.3

* Compile with GHC 9.2 (`Option` removed from `base-4.16`)
Expand Down
2 changes: 1 addition & 1 deletion mono-traversable/mono-traversable.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: mono-traversable
version: 1.0.15.3
version: 1.0.16.0
synopsis: Type classes for mapping, folding, and traversing monomorphic containers
description: Please see the README at <https://www.stackage.org/package/mono-traversable>
category: Data
Expand Down
2 changes: 1 addition & 1 deletion mono-traversable/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mono-traversable
version: 1.0.15.3
version: 1.0.16.0
synopsis: Type classes for mapping, folding, and traversing monomorphic containers
description: Please see the README at <https://www.stackage.org/package/mono-traversable>
category: Data
Expand Down
7 changes: 7 additions & 0 deletions mono-traversable/src/Data/MonoTraversable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import Control.Category
import Control.Monad (Monad (..))
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Builder as B
import qualified Data.Foldable as F
import Data.Functor
import Data.Maybe (fromMaybe)
Expand Down Expand Up @@ -106,6 +107,8 @@ import Control.Monad.Trans.Identity (IdentityT)
type family Element mono
type instance Element S.ByteString = Word8
type instance Element L.ByteString = Word8
-- | @since 1.0.16.0
type instance Element B.Builder = Word8
type instance Element T.Text = Char
type instance Element TL.Text = Char
type instance Element [a] = a
Expand Down Expand Up @@ -1140,6 +1143,10 @@ instance MonoPointed S.ByteString where
instance MonoPointed L.ByteString where
opoint = L.singleton
{-# INLINE opoint #-}
-- | @since 1.0.16.0
instance MonoPointed B.Builder where
BebeSparkelSparkel marked this conversation as resolved.
Show resolved Hide resolved
opoint = B.word8
{-# INLINE opoint #-}
instance MonoPointed T.Text where
opoint = T.singleton
{-# INLINE opoint #-}
Expand Down
Loading