Explicit universal quantification: uses an explicitly given test case generator.
Like forAll, but tries to shrink the argument for failing test cases.
This is a GHC/Hugs extension, and as such is not portable Haskell 98/2010. It is only a reserved word within types.
Type variables in a Haskell type expression are all assumed to be universally quantified; there is no explicit syntax for universal quantification, in standard Haskell 98/2010. For example, the type expressiona -> a denotes the type forall a. a ->a.
For clarity, however, we often write quantification explicitly when discussing the types of Haskell programs. When we write an explicitly quantified type, the scope of the forall extends as far to the right as possible; for example,
> forall a. a -> a
> forall a. (a -> a)
> GHC introduces a forall keyword, allowing explicit quantification, for example, to encode
> data Foo = forall a. MkFoo a (a -> Bool)
> | Nil
> MkFoo :: forall a. a -> (a -> Bool) -> Foo
> Nil :: Foo
> [MkFoo 3 even, MkFoo 'c' isUpper] :: [Foo]
> forall a. Eq a => C [a]
> forall <vars>. <ctxt> -> <type>