File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed
src/Codec/CBOR/Cuddle/CBOR Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ instance (RandomGen r) => RandomGenM (CapGenM r) r (M r) where
123
123
applyRandomGenM f _ = state @ " randomSeed" f
124
124
125
125
runGen :: M g a -> GenEnv g -> GenState g -> (a , GenState g )
126
- runGen ( M m) env st = runReader (runStateT m st) env
126
+ runGen m env st = runReader (runStateT (runM m) st) env
127
127
128
128
evalGen :: M g a -> GenEnv g -> GenState g -> a
129
129
evalGen m env = fst . runGen m env
@@ -166,19 +166,6 @@ genBytes n = asksM @"fakeSeed" $ uniformByteStringM n
166
166
genText :: forall g . (RandomGen g ) => Int -> M g Text
167
167
genText n = pure $ T. pack . take n . join $ repeat [' a' .. ' z' ]
168
168
169
- --------------------------------------------------------------------------------
170
- -- Combinators
171
- --------------------------------------------------------------------------------
172
-
173
- choose :: (RandomGen g ) => [a ] -> M g a
174
- choose xs = genUniformRM (0 , length xs) >>= \ i -> pure $ xs !! i
175
-
176
- oneOf :: (RandomGen g ) => [M g a ] -> M g a
177
- oneOf xs = genUniformRM (0 , length xs) >>= \ i -> xs !! i
178
-
179
- oneOfGenerated :: (RandomGen g ) => M g [a ] -> M g a
180
- oneOfGenerated genXs = genXs >>= choose
181
-
182
169
--------------------------------------------------------------------------------
183
170
-- Postlude
184
171
--------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments