Safe Haskell | None |
---|---|
Language | Haskell2010 |
orphan instances, of 'Enumerate'\/'Eq'\/'Show', for functions:
instance (Enumerable a, Enumerable b, Ord a, Ord b) => Enumerable (a -> b)
instance (Enumerable a, Eq b) => Eq (a -> b)
instance (Enumerable a, Show a, Show b) => Show (a -> b)
see:
(that are included for completeness, but not exported by default (i.e. by Enumerate). you probably want build-time instance-resolution errors, rather than possible runtime non-termination).
-- doctest
>>>
:set -XLambdaCase
Documentation
Orphan instances
(Enumerable a, Eq b) => Eq (a -> b) Source # | brute-force function extensionality. warning: the size of the domain grows exponentially in the number of arguments.
because functions are curried, the instance is recursive, and it works on functions of any arity: -- De Morgan's laws >> (\x y -> not (x && y)) == (\x y -> not x || not y) True >>> (x y -> not (x || y)) == (x y -> not x && not y) True |
(Enumerable a, Show a, Show b) => Show (a -> b) Source # |
because functions are curried, the instance is recursive, and it works on functions of any arity:
|
(Enumerable a, Enumerable b, Ord a, Ord b) => Enumerable (a -> b) Source # | the exponential type. the warning: it grows very quickly. might be useful for generating random functions on small types, like to fuzz test type class laws. the instance ( |