From 640b26b64dba00d5482111bc28203050d0bfe238 Mon Sep 17 00:00:00 2001
From: Bryan O'Sullivan <bos@serpentine.com>
Date: Sat, 20 May 2017 20:59:52 -0700
Subject: [PATCH] Wow, typo(s) of the week!  Or do I mean the decade?

This bug has been latent for 6.75 years, and lay dormant all that
time because the Arbitrary instance for Char only generates ASCII.

I just switched the Arbitrary instance for Text to generate a wider
range of Unicode code points, thanks to the quickcheck-unicode
package.  (I'm afraid I don't recall why I didn't do this much
earlier...)
---
 Data/Text/Foreign.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Data/Text/Foreign.hs b/Data/Text/Foreign.hs
index 8f273d9e..890deca3 100644
--- a/Data/Text/Foreign.hs
+++ b/Data/Text/Foreign.hs
@@ -108,7 +108,7 @@ takeWord16 (I16 n) t@(Text arr off len)
     | n >= len || m >= len = t
     | otherwise            = Text arr off m
   where
-    m | w < 0xDB00 || w > 0xD8FF = n
+    m | w < 0xD800 || w > 0xDBFF = n
       | otherwise                = n+1
     w = A.unsafeIndex arr (off+n-1)
 
-- 
GitLab