@@ -19,8 +19,8 @@ import Control.Monad.ST as ST
1919import Data.Array.NonEmpty (NonEmptyArray )
2020import Data.Array.NonEmpty as NEA
2121import Data.Array.ST as STA
22- import Data.Char (toCharCode , fromCharCode )
2322import Data.Either (Either (..))
23+ import Data.Enum (fromEnum , toEnumWithDefaults )
2424import Data.Foldable (foldl )
2525import Data.Generic.Rep (class Generic , to , from , NoArguments (..), Sum (..), Product (..), Constructor (..), Argument (..))
2626import Data.Identity (Identity (..))
@@ -31,15 +31,15 @@ import Data.List.NonEmpty (NonEmptyList(..))
3131import Data.Maybe (Maybe (..), fromJust )
3232import Data.Newtype (wrap )
3333import Data.NonEmpty (NonEmpty (..), (:|))
34- import Record as Record
35- import Data.String (charCodeAt , fromCharArray , split )
34+ import Data.String.CodeUnits (charAt , fromCharArray , split )
3635import Data.String.NonEmpty (NonEmptyString )
37- import Data.String.NonEmpty as NES
36+ import Data.String.NonEmpty.CodeUnits as NES
3837import Data.Symbol (class IsSymbol , SProxy (..))
3938import Data.Tuple (Tuple (..))
4039import Partial.Unsafe (unsafePartial )
4140import Prim.Row as Row
4241import Prim.RowList as RL
42+ import Record as Record
4343import Test.QuickCheck.Gen (Gen , arrayOf , chooseInt , elements , listOf , oneOf , perturbGen , repeatable , sized , uniform )
4444import Type.Data.RowList (RLProxy (..))
4545
@@ -86,7 +86,7 @@ instance arbString :: Arbitrary String where
8686 arbitrary = fromCharArray <$> arbitrary
8787
8888instance coarbString :: Coarbitrary String where
89- coarbitrary s = coarbitrary $ (charCodeAt zero <$> split (wrap " " ) s)
89+ coarbitrary s = coarbitrary $ (charAt zero <$> split (wrap " " ) s)
9090
9191instance arbNonEmptyString :: Arbitrary NonEmptyString where
9292 arbitrary = NES .cons <$> arbitrary <*> arbitrary
@@ -95,10 +95,10 @@ instance coarbNonEmptyString :: Coarbitrary NonEmptyString where
9595 coarbitrary = coarbitrary <<< NES .toString
9696
9797instance arbChar :: Arbitrary Char where
98- arbitrary = fromCharCode <$> chooseInt 0 65536
98+ arbitrary = toEnumWithDefaults bottom top <$> chooseInt 0 65536
9999
100100instance coarbChar :: Coarbitrary Char where
101- coarbitrary c = coarbitrary $ toCharCode c
101+ coarbitrary c = coarbitrary $ fromEnum c
102102
103103instance arbUnit :: Arbitrary Unit where
104104 arbitrary = pure unit
0 commit comments