Skip to content

Commit fb1f83d

Browse files
committed
Tests.QuickCheckUtils: i Arbitrary LText: arbitrary: refact
1 parent 812d8c0 commit fb1f83d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/Tests/QuickCheckUtils.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
--
55
{-# LANGUAGE FlexibleInstances #-}
66
{-# LANGUAGE DeriveFunctor #-}
7+
{-# LANGUAGE TypeApplications #-}
8+
{-# LANGUAGE ScopedTypeVariables #-}
79

810
{-# OPTIONS_GHC -fno-warn-orphans #-}
911

@@ -32,6 +34,7 @@ import Control.Arrow ((***))
3234
import Control.DeepSeq (NFData (..), deepseq)
3335
import Control.Exception (bracket)
3436
import Data.Char (isSpace)
37+
import Data.Coerce (coerce)
3538
import Data.Text.Foreign (I8)
3639
import Data.Text.Lazy.Builder.RealFloat (FPFormat(..))
3740
import Data.Word (Word8, Word16)
@@ -89,7 +92,7 @@ instance Arbitrary T.Text where
8992
shrink = map T.pack . shrink . T.unpack
9093

9194
instance Arbitrary TL.Text where
92-
arbitrary = (TL.fromChunks . map notEmpty . unSqrt) `fmap` arbitrary
95+
arbitrary = TL.fromChunks <$> coerce (arbitrary @(Sqrt [NotEmpty T.Text]))
9396
shrink = map TL.pack . shrink . TL.unpack
9497

9598
newtype BigInt = Big Integer

0 commit comments

Comments
 (0)