Commit 4c49b965 authored by Guido Trotter's avatar Guido Trotter
Browse files

make genMaybe more Just



There is a common conception that Just something is more worth than
Nothing. So we're biasing our tests towards that. As such let's generate
Nothing fewer times, and Just subgen more times. The values were copied
from the "official" maybe generator.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent f22433c0
......@@ -147,7 +147,7 @@ genFQDN = do
-- | Combinator that generates a 'Maybe' using a sub-combinator.
genMaybe :: Gen a -> Gen (Maybe a)
genMaybe subgen = oneof [ pure Nothing, liftM Just subgen ]
genMaybe subgen = frequency [ (1, pure Nothing), (3, Just <$> subgen) ]
-- | Defines a tag type.
newtype TagChar = TagChar { tagGetChar :: Char }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment