-- |
-- Module      : Test.LeanCheck.Utils.Types
-- Copyright   : (c) 2015-2024 Rudy Matela
-- License     : 3-Clause BSD  (see the file LICENSE)
-- Maintainer  : Rudy Matela <rudy@matela.com.br>
--
-- This module is part of LeanCheck,
-- a simple enumerative property-based testing library.
--
-- Types to aid in property-based testing.
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ == 708
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
#endif
module Test.LeanCheck.Utils.Types
  (
  -- * Integer types
  --
  -- | Small-width integer types to aid in property-based testing.
  -- Sometimes it is useful to limit the possibilities of enumerated values
  -- when testing polymorphic functions, these types allow that.
  --
  -- The signed integer types @IntN@ are of limited bit width @N@
  -- bounded by @-2^(N-1)@ to @2^(N-1)-1@.
  -- The unsigned integer types @WordN@ are of limited bit width @N@
  -- bounded by @0@ to @2^N-1@.
  --
  -- Operations are closed and modulo @2^N@.  e.g.:
  --
  -- > maxBound + 1      = minBound
  -- > read "2"          = -2 :: Int2
  -- > abs minBound      = minBound
  -- > negate n          = 2^N - n :: WordN
    Int1 (..)
  , Int2 (..)
  , Int3 (..)
  , Int4 (..)
  , Word1 (..)
  , Word2 (..)
  , Word3 (..)
  , Word4 (..)
  , Nat (..)
  , Nat1 (..)
  , Nat2 (..)
  , Nat3 (..)
  , Nat4 (..)
  , Nat5 (..)
  , Nat6 (..)
  , Nat7 (..)
  , Natural (..)

  -- ** Aliases to word types (deprecated)
  , UInt1
  , UInt2
  , UInt3
  , UInt4

  -- * Extreme Integers
  , X (..)
  , Xs (..)

  -- * List-wrapper types
  , NoDup (..)
  , Bag (..)
  , Set (..)
  , Map (..)

  -- * Character types
  , Space (..)
  , Lower (..)
  , Upper (..)
  , Alpha (..)
  , Digit (..)
  , AlphaNum (..)
  , Letter (..)

  -- * String types
  , Spaces (..)
  , Lowers (..)
  , Uppers (..)
  , Alphas (..)
  , Digits (..)
  , AlphaNums (..)
  , Letters (..)

  -- * Generic types
  , A, B, C, D, E, F
  )
where

import Test.LeanCheck (Listable(..), listIntegral)
import Test.LeanCheck.Core ((+|),cons1)
import Test.LeanCheck.Tiers (noDupListCons, setCons, bagCons, mapCons)
import Data.Ratio ((%))
import Data.Ix
#if __GLASGOW_HASKELL__ == 708
import Data.Typeable (Typeable)
#endif

narrowU :: Int -> Int -> Int
narrowU :: Int -> Int -> Int
narrowU Int
w Int
i  =  Int
i Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
2Int -> Int -> Int
forall a b. (Num a, Integral b) => a -> b -> a
^Int
w

narrowS :: Int -> Int -> Int
narrowS :: Int -> Int -> Int
narrowS Int
w Int
i  =  if Int
i' Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
2Int -> Int -> Int
forall a b. (Num a, Integral b) => a -> b -> a
^(Int
wInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)
                then Int
i'
                else Int
i' Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
l
                where
                l :: Int
l   =  Int
2Int -> Int -> Int
forall a b. (Num a, Integral b) => a -> b -> a
^Int
w
                i' :: Int
i'  =  Int
i Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
l


mapTuple :: (a -> b) -> (a,a) -> (b,b)
mapTuple :: forall a b. (a -> b) -> (a, a) -> (b, b)
mapTuple a -> b
f (a
x,a
y)  =  (a -> b
f a
x, a -> b
f a
y)

mapFst :: (a -> b) -> (a,c) -> (b,c)
mapFst :: forall a b c. (a -> b) -> (a, c) -> (b, c)
mapFst a -> b
f (a
x,c
y)  =  (a -> b
f a
x, c
y)

oNewtype :: (a -> b) -> (b -> a) -> (a -> a -> a) -> (b -> b -> b)
oNewtype :: forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype a -> b
con b -> a
des a -> a -> a
o  =  \b
x b
y -> a -> b
con (a -> b) -> a -> b
forall a b. (a -> b) -> a -> b
$ b -> a
des b
x a -> a -> a
`o` b -> a
des b
y

fNewtype :: (a -> b) -> (b -> a) -> (a -> a) -> (b -> b)
fNewtype :: forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype a -> b
con b -> a
des a -> a
f  =  a -> b
con (a -> b) -> (b -> a) -> b -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
f (a -> a) -> (b -> a) -> b -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> a
des

otNewtype :: (a -> b) -> (b -> a) -> (a -> a -> (a,a)) -> (b -> b -> (b,b))
otNewtype :: forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype a -> b
con b -> a
des a -> a -> (a, a)
o  =  \b
x b
y -> (a -> b) -> (a, a) -> (b, b)
forall a b. (a -> b) -> (a, a) -> (b, b)
mapTuple a -> b
con ((a, a) -> (b, b)) -> (a, a) -> (b, b)
forall a b. (a -> b) -> a -> b
$ b -> a
des b
x a -> a -> (a, a)
`o` b -> a
des b
y

readsPrecNewtype :: Read a => (a -> b) -> Int -> String -> [(b,String)]
readsPrecNewtype :: forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype a -> b
con Int
n  =  ((a, String) -> (b, String)) -> [(a, String)] -> [(b, String)]
forall a b. (a -> b) -> [a] -> [b]
map ((a -> b) -> (a, String) -> (b, String)
forall a b c. (a -> b) -> (a, c) -> (b, c)
mapFst a -> b
con) ([(a, String)] -> [(b, String)])
-> (String -> [(a, String)]) -> String -> [(b, String)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String -> [(a, String)]
forall a. Read a => Int -> ReadS a
readsPrec Int
n

boundedEnumFrom :: (Ord a,Bounded a,Enum a) => a -> [a]
boundedEnumFrom :: forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom a
x  =  [a
x..a
forall a. Bounded a => a
maxBound]

boundedEnumFromThen :: (Ord a,Bounded a,Enum a) => a -> a -> [a]
boundedEnumFromThen :: forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen a
x a
y  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
> a
y      =  [a
x,a
y..a
forall a. Bounded a => a
minBound]
                         | Bool
otherwise  =  [a
x,a
y..a
forall a. Bounded a => a
maxBound]

-- | Single-bit signed integers: -1, 0
newtype Int1  =  Int1 { Int1 -> Int
unInt1 :: Int }  deriving (Int1 -> Int1 -> Bool
(Int1 -> Int1 -> Bool) -> (Int1 -> Int1 -> Bool) -> Eq Int1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Int1 -> Int1 -> Bool
== :: Int1 -> Int1 -> Bool
$c/= :: Int1 -> Int1 -> Bool
/= :: Int1 -> Int1 -> Bool
Eq, Eq Int1
Eq Int1 =>
(Int1 -> Int1 -> Ordering)
-> (Int1 -> Int1 -> Bool)
-> (Int1 -> Int1 -> Bool)
-> (Int1 -> Int1 -> Bool)
-> (Int1 -> Int1 -> Bool)
-> (Int1 -> Int1 -> Int1)
-> (Int1 -> Int1 -> Int1)
-> Ord Int1
Int1 -> Int1 -> Bool
Int1 -> Int1 -> Ordering
Int1 -> Int1 -> Int1
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Int1 -> Int1 -> Ordering
compare :: Int1 -> Int1 -> Ordering
$c< :: Int1 -> Int1 -> Bool
< :: Int1 -> Int1 -> Bool
$c<= :: Int1 -> Int1 -> Bool
<= :: Int1 -> Int1 -> Bool
$c> :: Int1 -> Int1 -> Bool
> :: Int1 -> Int1 -> Bool
$c>= :: Int1 -> Int1 -> Bool
>= :: Int1 -> Int1 -> Bool
$cmax :: Int1 -> Int1 -> Int1
max :: Int1 -> Int1 -> Int1
$cmin :: Int1 -> Int1 -> Int1
min :: Int1 -> Int1 -> Int1
Ord)

-- | Two-bit signed integers: -2, -1, 0, 1
newtype Int2  =  Int2 { Int2 -> Int
unInt2 :: Int }  deriving (Int2 -> Int2 -> Bool
(Int2 -> Int2 -> Bool) -> (Int2 -> Int2 -> Bool) -> Eq Int2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Int2 -> Int2 -> Bool
== :: Int2 -> Int2 -> Bool
$c/= :: Int2 -> Int2 -> Bool
/= :: Int2 -> Int2 -> Bool
Eq, Eq Int2
Eq Int2 =>
(Int2 -> Int2 -> Ordering)
-> (Int2 -> Int2 -> Bool)
-> (Int2 -> Int2 -> Bool)
-> (Int2 -> Int2 -> Bool)
-> (Int2 -> Int2 -> Bool)
-> (Int2 -> Int2 -> Int2)
-> (Int2 -> Int2 -> Int2)
-> Ord Int2
Int2 -> Int2 -> Bool
Int2 -> Int2 -> Ordering
Int2 -> Int2 -> Int2
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Int2 -> Int2 -> Ordering
compare :: Int2 -> Int2 -> Ordering
$c< :: Int2 -> Int2 -> Bool
< :: Int2 -> Int2 -> Bool
$c<= :: Int2 -> Int2 -> Bool
<= :: Int2 -> Int2 -> Bool
$c> :: Int2 -> Int2 -> Bool
> :: Int2 -> Int2 -> Bool
$c>= :: Int2 -> Int2 -> Bool
>= :: Int2 -> Int2 -> Bool
$cmax :: Int2 -> Int2 -> Int2
max :: Int2 -> Int2 -> Int2
$cmin :: Int2 -> Int2 -> Int2
min :: Int2 -> Int2 -> Int2
Ord)

-- | Three-bit signed integers: -4, -3, -2, -1, 0, 1, 2, 3
newtype Int3  =  Int3 { Int3 -> Int
unInt3 :: Int }  deriving  (Int3 -> Int3 -> Bool
(Int3 -> Int3 -> Bool) -> (Int3 -> Int3 -> Bool) -> Eq Int3
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Int3 -> Int3 -> Bool
== :: Int3 -> Int3 -> Bool
$c/= :: Int3 -> Int3 -> Bool
/= :: Int3 -> Int3 -> Bool
Eq, Eq Int3
Eq Int3 =>
(Int3 -> Int3 -> Ordering)
-> (Int3 -> Int3 -> Bool)
-> (Int3 -> Int3 -> Bool)
-> (Int3 -> Int3 -> Bool)
-> (Int3 -> Int3 -> Bool)
-> (Int3 -> Int3 -> Int3)
-> (Int3 -> Int3 -> Int3)
-> Ord Int3
Int3 -> Int3 -> Bool
Int3 -> Int3 -> Ordering
Int3 -> Int3 -> Int3
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Int3 -> Int3 -> Ordering
compare :: Int3 -> Int3 -> Ordering
$c< :: Int3 -> Int3 -> Bool
< :: Int3 -> Int3 -> Bool
$c<= :: Int3 -> Int3 -> Bool
<= :: Int3 -> Int3 -> Bool
$c> :: Int3 -> Int3 -> Bool
> :: Int3 -> Int3 -> Bool
$c>= :: Int3 -> Int3 -> Bool
>= :: Int3 -> Int3 -> Bool
$cmax :: Int3 -> Int3 -> Int3
max :: Int3 -> Int3 -> Int3
$cmin :: Int3 -> Int3 -> Int3
min :: Int3 -> Int3 -> Int3
Ord)

-- | Four-bit signed integers:
-- -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7
newtype Int4  =  Int4 { Int4 -> Int
unInt4 :: Int }  deriving (Int4 -> Int4 -> Bool
(Int4 -> Int4 -> Bool) -> (Int4 -> Int4 -> Bool) -> Eq Int4
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Int4 -> Int4 -> Bool
== :: Int4 -> Int4 -> Bool
$c/= :: Int4 -> Int4 -> Bool
/= :: Int4 -> Int4 -> Bool
Eq, Eq Int4
Eq Int4 =>
(Int4 -> Int4 -> Ordering)
-> (Int4 -> Int4 -> Bool)
-> (Int4 -> Int4 -> Bool)
-> (Int4 -> Int4 -> Bool)
-> (Int4 -> Int4 -> Bool)
-> (Int4 -> Int4 -> Int4)
-> (Int4 -> Int4 -> Int4)
-> Ord Int4
Int4 -> Int4 -> Bool
Int4 -> Int4 -> Ordering
Int4 -> Int4 -> Int4
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Int4 -> Int4 -> Ordering
compare :: Int4 -> Int4 -> Ordering
$c< :: Int4 -> Int4 -> Bool
< :: Int4 -> Int4 -> Bool
$c<= :: Int4 -> Int4 -> Bool
<= :: Int4 -> Int4 -> Bool
$c> :: Int4 -> Int4 -> Bool
> :: Int4 -> Int4 -> Bool
$c>= :: Int4 -> Int4 -> Bool
>= :: Int4 -> Int4 -> Bool
$cmax :: Int4 -> Int4 -> Int4
max :: Int4 -> Int4 -> Int4
$cmin :: Int4 -> Int4 -> Int4
min :: Int4 -> Int4 -> Int4
Ord)

-- | Single-bit unsigned integer: 0, 1
newtype Word1  =  Word1 { Word1 -> Int
unWord1 :: Int }  deriving (Word1 -> Word1 -> Bool
(Word1 -> Word1 -> Bool) -> (Word1 -> Word1 -> Bool) -> Eq Word1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Word1 -> Word1 -> Bool
== :: Word1 -> Word1 -> Bool
$c/= :: Word1 -> Word1 -> Bool
/= :: Word1 -> Word1 -> Bool
Eq, Eq Word1
Eq Word1 =>
(Word1 -> Word1 -> Ordering)
-> (Word1 -> Word1 -> Bool)
-> (Word1 -> Word1 -> Bool)
-> (Word1 -> Word1 -> Bool)
-> (Word1 -> Word1 -> Bool)
-> (Word1 -> Word1 -> Word1)
-> (Word1 -> Word1 -> Word1)
-> Ord Word1
Word1 -> Word1 -> Bool
Word1 -> Word1 -> Ordering
Word1 -> Word1 -> Word1
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Word1 -> Word1 -> Ordering
compare :: Word1 -> Word1 -> Ordering
$c< :: Word1 -> Word1 -> Bool
< :: Word1 -> Word1 -> Bool
$c<= :: Word1 -> Word1 -> Bool
<= :: Word1 -> Word1 -> Bool
$c> :: Word1 -> Word1 -> Bool
> :: Word1 -> Word1 -> Bool
$c>= :: Word1 -> Word1 -> Bool
>= :: Word1 -> Word1 -> Bool
$cmax :: Word1 -> Word1 -> Word1
max :: Word1 -> Word1 -> Word1
$cmin :: Word1 -> Word1 -> Word1
min :: Word1 -> Word1 -> Word1
Ord)

-- | Two-bit unsigned integers: 0, 1, 2, 3
newtype Word2  =  Word2 { Word2 -> Int
unWord2 :: Int }  deriving (Word2 -> Word2 -> Bool
(Word2 -> Word2 -> Bool) -> (Word2 -> Word2 -> Bool) -> Eq Word2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Word2 -> Word2 -> Bool
== :: Word2 -> Word2 -> Bool
$c/= :: Word2 -> Word2 -> Bool
/= :: Word2 -> Word2 -> Bool
Eq, Eq Word2
Eq Word2 =>
(Word2 -> Word2 -> Ordering)
-> (Word2 -> Word2 -> Bool)
-> (Word2 -> Word2 -> Bool)
-> (Word2 -> Word2 -> Bool)
-> (Word2 -> Word2 -> Bool)
-> (Word2 -> Word2 -> Word2)
-> (Word2 -> Word2 -> Word2)
-> Ord Word2
Word2 -> Word2 -> Bool
Word2 -> Word2 -> Ordering
Word2 -> Word2 -> Word2
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Word2 -> Word2 -> Ordering
compare :: Word2 -> Word2 -> Ordering
$c< :: Word2 -> Word2 -> Bool
< :: Word2 -> Word2 -> Bool
$c<= :: Word2 -> Word2 -> Bool
<= :: Word2 -> Word2 -> Bool
$c> :: Word2 -> Word2 -> Bool
> :: Word2 -> Word2 -> Bool
$c>= :: Word2 -> Word2 -> Bool
>= :: Word2 -> Word2 -> Bool
$cmax :: Word2 -> Word2 -> Word2
max :: Word2 -> Word2 -> Word2
$cmin :: Word2 -> Word2 -> Word2
min :: Word2 -> Word2 -> Word2
Ord)

-- | Three-bit unsigned integers: 0, 1, 2, 3, 4, 5, 6, 7
newtype Word3  =  Word3 { Word3 -> Int
unWord3 :: Int }  deriving (Word3 -> Word3 -> Bool
(Word3 -> Word3 -> Bool) -> (Word3 -> Word3 -> Bool) -> Eq Word3
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Word3 -> Word3 -> Bool
== :: Word3 -> Word3 -> Bool
$c/= :: Word3 -> Word3 -> Bool
/= :: Word3 -> Word3 -> Bool
Eq, Eq Word3
Eq Word3 =>
(Word3 -> Word3 -> Ordering)
-> (Word3 -> Word3 -> Bool)
-> (Word3 -> Word3 -> Bool)
-> (Word3 -> Word3 -> Bool)
-> (Word3 -> Word3 -> Bool)
-> (Word3 -> Word3 -> Word3)
-> (Word3 -> Word3 -> Word3)
-> Ord Word3
Word3 -> Word3 -> Bool
Word3 -> Word3 -> Ordering
Word3 -> Word3 -> Word3
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Word3 -> Word3 -> Ordering
compare :: Word3 -> Word3 -> Ordering
$c< :: Word3 -> Word3 -> Bool
< :: Word3 -> Word3 -> Bool
$c<= :: Word3 -> Word3 -> Bool
<= :: Word3 -> Word3 -> Bool
$c> :: Word3 -> Word3 -> Bool
> :: Word3 -> Word3 -> Bool
$c>= :: Word3 -> Word3 -> Bool
>= :: Word3 -> Word3 -> Bool
$cmax :: Word3 -> Word3 -> Word3
max :: Word3 -> Word3 -> Word3
$cmin :: Word3 -> Word3 -> Word3
min :: Word3 -> Word3 -> Word3
Ord)

-- | Four-bit unsigned integers:
-- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
newtype Word4  =  Word4 { Word4 -> Int
unWord4 :: Int }  deriving (Word4 -> Word4 -> Bool
(Word4 -> Word4 -> Bool) -> (Word4 -> Word4 -> Bool) -> Eq Word4
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Word4 -> Word4 -> Bool
== :: Word4 -> Word4 -> Bool
$c/= :: Word4 -> Word4 -> Bool
/= :: Word4 -> Word4 -> Bool
Eq, Eq Word4
Eq Word4 =>
(Word4 -> Word4 -> Ordering)
-> (Word4 -> Word4 -> Bool)
-> (Word4 -> Word4 -> Bool)
-> (Word4 -> Word4 -> Bool)
-> (Word4 -> Word4 -> Bool)
-> (Word4 -> Word4 -> Word4)
-> (Word4 -> Word4 -> Word4)
-> Ord Word4
Word4 -> Word4 -> Bool
Word4 -> Word4 -> Ordering
Word4 -> Word4 -> Word4
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Word4 -> Word4 -> Ordering
compare :: Word4 -> Word4 -> Ordering
$c< :: Word4 -> Word4 -> Bool
< :: Word4 -> Word4 -> Bool
$c<= :: Word4 -> Word4 -> Bool
<= :: Word4 -> Word4 -> Bool
$c> :: Word4 -> Word4 -> Bool
> :: Word4 -> Word4 -> Bool
$c>= :: Word4 -> Word4 -> Bool
>= :: Word4 -> Word4 -> Bool
$cmax :: Word4 -> Word4 -> Word4
max :: Word4 -> Word4 -> Word4
$cmin :: Word4 -> Word4 -> Word4
min :: Word4 -> Word4 -> Word4
Ord)

-- | Natural numbers (including 0): 0, 1, 2, 3, 4, 5, 6, 7, ...
--
-- Internally, this type is represented as an 'Integer'
-- allowing for an infinity of possible values.
--
-- Its 'Enum', 'Listable' and 'Num' instances only produce non-negative values.
-- When @x < y@ then @x - y = 0@.
newtype Natural  =  Natural { Natural -> Integer
unNatural :: Integer }  deriving (Natural -> Natural -> Bool
(Natural -> Natural -> Bool)
-> (Natural -> Natural -> Bool) -> Eq Natural
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Natural -> Natural -> Bool
== :: Natural -> Natural -> Bool
$c/= :: Natural -> Natural -> Bool
/= :: Natural -> Natural -> Bool
Eq, Eq Natural
Eq Natural =>
(Natural -> Natural -> Ordering)
-> (Natural -> Natural -> Bool)
-> (Natural -> Natural -> Bool)
-> (Natural -> Natural -> Bool)
-> (Natural -> Natural -> Bool)
-> (Natural -> Natural -> Natural)
-> (Natural -> Natural -> Natural)
-> Ord Natural
Natural -> Natural -> Bool
Natural -> Natural -> Ordering
Natural -> Natural -> Natural
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Natural -> Natural -> Ordering
compare :: Natural -> Natural -> Ordering
$c< :: Natural -> Natural -> Bool
< :: Natural -> Natural -> Bool
$c<= :: Natural -> Natural -> Bool
<= :: Natural -> Natural -> Bool
$c> :: Natural -> Natural -> Bool
> :: Natural -> Natural -> Bool
$c>= :: Natural -> Natural -> Bool
>= :: Natural -> Natural -> Bool
$cmax :: Natural -> Natural -> Natural
max :: Natural -> Natural -> Natural
$cmin :: Natural -> Natural -> Natural
min :: Natural -> Natural -> Natural
Ord)

-- | Natural numbers (including 0): 0, 1, 2, 3, 4, 5, 6, 7, ...
--
-- Internally, this type is represented as an 'Int'.
-- So, it is limited by the 'maxBound' of 'Int'.
--
-- Its 'Enum', 'Listable' and 'Num' instances only produce non-negative values.
-- When @x < y@ then @x - y = 0@.
newtype Nat  =  Nat { Nat -> Int
unNat :: Int }  deriving (Nat -> Nat -> Bool
(Nat -> Nat -> Bool) -> (Nat -> Nat -> Bool) -> Eq Nat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat -> Nat -> Bool
== :: Nat -> Nat -> Bool
$c/= :: Nat -> Nat -> Bool
/= :: Nat -> Nat -> Bool
Eq, Eq Nat
Eq Nat =>
(Nat -> Nat -> Ordering)
-> (Nat -> Nat -> Bool)
-> (Nat -> Nat -> Bool)
-> (Nat -> Nat -> Bool)
-> (Nat -> Nat -> Bool)
-> (Nat -> Nat -> Nat)
-> (Nat -> Nat -> Nat)
-> Ord Nat
Nat -> Nat -> Bool
Nat -> Nat -> Ordering
Nat -> Nat -> Nat
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat -> Nat -> Ordering
compare :: Nat -> Nat -> Ordering
$c< :: Nat -> Nat -> Bool
< :: Nat -> Nat -> Bool
$c<= :: Nat -> Nat -> Bool
<= :: Nat -> Nat -> Bool
$c> :: Nat -> Nat -> Bool
> :: Nat -> Nat -> Bool
$c>= :: Nat -> Nat -> Bool
>= :: Nat -> Nat -> Bool
$cmax :: Nat -> Nat -> Nat
max :: Nat -> Nat -> Nat
$cmin :: Nat -> Nat -> Nat
min :: Nat -> Nat -> Nat
Ord)

-- | Natural numbers modulo 1: 0
newtype Nat1  =  Nat1 { Nat1 -> Int
unNat1 :: Int }  deriving (Nat1 -> Nat1 -> Bool
(Nat1 -> Nat1 -> Bool) -> (Nat1 -> Nat1 -> Bool) -> Eq Nat1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat1 -> Nat1 -> Bool
== :: Nat1 -> Nat1 -> Bool
$c/= :: Nat1 -> Nat1 -> Bool
/= :: Nat1 -> Nat1 -> Bool
Eq, Eq Nat1
Eq Nat1 =>
(Nat1 -> Nat1 -> Ordering)
-> (Nat1 -> Nat1 -> Bool)
-> (Nat1 -> Nat1 -> Bool)
-> (Nat1 -> Nat1 -> Bool)
-> (Nat1 -> Nat1 -> Bool)
-> (Nat1 -> Nat1 -> Nat1)
-> (Nat1 -> Nat1 -> Nat1)
-> Ord Nat1
Nat1 -> Nat1 -> Bool
Nat1 -> Nat1 -> Ordering
Nat1 -> Nat1 -> Nat1
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat1 -> Nat1 -> Ordering
compare :: Nat1 -> Nat1 -> Ordering
$c< :: Nat1 -> Nat1 -> Bool
< :: Nat1 -> Nat1 -> Bool
$c<= :: Nat1 -> Nat1 -> Bool
<= :: Nat1 -> Nat1 -> Bool
$c> :: Nat1 -> Nat1 -> Bool
> :: Nat1 -> Nat1 -> Bool
$c>= :: Nat1 -> Nat1 -> Bool
>= :: Nat1 -> Nat1 -> Bool
$cmax :: Nat1 -> Nat1 -> Nat1
max :: Nat1 -> Nat1 -> Nat1
$cmin :: Nat1 -> Nat1 -> Nat1
min :: Nat1 -> Nat1 -> Nat1
Ord)

-- | Natural numbers modulo 2: 0, 1
newtype Nat2  =  Nat2 { Nat2 -> Int
unNat2 :: Int }  deriving (Nat2 -> Nat2 -> Bool
(Nat2 -> Nat2 -> Bool) -> (Nat2 -> Nat2 -> Bool) -> Eq Nat2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat2 -> Nat2 -> Bool
== :: Nat2 -> Nat2 -> Bool
$c/= :: Nat2 -> Nat2 -> Bool
/= :: Nat2 -> Nat2 -> Bool
Eq, Eq Nat2
Eq Nat2 =>
(Nat2 -> Nat2 -> Ordering)
-> (Nat2 -> Nat2 -> Bool)
-> (Nat2 -> Nat2 -> Bool)
-> (Nat2 -> Nat2 -> Bool)
-> (Nat2 -> Nat2 -> Bool)
-> (Nat2 -> Nat2 -> Nat2)
-> (Nat2 -> Nat2 -> Nat2)
-> Ord Nat2
Nat2 -> Nat2 -> Bool
Nat2 -> Nat2 -> Ordering
Nat2 -> Nat2 -> Nat2
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat2 -> Nat2 -> Ordering
compare :: Nat2 -> Nat2 -> Ordering
$c< :: Nat2 -> Nat2 -> Bool
< :: Nat2 -> Nat2 -> Bool
$c<= :: Nat2 -> Nat2 -> Bool
<= :: Nat2 -> Nat2 -> Bool
$c> :: Nat2 -> Nat2 -> Bool
> :: Nat2 -> Nat2 -> Bool
$c>= :: Nat2 -> Nat2 -> Bool
>= :: Nat2 -> Nat2 -> Bool
$cmax :: Nat2 -> Nat2 -> Nat2
max :: Nat2 -> Nat2 -> Nat2
$cmin :: Nat2 -> Nat2 -> Nat2
min :: Nat2 -> Nat2 -> Nat2
Ord)

-- | Natural numbers modulo 3: 0, 1, 2
newtype Nat3  =  Nat3 { Nat3 -> Int
unNat3 :: Int }  deriving (Nat3 -> Nat3 -> Bool
(Nat3 -> Nat3 -> Bool) -> (Nat3 -> Nat3 -> Bool) -> Eq Nat3
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat3 -> Nat3 -> Bool
== :: Nat3 -> Nat3 -> Bool
$c/= :: Nat3 -> Nat3 -> Bool
/= :: Nat3 -> Nat3 -> Bool
Eq, Eq Nat3
Eq Nat3 =>
(Nat3 -> Nat3 -> Ordering)
-> (Nat3 -> Nat3 -> Bool)
-> (Nat3 -> Nat3 -> Bool)
-> (Nat3 -> Nat3 -> Bool)
-> (Nat3 -> Nat3 -> Bool)
-> (Nat3 -> Nat3 -> Nat3)
-> (Nat3 -> Nat3 -> Nat3)
-> Ord Nat3
Nat3 -> Nat3 -> Bool
Nat3 -> Nat3 -> Ordering
Nat3 -> Nat3 -> Nat3
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat3 -> Nat3 -> Ordering
compare :: Nat3 -> Nat3 -> Ordering
$c< :: Nat3 -> Nat3 -> Bool
< :: Nat3 -> Nat3 -> Bool
$c<= :: Nat3 -> Nat3 -> Bool
<= :: Nat3 -> Nat3 -> Bool
$c> :: Nat3 -> Nat3 -> Bool
> :: Nat3 -> Nat3 -> Bool
$c>= :: Nat3 -> Nat3 -> Bool
>= :: Nat3 -> Nat3 -> Bool
$cmax :: Nat3 -> Nat3 -> Nat3
max :: Nat3 -> Nat3 -> Nat3
$cmin :: Nat3 -> Nat3 -> Nat3
min :: Nat3 -> Nat3 -> Nat3
Ord)

-- | Natural numbers modulo 4: 0, 1, 2, 3
newtype Nat4  =  Nat4 { Nat4 -> Int
unNat4 :: Int }  deriving (Nat4 -> Nat4 -> Bool
(Nat4 -> Nat4 -> Bool) -> (Nat4 -> Nat4 -> Bool) -> Eq Nat4
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat4 -> Nat4 -> Bool
== :: Nat4 -> Nat4 -> Bool
$c/= :: Nat4 -> Nat4 -> Bool
/= :: Nat4 -> Nat4 -> Bool
Eq, Eq Nat4
Eq Nat4 =>
(Nat4 -> Nat4 -> Ordering)
-> (Nat4 -> Nat4 -> Bool)
-> (Nat4 -> Nat4 -> Bool)
-> (Nat4 -> Nat4 -> Bool)
-> (Nat4 -> Nat4 -> Bool)
-> (Nat4 -> Nat4 -> Nat4)
-> (Nat4 -> Nat4 -> Nat4)
-> Ord Nat4
Nat4 -> Nat4 -> Bool
Nat4 -> Nat4 -> Ordering
Nat4 -> Nat4 -> Nat4
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat4 -> Nat4 -> Ordering
compare :: Nat4 -> Nat4 -> Ordering
$c< :: Nat4 -> Nat4 -> Bool
< :: Nat4 -> Nat4 -> Bool
$c<= :: Nat4 -> Nat4 -> Bool
<= :: Nat4 -> Nat4 -> Bool
$c> :: Nat4 -> Nat4 -> Bool
> :: Nat4 -> Nat4 -> Bool
$c>= :: Nat4 -> Nat4 -> Bool
>= :: Nat4 -> Nat4 -> Bool
$cmax :: Nat4 -> Nat4 -> Nat4
max :: Nat4 -> Nat4 -> Nat4
$cmin :: Nat4 -> Nat4 -> Nat4
min :: Nat4 -> Nat4 -> Nat4
Ord)

-- | Natural numbers modulo 5: 0, 1, 2, 3, 4
newtype Nat5  =  Nat5 { Nat5 -> Int
unNat5 :: Int }  deriving (Nat5 -> Nat5 -> Bool
(Nat5 -> Nat5 -> Bool) -> (Nat5 -> Nat5 -> Bool) -> Eq Nat5
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat5 -> Nat5 -> Bool
== :: Nat5 -> Nat5 -> Bool
$c/= :: Nat5 -> Nat5 -> Bool
/= :: Nat5 -> Nat5 -> Bool
Eq, Eq Nat5
Eq Nat5 =>
(Nat5 -> Nat5 -> Ordering)
-> (Nat5 -> Nat5 -> Bool)
-> (Nat5 -> Nat5 -> Bool)
-> (Nat5 -> Nat5 -> Bool)
-> (Nat5 -> Nat5 -> Bool)
-> (Nat5 -> Nat5 -> Nat5)
-> (Nat5 -> Nat5 -> Nat5)
-> Ord Nat5
Nat5 -> Nat5 -> Bool
Nat5 -> Nat5 -> Ordering
Nat5 -> Nat5 -> Nat5
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat5 -> Nat5 -> Ordering
compare :: Nat5 -> Nat5 -> Ordering
$c< :: Nat5 -> Nat5 -> Bool
< :: Nat5 -> Nat5 -> Bool
$c<= :: Nat5 -> Nat5 -> Bool
<= :: Nat5 -> Nat5 -> Bool
$c> :: Nat5 -> Nat5 -> Bool
> :: Nat5 -> Nat5 -> Bool
$c>= :: Nat5 -> Nat5 -> Bool
>= :: Nat5 -> Nat5 -> Bool
$cmax :: Nat5 -> Nat5 -> Nat5
max :: Nat5 -> Nat5 -> Nat5
$cmin :: Nat5 -> Nat5 -> Nat5
min :: Nat5 -> Nat5 -> Nat5
Ord)

-- | Natural numbers modulo 6: 0, 1, 2, 3, 4, 5
newtype Nat6  =  Nat6 { Nat6 -> Int
unNat6 :: Int }  deriving (Nat6 -> Nat6 -> Bool
(Nat6 -> Nat6 -> Bool) -> (Nat6 -> Nat6 -> Bool) -> Eq Nat6
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat6 -> Nat6 -> Bool
== :: Nat6 -> Nat6 -> Bool
$c/= :: Nat6 -> Nat6 -> Bool
/= :: Nat6 -> Nat6 -> Bool
Eq, Eq Nat6
Eq Nat6 =>
(Nat6 -> Nat6 -> Ordering)
-> (Nat6 -> Nat6 -> Bool)
-> (Nat6 -> Nat6 -> Bool)
-> (Nat6 -> Nat6 -> Bool)
-> (Nat6 -> Nat6 -> Bool)
-> (Nat6 -> Nat6 -> Nat6)
-> (Nat6 -> Nat6 -> Nat6)
-> Ord Nat6
Nat6 -> Nat6 -> Bool
Nat6 -> Nat6 -> Ordering
Nat6 -> Nat6 -> Nat6
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat6 -> Nat6 -> Ordering
compare :: Nat6 -> Nat6 -> Ordering
$c< :: Nat6 -> Nat6 -> Bool
< :: Nat6 -> Nat6 -> Bool
$c<= :: Nat6 -> Nat6 -> Bool
<= :: Nat6 -> Nat6 -> Bool
$c> :: Nat6 -> Nat6 -> Bool
> :: Nat6 -> Nat6 -> Bool
$c>= :: Nat6 -> Nat6 -> Bool
>= :: Nat6 -> Nat6 -> Bool
$cmax :: Nat6 -> Nat6 -> Nat6
max :: Nat6 -> Nat6 -> Nat6
$cmin :: Nat6 -> Nat6 -> Nat6
min :: Nat6 -> Nat6 -> Nat6
Ord)

-- | Natural numbers modulo 7: 0, 1, 2, 3, 4, 5, 6
newtype Nat7  =  Nat7 { Nat7 -> Int
unNat7 :: Int }  deriving (Nat7 -> Nat7 -> Bool
(Nat7 -> Nat7 -> Bool) -> (Nat7 -> Nat7 -> Bool) -> Eq Nat7
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nat7 -> Nat7 -> Bool
== :: Nat7 -> Nat7 -> Bool
$c/= :: Nat7 -> Nat7 -> Bool
/= :: Nat7 -> Nat7 -> Bool
Eq, Eq Nat7
Eq Nat7 =>
(Nat7 -> Nat7 -> Ordering)
-> (Nat7 -> Nat7 -> Bool)
-> (Nat7 -> Nat7 -> Bool)
-> (Nat7 -> Nat7 -> Bool)
-> (Nat7 -> Nat7 -> Bool)
-> (Nat7 -> Nat7 -> Nat7)
-> (Nat7 -> Nat7 -> Nat7)
-> Ord Nat7
Nat7 -> Nat7 -> Bool
Nat7 -> Nat7 -> Ordering
Nat7 -> Nat7 -> Nat7
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Nat7 -> Nat7 -> Ordering
compare :: Nat7 -> Nat7 -> Ordering
$c< :: Nat7 -> Nat7 -> Bool
< :: Nat7 -> Nat7 -> Bool
$c<= :: Nat7 -> Nat7 -> Bool
<= :: Nat7 -> Nat7 -> Bool
$c> :: Nat7 -> Nat7 -> Bool
> :: Nat7 -> Nat7 -> Bool
$c>= :: Nat7 -> Nat7 -> Bool
>= :: Nat7 -> Nat7 -> Bool
$cmax :: Nat7 -> Nat7 -> Nat7
max :: Nat7 -> Nat7 -> Nat7
$cmin :: Nat7 -> Nat7 -> Nat7
min :: Nat7 -> Nat7 -> Nat7
Ord)

-- | Generic type 'A'.
--
-- Can be used to test polymorphic functions with a type variable
-- such as 'take' or 'sort':
--
-- > take :: Int -> [a] -> [a]
-- > sort :: Ord a => [a] -> [a]
--
-- by binding them to the following types:
--
-- > take :: Int -> [A] -> [A]
-- > sort :: [A] -> [A]
--
-- This type is homomorphic to 'Nat6', 'B', 'C', 'D', 'E' and 'F'.
--
-- It is instance to several typeclasses so that it can be used
-- to test functions with type contexts.
newtype A  =  A Int  deriving (A -> A -> Bool
(A -> A -> Bool) -> (A -> A -> Bool) -> Eq A
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: A -> A -> Bool
== :: A -> A -> Bool
$c/= :: A -> A -> Bool
/= :: A -> A -> Bool
Eq, Eq A
Eq A =>
(A -> A -> Ordering)
-> (A -> A -> Bool)
-> (A -> A -> Bool)
-> (A -> A -> Bool)
-> (A -> A -> Bool)
-> (A -> A -> A)
-> (A -> A -> A)
-> Ord A
A -> A -> Bool
A -> A -> Ordering
A -> A -> A
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: A -> A -> Ordering
compare :: A -> A -> Ordering
$c< :: A -> A -> Bool
< :: A -> A -> Bool
$c<= :: A -> A -> Bool
<= :: A -> A -> Bool
$c> :: A -> A -> Bool
> :: A -> A -> Bool
$c>= :: A -> A -> Bool
>= :: A -> A -> Bool
$cmax :: A -> A -> A
max :: A -> A -> A
$cmin :: A -> A -> A
min :: A -> A -> A
Ord)

-- | Generic type 'B'.
--
-- Can be used to test polymorphic functions with two type variables
-- such as 'map' or 'foldr':
--
-- > map :: (a -> b) -> [a] -> [b]
-- > foldr :: (a -> b -> b) -> b -> [a] -> b
--
-- by binding them to the following types:
--
-- > map :: (A -> B) -> [A] -> [B]
-- > foldr :: (A -> B -> B) -> B -> [A] -> B
--
-- This type is homomorphic to 'A', 'Nat6', 'C', 'D', 'E' and 'F'.
newtype B  =  B Int  deriving (B -> B -> Bool
(B -> B -> Bool) -> (B -> B -> Bool) -> Eq B
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: B -> B -> Bool
== :: B -> B -> Bool
$c/= :: B -> B -> Bool
/= :: B -> B -> Bool
Eq, Eq B
Eq B =>
(B -> B -> Ordering)
-> (B -> B -> Bool)
-> (B -> B -> Bool)
-> (B -> B -> Bool)
-> (B -> B -> Bool)
-> (B -> B -> B)
-> (B -> B -> B)
-> Ord B
B -> B -> Bool
B -> B -> Ordering
B -> B -> B
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: B -> B -> Ordering
compare :: B -> B -> Ordering
$c< :: B -> B -> Bool
< :: B -> B -> Bool
$c<= :: B -> B -> Bool
<= :: B -> B -> Bool
$c> :: B -> B -> Bool
> :: B -> B -> Bool
$c>= :: B -> B -> Bool
>= :: B -> B -> Bool
$cmax :: B -> B -> B
max :: B -> B -> B
$cmin :: B -> B -> B
min :: B -> B -> B
Ord)

-- | Generic type 'C'.
--
-- Can be used to test polymorphic functions with three type variables
-- such as 'uncurry' or 'zipWith':
--
-- > uncurry :: (a -> b -> c) -> (a, b) -> c
-- > zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
--
-- by binding them to the following types:
--
-- > uncurry :: (A -> B -> C) -> (A, B) -> C
-- > zipWith :: (A -> B -> C) -> [A] -> [B] -> [C]
--
-- This type is homomorphic to 'A', 'B', 'Nat6', 'D', 'E' and 'F'.
newtype C  =  C Int  deriving (C -> C -> Bool
(C -> C -> Bool) -> (C -> C -> Bool) -> Eq C
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: C -> C -> Bool
== :: C -> C -> Bool
$c/= :: C -> C -> Bool
/= :: C -> C -> Bool
Eq, Eq C
Eq C =>
(C -> C -> Ordering)
-> (C -> C -> Bool)
-> (C -> C -> Bool)
-> (C -> C -> Bool)
-> (C -> C -> Bool)
-> (C -> C -> C)
-> (C -> C -> C)
-> Ord C
C -> C -> Bool
C -> C -> Ordering
C -> C -> C
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: C -> C -> Ordering
compare :: C -> C -> Ordering
$c< :: C -> C -> Bool
< :: C -> C -> Bool
$c<= :: C -> C -> Bool
<= :: C -> C -> Bool
$c> :: C -> C -> Bool
> :: C -> C -> Bool
$c>= :: C -> C -> Bool
>= :: C -> C -> Bool
$cmax :: C -> C -> C
max :: C -> C -> C
$cmin :: C -> C -> C
min :: C -> C -> C
Ord)

-- | Generic type 'D'.
--
-- Can be used to test polymorphic functions with four type variables.
--
-- This type is homomorphic to 'A', 'B', 'C', 'Nat6', 'E' and 'F'.
newtype D  =  D Int  deriving (D -> D -> Bool
(D -> D -> Bool) -> (D -> D -> Bool) -> Eq D
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: D -> D -> Bool
== :: D -> D -> Bool
$c/= :: D -> D -> Bool
/= :: D -> D -> Bool
Eq, Eq D
Eq D =>
(D -> D -> Ordering)
-> (D -> D -> Bool)
-> (D -> D -> Bool)
-> (D -> D -> Bool)
-> (D -> D -> Bool)
-> (D -> D -> D)
-> (D -> D -> D)
-> Ord D
D -> D -> Bool
D -> D -> Ordering
D -> D -> D
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: D -> D -> Ordering
compare :: D -> D -> Ordering
$c< :: D -> D -> Bool
< :: D -> D -> Bool
$c<= :: D -> D -> Bool
<= :: D -> D -> Bool
$c> :: D -> D -> Bool
> :: D -> D -> Bool
$c>= :: D -> D -> Bool
>= :: D -> D -> Bool
$cmax :: D -> D -> D
max :: D -> D -> D
$cmin :: D -> D -> D
min :: D -> D -> D
Ord)

-- | Generic type 'E'.
--
-- Can be used to test polymorphic functions with five type variables.
--
-- This type is homomorphic to 'A', 'B', 'C', 'D', 'Nat6' and 'F'.
newtype E  =  E Int  deriving (E -> E -> Bool
(E -> E -> Bool) -> (E -> E -> Bool) -> Eq E
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E -> E -> Bool
== :: E -> E -> Bool
$c/= :: E -> E -> Bool
/= :: E -> E -> Bool
Eq, Eq E
Eq E =>
(E -> E -> Ordering)
-> (E -> E -> Bool)
-> (E -> E -> Bool)
-> (E -> E -> Bool)
-> (E -> E -> Bool)
-> (E -> E -> E)
-> (E -> E -> E)
-> Ord E
E -> E -> Bool
E -> E -> Ordering
E -> E -> E
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: E -> E -> Ordering
compare :: E -> E -> Ordering
$c< :: E -> E -> Bool
< :: E -> E -> Bool
$c<= :: E -> E -> Bool
<= :: E -> E -> Bool
$c> :: E -> E -> Bool
> :: E -> E -> Bool
$c>= :: E -> E -> Bool
>= :: E -> E -> Bool
$cmax :: E -> E -> E
max :: E -> E -> E
$cmin :: E -> E -> E
min :: E -> E -> E
Ord)

-- | Generic type 'F'.
--
-- Can be used to test polymorphic functions with five type variables.
--
-- This type is homomorphic to 'A', 'B', 'C', 'D', 'E' and 'Nat6'.
newtype F  =  F Int  deriving (F -> F -> Bool
(F -> F -> Bool) -> (F -> F -> Bool) -> Eq F
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: F -> F -> Bool
== :: F -> F -> Bool
$c/= :: F -> F -> Bool
/= :: F -> F -> Bool
Eq, Eq F
Eq F =>
(F -> F -> Ordering)
-> (F -> F -> Bool)
-> (F -> F -> Bool)
-> (F -> F -> Bool)
-> (F -> F -> Bool)
-> (F -> F -> F)
-> (F -> F -> F)
-> Ord F
F -> F -> Bool
F -> F -> Ordering
F -> F -> F
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: F -> F -> Ordering
compare :: F -> F -> Ordering
$c< :: F -> F -> Bool
< :: F -> F -> Bool
$c<= :: F -> F -> Bool
<= :: F -> F -> Bool
$c> :: F -> F -> Bool
> :: F -> F -> Bool
$c>= :: F -> F -> Bool
>= :: F -> F -> Bool
$cmax :: F -> F -> F
max :: F -> F -> F
$cmin :: F -> F -> F
min :: F -> F -> F
Ord)

unA :: A -> Int;  unA :: A -> Int
unA (A Int
n)  =  Int
n
unB :: B -> Int;  unB :: B -> Int
unB (B Int
n)  =  Int
n
unC :: C -> Int;  unC :: C -> Int
unC (C Int
n)  =  Int
n
unD :: D -> Int;  unD :: D -> Int
unD (D Int
n)  =  Int
n
unE :: E -> Int;  unE :: E -> Int
unE (E Int
n)  =  Int
n
unF :: F -> Int;  unF :: F -> Int
unF (F Int
n)  =  Int
n

negativeToZero :: (Ord a, Num a) => a -> a
negativeToZero :: forall a. (Ord a, Num a) => a -> a
negativeToZero a
x  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
< a
0      =  a
0
                  | Bool
otherwise  =  a
x

int1  :: Int -> Int1;   int1 :: Int -> Int1
int1   =  Int -> Int1
Int1  (Int -> Int1) -> (Int -> Int) -> Int -> Int1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowS Int
1
int2  :: Int -> Int2;   int2 :: Int -> Int2
int2   =  Int -> Int2
Int2  (Int -> Int2) -> (Int -> Int) -> Int -> Int2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowS Int
2
int3  :: Int -> Int3;   int3 :: Int -> Int3
int3   =  Int -> Int3
Int3  (Int -> Int3) -> (Int -> Int) -> Int -> Int3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowS Int
3
int4  :: Int -> Int4;   int4 :: Int -> Int4
int4   =  Int -> Int4
Int4  (Int -> Int4) -> (Int -> Int) -> Int -> Int4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowS Int
4
word1 :: Int -> Word1;  word1 :: Int -> Word1
word1  =  Int -> Word1
Word1 (Int -> Word1) -> (Int -> Int) -> Int -> Word1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowU Int
1
word2 :: Int -> Word2;  word2 :: Int -> Word2
word2  =  Int -> Word2
Word2 (Int -> Word2) -> (Int -> Int) -> Int -> Word2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowU Int
2
word3 :: Int -> Word3;  word3 :: Int -> Word3
word3  =  Int -> Word3
Word3 (Int -> Word3) -> (Int -> Int) -> Int -> Word3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowU Int
3
word4 :: Int -> Word4;  word4 :: Int -> Word4
word4  =  Int -> Word4
Word4 (Int -> Word4) -> (Int -> Int) -> Int -> Word4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> Int
narrowU Int
4
nat1 :: Int -> Nat1;  nat1 :: Int -> Nat1
nat1  =  Int -> Nat1
Nat1 (Int -> Nat1) -> (Int -> Int) -> Int -> Nat1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
1)
nat2 :: Int -> Nat2;  nat2 :: Int -> Nat2
nat2  =  Int -> Nat2
Nat2 (Int -> Nat2) -> (Int -> Int) -> Int -> Nat2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
2)
nat3 :: Int -> Nat3;  nat3 :: Int -> Nat3
nat3  =  Int -> Nat3
Nat3 (Int -> Nat3) -> (Int -> Int) -> Int -> Nat3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
3)
nat4 :: Int -> Nat4;  nat4 :: Int -> Nat4
nat4  =  Int -> Nat4
Nat4 (Int -> Nat4) -> (Int -> Int) -> Int -> Nat4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
4)
nat5 :: Int -> Nat5;  nat5 :: Int -> Nat5
nat5  =  Int -> Nat5
Nat5 (Int -> Nat5) -> (Int -> Int) -> Int -> Nat5
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
5)
nat6 :: Int -> Nat6;  nat6 :: Int -> Nat6
nat6  =  Int -> Nat6
Nat6 (Int -> Nat6) -> (Int -> Int) -> Int -> Nat6
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)
nat7 :: Int -> Nat7;  nat7 :: Int -> Nat7
nat7  =  Int -> Nat7
Nat7 (Int -> Nat7) -> (Int -> Int) -> Int -> Nat7
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
7)
nat  :: Int -> Nat;   nat :: Int -> Nat
nat   =  Int -> Nat
Nat  (Int -> Nat) -> (Int -> Int) -> Int -> Nat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int
forall a. (Ord a, Num a) => a -> a
negativeToZero
natural :: Integer -> Natural;  natural :: Integer -> Natural
natural  =  Integer -> Natural
Natural (Integer -> Natural) -> (Integer -> Integer) -> Integer -> Natural
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Integer
forall a. (Ord a, Num a) => a -> a
negativeToZero
mkA :: Int -> A;  mkA :: Int -> A
mkA  =  Int -> A
A (Int -> A) -> (Int -> Int) -> Int -> A
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)
mkB :: Int -> B;  mkB :: Int -> B
mkB  =  Int -> B
B (Int -> B) -> (Int -> Int) -> Int -> B
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)
mkC :: Int -> C;  mkC :: Int -> C
mkC  =  Int -> C
C (Int -> C) -> (Int -> Int) -> Int -> C
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)
mkD :: Int -> D;  mkD :: Int -> D
mkD  =  Int -> D
D (Int -> D) -> (Int -> Int) -> Int -> D
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)
mkE :: Int -> E;  mkE :: Int -> E
mkE  =  Int -> E
E (Int -> E) -> (Int -> Int) -> Int -> E
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)
mkF :: Int -> F;  mkF :: Int -> F
mkF  =  Int -> F
F (Int -> F) -> (Int -> Int) -> Int -> F
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
6)

