Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Data/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ infixl 5 :>
-- | /O(1)/ Tests whether a 'Text' contains exactly one character.
isSingleton :: Text -> Bool
isSingleton (Text arr off len) =
len == utf8LengthByLeader (A.unsafeIndex arr off)
len /= 0 && len == utf8LengthByLeader (A.unsafeIndex arr off)
{-# INLINE isSingleton #-}

-- | /O(n)/ Returns the number of characters in a 'Text'.
Expand Down