File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ data NonEmptyText =
3737 NonEmptyText Char Text. Text
3838 deriving (Eq , Ord , NFData , Generic )
3939
40+ -- |
41+ -- Note that this instance uses 'toText', so two unequal NonEmptyTexts might be
42+ -- unequal even though they 'show' the same
4043instance Show NonEmptyText where
4144 show = show . toText
4245
@@ -140,6 +143,8 @@ length = (1 +) . Text.length . Data.NonEmptyText.tail
140143--
141144-- The 'Data.Text.Text' result is guaranteed to be non-empty. However, this is
142145-- not reflected in the type.
146+ -- Note that the first 'Char' may be replaced with U+FFFD,
147+ -- which happens when 'Data.Text.cons' would also replace it.
143148toText :: NonEmptyText -> Text. Text
144149toText = uncurry Text. cons . uncons
145150
You can’t perform that action at this time.
0 commit comments