type ONewtype a  =  (Int -> Int -> Int) -> (a -> a -> a)

oInt1  :: ONewtype Int1;   oInt1 :: ONewtype Int1
oInt1   =  (Int -> Int1) -> (Int1 -> Int) -> ONewtype Int1
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Int1
int1  Int1 -> Int
unInt1
oInt2  :: ONewtype Int2;   oInt2 :: ONewtype Int2
oInt2   =  (Int -> Int2) -> (Int2 -> Int) -> ONewtype Int2
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Int2
int2  Int2 -> Int
unInt2
oInt3  :: ONewtype Int3;   oInt3 :: ONewtype Int3
oInt3   =  (Int -> Int3) -> (Int3 -> Int) -> ONewtype Int3
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Int3
int3  Int3 -> Int
unInt3
oInt4  :: ONewtype Int4;   oInt4 :: ONewtype Int4
oInt4   =  (Int -> Int4) -> (Int4 -> Int) -> ONewtype Int4
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Int4
int4  Int4 -> Int
unInt4
oWord1 :: ONewtype Word1;  oWord1 :: ONewtype Word1
oWord1  =  (Int -> Word1) -> (Word1 -> Int) -> ONewtype Word1
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Word1
word1 Word1 -> Int
unWord1
oWord2 :: ONewtype Word2;  oWord2 :: ONewtype Word2
oWord2  =  (Int -> Word2) -> (Word2 -> Int) -> ONewtype Word2
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Word2
word2 Word2 -> Int
unWord2
oWord3 :: ONewtype Word3;  oWord3 :: ONewtype Word3
oWord3  =  (Int -> Word3) -> (Word3 -> Int) -> ONewtype Word3
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Word3
word3 Word3 -> Int
unWord3
oWord4 :: ONewtype Word4;  oWord4 :: ONewtype Word4
oWord4  =  (Int -> Word4) -> (Word4 -> Int) -> ONewtype Word4
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Word4
word4 Word4 -> Int
unWord4
oNat   :: ONewtype Nat;    oNat :: ONewtype Nat
oNat    =  (Int -> Nat) -> (Nat -> Int) -> ONewtype Nat
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat
nat   Nat -> Int
unNat
oNat1  :: ONewtype Nat1;   oNat1 :: ONewtype Nat1
oNat1   =  (Int -> Nat1) -> (Nat1 -> Int) -> ONewtype Nat1
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat1
nat1  Nat1 -> Int
unNat1
oNat2  :: ONewtype Nat2;   oNat2 :: ONewtype Nat2
oNat2   =  (Int -> Nat2) -> (Nat2 -> Int) -> ONewtype Nat2
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat2
nat2  Nat2 -> Int
unNat2
oNat3  :: ONewtype Nat3;   oNat3 :: ONewtype Nat3
oNat3   =  (Int -> Nat3) -> (Nat3 -> Int) -> ONewtype Nat3
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat3
nat3  Nat3 -> Int
unNat3
oNat4  :: ONewtype Nat4;   oNat4 :: ONewtype Nat4
oNat4   =  (Int -> Nat4) -> (Nat4 -> Int) -> ONewtype Nat4
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat4
nat4  Nat4 -> Int
unNat4
oNat5  :: ONewtype Nat5;   oNat5 :: ONewtype Nat5
oNat5   =  (Int -> Nat5) -> (Nat5 -> Int) -> ONewtype Nat5
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat5
nat5  Nat5 -> Int
unNat5
oNat6  :: ONewtype Nat6;   oNat6 :: ONewtype Nat6
oNat6   =  (Int -> Nat6) -> (Nat6 -> Int) -> ONewtype Nat6
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat6
nat6  Nat6 -> Int
unNat6
oNat7  :: ONewtype Nat7;   oNat7 :: ONewtype Nat7
oNat7   =  (Int -> Nat7) -> (Nat7 -> Int) -> ONewtype Nat7
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> Nat7
nat7  Nat7 -> Int
unNat7
oNatural :: (Integer -> Integer -> Integer) -> (Natural -> Natural -> Natural)
oNatural :: (Integer -> Integer -> Integer) -> Natural -> Natural -> Natural
oNatural  =  (Integer -> Natural)
-> (Natural -> Integer)
-> (Integer -> Integer -> Integer)
-> Natural
-> Natural
-> Natural
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Integer -> Natural
natural Natural -> Integer
unNatural
oA :: ONewtype A;  oA :: ONewtype A
oA  =  (Int -> A) -> (A -> Int) -> ONewtype A
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> A
mkA A -> Int
unA
oB :: ONewtype B;  oB :: ONewtype B
oB  =  (Int -> B) -> (B -> Int) -> ONewtype B
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> B
mkB B -> Int
unB
oC :: ONewtype C;  oC :: ONewtype C
oC  =  (Int -> C) -> (C -> Int) -> ONewtype C
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> C
mkC C -> Int
unC
oD :: ONewtype D;  oD :: ONewtype D
oD  =  (Int -> D) -> (D -> Int) -> ONewtype D
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> D
mkD D -> Int
unD
oE :: ONewtype E;  oE :: ONewtype E
oE  =  (Int -> E) -> (E -> Int) -> ONewtype E
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> E
mkE E -> Int
unE
oF :: ONewtype F;  oF :: ONewtype F
oF  =  (Int -> F) -> (F -> Int) -> ONewtype F
forall a b. (a -> b) -> (b -> a) -> (a -> a -> a) -> b -> b -> b
oNewtype Int -> F
mkF F -> Int
unF

fInt1  :: (Int->Int) -> (Int1->Int1)  ;  fInt1 :: (Int -> Int) -> Int1 -> Int1
fInt1   =  (Int -> Int1) -> (Int1 -> Int) -> (Int -> Int) -> Int1 -> Int1
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Int1
int1  Int1 -> Int
unInt1
fInt2  :: (Int->Int) -> (Int2->Int2)  ;  fInt2 :: (Int -> Int) -> Int2 -> Int2
fInt2   =  (Int -> Int2) -> (Int2 -> Int) -> (Int -> Int) -> Int2 -> Int2
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Int2
int2  Int2 -> Int
unInt2
fInt3  :: (Int->Int) -> (Int3->Int3)  ;  fInt3 :: (Int -> Int) -> Int3 -> Int3
fInt3   =  (Int -> Int3) -> (Int3 -> Int) -> (Int -> Int) -> Int3 -> Int3
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Int3
int3  Int3 -> Int
unInt3
fInt4  :: (Int->Int) -> (Int4->Int4)  ;  fInt4 :: (Int -> Int) -> Int4 -> Int4
fInt4   =  (Int -> Int4) -> (Int4 -> Int) -> (Int -> Int) -> Int4 -> Int4
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Int4
int4  Int4 -> Int
unInt4
fWord1 :: (Int->Int) -> (Word1->Word1);  fWord1 :: (Int -> Int) -> Word1 -> Word1
fWord1  =  (Int -> Word1) -> (Word1 -> Int) -> (Int -> Int) -> Word1 -> Word1
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Word1
word1 Word1 -> Int
unWord1
fWord2 :: (Int->Int) -> (Word2->Word2);  fWord2 :: (Int -> Int) -> Word2 -> Word2
fWord2  =  (Int -> Word2) -> (Word2 -> Int) -> (Int -> Int) -> Word2 -> Word2
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Word2
word2 Word2 -> Int
unWord2
fWord3 :: (Int->Int) -> (Word3->Word3);  fWord3 :: (Int -> Int) -> Word3 -> Word3
fWord3  =  (Int -> Word3) -> (Word3 -> Int) -> (Int -> Int) -> Word3 -> Word3
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Word3
word3 Word3 -> Int
unWord3
fWord4 :: (Int->Int) -> (Word4->Word4);  fWord4 :: (Int -> Int) -> Word4 -> Word4
fWord4  =  (Int -> Word4) -> (Word4 -> Int) -> (Int -> Int) -> Word4 -> Word4
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Word4
word4 Word4 -> Int
unWord4
fNat   :: (Int->Int) -> (Nat->Nat)    ;  fNat :: (Int -> Int) -> Nat -> Nat
fNat    =  (Int -> Nat) -> (Nat -> Int) -> (Int -> Int) -> Nat -> Nat
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat
Nat   Nat -> Int
unNat
fNat1  :: (Int->Int) -> (Nat1->Nat1)  ;  fNat1 :: (Int -> Int) -> Nat1 -> Nat1
fNat1   =  (Int -> Nat1) -> (Nat1 -> Int) -> (Int -> Int) -> Nat1 -> Nat1
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat1
nat1  Nat1 -> Int
unNat1
fNat2  :: (Int->Int) -> (Nat2->Nat2)  ;  fNat2 :: (Int -> Int) -> Nat2 -> Nat2
fNat2   =  (Int -> Nat2) -> (Nat2 -> Int) -> (Int -> Int) -> Nat2 -> Nat2
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat2
nat2  Nat2 -> Int
unNat2
fNat3  :: (Int->Int) -> (Nat3->Nat3)  ;  fNat3 :: (Int -> Int) -> Nat3 -> Nat3
fNat3   =  (Int -> Nat3) -> (Nat3 -> Int) -> (Int -> Int) -> Nat3 -> Nat3
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat3
nat3  Nat3 -> Int
unNat3
fNat4  :: (Int->Int) -> (Nat4->Nat4)  ;  fNat4 :: (Int -> Int) -> Nat4 -> Nat4
fNat4   =  (Int -> Nat4) -> (Nat4 -> Int) -> (Int -> Int) -> Nat4 -> Nat4
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat4
nat4  Nat4 -> Int
unNat4
fNat5  :: (Int->Int) -> (Nat5->Nat5)  ;  fNat5 :: (Int -> Int) -> Nat5 -> Nat5
fNat5   =  (Int -> Nat5) -> (Nat5 -> Int) -> (Int -> Int) -> Nat5 -> Nat5
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat5
nat5  Nat5 -> Int
unNat5
fNat6  :: (Int->Int) -> (Nat6->Nat6)  ;  fNat6 :: (Int -> Int) -> Nat6 -> Nat6
fNat6   =  (Int -> Nat6) -> (Nat6 -> Int) -> (Int -> Int) -> Nat6 -> Nat6
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat6
nat6  Nat6 -> Int
unNat6
fNat7  :: (Int->Int) -> (Nat7->Nat7)  ;  fNat7 :: (Int -> Int) -> Nat7 -> Nat7
fNat7   =  (Int -> Nat7) -> (Nat7 -> Int) -> (Int -> Int) -> Nat7 -> Nat7
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> Nat7
nat7  Nat7 -> Int
unNat7
fNatural :: (Integer->Integer) -> (Natural->Natural)
fNatural :: (Integer -> Integer) -> Natural -> Natural
fNatural  =  (Integer -> Natural)
-> (Natural -> Integer)
-> (Integer -> Integer)
-> Natural
-> Natural
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Integer -> Natural
Natural Natural -> Integer
unNatural
fA :: (Int -> Int) -> (A -> A);  fA :: (Int -> Int) -> A -> A
fA  =  (Int -> A) -> (A -> Int) -> (Int -> Int) -> A -> A
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> A
mkA A -> Int
unA
fB :: (Int -> Int) -> (B -> B);  fB :: (Int -> Int) -> B -> B
fB  =  (Int -> B) -> (B -> Int) -> (Int -> Int) -> B -> B
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> B
mkB B -> Int
unB
fC :: (Int -> Int) -> (C -> C);  fC :: (Int -> Int) -> C -> C
fC  =  (Int -> C) -> (C -> Int) -> (Int -> Int) -> C -> C
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> C
mkC C -> Int
unC
fD :: (Int -> Int) -> (D -> D);  fD :: (Int -> Int) -> D -> D
fD  =  (Int -> D) -> (D -> Int) -> (Int -> Int) -> D -> D
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> D
mkD D -> Int
unD
fE :: (Int -> Int) -> (E -> E);  fE :: (Int -> Int) -> E -> E
fE  =  (Int -> E) -> (E -> Int) -> (Int -> Int) -> E -> E
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> E
mkE E -> Int
unE
fF :: (Int -> Int) -> (F -> F);  fF :: (Int -> Int) -> F -> F
fF  =  (Int -> F) -> (F -> Int) -> (Int -> Int) -> F -> F
forall a b. (a -> b) -> (b -> a) -> (a -> a) -> b -> b
fNewtype Int -> F
mkF F -> Int
unF

instance Show Int1 where  show :: Int1 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Int1 -> Int) -> Int1 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int1 -> Int
unInt1
instance Show Int2 where  show :: Int2 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Int2 -> Int) -> Int2 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int2 -> Int
unInt2
instance Show Int3 where  show :: Int3 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Int3 -> Int) -> Int3 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int3 -> Int
unInt3
instance Show Int4 where  show :: Int4 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Int4 -> Int) -> Int4 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int4 -> Int
unInt4
instance Show Word1 where  show :: Word1 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Word1 -> Int) -> Word1 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word1 -> Int
unWord1
instance Show Word2 where  show :: Word2 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Word2 -> Int) -> Word2 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word2 -> Int
unWord2
instance Show Word3 where  show :: Word3 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Word3 -> Int) -> Word3 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word3 -> Int
unWord3
instance Show Word4 where  show :: Word4 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Word4 -> Int) -> Word4 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word4 -> Int
unWord4
instance Show Nat where  show :: Nat -> String
show (Nat Int
x)  =  Int -> String
forall a. Show a => a -> String
show Int
x
instance Show Nat1 where  show :: Nat1 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat1 -> Int) -> Nat1 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat1 -> Int
unNat1
instance Show Nat2 where  show :: Nat2 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat2 -> Int) -> Nat2 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat2 -> Int
unNat2
instance Show Nat3 where  show :: Nat3 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat3 -> Int) -> Nat3 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat3 -> Int
unNat3
instance Show Nat4 where  show :: Nat4 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat4 -> Int) -> Nat4 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat4 -> Int
unNat4
instance Show Nat5 where  show :: Nat5 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat5 -> Int) -> Nat5 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat5 -> Int
unNat5
instance Show Nat6 where  show :: Nat6 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat6 -> Int) -> Nat6 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat6 -> Int
unNat6
instance Show Nat7 where  show :: Nat7 -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (Nat7 -> Int) -> Nat7 -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat7 -> Int
unNat7
instance Show Natural where  show :: Natural -> String
show (Natural Integer
x)  =  Integer -> String
forall a. Show a => a -> String
show Integer
x
instance Show A where  show :: A -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (A -> Int) -> A -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. A -> Int
unA
instance Show B where  show :: B -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (B -> Int) -> B -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. B -> Int
unB
instance Show C where  show :: C -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (C -> Int) -> C -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. C -> Int
unC
instance Show D where  show :: D -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (D -> Int) -> D -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. D -> Int
unD
instance Show E where  show :: E -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (E -> Int) -> E -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E -> Int
unE
instance Show F where  show :: F -> String
show  =  Int -> String
forall a. Show a => a -> String
show (Int -> String) -> (F -> Int) -> F -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. F -> Int
unF

instance Read Int1 where  readsPrec :: Int -> ReadS Int1
readsPrec  =  (Int -> Int1) -> Int -> ReadS Int1
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Int1
int1
instance Read Int2 where  readsPrec :: Int -> ReadS Int2
readsPrec  =  (Int -> Int2) -> Int -> ReadS Int2
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Int2
int2
instance Read Int3 where  readsPrec :: Int -> ReadS Int3
readsPrec  =  (Int -> Int3) -> Int -> ReadS Int3
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Int3
int3
instance Read Int4 where  readsPrec :: Int -> ReadS Int4
readsPrec  =  (Int -> Int4) -> Int -> ReadS Int4
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Int4
int4
instance Read Word1 where  readsPrec :: Int -> ReadS Word1
readsPrec  =  (Int -> Word1) -> Int -> ReadS Word1
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Word1
word1
instance Read Word2 where  readsPrec :: Int -> ReadS Word2
readsPrec  =  (Int -> Word2) -> Int -> ReadS Word2
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Word2
word2
instance Read Word3 where  readsPrec :: Int -> ReadS Word3
readsPrec  =  (Int -> Word3) -> Int -> ReadS Word3
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Word3
word3
instance Read Word4 where  readsPrec :: Int -> ReadS Word4
readsPrec  =  (Int -> Word4) -> Int -> ReadS Word4
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Word4
word4
instance Read Nat where  readsPrec :: Int -> ReadS Nat
readsPrec  =  (Int -> Nat) -> Int -> ReadS Nat
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat
nat
instance Read Nat1 where  readsPrec :: Int -> ReadS Nat1
readsPrec  =  (Int -> Nat1) -> Int -> ReadS Nat1
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat1
nat1
instance Read Nat2 where  readsPrec :: Int -> ReadS Nat2
readsPrec  =  (Int -> Nat2) -> Int -> ReadS Nat2
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat2
nat2
instance Read Nat3 where  readsPrec :: Int -> ReadS Nat3
readsPrec  =  (Int -> Nat3) -> Int -> ReadS Nat3
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat3
nat3
instance Read Nat4 where  readsPrec :: Int -> ReadS Nat4
readsPrec  =  (Int -> Nat4) -> Int -> ReadS Nat4
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat4
nat4
instance Read Nat5 where  readsPrec :: Int -> ReadS Nat5
readsPrec  =  (Int -> Nat5) -> Int -> ReadS Nat5
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat5
nat5
instance Read Nat6 where  readsPrec :: Int -> ReadS Nat6
readsPrec  =  (Int -> Nat6) -> Int -> ReadS Nat6
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat6
nat6
instance Read Nat7 where  readsPrec :: Int -> ReadS Nat7
readsPrec  =  (Int -> Nat7) -> Int -> ReadS Nat7
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> Nat7
nat7
instance Read Natural where  readsPrec :: Int -> ReadS Natural
readsPrec  =  (Integer -> Natural) -> Int -> ReadS Natural
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Integer -> Natural
natural
instance Read A where  readsPrec :: Int -> ReadS A
readsPrec  =  (Int -> A) -> Int -> ReadS A
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> A
mkA
instance Read B where  readsPrec :: Int -> ReadS B
readsPrec  =  (Int -> B) -> Int -> ReadS B
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> B
mkB
instance Read C where  readsPrec :: Int -> ReadS C
readsPrec  =  (Int -> C) -> Int -> ReadS C
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> C
mkC
instance Read D where  readsPrec :: Int -> ReadS D
readsPrec  =  (Int -> D) -> Int -> ReadS D
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> D
mkD
instance Read E where  readsPrec :: Int -> ReadS E
readsPrec  =  (Int -> E) -> Int -> ReadS E
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> E
mkE
instance Read F where  readsPrec :: Int -> ReadS F
readsPrec  =  (Int -> F) -> Int -> ReadS F
forall a b. Read a => (a -> b) -> Int -> String -> [(b, String)]
readsPrecNewtype Int -> F
mkF


instance Num Int1 where
  + :: Int1 -> Int1 -> Int1
(+)  =  ONewtype Int1
oInt1 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Int1 -> Int1
abs     =  (Int -> Int) -> Int1 -> Int1
fInt1 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Int1
oInt1 (-);  signum :: Int1 -> Int1
signum  =  (Int -> Int) -> Int1 -> Int1
fInt1 Int -> Int
forall a. Num a => a -> a
signum
  * :: Int1 -> Int1 -> Int1
(*)  =  ONewtype Int1
oInt1 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Int1
fromInteger  =  Int -> Int1
int1 (Int -> Int1) -> (Integer -> Int) -> Integer -> Int1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Int2 where
  + :: Int2 -> Int2 -> Int2
(+)  =  ONewtype Int2
oInt2 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Int2 -> Int2
abs     =  (Int -> Int) -> Int2 -> Int2
fInt2 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Int2
oInt2 (-);  signum :: Int2 -> Int2
signum  =  (Int -> Int) -> Int2 -> Int2
fInt2 Int -> Int
forall a. Num a => a -> a
signum
  * :: Int2 -> Int2 -> Int2
(*)  =  ONewtype Int2
oInt2 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Int2
fromInteger  =  Int -> Int2
int2 (Int -> Int2) -> (Integer -> Int) -> Integer -> Int2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Int3 where
  + :: Int3 -> Int3 -> Int3
(+)  =  ONewtype Int3
oInt3 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Int3 -> Int3
abs     =  (Int -> Int) -> Int3 -> Int3
fInt3 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Int3
oInt3 (-);  signum :: Int3 -> Int3
signum  =  (Int -> Int) -> Int3 -> Int3
fInt3 Int -> Int
forall a. Num a => a -> a
signum
  * :: Int3 -> Int3 -> Int3
(*)  =  ONewtype Int3
oInt3 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Int3
fromInteger  =  Int -> Int3
int3 (Int -> Int3) -> (Integer -> Int) -> Integer -> Int3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Int4 where
  + :: Int4 -> Int4 -> Int4
(+)  =  ONewtype Int4
oInt4 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Int4 -> Int4
abs     =  (Int -> Int) -> Int4 -> Int4
fInt4 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Int4
oInt4 (-);  signum :: Int4 -> Int4
signum  =  (Int -> Int) -> Int4 -> Int4
fInt4 Int -> Int
forall a. Num a => a -> a
signum
  * :: Int4 -> Int4 -> Int4
(*)  =  ONewtype Int4
oInt4 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Int4
fromInteger  =  Int -> Int4
int4 (Int -> Int4) -> (Integer -> Int) -> Integer -> Int4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Word1 where
  + :: Word1 -> Word1 -> Word1
(+)  =  ONewtype Word1
oWord1 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Word1 -> Word1
abs     =  (Int -> Int) -> Word1 -> Word1
fWord1 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Word1
oWord1 (-);  signum :: Word1 -> Word1
signum  =  (Int -> Int) -> Word1 -> Word1
fWord1 Int -> Int
forall a. Num a => a -> a
signum
  * :: Word1 -> Word1 -> Word1
(*)  =  ONewtype Word1
oWord1 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Word1
fromInteger  =  Int -> Word1
word1 (Int -> Word1) -> (Integer -> Int) -> Integer -> Word1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Word2 where
  + :: Word2 -> Word2 -> Word2
(+)  =  ONewtype Word2
oWord2 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Word2 -> Word2
abs     =  (Int -> Int) -> Word2 -> Word2
fWord2 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Word2
oWord2 (-);  signum :: Word2 -> Word2
signum  =  (Int -> Int) -> Word2 -> Word2
fWord2 Int -> Int
forall a. Num a => a -> a
signum
  * :: Word2 -> Word2 -> Word2
(*)  =  ONewtype Word2
oWord2 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Word2
fromInteger  =  Int -> Word2
word2 (Int -> Word2) -> (Integer -> Int) -> Integer -> Word2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Word3 where
  + :: Word3 -> Word3 -> Word3
(+)  =  ONewtype Word3
oWord3 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Word3 -> Word3
abs     =  (Int -> Int) -> Word3 -> Word3
fWord3 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Word3
oWord3 (-);  signum :: Word3 -> Word3
signum  =  (Int -> Int) -> Word3 -> Word3
fWord3 Int -> Int
forall a. Num a => a -> a
signum
  * :: Word3 -> Word3 -> Word3
(*)  =  ONewtype Word3
oWord3 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Word3
fromInteger  =  Int -> Word3
word3 (Int -> Word3) -> (Integer -> Int) -> Integer -> Word3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Word4 where
  + :: Word4 -> Word4 -> Word4
(+)  =  ONewtype Word4
oWord4 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Word4 -> Word4
abs     =  (Int -> Int) -> Word4 -> Word4
fWord4 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Word4
oWord4 (-);  signum :: Word4 -> Word4
signum  =  (Int -> Int) -> Word4 -> Word4
fWord4 Int -> Int
forall a. Num a => a -> a
signum
  * :: Word4 -> Word4 -> Word4
(*)  =  ONewtype Word4
oWord4 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Word4
fromInteger  =  Int -> Word4
word4 (Int -> Word4) -> (Integer -> Int) -> Integer -> Word4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat where
  + :: Nat -> Nat -> Nat
(+)  =  ONewtype Nat
oNat Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat -> Nat
abs     =  (Int -> Int) -> Nat -> Nat
fNat Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat
oNat (-);  signum :: Nat -> Nat
signum  =  (Int -> Int) -> Nat -> Nat
fNat Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat -> Nat -> Nat
(*)  =  ONewtype Nat
oNat Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat
fromInteger  =  Int -> Nat
nat (Int -> Nat) -> (Integer -> Int) -> Integer -> Nat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat1 where
  + :: Nat1 -> Nat1 -> Nat1
(+)  =  ONewtype Nat1
oNat1 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat1 -> Nat1
abs     =  (Int -> Int) -> Nat1 -> Nat1
fNat1 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat1
oNat1 (-);  signum :: Nat1 -> Nat1
signum  =  (Int -> Int) -> Nat1 -> Nat1
fNat1 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat1 -> Nat1 -> Nat1
(*)  =  ONewtype Nat1
oNat1 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat1
fromInteger  =  Int -> Nat1
nat1 (Int -> Nat1) -> (Integer -> Int) -> Integer -> Nat1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat2 where
  + :: Nat2 -> Nat2 -> Nat2
(+)  =  ONewtype Nat2
oNat2 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat2 -> Nat2
abs     =  (Int -> Int) -> Nat2 -> Nat2
fNat2 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat2
oNat2 (-);  signum :: Nat2 -> Nat2
signum  =  (Int -> Int) -> Nat2 -> Nat2
fNat2 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat2 -> Nat2 -> Nat2
(*)  =  ONewtype Nat2
oNat2 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat2
fromInteger  =  Int -> Nat2
nat2 (Int -> Nat2) -> (Integer -> Int) -> Integer -> Nat2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat3 where
  + :: Nat3 -> Nat3 -> Nat3
(+)  =  ONewtype Nat3
oNat3 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat3 -> Nat3
abs     =  (Int -> Int) -> Nat3 -> Nat3
fNat3 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat3
oNat3 (-);  signum :: Nat3 -> Nat3
signum  =  (Int -> Int) -> Nat3 -> Nat3
fNat3 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat3 -> Nat3 -> Nat3
(*)  =  ONewtype Nat3
oNat3 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat3
fromInteger  =  Int -> Nat3
nat3 (Int -> Nat3) -> (Integer -> Int) -> Integer -> Nat3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat4 where
  + :: Nat4 -> Nat4 -> Nat4
(+)  =  ONewtype Nat4
oNat4 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat4 -> Nat4
abs     =  (Int -> Int) -> Nat4 -> Nat4
fNat4 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat4
oNat4 (-);  signum :: Nat4 -> Nat4
signum  =  (Int -> Int) -> Nat4 -> Nat4
fNat4 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat4 -> Nat4 -> Nat4
(*)  =  ONewtype Nat4
oNat4 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat4
fromInteger  =  Int -> Nat4
nat4 (Int -> Nat4) -> (Integer -> Int) -> Integer -> Nat4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat5 where
  + :: Nat5 -> Nat5 -> Nat5
(+)  =  ONewtype Nat5
oNat5 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat5 -> Nat5
abs     =  (Int -> Int) -> Nat5 -> Nat5
fNat5 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat5
oNat5 (-);  signum :: Nat5 -> Nat5
signum  =  (Int -> Int) -> Nat5 -> Nat5
fNat5 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat5 -> Nat5 -> Nat5
(*)  =  ONewtype Nat5
oNat5 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat5
fromInteger  =  Int -> Nat5
nat5 (Int -> Nat5) -> (Integer -> Int) -> Integer -> Nat5
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat6 where
  + :: Nat6 -> Nat6 -> Nat6
(+)  =  ONewtype Nat6
oNat6 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat6 -> Nat6
abs     =  (Int -> Int) -> Nat6 -> Nat6
fNat6 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat6
oNat6 (-);  signum :: Nat6 -> Nat6
signum  =  (Int -> Int) -> Nat6 -> Nat6
fNat6 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat6 -> Nat6 -> Nat6
(*)  =  ONewtype Nat6
oNat6 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat6
fromInteger  =  Int -> Nat6
nat6 (Int -> Nat6) -> (Integer -> Int) -> Integer -> Nat6
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Nat7 where
  + :: Nat7 -> Nat7 -> Nat7
(+)  =  ONewtype Nat7
oNat7 Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: Nat7 -> Nat7
abs     =  (Int -> Int) -> Nat7 -> Nat7
fNat7 Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype Nat7
oNat7 (-);  signum :: Nat7 -> Nat7
signum  =  (Int -> Int) -> Nat7 -> Nat7
fNat7 Int -> Int
forall a. Num a => a -> a
signum
  * :: Nat7 -> Nat7 -> Nat7
(*)  =  ONewtype Nat7
oNat7 Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Nat7
fromInteger  =  Int -> Nat7
nat7 (Int -> Nat7) -> (Integer -> Int) -> Integer -> Nat7
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num Natural where
  + :: Natural -> Natural -> Natural
(+)  =  (Integer -> Integer -> Integer) -> Natural -> Natural -> Natural
oNatural Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
(+);  abs :: Natural -> Natural
abs     =  (Integer -> Integer) -> Natural -> Natural
fNatural Integer -> Integer
forall a. Num a => a -> a
abs
  (-)  =  (Integer -> Integer -> Integer) -> Natural -> Natural -> Natural
oNatural (-);  signum :: Natural -> Natural
signum  =  (Integer -> Integer) -> Natural -> Natural
fNatural Integer -> Integer
forall a. Num a => a -> a
signum
  * :: Natural -> Natural -> Natural
