Skip to content

Commit

Permalink
Tweak Haddocks
Browse files Browse the repository at this point in the history
  • Loading branch information
hvr committed Jul 20, 2019
1 parent 45ab915 commit 80e66db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Define `Typeable ShortText` also for GHC 7.8 as well
(NB: for GHC 7.10.3 and up `Typeable` instances are automatically
defined even when not mentioned explicitly in a `deriving` clause)
* Add equivalent verb `Data.Text.split` to `Data.Text.Short` API

split :: (Char -> Bool) -> ShortText -> [ShortText]

## 0.1.2

Expand Down
4 changes: 3 additions & 1 deletion src/Data/Text/Short.hs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ dropWhileEnd p = fst . spanEnd p
--
-- prop> intercalate (singleton c) (split (== c) t) = t
--
-- @since UNRELEASED
-- __NOTE__: 'split' never returns an empty list to match the semantics of its counterpart from "Data.Text".
--
-- @since 0.1.3
split :: (Char -> Bool) -> ShortText -> [ShortText]
split p st0 = loop st0
where
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Text/Short/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ import qualified PrimOps
newtype ShortText = ShortText ShortByteString
deriving (Hashable,Monoid,NFData,Data.Semigroup.Semigroup,Typeable)

-- | It exposes a similar 'Data' instance abstraction as 'Text' (see
-- | It exposes a similar 'Data' instance abstraction as 'T.Text' (see
-- discussion referenced there for more details), preserving the
-- @[Char]@ data abstraction at the cost of inefficiency.
--
Expand Down Expand Up @@ -1477,7 +1477,7 @@ instance GHC.Exts.IsList ShortText where

-- | __Note__: Surrogate pairs (@[U+D800 .. U+DFFF]@) in string literals are replaced by U+FFFD.
--
-- This matches the behaviour of 'IsString' instance for 'T.Text'.
-- This matches the behaviour of 'S.IsString' instance for 'T.Text'.
instance S.IsString ShortText where
fromString = fromStringLit

Expand Down

0 comments on commit 80e66db

Please sign in to comment.