packages feed

event-list-0.0.6: src-1/Test/Instances.hs

module Test.Instances where

import Test.QuickCheck (Arbitrary(..))

import Control.Monad (liftM)
import Data.Char (chr)


instance Arbitrary Char where
   arbitrary = liftM (chr . (32+) . flip mod 96) arbitrary
   coarbitrary = undefined

instance Arbitrary a => Arbitrary (Maybe a) where
   arbitrary =
      arbitrary >>=
         \b -> if b then fmap Just arbitrary else return Nothing
   coarbitrary = undefined