(*)  =  (Integer -> Integer -> Integer) -> Natural -> Natural -> Natural
oNatural Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> Natural
fromInteger  =  Integer -> Natural
natural (Integer -> Natural) -> (Integer -> Integer) -> Integer -> Natural
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Integer
forall a. Num a => Integer -> a
fromInteger

instance Num A where
  + :: A -> A -> A
(+)  =  ONewtype A
oA Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: A -> A
abs     =  (Int -> Int) -> A -> A
fA Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype A
oA (-);  signum :: A -> A
signum  =  (Int -> Int) -> A -> A
fA Int -> Int
forall a. Num a => a -> a
signum
  * :: A -> A -> A
(*)  =  ONewtype A
oA Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> A
fromInteger  =  Int -> A
mkA (Int -> A) -> (Integer -> Int) -> Integer -> A
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num B where
  + :: B -> B -> B
(+)  =  ONewtype B
oB Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: B -> B
abs     =  (Int -> Int) -> B -> B
fB Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype B
oB (-);  signum :: B -> B
signum  =  (Int -> Int) -> B -> B
fB Int -> Int
forall a. Num a => a -> a
signum
  * :: B -> B -> B
(*)  =  ONewtype B
oB Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> B
fromInteger  =  Int -> B
mkB (Int -> B) -> (Integer -> Int) -> Integer -> B
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num C where
  + :: C -> C -> C
(+)  =  ONewtype C
oC Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: C -> C
abs     =  (Int -> Int) -> C -> C
fC Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype C
oC (-);  signum :: C -> C
signum  =  (Int -> Int) -> C -> C
fC Int -> Int
forall a. Num a => a -> a
signum
  * :: C -> C -> C
(*)  =  ONewtype C
oC Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> C
fromInteger  =  Int -> C
mkC (Int -> C) -> (Integer -> Int) -> Integer -> C
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num D where
  + :: D -> D -> D
(+)  =  ONewtype D
oD Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: D -> D
abs     =  (Int -> Int) -> D -> D
fD Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype D
oD (-);  signum :: D -> D
signum  =  (Int -> Int) -> D -> D
fD Int -> Int
forall a. Num a => a -> a
signum
  * :: D -> D -> D
(*)  =  ONewtype D
oD Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> D
fromInteger  =  Int -> D
mkD (Int -> D) -> (Integer -> Int) -> Integer -> D
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num E where
  + :: E -> E -> E
(+)  =  ONewtype E
oE Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: E -> E
abs     =  (Int -> Int) -> E -> E
fE Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype E
oE (-);  signum :: E -> E
signum  =  (Int -> Int) -> E -> E
fE Int -> Int
forall a. Num a => a -> a
signum
  * :: E -> E -> E
(*)  =  ONewtype E
oE Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> E
fromInteger  =  Int -> E
mkE (Int -> E) -> (Integer -> Int) -> Integer -> E
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger

instance Num F where
  + :: F -> F -> F
(+)  =  ONewtype F
oF Int -> Int -> Int
forall a. Num a => a -> a -> a
(+);  abs :: F -> F
abs     =  (Int -> Int) -> F -> F
fF Int -> Int
forall a. Num a => a -> a
abs
  (-)  =  ONewtype F
oF (-);  signum :: F -> F
signum  =  (Int -> Int) -> F -> F
fF Int -> Int
forall a. Num a => a -> a
signum
  * :: F -> F -> F
(*)  =  ONewtype F
oF Int -> Int -> Int
forall a. Num a => a -> a -> a
(*);  fromInteger :: Integer -> F
fromInteger  =  Int -> F
mkF (Int -> F) -> (Integer -> Int) -> Integer -> F
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Int
forall a. Num a => Integer -> a
fromInteger


instance Real Int1 where  toRational :: Int1 -> Rational
toRational (Int1 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Int2 where  toRational :: Int2 -> Rational
toRational (Int2 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Int3 where  toRational :: Int3 -> Rational
toRational (Int3 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Int4 where  toRational :: Int4 -> Rational
toRational (Int4 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Word1 where  toRational :: Word1 -> Rational
toRational (Word1 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Word2 where  toRational :: Word2 -> Rational
toRational (Word2 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Word3 where  toRational :: Word3 -> Rational
toRational (Word3 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Word4 where  toRational :: Word4 -> Rational
toRational (Word4 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat where  toRational :: Nat -> Rational
toRational (Nat Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat1 where  toRational :: Nat1 -> Rational
toRational (Nat1 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat2 where  toRational :: Nat2 -> Rational
toRational (Nat2 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat3 where  toRational :: Nat3 -> Rational
toRational (Nat3 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat4 where  toRational :: Nat4 -> Rational
toRational (Nat4 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat5 where  toRational :: Nat5 -> Rational
toRational (Nat5 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat6 where  toRational :: Nat6 -> Rational
toRational (Nat6 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Nat7 where  toRational :: Nat7 -> Rational
toRational (Nat7 Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real Natural where  toRational :: Natural -> Rational
toRational (Natural Integer
x)  =  Integer -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real A where  toRational :: A -> Rational
toRational (A Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real B where  toRational :: B -> Rational
toRational (B Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real C where  toRational :: C -> Rational
toRational (C Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real D where  toRational :: D -> Rational
toRational (D Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real E where  toRational :: E -> Rational
toRational (E Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1
instance Real F where  toRational :: F -> Rational
toRational (F Int
x)  =  Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1

instance Integral Int1 where  quotRem :: Int1 -> Int1 -> (Int1, Int1)
quotRem  =  (Int -> Int1)
-> (Int1 -> Int)
-> (Int -> Int -> (Int, Int))
-> Int1
-> Int1
-> (Int1, Int1)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Int1
int1 Int1 -> Int
unInt1 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Int1 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Int1 -> Int) -> Int1 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int1 -> Int
unInt1

instance Integral Int2 where  quotRem :: Int2 -> Int2 -> (Int2, Int2)
quotRem  =  (Int -> Int2)
-> (Int2 -> Int)
-> (Int -> Int -> (Int, Int))
-> Int2
-> Int2
-> (Int2, Int2)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Int2
int2 Int2 -> Int
unInt2 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Int2 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Int2 -> Int) -> Int2 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int2 -> Int
unInt2

instance Integral Int3 where  quotRem :: Int3 -> Int3 -> (Int3, Int3)
quotRem  =  (Int -> Int3)
-> (Int3 -> Int)
-> (Int -> Int -> (Int, Int))
-> Int3
-> Int3
-> (Int3, Int3)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Int3
int3 Int3 -> Int
unInt3 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Int3 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Int3 -> Int) -> Int3 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int3 -> Int
unInt3

instance Integral Int4 where  quotRem :: Int4 -> Int4 -> (Int4, Int4)
quotRem  =  (Int -> Int4)
-> (Int4 -> Int)
-> (Int -> Int -> (Int, Int))
-> Int4
-> Int4
-> (Int4, Int4)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Int4
int4 Int4 -> Int
unInt4 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Int4 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Int4 -> Int) -> Int4 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int4 -> Int
unInt4

instance Integral Word1 where  quotRem :: Word1 -> Word1 -> (Word1, Word1)
quotRem  =  (Int -> Word1)
-> (Word1 -> Int)
-> (Int -> Int -> (Int, Int))
-> Word1
-> Word1
-> (Word1, Word1)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Word1
word1 Word1 -> Int
unWord1 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                               toInteger :: Word1 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Word1 -> Int) -> Word1 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word1 -> Int
unWord1

instance Integral Word2 where  quotRem :: Word2 -> Word2 -> (Word2, Word2)
quotRem  =  (Int -> Word2)
-> (Word2 -> Int)
-> (Int -> Int -> (Int, Int))
-> Word2
-> Word2
-> (Word2, Word2)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Word2
word2 Word2 -> Int
unWord2 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                               toInteger :: Word2 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Word2 -> Int) -> Word2 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word2 -> Int
unWord2

instance Integral Word3 where  quotRem :: Word3 -> Word3 -> (Word3, Word3)
quotRem  =  (Int -> Word3)
-> (Word3 -> Int)
-> (Int -> Int -> (Int, Int))
-> Word3
-> Word3
-> (Word3, Word3)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Word3
word3 Word3 -> Int
unWord3 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                               toInteger :: Word3 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Word3 -> Int) -> Word3 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word3 -> Int
unWord3

instance Integral Word4 where  quotRem :: Word4 -> Word4 -> (Word4, Word4)
quotRem  =  (Int -> Word4)
-> (Word4 -> Int)
-> (Int -> Int -> (Int, Int))
-> Word4
-> Word4
-> (Word4, Word4)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Word4
word4 Word4 -> Int
unWord4 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                               toInteger :: Word4 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Word4 -> Int) -> Word4 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word4 -> Int
unWord4

instance Integral Nat where  quotRem :: Nat -> Nat -> (Nat, Nat)
quotRem  =  (Int -> Nat)
-> (Nat -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat
-> Nat
-> (Nat, Nat)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat
Nat Nat -> Int
unNat Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                             toInteger :: Nat -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat -> Int) -> Nat -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat -> Int
unNat

instance Integral Nat1 where  quotRem :: Nat1 -> Nat1 -> (Nat1, Nat1)
quotRem  =  (Int -> Nat1)
-> (Nat1 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat1
-> Nat1
-> (Nat1, Nat1)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat1
nat1 Nat1 -> Int
unNat1 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat1 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat1 -> Int) -> Nat1 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat1 -> Int
unNat1

instance Integral Nat2 where  quotRem :: Nat2 -> Nat2 -> (Nat2, Nat2)
quotRem  =  (Int -> Nat2)
-> (Nat2 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat2
-> Nat2
-> (Nat2, Nat2)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat2
nat2 Nat2 -> Int
unNat2 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat2 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat2 -> Int) -> Nat2 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat2 -> Int
unNat2

instance Integral Nat3 where  quotRem :: Nat3 -> Nat3 -> (Nat3, Nat3)
quotRem  =  (Int -> Nat3)
-> (Nat3 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat3
-> Nat3
-> (Nat3, Nat3)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat3
nat3 Nat3 -> Int
unNat3 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat3 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat3 -> Int) -> Nat3 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat3 -> Int
unNat3

instance Integral Nat4 where  quotRem :: Nat4 -> Nat4 -> (Nat4, Nat4)
quotRem  =  (Int -> Nat4)
-> (Nat4 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat4
-> Nat4
-> (Nat4, Nat4)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat4
nat4 Nat4 -> Int
unNat4 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat4 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat4 -> Int) -> Nat4 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat4 -> Int
unNat4

instance Integral Nat5 where  quotRem :: Nat5 -> Nat5 -> (Nat5, Nat5)
quotRem  =  (Int -> Nat5)
-> (Nat5 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat5
-> Nat5
-> (Nat5, Nat5)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat5
nat5 Nat5 -> Int
unNat5 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat5 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat5 -> Int) -> Nat5 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat5 -> Int
unNat5

instance Integral Nat6 where  quotRem :: Nat6 -> Nat6 -> (Nat6, Nat6)
quotRem  =  (Int -> Nat6)
-> (Nat6 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat6
-> Nat6
-> (Nat6, Nat6)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat6
nat6 Nat6 -> Int
unNat6 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat6 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat6 -> Int) -> Nat6 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat6 -> Int
unNat6

instance Integral Nat7 where  quotRem :: Nat7 -> Nat7 -> (Nat7, Nat7)
quotRem  =  (Int -> Nat7)
-> (Nat7 -> Int)
-> (Int -> Int -> (Int, Int))
-> Nat7
-> Nat7
-> (Nat7, Nat7)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> Nat7
nat7 Nat7 -> Int
unNat7 Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                              toInteger :: Nat7 -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (Nat7 -> Int) -> Nat7 -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Nat7 -> Int
unNat7

instance Integral Natural where  quotRem :: Natural -> Natural -> (Natural, Natural)
quotRem  =  (Integer -> Natural)
-> (Natural -> Integer)
-> (Integer -> Integer -> (Integer, Integer))
-> Natural
-> Natural
-> (Natural, Natural)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Integer -> Natural
natural Natural -> Integer
unNatural Integer -> Integer -> (Integer, Integer)
forall a. Integral a => a -> a -> (a, a)
quotRem
                                 toInteger :: Natural -> Integer
toInteger  =  Integer -> Integer
forall a. Integral a => a -> Integer
toInteger (Integer -> Integer) -> (Natural -> Integer) -> Natural -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Natural -> Integer
unNatural

instance Integral A where  quotRem :: A -> A -> (A, A)
quotRem  =  (Int -> A)
-> (A -> Int) -> (Int -> Int -> (Int, Int)) -> A -> A -> (A, A)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> A
mkA A -> Int
unA Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                           toInteger :: A -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (A -> Int) -> A -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. A -> Int
unA

instance Integral B where  quotRem :: B -> B -> (B, B)
quotRem  =  (Int -> B)
-> (B -> Int) -> (Int -> Int -> (Int, Int)) -> B -> B -> (B, B)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> B
mkB B -> Int
unB Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                           toInteger :: B -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (B -> Int) -> B -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. B -> Int
unB

instance Integral C where  quotRem :: C -> C -> (C, C)
quotRem  =  (Int -> C)
-> (C -> Int) -> (Int -> Int -> (Int, Int)) -> C -> C -> (C, C)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> C
mkC C -> Int
unC Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                           toInteger :: C -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (C -> Int) -> C -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. C -> Int
unC

instance Integral D where  quotRem :: D -> D -> (D, D)
quotRem  =  (Int -> D)
-> (D -> Int) -> (Int -> Int -> (Int, Int)) -> D -> D -> (D, D)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> D
mkD D -> Int
unD Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                           toInteger :: D -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (D -> Int) -> D -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. D -> Int
unD

instance Integral E where  quotRem :: E -> E -> (E, E)
quotRem  =  (Int -> E)
-> (E -> Int) -> (Int -> Int -> (Int, Int)) -> E -> E -> (E, E)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> E
mkE E -> Int
unE Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                           toInteger :: E -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (E -> Int) -> E -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E -> Int
unE

instance Integral F where  quotRem :: F -> F -> (F, F)
quotRem  =  (Int -> F)
-> (F -> Int) -> (Int -> Int -> (Int, Int)) -> F -> F -> (F, F)
forall a b.
(a -> b) -> (b -> a) -> (a -> a -> (a, a)) -> b -> b -> (b, b)
otNewtype Int -> F
mkF F -> Int
unF Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
quotRem
                           toInteger :: F -> Integer
toInteger  =  Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> (F -> Int) -> F -> Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. F -> Int
unF

instance Bounded Int1 where  maxBound :: Int1
maxBound  =  Int -> Int1
Int1 Int
0;  minBound :: Int1
minBound  =  Int -> Int1
Int1 (-Int
1)
instance Bounded Int2 where  maxBound :: Int2
maxBound  =  Int -> Int2
Int2 Int
1;  minBound :: Int2
minBound  =  Int -> Int2
Int2 (-Int
2)
instance Bounded Int3 where  maxBound :: Int3
maxBound  =  Int -> Int3
Int3 Int
3;  minBound :: Int3
minBound  =  Int -> Int3
Int3 (-Int
4)
instance Bounded Int4 where  maxBound :: Int4
maxBound  =  Int -> Int4
Int4 Int
7;  minBound :: Int4
minBound  =  Int -> Int4
Int4 (-Int
8)
instance Bounded Word1 where  maxBound :: Word1
maxBound  =  Int -> Word1
Word1 Int
1;  minBound :: Word1
minBound  =  Int -> Word1
Word1 Int
0
instance Bounded Word2 where  maxBound :: Word2
maxBound  =  Int -> Word2
Word2 Int
3;  minBound :: Word2
minBound  =  Int -> Word2
Word2 Int
0
instance Bounded Word3 where  maxBound :: Word3
maxBound  =  Int -> Word3
Word3 Int
7;  minBound :: Word3
minBound  =  Int -> Word3
Word3 Int
0
instance Bounded Word4 where  maxBound :: Word4
maxBound  =  Int -> Word4
Word4 Int
15;  minBound :: Word4
minBound  =  Int -> Word4
Word4 Int
0
instance Bounded Nat where  maxBound :: Nat
maxBound  =  Int -> Nat
Nat Int
forall a. Bounded a => a
maxBound;  minBound :: Nat
minBound  =  Int -> Nat
Nat Int
0
instance Bounded Nat1 where  maxBound :: Nat1
maxBound  =  Int -> Nat1
Nat1 Int
0;  minBound :: Nat1
minBound  =  Int -> Nat1
Nat1 Int
0
instance Bounded Nat2 where  maxBound :: Nat2
maxBound  =  Int -> Nat2
Nat2 Int
1;  minBound :: Nat2
minBound  =  Int -> Nat2
Nat2 Int
0
instance Bounded Nat3 where  maxBound :: Nat3
maxBound  =  Int -> Nat3
Nat3 Int
2;  minBound :: Nat3
minBound  =  Int -> Nat3
Nat3 Int
0
instance Bounded Nat4 where  maxBound :: Nat4
maxBound  =  Int -> Nat4
Nat4 Int
3;  minBound :: Nat4
minBound  =  Int -> Nat4
Nat4 Int
0
instance Bounded Nat5 where  maxBound :: Nat5
maxBound  =  Int -> Nat5
Nat5 Int
4;  minBound :: Nat5
minBound  =  Int -> Nat5
Nat5 Int
0
instance Bounded Nat6 where  maxBound :: Nat6
maxBound  =  Int -> Nat6
Nat6 Int
5;  minBound :: Nat6
minBound  =  Int -> Nat6
Nat6 Int
0
instance Bounded Nat7 where  maxBound :: Nat7
maxBound  =  Int -> Nat7
Nat7 Int
6;  minBound :: Nat7
minBound  =  Int -> Nat7
Nat7 Int
0
instance Bounded A where  maxBound :: A
maxBound  =  Int -> A
A Int
5;  minBound :: A
minBound  =  Int -> A
A Int
0
instance Bounded B where  maxBound :: B
maxBound  =  Int -> B
B Int
5;  minBound :: B
minBound  =  Int -> B
B Int
0
instance Bounded C where  maxBound :: C
maxBound  =  Int -> C
C Int
5;  minBound :: C
minBound  =  Int -> C
C Int
0
instance Bounded D where  maxBound :: D
maxBound  =  Int -> D
D Int
5;  minBound :: D
minBound  =  Int -> D
D Int
0
instance Bounded E where  maxBound :: E
maxBound  =  Int -> E
E Int
5;  minBound :: E
minBound  =  Int -> E
E Int
0
instance Bounded F where  maxBound :: F
maxBound  =  Int -> F
F Int
5;  minBound :: F
minBound  =  Int -> F
F Int
0

instance Enum Int1 where
  toEnum :: Int -> Int1
toEnum    =  Int -> Int1
int1;    enumFrom :: Int1 -> [Int1]
enumFrom      =  Int1 -> [Int1]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Int1 -> Int
fromEnum  =  Int1 -> Int
unInt1;  enumFromThen :: Int1 -> Int1 -> [Int1]
enumFromThen  =  Int1 -> Int1 -> [Int1]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Int2 where
  toEnum :: Int -> Int2
toEnum    =  Int -> Int2
int2;    enumFrom :: Int2 -> [Int2]
enumFrom      =  Int2 -> [Int2]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Int2 -> Int
fromEnum  =  Int2 -> Int
unInt2;  enumFromThen :: Int2 -> Int2 -> [Int2]
enumFromThen  =  Int2 -> Int2 -> [Int2]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Int3 where
  toEnum :: Int -> Int3
toEnum    =  Int -> Int3
int3;    enumFrom :: Int3 -> [Int3]
enumFrom      =  Int3 -> [Int3]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Int3 -> Int
fromEnum  =  Int3 -> Int
unInt3;  enumFromThen :: Int3 -> Int3 -> [Int3]
enumFromThen  =  Int3 -> Int3 -> [Int3]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Int4 where
  toEnum :: Int -> Int4
toEnum    =  Int -> Int4
int4;    enumFrom :: Int4 -> [Int4]
enumFrom      =  Int4 -> [Int4]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Int4 -> Int
fromEnum  =  Int4 -> Int
unInt4;  enumFromThen :: Int4 -> Int4 -> [Int4]
enumFromThen  =  Int4 -> Int4 -> [Int4]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Word1 where
  toEnum :: Int -> Word1
toEnum    =  Int -> Word1
word1;    enumFrom :: Word1 -> [Word1]
enumFrom      =  Word1 -> [Word1]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Word1 -> Int
fromEnum  =  Word1 -> Int
unWord1;  enumFromThen :: Word1 -> Word1 -> [Word1]
enumFromThen  =  Word1 -> Word1 -> [Word1]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Word2 where
  toEnum :: Int -> Word2
toEnum    =  Int -> Word2
word2;    enumFrom :: Word2 -> [Word2]
enumFrom      =  Word2 -> [Word2]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Word2 -> Int
fromEnum  =  Word2 -> Int
unWord2;  enumFromThen :: Word2 -> Word2 -> [Word2]
enumFromThen  =  Word2 -> Word2 -> [Word2]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Word3 where
  toEnum :: Int -> Word3
toEnum    =  Int -> Word3
word3;    enumFrom :: Word3 -> [Word3]
enumFrom      =  Word3 -> [Word3]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Word3 -> Int
fromEnum  =  Word3 -> Int
unWord3;  enumFromThen :: Word3 -> Word3 -> [Word3]
enumFromThen  =  Word3 -> Word3 -> [Word3]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Word4 where
  toEnum :: Int -> Word4
toEnum    =  Int -> Word4
word4;    enumFrom :: Word4 -> [Word4]
enumFrom      =  Word4 -> [Word4]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Word4 -> Int
fromEnum  =  Word4 -> Int
unWord4;  enumFromThen :: Word4 -> Word4 -> [Word4]
enumFromThen  =  Word4 -> Word4 -> [Word4]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat where
  toEnum :: Int -> Nat
toEnum    =  Int -> Nat
nat;    enumFrom :: Nat -> [Nat]
enumFrom      =  Nat -> [Nat]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat -> Int
fromEnum  =  Nat -> Int
unNat;  enumFromThen :: Nat -> Nat -> [Nat]
enumFromThen  =  Nat -> Nat -> [Nat]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat1 where
  toEnum :: Int -> Nat1
toEnum    =  Int -> Nat1
nat1;    enumFrom :: Nat1 -> [Nat1]
enumFrom      =  Nat1 -> [Nat1]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat1 -> Int
fromEnum  =  Nat1 -> Int
unNat1;  enumFromThen :: Nat1 -> Nat1 -> [Nat1]
enumFromThen  =  Nat1 -> Nat1 -> [Nat1]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat2 where
  toEnum :: Int -> Nat2
toEnum    =  Int -> Nat2
nat2;    enumFrom :: Nat2 -> [Nat2]
enumFrom      =  Nat2 -> [Nat2]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat2 -> Int
fromEnum  =  Nat2 -> Int
unNat2;  enumFromThen :: Nat2 -> Nat2 -> [Nat2]
enumFromThen  =  Nat2 -> Nat2 -> [Nat2]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat3 where
  toEnum :: Int -> Nat3
toEnum    =  Int -> Nat3
nat3;    enumFrom :: Nat3 -> [Nat3]
enumFrom      =  Nat3 -> [Nat3]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat3 -> Int
fromEnum  =  Nat3 -> Int
unNat3;  enumFromThen :: Nat3 -> Nat3 -> [Nat3]
enumFromThen  =  Nat3 -> Nat3 -> [Nat3]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat4 where
  toEnum :: Int -> Nat4
toEnum    =  Int -> Nat4
nat4;    enumFrom :: Nat4 -> [Nat4]
enumFrom      =  Nat4 -> [Nat4]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat4 -> Int
fromEnum  =  Nat4 -> Int
unNat4;  enumFromThen :: Nat4 -> Nat4 -> [Nat4]
enumFromThen  =  Nat4 -> Nat4 -> [Nat4]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat5 where
  toEnum :: Int -> Nat5
toEnum    =  Int -> Nat5
nat5;    enumFrom :: Nat5 -> [Nat5]
enumFrom      =  Nat5 -> [Nat5]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat5 -> Int
fromEnum  =  Nat5 -> Int
unNat5;  enumFromThen :: Nat5 -> Nat5 -> [Nat5]
enumFromThen  =  Nat5 -> Nat5 -> [Nat5]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat6 where
  toEnum :: Int -> Nat6
toEnum    =  Int -> Nat6
nat6;    enumFrom :: Nat6 -> [Nat6]
enumFrom      =  Nat6 -> [Nat6]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat6 -> Int
fromEnum  =  Nat6 -> Int
unNat6;  enumFromThen :: Nat6 -> Nat6 -> [Nat6]
enumFromThen  =  Nat6 -> Nat6 -> [Nat6]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Nat7 where
  toEnum :: Int -> Nat7
toEnum    =  Int -> Nat7
nat7;    enumFrom :: Nat7 -> [Nat7]
enumFrom      =  Nat7 -> [Nat7]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: Nat7 -> Int
fromEnum  =  Nat7 -> Int
unNat7;  enumFromThen :: Nat7 -> Nat7 -> [Nat7]
enumFromThen  =  Nat7 -> Nat7 -> [Nat7]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum Natural where
  toEnum :: Int -> Natural
toEnum    =  Integer -> Natural
natural (Integer -> Natural) -> (Int -> Integer) -> Int -> Natural
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral
  fromEnum :: Natural -> Int
fromEnum  =  Integer -> Int
forall a. Num a => Integer -> a
fromInteger (Integer -> Int) -> (Natural -> Integer) -> Natural -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Natural -> Integer
unNatural
  enumFrom :: Natural -> [Natural]
enumFrom     (Natural Integer
x)              =  (Integer -> Natural) -> [Integer] -> [Natural]
forall a b. (a -> b) -> [a] -> [b]
map Integer -> Natural
Natural [Integer
x..]
  enumFromThen :: Natural -> Natural -> [Natural]
enumFromThen (Natural Integer
x) (Natural Integer
s)  =  (Integer -> Natural) -> [Integer] -> [Natural]
forall a b. (a -> b) -> [a] -> [b]
map Integer -> Natural
Natural [Integer
x,Integer
s..]

instance Enum A where
  toEnum :: Int -> A
toEnum    =  Int -> A
mkA;  enumFrom :: A -> [A]
enumFrom      =  A -> [A]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: A -> Int
fromEnum  =  A -> Int
unA;  enumFromThen :: A -> A -> [A]
enumFromThen  =  A -> A -> [A]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum B where
  toEnum :: Int -> B
toEnum    =  Int -> B
mkB;  enumFrom :: B -> [B]
enumFrom      =  B -> [B]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: B -> Int
fromEnum  =  B -> Int
unB;  enumFromThen :: B -> B -> [B]
enumFromThen  =  B -> B -> [B]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum C where
  toEnum :: Int -> C
toEnum    =  Int -> C
mkC;  enumFrom :: C -> [C]
enumFrom      =  C -> [C]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: C -> Int
fromEnum  =  C -> Int
unC;  enumFromThen :: C -> C -> [C]
enumFromThen  =  C -> C -> [C]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum D where
  toEnum :: Int -> D
toEnum    =  Int -> D
mkD;  enumFrom :: D -> [D]
enumFrom      =  D -> [D]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: D -> Int
fromEnum  =  D -> Int
unD;  enumFromThen :: D -> D -> [D]
enumFromThen  =  D -> D -> [D]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum E where
  toEnum :: Int -> E
toEnum    =  Int -> E
mkE;  enumFrom :: E -> [E]
enumFrom      =  E -> [E]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
  fromEnum :: E -> Int
fromEnum  =  E -> Int
unE;  enumFromThen :: E -> E -> [E]
enumFromThen  =  E -> E -> [E]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

instance Enum F where toEnum :: Int -> F
toEnum    =  Int -> F
mkF;  enumFrom :: F -> [F]
enumFrom      =  F -> [F]
forall a. (Ord a, Bounded a, Enum a) => a -> [a]
boundedEnumFrom
                      fromEnum :: F -> Int
fromEnum  =  F -> Int
unF;  enumFromThen :: F -> F -> [F]
enumFromThen  =  F -> F -> [F]
forall a. (Ord a, Bounded a, Enum a) => a -> a -> [a]
boundedEnumFromThen

rng :: Enum a => (a,a) -> [a]
rng :: forall a. Enum a => (a, a) -> [a]
rng (a
m,a
n)  =  [a
m..a
n]

idx :: Integral a => (a,a) -> a -> Int
idx :: forall a. Integral a => (a, a) -> a -> Int
idx b :: (a, a)
b@(a
m,a
_) a
i  | (a, a) -> a -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng (a, a)
b a
i   =  a -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (a
i a -> a -> a
forall a. Num a => a -> a -> a
- a
m)
               | Bool
otherwise  =  String -> Int
forall a. HasCallStack => String -> a
error String
"Test.LeanCheck.Utils.Types.idx: index out of range"

irng :: Ord a => (a,a) -> a -> Bool
irng :: forall a. Ord a => (a, a) -> a -> Bool
irng (a
m,a
n) a
i  =  a
m a -> a -> Bool
forall a. Ord a => a -> a -> Bool
<= a
i Bool -> Bool -> Bool
&& a
i a -> a -> Bool
forall a. Ord a => a -> a -> Bool
<= a
m

instance Ix Int1    where  range :: (Int1, Int1) -> [Int1]
range  =  (Int1, Int1) -> [Int1]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Int1, Int1) -> Int1 -> Int
index  =  (Int1, Int1) -> Int1 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Int1, Int1) -> Int1 -> Bool
inRange  =  (Int1, Int1) -> Int1 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Int2    where  range :: (Int2, Int2) -> [Int2]
range  =  (Int2, Int2) -> [Int2]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Int2, Int2) -> Int2 -> Int
index  =  (Int2, Int2) -> Int2 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Int2, Int2) -> Int2 -> Bool
inRange  =  (Int2, Int2) -> Int2 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Int3    where  range :: (Int3, Int3) -> [Int3]
range  =  (Int3, Int3) -> [Int3]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Int3, Int3) -> Int3 -> Int
index  =  (Int3, Int3) -> Int3 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Int3, Int3) -> Int3 -> Bool
inRange  =  (Int3, Int3) -> Int3 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Int4    where  range :: (Int4, Int4) -> [Int4]
range  =  (Int4, Int4) -> [Int4]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Int4, Int4) -> Int4 -> Int
index  =  (Int4, Int4) -> Int4 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Int4, Int4) -> Int4 -> Bool
inRange  =  (Int4, Int4) -> Int4 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Word1   where  range :: (Word1, Word1) -> [Word1]
range  =  (Word1, Word1) -> [Word1]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Word1, Word1) -> Word1 -> Int
index  =  (Word1, Word1) -> Word1 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Word1, Word1) -> Word1 -> Bool
inRange  =  (Word1, Word1) -> Word1 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Word2   where  range :: (Word2, Word2) -> [Word2]
range  =  (Word2, Word2) -> [Word2]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Word2, Word2) -> Word2 -> Int
index  =  (Word2, Word2) -> Word2 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Word2, Word2) -> Word2 -> Bool
inRange  =  (Word2, Word2) -> Word2 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Word3   where  range :: (Word3, Word3) -> [Word3]
range  =  (Word3, Word3) -> [Word3]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Word3, Word3) -> Word3 -> Int
index  =  (Word3, Word3) -> Word3 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Word3, Word3) -> Word3 -> Bool
inRange  =  (Word3, Word3) -> Word3 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Word4   where  range :: (Word4, Word4) -> [Word4]
range  =  (Word4, Word4) -> [Word4]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Word4, Word4) -> Word4 -> Int
index  =  (Word4, Word4) -> Word4 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Word4, Word4) -> Word4 -> Bool
inRange  =  (Word4, Word4) -> Word4 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat     where  range :: (Nat, Nat) -> [Nat]
range  =  (Nat, Nat) -> [Nat]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat, Nat) -> Nat -> Int
index  =  (Nat, Nat) -> Nat -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat, Nat) -> Nat -> Bool
inRange  =  (Nat, Nat) -> Nat -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat1    where  range :: (Nat1, Nat1) -> [Nat1]
range  =  (Nat1, Nat1) -> [Nat1]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat1, Nat1) -> Nat1 -> Int
index  =  (Nat1, Nat1) -> Nat1 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat1, Nat1) -> Nat1 -> Bool
inRange  =  (Nat1, Nat1) -> Nat1 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat2    where  range :: (Nat2, Nat2) -> [Nat2]
range  =  (Nat2, Nat2) -> [Nat2]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat2, Nat2) -> Nat2 -> Int
index  =  (Nat2, Nat2) -> Nat2 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat2, Nat2) -> Nat2 -> Bool
inRange  =  (Nat2, Nat2) -> Nat2 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat3    where  range :: (Nat3, Nat3) -> [Nat3]
range  =  (Nat3, Nat3) -> [Nat3]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat3, Nat3) -> Nat3 -> Int
index  =  (Nat3, Nat3) -> Nat3 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat3, Nat3) -> Nat3 -> Bool
inRange  =  (Nat3, Nat3) -> Nat3 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat4    where  range :: (Nat4, Nat4) -> [Nat4]
range  =  (Nat4, Nat4) -> [Nat4]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat4, Nat4) -> Nat4 -> Int
index  =  (Nat4, Nat4) -> Nat4 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat4, Nat4) -> Nat4 -> Bool
inRange  =  (Nat4, Nat4) -> Nat4 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat5    where  range :: (Nat5, Nat5) -> [Nat5]
range  =  (Nat5, Nat5) -> [Nat5]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat5, Nat5) -> Nat5 -> Int
index  =  (Nat5, Nat5) -> Nat5 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat5, Nat5) -> Nat5 -> Bool
inRange  =  (Nat5, Nat5) -> Nat5 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat6    where  range :: (Nat6, Nat6) -> [Nat6]
range  =  (Nat6, Nat6) -> [Nat6]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat6, Nat6) -> Nat6 -> Int
index  =  (Nat6, Nat6) -> Nat6 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat6, Nat6) -> Nat6 -> Bool
inRange  =  (Nat6, Nat6) -> Nat6 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Nat7    where  range :: (Nat7, Nat7) -> [Nat7]
range  =  (Nat7, Nat7) -> [Nat7]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Nat7, Nat7) -> Nat7 -> Int
index  =  (Nat7, Nat7) -> Nat7 -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Nat7, Nat7) -> Nat7 -> Bool
inRange  =  (Nat7, Nat7) -> Nat7 -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix Natural where  range :: (Natural, Natural) -> [Natural]
range  =  (Natural, Natural) -> [Natural]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (Natural, Natural) -> Natural -> Int
index  =  (Natural, Natural) -> Natural -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (Natural, Natural) -> Natural -> Bool
inRange  =  (Natural, Natural) -> Natural -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix A       where  range :: (A, A) -> [A]
range  =  (A, A) -> [A]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (A, A) -> A -> Int
index  =  (A, A) -> A -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (A, A) -> A -> Bool
inRange  =  (A, A) -> A -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix B       where  range :: (B, B) -> [B]
range  =  (B, B) -> [B]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (B, B) -> B -> Int
index  =  (B, B) -> B -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (B, B) -> B -> Bool
inRange  =  (B, B) -> B -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix C       where  range :: (C, C) -> [C]
range  =  (C, C) -> [C]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (C, C) -> C -> Int
index  =  (C, C) -> C -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (C, C) -> C -> Bool
inRange  =  (C, C) -> C -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix D       where  range :: (D, D) -> [D]
range  =  (D, D) -> [D]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (D, D) -> D -> Int
index  =  (D, D) -> D -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (D, D) -> D -> Bool
inRange  =  (D, D) -> D -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix E       where  range :: (E, E) -> [E]
range  =  (E, E) -> [E]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (E, E) -> E -> Int
index  =  (E, E) -> E -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (E, E) -> E -> Bool
inRange  =  (E, E) -> E -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng
instance Ix F       where  range :: (F, F) -> [F]
range  =  (F, F) -> [F]
forall a. Enum a => (a, a) -> [a]
rng;  index :: (F, F) -> F -> Int
index  =  (F, F) -> F -> Int
forall a. Integral a => (a, a) -> a -> Int
idx;  inRange :: (F, F) -> F -> Bool
inRange  =  (F, F) -> F -> Bool
forall a. Ord a => (a, a) -> a -> Bool
irng

