function3
  :: (a -> Gen r -> Gen r)
  -> (b -> Gen r -> Gen r)
  -> (c -> Gen r -> Gen r)
  -> Gen r
  -> Gen (a -> b -> c -> r)
function3 p1 p2 p3 = fmap f . function1 p'
  where
    p' (a, b, c) = p1 a . p2 b . p3 c
    f g = \a b c -> g (a, b, c)
function3
  :: (a -> Gen r -> Gen r)
  -> (b -> Gen r -> Gen r)
  -> (c -> Gen r -> Gen r)
  -> Gen r
  -> Gen (a -> b -> c -> r)
function3 p1 p2 p3 = fmap f . function1 p'
  where
    p' (a, b, c) = p1 a . p2 b . p3 c
    f g = \a b c -> g (a, b, c)
function3 p1 p2 p3 = fmap f . function1 p'
  where
    p' (a, b, c) = p1 a . p2 b . p3 c
    f g = \a b c -> g (a, b, c)