instance Listable Int1 where  list :: [Int1]
list  =  [Int1
0,Int1
forall a. Bounded a => a
minBound]
instance Listable Int2 where  list :: [Int2]
list  =  [Int2]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Int3 where  list :: [Int3]
list  =  [Int3]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Int4 where  list :: [Int4]
list  =  [Int4]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Word1 where  list :: [Word1]
list  =  [Word1]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Word2 where  list :: [Word2]
list  =  [Word2]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Word3 where  list :: [Word3]
list  =  [Word3]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Word4 where  list :: [Word4]
list  =  [Word4]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat where  list :: [Nat]
list  =  [Nat]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat1 where  list :: [Nat1]
list  =  [Nat1]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat2 where  list :: [Nat2]
list  =  [Nat2]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat3 where  list :: [Nat3]
list  =  [Nat3]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat4 where  list :: [Nat4]
list  =  [Nat4]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat5 where  list :: [Nat5]
list  =  [Nat5]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat6 where  list :: [Nat6]
list  =  [Nat6]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Nat7 where  list :: [Nat7]
list  =  [Nat7]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable Natural where  list :: [Natural]
list  =  [Natural]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable A where  list :: [A]
list  =  [A]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable B where  list :: [B]
list  =  [B]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable C where  list :: [C]
list  =  [C]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable D where  list :: [D]
list  =  [D]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable E where  list :: [E]
list  =  [E]
forall a. (Ord a, Num a) => [a]
listIntegral
instance Listable F where  list :: [F]
list  =  [F]
forall a. (Ord a, Num a) => [a]
listIntegral

-- | Deprecated.  Use 'Word1'.
type UInt1  =  Word1

-- | Deprecated.  Use 'Word2'.
type UInt2  =  Word2

-- | Deprecated.  Use 'Word3'.
type UInt3  =  Word3

-- | Deprecated.  Use 'Word4'.
type UInt4  =  Word4

-- | Lists without repeated elements.
--
-- > > take 6 $ list :: [NoDup Nat]
-- > [NoDup [],NoDup [0],NoDup [1],NoDup [0,1],NoDup [1,0],NoDup [2]]
--
-- Example, checking the property that @nub@ is an identity:
--
-- > import Data.List (nub)
-- > > check $ \xs -> nub xs == (xs :: [Int])
-- > *** Failed! Falsifiable (after 3 tests):
-- > [0,0]
-- > > check $ \(NoDup xs) -> nub xs == (xs :: [Int])
-- > +++ OK, passed 200 tests.
newtype NoDup a  =  NoDup [a]  deriving (Int -> NoDup a -> ShowS
[NoDup a] -> ShowS
NoDup a -> String
(Int -> NoDup a -> ShowS)
-> (NoDup a -> String) -> ([NoDup a] -> ShowS) -> Show (NoDup a)
forall a. Show a => Int -> NoDup a -> ShowS
forall a. Show a => [NoDup a] -> ShowS
forall a. Show a => NoDup a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> NoDup a -> ShowS
showsPrec :: Int -> NoDup a -> ShowS
$cshow :: forall a. Show a => NoDup a -> String
show :: NoDup a -> String
$cshowList :: forall a. Show a => [NoDup a] -> ShowS
showList :: [NoDup a] -> ShowS
Show, ReadPrec [NoDup a]
ReadPrec (NoDup a)
Int -> ReadS (NoDup a)
ReadS [NoDup a]
(Int -> ReadS (NoDup a))
-> ReadS [NoDup a]
-> ReadPrec (NoDup a)
-> ReadPrec [NoDup a]
-> Read (NoDup a)
forall a. Read a => ReadPrec [NoDup a]
forall a. Read a => ReadPrec (NoDup a)
forall a. Read a => Int -> ReadS (NoDup a)
forall a. Read a => ReadS [NoDup a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (NoDup a)
readsPrec :: Int -> ReadS (NoDup a)
$creadList :: forall a. Read a => ReadS [NoDup a]
readList :: ReadS [NoDup a]
$creadPrec :: forall a. Read a => ReadPrec (NoDup a)
readPrec :: ReadPrec (NoDup a)
$creadListPrec :: forall a. Read a => ReadPrec [NoDup a]
readListPrec :: ReadPrec [NoDup a]
Read, NoDup a -> NoDup a -> Bool
(NoDup a -> NoDup a -> Bool)
-> (NoDup a -> NoDup a -> Bool) -> Eq (NoDup a)
forall a. Eq a => NoDup a -> NoDup a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => NoDup a -> NoDup a -> Bool
== :: NoDup a -> NoDup a -> Bool
$c/= :: forall a. Eq a => NoDup a -> NoDup a -> Bool
/= :: NoDup a -> NoDup a -> Bool
Eq, Eq (NoDup a)
Eq (NoDup a) =>
(NoDup a -> NoDup a -> Ordering)
-> (NoDup a -> NoDup a -> Bool)
-> (NoDup a -> NoDup a -> Bool)
-> (NoDup a -> NoDup a -> Bool)
-> (NoDup a -> NoDup a -> Bool)
-> (NoDup a -> NoDup a -> NoDup a)
-> (NoDup a -> NoDup a -> NoDup a)
-> Ord (NoDup a)
NoDup a -> NoDup a -> Bool
NoDup a -> NoDup a -> Ordering
NoDup a -> NoDup a -> NoDup a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (NoDup a)
forall a. Ord a => NoDup a -> NoDup a -> Bool
forall a. Ord a => NoDup a -> NoDup a -> Ordering
forall a. Ord a => NoDup a -> NoDup a -> NoDup a
$ccompare :: forall a. Ord a => NoDup a -> NoDup a -> Ordering
compare :: NoDup a -> NoDup a -> Ordering
$c< :: forall a. Ord a => NoDup a -> NoDup a -> Bool
< :: NoDup a -> NoDup a -> Bool
$c<= :: forall a. Ord a => NoDup a -> NoDup a -> Bool
<= :: NoDup a -> NoDup a -> Bool
$c> :: forall a. Ord a => NoDup a -> NoDup a -> Bool
> :: NoDup a -> NoDup a -> Bool
$c>= :: forall a. Ord a => NoDup a -> NoDup a -> Bool
>= :: NoDup a -> NoDup a -> Bool
$cmax :: forall a. Ord a => NoDup a -> NoDup a -> NoDup a
max :: NoDup a -> NoDup a -> NoDup a
$cmin :: forall a. Ord a => NoDup a -> NoDup a -> NoDup a
min :: NoDup a -> NoDup a -> NoDup a
Ord)

-- | Lists representing bags (multisets).
--   The 'Listable' 'tiers' enumeration will not have repeated bags.
--
-- > > take 6 (list :: [Bag Nat])
-- > [Bag [],Bag [0],Bag [0,0],Bag [1],Bag [0,0,0],Bag [0,1]]
--
-- See also: 'Test.LeanCheck.Tiers.bagsOf' and 'bagCons'.
newtype Bag a  =  Bag [a]  deriving (Int -> Bag a -> ShowS
[Bag a] -> ShowS
Bag a -> String
(Int -> Bag a -> ShowS)
-> (Bag a -> String) -> ([Bag a] -> ShowS) -> Show (Bag a)
forall a. Show a => Int -> Bag a -> ShowS
forall a. Show a => [Bag a] -> ShowS
forall a. Show a => Bag a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Bag a -> ShowS
showsPrec :: Int -> Bag a -> ShowS
$cshow :: forall a. Show a => Bag a -> String
show :: Bag a -> String
$cshowList :: forall a. Show a => [Bag a] -> ShowS
showList :: [Bag a] -> ShowS
Show, ReadPrec [Bag a]
ReadPrec (Bag a)
Int -> ReadS (Bag a)
ReadS [Bag a]
(Int -> ReadS (Bag a))
-> ReadS [Bag a]
-> ReadPrec (Bag a)
-> ReadPrec [Bag a]
-> Read (Bag a)
forall a. Read a => ReadPrec [Bag a]
forall a. Read a => ReadPrec (Bag a)
forall a. Read a => Int -> ReadS (Bag a)
forall a. Read a => ReadS [Bag a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Bag a)
readsPrec :: Int -> ReadS (Bag a)
$creadList :: forall a. Read a => ReadS [Bag a]
readList :: ReadS [Bag a]
$creadPrec :: forall a. Read a => ReadPrec (Bag a)
readPrec :: ReadPrec (Bag a)
$creadListPrec :: forall a. Read a => ReadPrec [Bag a]
readListPrec :: ReadPrec [Bag a]
Read, Bag a -> Bag a -> Bool
(Bag a -> Bag a -> Bool) -> (Bag a -> Bag a -> Bool) -> Eq (Bag a)
forall a. Eq a => Bag a -> Bag a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Bag a -> Bag a -> Bool
== :: Bag a -> Bag a -> Bool
$c/= :: forall a. Eq a => Bag a -> Bag a -> Bool
/= :: Bag a -> Bag a -> Bool
Eq, Eq (Bag a)
Eq (Bag a) =>
(Bag a -> Bag a -> Ordering)
-> (Bag a -> Bag a -> Bool)
-> (Bag a -> Bag a -> Bool)
-> (Bag a -> Bag a -> Bool)
-> (Bag a -> Bag a -> Bool)
-> (Bag a -> Bag a -> Bag a)
-> (Bag a -> Bag a -> Bag a)
-> Ord (Bag a)
Bag a -> Bag a -> Bool
Bag a -> Bag a -> Ordering
Bag a -> Bag a -> Bag a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Bag a)
forall a. Ord a => Bag a -> Bag a -> Bool
forall a. Ord a => Bag a -> Bag a -> Ordering
forall a. Ord a => Bag a -> Bag a -> Bag a
$ccompare :: forall a. Ord a => Bag a -> Bag a -> Ordering
compare :: Bag a -> Bag a -> Ordering
$c< :: forall a. Ord a => Bag a -> Bag a -> Bool
< :: Bag a -> Bag a -> Bool
$c<= :: forall a. Ord a => Bag a -> Bag a -> Bool
<= :: Bag a -> Bag a -> Bool
$c> :: forall a. Ord a => Bag a -> Bag a -> Bool
> :: Bag a -> Bag a -> Bool
$c>= :: forall a. Ord a => Bag a -> Bag a -> Bool
>= :: Bag a -> Bag a -> Bool
$cmax :: forall a. Ord a => Bag a -> Bag a -> Bag a
max :: Bag a -> Bag a -> Bag a
$cmin :: forall a. Ord a => Bag a -> Bag a -> Bag a
min :: Bag a -> Bag a -> Bag a
Ord)

-- | Lists representing sets.
--   The 'Listable' 'tiers' enumeration will not have repeated sets.
--
-- > > take 6 (list :: [Set Nat])
-- > [Set [],Set [0],Set [1],Set [0,1],Set [2],Set [0,2]]
newtype Set a  =  Set [a]  deriving (Int -> Set a -> ShowS
[Set a] -> ShowS
Set a -> String
(Int -> Set a -> ShowS)
-> (Set a -> String) -> ([Set a] -> ShowS) -> Show (Set a)
forall a. Show a => Int -> Set a -> ShowS
forall a. Show a => [Set a] -> ShowS
forall a. Show a => Set a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Set a -> ShowS
showsPrec :: Int -> Set a -> ShowS
$cshow :: forall a. Show a => Set a -> String
show :: Set a -> String
$cshowList :: forall a. Show a => [Set a] -> ShowS
showList :: [Set a] -> ShowS
Show, ReadPrec [Set a]
ReadPrec (Set a)
Int -> ReadS (Set a)
ReadS [Set a]
(Int -> ReadS (Set a))
-> ReadS [Set a]
-> ReadPrec (Set a)
-> ReadPrec [Set a]
-> Read (Set a)
forall a. Read a => ReadPrec [Set a]
forall a. Read a => ReadPrec (Set a)
forall a. Read a => Int -> ReadS (Set a)
forall a. Read a => ReadS [Set a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Set a)
readsPrec :: Int -> ReadS (Set a)
$creadList :: forall a. Read a => ReadS [Set a]
readList :: ReadS [Set a]
$creadPrec :: forall a. Read a => ReadPrec (Set a)
readPrec :: ReadPrec (Set a)
$creadListPrec :: forall a. Read a => ReadPrec [Set a]
readListPrec :: ReadPrec [Set a]
Read, Set a -> Set a -> Bool
(Set a -> Set a -> Bool) -> (Set a -> Set a -> Bool) -> Eq (Set a)
forall a. Eq a => Set a -> Set a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Set a -> Set a -> Bool
== :: Set a -> Set a -> Bool
$c/= :: forall a. Eq a => Set a -> Set a -> Bool
/= :: Set a -> Set a -> Bool
Eq, Eq (Set a)
Eq (Set a) =>
(Set a -> Set a -> Ordering)
-> (Set a -> Set a -> Bool)
-> (Set a -> Set a -> Bool)
-> (Set a -> Set a -> Bool)
-> (Set a -> Set a -> Bool)
-> (Set a -> Set a -> Set a)
-> (Set a -> Set a -> Set a)
-> Ord (Set a)
Set a -> Set a -> Bool
Set a -> Set a -> Ordering
Set a -> Set a -> Set a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Set a)
forall a. Ord a => Set a -> Set a -> Bool
forall a. Ord a => Set a -> Set a -> Ordering
forall a. Ord a => Set a -> Set a -> Set a
$ccompare :: forall a. Ord a => Set a -> Set a -> Ordering
compare :: Set a -> Set a -> Ordering
$c< :: forall a. Ord a => Set a -> Set a -> Bool
< :: Set a -> Set a -> Bool
$c<= :: forall a. Ord a => Set a -> Set a -> Bool
<= :: Set a -> Set a -> Bool
$c> :: forall a. Ord a => Set a -> Set a -> Bool
> :: Set a -> Set a -> Bool
$c>= :: forall a. Ord a => Set a -> Set a -> Bool
>= :: Set a -> Set a -> Bool
$cmax :: forall a. Ord a => Set a -> Set a -> Set a
max :: Set a -> Set a -> Set a
$cmin :: forall a. Ord a => Set a -> Set a -> Set a
min :: Set a -> Set a -> Set a
Ord)

-- | Lists of pairs representing maps.
--   The 'Listable' 'tiers' enumeration will not have repeated maps.
--
-- > > take 6 (list :: [Map Nat Nat])
-- > [Map [],Map [(0,0)],Map [(0,1)],Map [(1,0)],Map [(0,2)],Map [(1,1)]]
newtype Map a b  =  Map [(a,b)]  deriving (Int -> Map a b -> ShowS
[Map a b] -> ShowS
Map a b -> String
(Int -> Map a b -> ShowS)
-> (Map a b -> String) -> ([Map a b] -> ShowS) -> Show (Map a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b. (Show a, Show b) => Int -> Map a b -> ShowS
forall a b. (Show a, Show b) => [Map a b] -> ShowS
forall a b. (Show a, Show b) => Map a b -> String
$cshowsPrec :: forall a b. (Show a, Show b) => Int -> Map a b -> ShowS
showsPrec :: Int -> Map a b -> ShowS
$cshow :: forall a b. (Show a, Show b) => Map a b -> String
show :: Map a b -> String
$cshowList :: forall a b. (Show a, Show b) => [Map a b] -> ShowS
showList :: [Map a b] -> ShowS
Show, ReadPrec [Map a b]
ReadPrec (Map a b)
Int -> ReadS (Map a b)
ReadS [Map a b]
(Int -> ReadS (Map a b))
-> ReadS [Map a b]
-> ReadPrec (Map a b)
-> ReadPrec [Map a b]
-> Read (Map a b)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall a b. (Read a, Read b) => ReadPrec [Map a b]
forall a b. (Read a, Read b) => ReadPrec (Map a b)
forall a b. (Read a, Read b) => Int -> ReadS (Map a b)
forall a b. (Read a, Read b) => ReadS [Map a b]
$creadsPrec :: forall a b. (Read a, Read b) => Int -> ReadS (Map a b)
readsPrec :: Int -> ReadS (Map a b)
$creadList :: forall a b. (Read a, Read b) => ReadS [Map a b]
readList :: ReadS [Map a b]
$creadPrec :: forall a b. (Read a, Read b) => ReadPrec (Map a b)
readPrec :: ReadPrec (Map a b)
$creadListPrec :: forall a b. (Read a, Read b) => ReadPrec [Map a b]
readListPrec :: ReadPrec [Map a b]
Read, Map a b -> Map a b -> Bool
(Map a b -> Map a b -> Bool)
-> (Map a b -> Map a b -> Bool) -> Eq (Map a b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a b. (Eq a, Eq b) => Map a b -> Map a b -> Bool
$c== :: forall a b. (Eq a, Eq b) => Map a b -> Map a b -> Bool
== :: Map a b -> Map a b -> Bool
$c/= :: forall a b. (Eq a, Eq b) => Map a b -> Map a b -> Bool
/= :: Map a b -> Map a b -> Bool
Eq, Eq (Map a b)
Eq (Map a b) =>
(Map a b -> Map a b -> Ordering)
-> (Map a b -> Map a b -> Bool)
-> (Map a b -> Map a b -> Bool)
-> (Map a b -> Map a b -> Bool)
-> (Map a b -> Map a b -> Bool)
-> (Map a b -> Map a b -> Map a b)
-> (Map a b -> Map a b -> Map a b)
-> Ord (Map a b)
Map a b -> Map a b -> Bool
Map a b -> Map a b -> Ordering
Map a b -> Map a b -> Map a b
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a b. (Ord a, Ord b) => Eq (Map a b)
forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Bool
forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Ordering
forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Map a b
$ccompare :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Ordering
compare :: Map a b -> Map a b -> Ordering
$c< :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Bool
< :: Map a b -> Map a b -> Bool
$c<= :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Bool
<= :: Map a b -> Map a b -> Bool
$c> :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Bool
> :: Map a b -> Map a b -> Bool
$c>= :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Bool
>= :: Map a b -> Map a b -> Bool
$cmax :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Map a b
max :: Map a b -> Map a b -> Map a b
$cmin :: forall a b. (Ord a, Ord b) => Map a b -> Map a b -> Map a b
min :: Map a b -> Map a b -> Map a b
Ord)

instance Listable a => Listable (NoDup a) where  tiers :: [[NoDup a]]
tiers  =  ([a] -> NoDup a) -> [[NoDup a]]
forall a b. Listable a => ([a] -> b) -> [[b]]
noDupListCons [a] -> NoDup a
forall a. [a] -> NoDup a
NoDup
instance Listable a => Listable (Bag a)   where  tiers :: [[Bag a]]
tiers  =  ([a] -> Bag a) -> [[Bag a]]
forall a b. Listable a => ([a] -> b) -> [[b]]
bagCons [a] -> Bag a
forall a. [a] -> Bag a
Bag
instance Listable a => Listable (Set a)   where  tiers :: [[Set a]]
tiers  =  ([a] -> Set a) -> [[Set a]]
forall a b. Listable a => ([a] -> b) -> [[b]]
setCons [a] -> Set a
forall a. [a] -> Set a
Set
instance (Listable a, Listable b)
                    => Listable (Map a b) where  tiers :: [[Map a b]]
tiers  =  ([(a, b)] -> Map a b) -> [[Map a b]]
forall a b c. (Listable a, Listable b) => ([(a, b)] -> c) -> [[c]]
mapCons [(a, b)] -> Map a b
forall a b. [(a, b)] -> Map a b
Map

-- | 'X' type to be wrapped around integer types for an e-'X'-treme integer
--   enumeration.  See the 'Listable' instance for 'X'.  Use 'X' when
--   testing properties about overflows and the like:
--
-- > > check $ \x -> x + 1 > (x :: Int)
-- > +++ OK, passed 200 tests.
--
-- > > check $ \(X x) -> x + 1 > (x :: Int)
-- > +++ Failed! Falsifiable (after 4 tests):
-- > 9223372036854775807
newtype X a  =  X {forall a. X a -> a
unX :: a}  deriving (X a -> X a -> Bool
(X a -> X a -> Bool) -> (X a -> X a -> Bool) -> Eq (X a)
forall a. Eq a => X a -> X a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => X a -> X a -> Bool
== :: X a -> X a -> Bool
$c/= :: forall a. Eq a => X a -> X a -> Bool
/= :: X a -> X a -> Bool
Eq, Eq (X a)
Eq (X a) =>
(X a -> X a -> Ordering)
-> (X a -> X a -> Bool)
-> (X a -> X a -> Bool)
-> (X a -> X a -> Bool)
-> (X a -> X a -> Bool)
-> (X a -> X a -> X a)
-> (X a -> X a -> X a)
-> Ord (X a)
X a -> X a -> Bool
X a -> X a -> Ordering
X a -> X a -> X a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (X a)
forall a. Ord a => X a -> X a -> Bool
forall a. Ord a => X a -> X a -> Ordering
forall a. Ord a => X a -> X a -> X a
$ccompare :: forall a. Ord a => X a -> X a -> Ordering
compare :: X a -> X a -> Ordering
$c< :: forall a. Ord a => X a -> X a -> Bool
< :: X a -> X a -> Bool
$c<= :: forall a. Ord a => X a -> X a -> Bool
<= :: X a -> X a -> Bool
$c> :: forall a. Ord a => X a -> X a -> Bool
> :: X a -> X a -> Bool
$c>= :: forall a. Ord a => X a -> X a -> Bool
>= :: X a -> X a -> Bool
$cmax :: forall a. Ord a => X a -> X a -> X a
max :: X a -> X a -> X a
$cmin :: forall a. Ord a => X a -> X a -> X a
min :: X a -> X a -> X a
Ord)
instance Show a => Show (X a) where  show :: X a -> String
show (X a
x)  =  a -> String
forall a. Show a => a -> String
show a
x
instance (Integral a, Bounded a) => Listable (X a) where
  list :: [X a]
list  =  (a -> X a) -> [a] -> [X a]
forall a b. (a -> b) -> [a] -> [b]
map a -> X a
forall a. a -> X a
X [a]
forall a. (Bounded a, Integral a) => [a]
listXIntegral
-- ^ Extremily large integers are intercalated with small integers.
--
--   > list :: [X Int]  =  map X
--   >   [ 0, 1, -1, maxBound,   minBound
--   >      , 2, -2, maxBound-1, minBound+1
--   >      , 3, -3, maxBound-2, minBound+2
--   >      , ... ]

-- FIXME: make this work for Int2 / Word2 types
--        by checking then using normal enumeration
listXIntegral :: (Bounded a, Integral a) => [a]
listXIntegral :: forall a. (Bounded a, Integral a) => [a]
listXIntegral  =  a -> [a]
forall a. (Bounded a, Integral a) => a -> [a]
l a
forall a. HasCallStack => a
undefined
  where
  l :: (Bounded a, Integral a) => a -> [a]
  l :: forall a. (Bounded a, Integral a) => a -> [a]
l a
a | a -> Integer
forall a. (Bounded a, Integral a) => a -> Integer
count a
a Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= Integer
4  =  [a]
forall a. (Ord a, Num a) => [a]
listIntegral
      | a
min a -> a -> Bool
forall a. Ord a => a -> a -> Bool
< a
0       =  [a]
forall a. (Bounded a, Integral a) => [a]
listXIntegralN
      | Bool
otherwise     =  [a]
forall a. (Bounded a, Integral a) => [a]
listXIntegralP
    where
    min :: a
min  =  a
forall a. Bounded a => a
minBound a -> a -> a
forall a. a -> a -> a
`asTypeOf` a
a
-- The type-hackery above is needed so that we don't need to activate
-- ScopedTypeVariables

listXIntegralN :: (Bounded a, Integral a) => [a]
listXIntegralN :: forall a. (Bounded a, Integral a) => [a]
listXIntegralN  =  a
0 a -> [a] -> [a]
forall a. a -> [a] -> [a]
: (a -> a -> [a]
forall a. Integral a => a -> a -> [a]
extremes a
1 a
forall a. Bounded a => a
maxBound) [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
+| (a -> a -> [a]
forall a. Integral a => a -> a -> [a]
extremes (-a
1) a
forall a. Bounded a => a
minBound)
-- listXIntegralN :: Int4 =
--    0 : (([1,2,3,4] +| [7,6,5]) +| ([-1,-2,-3,-4] +| [-8,-7,-6,-5]))

listXIntegralP :: (Bounded a, Integral a) => [a]
listXIntegralP :: forall a. (Bounded a, Integral a) => [a]
listXIntegralP  =  a
0 a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a
1..a
midBound] [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++| [a
forall a. Bounded a => a
maxBound,(a
forall a. Bounded a => a
maxBounda -> a -> a
forall a. Num a => a -> a -> a
-a
1)..(a
midBounda -> a -> a
forall a. Num a => a -> a -> a
+a
1)]
  where
  midBound :: a
midBound  =  a
forall a. Bounded a => a
maxBound a -> a -> a
forall a. Integral a => a -> a -> a
`div` a
3 a -> a -> a
forall a. Num a => a -> a -> a
* a
2

-- how many of this type exist?
-- assumes 0 `elem` [minBound..maxBound]
count :: (Bounded a, Integral a) => a -> Integer
count :: forall a. (Bounded a, Integral a) => a -> Integer
count a
a  =  Integer
1 Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
max Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer -> Integer
forall a. Num a => a -> a
abs Integer
min
  where
  min :: Integer
min  =  a -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (a -> Integer) -> a -> Integer
forall a b. (a -> b) -> a -> b
$ a
forall a. Bounded a => a
minBound a -> a -> a
forall a. a -> a -> a
`asTypeOf` a
a
  max :: Integer
max  =  a -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (a -> Integer) -> a -> Integer
forall a b. (a -> b) -> a -> b
$ a
forall a. Bounded a => a
maxBound a -> a -> a
forall a. a -> a -> a
`asTypeOf` a
a

extremes :: (Integral a) => a -> a -> [a]
extremes :: forall a. Integral a => a -> a -> [a]
extremes a
x a
y
  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
> a
y      =  [a
x,a
xa -> a -> a
forall a. Num a => a -> a -> a
-a
1..a
m] [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
+| [a
y..a
ma -> a -> a
forall a. Num a => a -> a -> a
-a
1]
  | Bool
otherwise  =  [a
x..a
m] [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
+| [a
y,a
ya -> a -> a
forall a. Num a => a -> a -> a
-a
1..a
ma -> a -> a
forall a. Num a => a -> a -> a
+a
1]
  where  m :: a
m  =  a -> a -> a
forall a. Integral a => a -> a -> a
mid a
x a
y

mid :: Integral a => a -> a -> a
mid :: forall a. Integral a => a -> a -> a
mid a
x a
y  =  a
x a -> a -> a
forall a. Integral a => a -> a -> a
`div` a
2
         a -> a -> a
forall a. Num a => a -> a -> a
+  a
y a -> a -> a
forall a. Integral a => a -> a -> a
`div` a
2
         a -> a -> a
forall a. Num a => a -> a -> a
+  if a -> Bool
forall a. Integral a => a -> Bool
odd a
x Bool -> Bool -> Bool
&& a -> Bool
forall a. Integral a => a -> Bool
odd a
y then a
1 else a
0

-- | Lazily interleaves two lists, switching between elements of the two.
--   This version uses the first list more frequently than the second.
--
-- > [x,y,z,w] +| [a,b] == [x,y, a, z,w, b]
(++|) :: [a] -> [a] -> [a]
[]        ++| :: forall a. [a] -> [a] -> [a]
++| [a]
ys      =  [a]
ys
[a]
xs        ++| []      =  [a]
xs
[a
x]       ++| [a]
ys      =  a
xa -> [a] -> [a]
forall a. a -> [a] -> [a]
:[a]
ys
(a
x:a
x':[a]
xs) ++| (a
y:[a]
ys)  =  a
xa -> [a] -> [a]
forall a. a -> [a] -> [a]
:a
x'a -> [a] -> [a]
forall a. a -> [a] -> [a]
:a
ya -> [a] -> [a]
forall a. a -> [a] -> [a]
:([a]
xs [a] -> [a] -> [a]
forall a. [a] -> [a] -> [a]
++| [a]
ys)
infixr 5 ++|

-- | Wrap around lists of integers for an enumeration containing e-'X'-treme
--   integer values.
--
-- > > check $ \xs -> all (>=0) xs ==> sum (take 1 xs :: [Int]) <= sum xs
-- > +++ OK, passed 200 tests.
--
-- > > check $ \(Xs xs) -> all (>=0) xs ==> sum (take 1 xs :: [Int]) <= sum xs
-- > *** Failed! Falsifiable (after 56 tests):
-- > [1,9223372036854775807]
newtype Xs a  =  Xs [a]  deriving (Xs a -> Xs a -> Bool
(Xs a -> Xs a -> Bool) -> (Xs a -> Xs a -> Bool) -> Eq (Xs a)
forall a. Eq a => Xs a -> Xs a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Xs a -> Xs a -> Bool
== :: Xs a -> Xs a -> Bool
$c/= :: forall a. Eq a => Xs a -> Xs a -> Bool
/= :: Xs a -> Xs a -> Bool
Eq, Eq (Xs a)
Eq (Xs a) =>
(Xs a -> Xs a -> Ordering)
-> (Xs a -> Xs a -> Bool)
-> (Xs a -> Xs a -> Bool)
-> (Xs a -> Xs a -> Bool)
-> (Xs a -> Xs a -> Bool)
-> (Xs a -> Xs a -> Xs a)
-> (Xs a -> Xs a -> Xs a)
-> Ord (Xs a)
Xs a -> Xs a -> Bool
Xs a -> Xs a -> Ordering
Xs a -> Xs a -> Xs a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Xs a)
forall a. Ord a => Xs a -> Xs a -> Bool
forall a. Ord a => Xs a -> Xs a -> Ordering
forall a. Ord a => Xs a -> Xs a -> Xs a
$ccompare :: forall a. Ord a => Xs a -> Xs a -> Ordering
compare :: Xs a -> Xs a -> Ordering
$c< :: forall a. Ord a => Xs a -> Xs a -> Bool
< :: Xs a -> Xs a -> Bool
$c<= :: forall a. Ord a => Xs a -> Xs a -> Bool
<= :: Xs a -> Xs a -> Bool
$c> :: forall a. Ord a => Xs a -> Xs a -> Bool
> :: Xs a -> Xs a -> Bool
$c>= :: forall a. Ord a => Xs a -> Xs a -> Bool
>= :: Xs a -> Xs a -> Bool
$cmax :: forall a. Ord a => Xs a -> Xs a -> Xs a
max :: Xs a -> Xs a -> Xs a
$cmin :: forall a. Ord a => Xs a -> Xs a -> Xs a
min :: Xs a -> Xs a -> Xs a
Ord, Int -> Xs a -> ShowS
[Xs a] -> ShowS
Xs a -> String
(Int -> Xs a -> ShowS)
-> (Xs a -> String) -> ([Xs a] -> ShowS) -> Show (Xs a)
forall a. Show a => Int -> Xs a -> ShowS
forall a. Show a => [Xs a] -> ShowS
forall a. Show a => Xs a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Xs a -> ShowS
showsPrec :: Int -> Xs a -> ShowS
$cshow :: forall a. Show a => Xs a -> String
show :: Xs a -> String
$cshowList :: forall a. Show a => [Xs a] -> ShowS
showList :: [Xs a] -> ShowS
Show, ReadPrec [Xs a]
ReadPrec (Xs a)
Int -> ReadS (Xs a)
ReadS [Xs a]
(Int -> ReadS (Xs a))
-> ReadS [Xs a]
-> ReadPrec (Xs a)
-> ReadPrec [Xs a]
-> Read (Xs a)
forall a. Read a => ReadPrec [Xs a]
forall a. Read a => ReadPrec (Xs a)
forall a. Read a => Int -> ReadS (Xs a)
forall a. Read a => ReadS [Xs a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Xs a)
readsPrec :: Int -> ReadS (Xs a)
$creadList :: forall a. Read a => ReadS [Xs a]
readList :: ReadS [Xs a]
$creadPrec :: forall a. Read a => ReadPrec (Xs a)
readPrec :: ReadPrec (Xs a)
$creadListPrec :: forall a. Read a => ReadPrec [Xs a]
readListPrec :: ReadPrec [Xs a]
Read)
instance (Integral a, Bounded a) => Listable (Xs a) where
  tiers :: [[Xs a]]
tiers  =  ([X a] -> Xs a) -> [[Xs a]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 ([a] -> Xs a
forall a. [a] -> Xs a
Xs ([a] -> Xs a) -> ([X a] -> [a]) -> [X a] -> Xs a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (X a -> a) -> [X a] -> [a]
forall a b. (a -> b) -> [a] -> [b]
map X a -> a
forall a. X a -> a
unX)
-- ^ Lists with elements of the 'X' type.

-- | Space characters.
--
-- > list :: [Space]  =  " \t\n\r\f\v"
--
-- > > check $ \(Space c) -> isSpace c
-- > +++ OK, passed 6 tests (exhausted).
newtype Space  =  Space {Space -> Char
unSpace :: Char}

-- | Lowercase characters.
--
-- > list :: [Lower]  =  "abcdef..."
--
-- > > check $ \(Lower c) -> isLower c
-- > +++ OK, passed 26 tests (exhausted).
newtype Lower  =  Lower {Lower -> Char
unLower :: Char}

-- | Uppercase characters.
--
-- > list :: [Upper]  =  "ABCDEF..."
--
-- > > check $ \(Upper c) -> isUpper c
-- > +++ OK, passed 26 tests (exhausted).
newtype Upper  =  Upper {Upper -> Char
unUpper :: Char}

-- | Alphabetic characters.
--
-- > list :: [Alpha]  =  "aAbBcC..."
--
-- > > check $ \(Alpha c) -> isAlpha c
-- > +++ OK, passed 52 tests (exhausted).
--
-- Equivalent to 'Letter'.
newtype Alpha  =  Alpha {Alpha -> Char
unAlpha :: Char}

-- | Digits.
--
-- > list :: [Digit]  =  "0123456789"
--
-- > > check $ \(Digit c) -> isDigit c
-- > +++ OK, passed 10 tests (exhausted).
newtype Digit  =  Digit {Digit -> Char
unDigit :: Char}

-- | Alphanumeric characters.
--
-- > list :: [AlphaNum]  =  "0a1A2b3B4c..."
--
-- > > check $ \(AlphaNum c) -> isAlphaNum c
-- > +++ OK, passed 62 tests (exhausted).
newtype AlphaNum  =  AlphaNum {AlphaNum -> Char
unAlphaNum :: Char}

-- | Alphabetic characters.
--
-- > list :: [Letter]  =  "aAbBcC..."
--
-- > > check $ \(Letter c) -> isLetter c
-- > +++ OK, passed 52 tests (exhausted).
--
-- Equivalent to 'Alpha'.
newtype Letter    =  Letter   {Letter -> Char
unLetter   :: Char}

instance Show Space where  show :: Space -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (Space -> Char) -> Space -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Space -> Char
unSpace
instance Show Lower where  show :: Lower -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (Lower -> Char) -> Lower -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Lower -> Char
unLower
instance Show Upper where  show :: Upper -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (Upper -> Char) -> Upper -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Upper -> Char
unUpper
instance Show Alpha where  show :: Alpha -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (Alpha -> Char) -> Alpha -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Alpha -> Char
unAlpha
instance Show Digit where  show :: Digit -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (Digit -> Char) -> Digit -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Digit -> Char
unDigit
instance Show AlphaNum where  show :: AlphaNum -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (AlphaNum -> Char) -> AlphaNum -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AlphaNum -> Char
unAlphaNum
instance Show Letter   where  show :: Letter -> String
show  =  Char -> String
forall a. Show a => a -> String
show (Char -> String) -> (Letter -> Char) -> Letter -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Letter -> Char
unLetter

instance Listable Space where
  list :: [Space]
list  =  (Char -> Space) -> String -> [Space]
forall a b. (a -> b) -> [a] -> [b]
map Char -> Space
Space [Char
' ', Char
'\t', Char
'\n', Char
'\r', Char
'\f', Char
'\v']

instance Listable Lower where
  list :: [Lower]
list  =  (Char -> Lower) -> String -> [Lower]
forall a b. (a -> b) -> [a] -> [b]
map Char -> Lower
Lower [Char
'a'..Char
'z']

instance Listable Upper where
  list :: [Upper]
list  =  (Char -> Upper) -> String -> [Upper]
forall a b. (a -> b) -> [a] -> [b]
map Char -> Upper
Upper [Char
'A'..Char
'Z']

instance Listable Alpha where
  list :: [Alpha]
list  =  (Char -> Alpha) -> String -> [Alpha]
forall a b. (a -> b) -> [a] -> [b]
map Char -> Alpha
Alpha (String -> [Alpha]) -> String -> [Alpha]
forall a b. (a -> b) -> a -> b
$ [Char
'a'..Char
'z'] String -> ShowS
forall a. [a] -> [a] -> [a]
+| [Char
'A'..Char
'Z']

instance Listable Digit where
  list :: [Digit]
list  =  (Char -> Digit) -> String -> [Digit]
forall a b. (a -> b) -> [a] -> [b]
map Char -> Digit
Digit [Char
'0'..Char
'9']

instance Listable AlphaNum where
  list :: [AlphaNum]
list  =  (Char -> AlphaNum) -> String -> [AlphaNum]
forall a b. (a -> b) -> [a] -> [b]
map Char -> AlphaNum
AlphaNum (String -> [AlphaNum]) -> String -> [AlphaNum]
forall a b. (a -> b) -> a -> b
$ [Char
'0'..Char
'9'] String -> ShowS
forall a. [a] -> [a] -> [a]
+| [Char
'a'..Char
'z'] String -> ShowS
forall a. [a] -> [a] -> [a]
+| [Char
'A'..Char
'Z']

instance Listable Letter where
  list :: [Letter]
list  =  (Char -> Letter) -> String -> [Letter]
forall a b. (a -> b) -> [a] -> [b]
map Char -> Letter
Letter (String -> [Letter]) -> String -> [Letter]
forall a b. (a -> b) -> a -> b
$ [Char
'a'..Char
'z'] String -> ShowS
forall a. [a] -> [a] -> [a]
+| [Char
'A'..Char
'Z']

-- | Strings of spaces.
newtype Spaces  =  Spaces {Spaces -> String
unSpaces :: String}

-- | Strings of lowercase characters.
newtype Lowers  =  Lowers {Lowers -> String
unLowers :: String}

-- | Strings of uppercase characters
newtype Uppers  =  Uppers {Uppers -> String
unUppers :: String}

-- | Strings of alphabetic characters
newtype Alphas  =  Alphas {Alphas -> String
unAlphas :: String}

-- | Strings of digits.
newtype Digits  =  Digits {Digits -> String
unDigits :: String}

-- | Strings of alphanumeric characters
newtype AlphaNums  =  AlphaNums {AlphaNums -> String
unAlphaNums :: String}

-- | Strings of letters
newtype Letters    =  Letters   {Letters -> String
unLetters   :: String}

instance Show Spaces where  show :: Spaces -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (Spaces -> String) -> Spaces -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Spaces -> String
unSpaces
instance Show Lowers where  show :: Lowers -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (Lowers -> String) -> Lowers -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Lowers -> String
unLowers
instance Show Uppers where  show :: Uppers -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (Uppers -> String) -> Uppers -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Uppers -> String
unUppers
instance Show Alphas where  show :: Alphas -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (Alphas -> String) -> Alphas -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Alphas -> String
unAlphas
instance Show Digits where  show :: Digits -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (Digits -> String) -> Digits -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Digits -> String
unDigits
instance Show AlphaNums where  show :: AlphaNums -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (AlphaNums -> String) -> AlphaNums -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AlphaNums -> String
unAlphaNums
instance Show Letters   where  show :: Letters -> String
show  =  ShowS
forall a. Show a => a -> String
show ShowS -> (Letters -> String) -> Letters -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Letters -> String
unLetters

instance Listable Spaces where  tiers :: [[Spaces]]
tiers  =  ([Space] -> Spaces) -> [[Spaces]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> Spaces
Spaces (String -> Spaces) -> ([Space] -> String) -> [Space] -> Spaces
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Space -> Char) -> [Space] -> String
forall a b. (a -> b) -> [a] -> [b]
map Space -> Char
unSpace)
instance Listable Lowers where  tiers :: [[Lowers]]
tiers  =  ([Lower] -> Lowers) -> [[Lowers]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> Lowers
Lowers (String -> Lowers) -> ([Lower] -> String) -> [Lower] -> Lowers
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Lower -> Char) -> [Lower] -> String
forall a b. (a -> b) -> [a] -> [b]
map Lower -> Char
unLower)
instance Listable Uppers where  tiers :: [[Uppers]]
tiers  =  ([Upper] -> Uppers) -> [[Uppers]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> Uppers
Uppers (String -> Uppers) -> ([Upper] -> String) -> [Upper] -> Uppers
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Upper -> Char) -> [Upper] -> String
forall a b. (a -> b) -> [a] -> [b]
map Upper -> Char
unUpper)
instance Listable Alphas where  tiers :: [[Alphas]]
tiers  =  ([Alpha] -> Alphas) -> [[Alphas]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> Alphas
Alphas (String -> Alphas) -> ([Alpha] -> String) -> [Alpha] -> Alphas
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Alpha -> Char) -> [Alpha] -> String
forall a b. (a -> b) -> [a] -> [b]
map Alpha -> Char
unAlpha)
instance Listable Digits where  tiers :: [[Digits]]
tiers  =  ([Digit] -> Digits) -> [[Digits]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> Digits
Digits (String -> Digits) -> ([Digit] -> String) -> [Digit] -> Digits
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Digit -> Char) -> [Digit] -> String
forall a b. (a -> b) -> [a] -> [b]
map Digit -> Char
unDigit)
instance Listable AlphaNums where  tiers :: [[AlphaNums]]
tiers  =  ([AlphaNum] -> AlphaNums) -> [[AlphaNums]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> AlphaNums
AlphaNums (String -> AlphaNums)
-> ([AlphaNum] -> String) -> [AlphaNum] -> AlphaNums
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (AlphaNum -> Char) -> [AlphaNum] -> String
forall a b. (a -> b) -> [a] -> [b]
map AlphaNum -> Char
unAlphaNum)
instance Listable Letters   where  tiers :: [[Letters]]
tiers  =  ([Letter] -> Letters) -> [[Letters]]
forall a b. Listable a => (a -> b) -> [[b]]
cons1 (String -> Letters
Letters   (String -> Letters) -> ([Letter] -> String) -> [Letter] -> Letters
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Letter -> Char) -> [Letter] -> String
forall a b. (a -> b) -> [a] -> [b]
map Letter -> Char
unLetter)

#if __GLASGOW_HASKELL__ == 708
-- there's no need to derive these on GHC >= 7.10
-- as they are automatically derived
deriving instance Typeable Int1
deriving instance Typeable Int2
deriving instance Typeable Int3
deriving instance Typeable Int4
deriving instance Typeable Word1
deriving instance Typeable Word2
deriving instance Typeable Word3
deriving instance Typeable Word4
deriving instance Typeable Nat
deriving instance Typeable Nat1
deriving instance Typeable Nat2
deriving instance Typeable Nat3
deriving instance Typeable Nat4
deriving instance Typeable Nat5
deriving instance Typeable Nat6
deriving instance Typeable Nat7
deriving instance Typeable Natural
deriving instance Typeable X
deriving instance Typeable Xs
deriving instance Typeable NoDup
deriving instance Typeable Bag
deriving instance Typeable Set
deriving instance Typeable Map
deriving instance Typeable Space
deriving instance Typeable Lower
deriving instance Typeable Upper
deriving instance Typeable Alpha
deriving instance Typeable Digit
deriving instance Typeable AlphaNum
deriving instance Typeable Letter
deriving instance Typeable Spaces
deriving instance Typeable Lowers
deriving instance Typeable Uppers
deriving instance Typeable Alphas
deriving instance Typeable Digits
deriving instance Typeable AlphaNums
deriving instance Typeable Letters
deriving instance Typeable A
deriving instance Typeable B
deriving instance Typeable C
deriving instance Typeable D
deriving instance Typeable E
deriving instance Typeable F
#endif