enum01.stdout-alpha-dec-osf3 12.3 KB
Newer Older
ken's avatar
ken committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
Testing Enum Int: 
    (succ (0::Int)) = 1
    (succ (minBound::Int)) = -9223372036854775807
    (succ (maxBound::Int)) = error "Prelude.Enum.succ{Int}: tried to take `succ' of maxBound"
    pred (1::Int) = 0
    pred (maxBound::Int) = 9223372036854775806
    pred (minBound::Int) = error "Prelude.Enum.pred{Int}: tried to take `pred' of minBound"
    (map (toEnum::Int->Int) [1,minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807]
    (map fromEnum [(1::Int),minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807]
    (take 7 [(1::Int)..]) = [1,2,3,4,5,6,7]
    (take 7 [((maxBound::Int)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807]
    (take 7 [(1::Int),2..]) = [1,2,3,4,5,6,7]
    (take 7 [(1::Int),7..]) = [1,7,13,19,25,31,37]
    (take 7 [(1::Int),1..]) = [1,1,1,1,1,1,1]
    (take 7 [(1::Int),0..]) = [1,0,-1,-2,-3,-4,-5]
    (take 7 [(5::Int),2..]) = [5,2,-1,-4,-7,-10,-13]
    (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808]
    (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808]
    (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807]
    (take 7 ([(1::Int) .. 5])) = [1,2,3,4,5]
    (take 4 ([(1::Int) .. 1])) = [1]
    (take 7 ([(1::Int) .. 0])) = []
    (take 7 ([(5::Int) .. 0])) = []
    (take 7 ([(maxBound-(5::Int)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807]
    (take 7 ([(minBound+(5::Int)) .. minBound])) = []
    (take 7 [(5::Int),4..1]) = [5,4,3,2,1]
    (take 7 [(5::Int),3..1]) = [5,3,1]
    (take 7 [(5::Int),3..2]) = [5,3]
    (take 7 [(1::Int),2..1]) = [1]
    (take 7 [(2::Int),1..2]) = [2]
    (take 7 [(2::Int),1..1]) = [2,1]
    (take 7 [(2::Int),3..1]) = []
    (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807]
    (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808]
Testing Enum Integer: 
    (succ (0::Integer)) = 1
    (succ ((-1)::Integer)) = 0
    pred (1::Integer) = 0
    pred (0::Integer) = -1
    (map (toEnum::Int->Integer) [1,minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807]
    (map fromEnum [(1::Integer),42,45]) = [1,42,45]
    (take 7 [(1::Integer)..]) = [1,2,3,4,5,6,7]
    (take 7 [(-5::Integer)..]) = [-5,-4,-3,-2,-1,0,1]
    (take 7 [(1::Integer),2..]) = [1,2,3,4,5,6,7]
    (take 7 [(1::Integer),7..]) = [1,7,13,19,25,31,37]
    (take 7 [(1::Integer),1..]) = [1,1,1,1,1,1,1]
    (take 7 [(1::Integer),0..]) = [1,0,-1,-2,-3,-4,-5]
    (take 7 [(5::Integer),2..]) = [5,2,-1,-4,-7,-10,-13]
    (take 7 ([(1::Integer) .. 5])) = [1,2,3,4,5]
    (take 4 ([(1::Integer) .. 1])) = [1]
    (take 7 ([(1::Integer) .. 0])) = []
    (take 7 ([(5::Integer) .. 0])) = []
    (take 7 [(5::Integer),4..1]) = [5,4,3,2,1]
    (take 7 [(5::Integer),3..1]) = [5,3,1]
    (take 7 [(5::Integer),3..2]) = [5,3]
    (take 7 [(1::Integer),2..1]) = [1]
    (take 7 [(2::Integer),1..2]) = [2]
    (take 7 [(2::Integer),1..1]) = [2,1]
    (take 7 [(2::Integer),3..1]) = []
Testing Enum Char: 
    (succ 'a') = 'b'
    (succ (minBound::Char)) = '\SOH'
    (succ (maxBound::Char)) = error "Prelude.Enum.Char.succ: bad argument"
    (pred 'b') = 'a'
    pred (maxBound::Char) = '\1114110'
    pred (minBound::Char) = error "Prelude.Enum.Char.pred: bad argument"
    (map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\1114111"
    (toEnum::Int->Char) (minBound::Int) = error "Prelude.chr: bad argument"
    (map fromEnum ['X',minBound,maxBound]) = [88,0,1114111]
    (take 7 ['\NUL' .. ]) = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK"
    (take 7 ['\250' .. ]) = "\250\251\252\253\254\255\256"
    (take 7 ['a','b'..]) = "abcdefg"
    (take 7 ['a','e'..]) = "aeimquy"
    (take 7 ['a','a'..]) = "aaaaaaa"
    (take 7 ['z','y'..]) = "zyxwvut"
    (take 7 ['z','v'..]) = "zvrnjfb"
    (take 7 ['\1', '\0' ..]) = "\SOH\NUL"
    (take 7 ['\5', '\4' ..]) = "\ENQ\EOT\ETX\STX\SOH\NUL"
    (take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255\256"
    (take 7 (['a' .. 'e'])) = "abcde"
    (take 4 (['a' .. 'a'])) = "a"
    (take 7 (['b' .. 'a'])) = ""
    (take 7 (['e' .. 'a'])) = ""
    (take 7 (['\250' .. '\255'])) = "\250\251\252\253\254\255"
    (take 7 (['\5' .. '\0'])) = ""
    (take 7 ['f','e' .. 'b']) = "fedcb"
    (take 7 ['g','e' .. 'b']) = "gec"
    (take 7 ['g','d' .. 'c']) = "gd"
    (take 7 ['b','c' .. 'b']) = "b"
    (take 7 ['c','b' .. 'c']) = "c"
    (take 7 ['c','b' .. 'b']) = "cb"
    (take 7 ['c','d' .. 'b']) = ""
    (take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255\256\257"
    (take 7 ['\5', '\4' .. minBound]) = "\ENQ\EOT\ETX\STX\SOH\NUL"
Testing Enum (): 
    (succ ()) = error "Prelude.Enum.().succ: bad argment"
    (succ (minBound::())) = error "Prelude.Enum.().succ: bad argment"
    (succ (maxBound::())) = error "Prelude.Enum.().succ: bad argment"
    (pred ()) = error "Prelude.Enum.().pred: bad argument"
    (pred (minBound::())) = error "Prelude.Enum.().pred: bad argument"
    (pred (maxBound::())) = error "Prelude.Enum.().pred: bad argument"
    (toEnum 0)::() = ()
    (toEnum 1)::() = error "Prelude.Enum.().toEnum: bad argument"
    (fromEnum ()) = 0
    ([()..]) = [()]
    ([(),()..]) = [()]
    ([()..()]) = [()]
    ([(),()..()]) = [()]
Testing Enum Ordering (derived): 
    (succ LT) = EQ
    (succ (minBound::Ordering)) = EQ
    (succ (maxBound::Ordering)) = error "Prelude.Enum.Ordering.succ: bad argment"
    (pred GT) = EQ
    (pred (maxBound::Ordering)) = EQ
    (pred (minBound::Ordering)) = error "Prelude.Enum.Ordering.pred: bad argment"
    (toEnum 0)::Ordering = LT
    (toEnum 5)::Ordering = error "Prelude.Enum.Ordering.toEnum: bad argment"
    (fromEnum LT) = 0
    (fromEnum EQ) = 1
    (fromEnum GT) = 2
    ([LT ..]) = [LT,EQ,GT]
    ([EQ ..]) = [EQ,GT]
    ([GT ..]) = [GT]
    ([LT,EQ ..]) = [LT,EQ,GT]
    ([EQ,GT ..]) = [EQ,GT]
    ([EQ,LT ..]) = [EQ,LT]
    ([LT,GT ..]) = [LT,GT]
    ([GT,LT ..]) = [GT,LT]
    take 7 (([GT,GT ..])) = [GT,GT,GT,GT,GT,GT,GT]
    take 7 (([LT,LT ..])) = [LT,LT,LT,LT,LT,LT,LT]
    ([LT .. GT]) = [LT,EQ,GT]
    ([LT .. EQ]) = [LT,EQ]
    ([LT .. LT]) = [LT]
    ([GT .. LT]) = []
    ([GT .. EQ]) = []
    ([GT .. GT]) = [GT]
    ([LT,EQ .. GT]) = [LT,EQ,GT]
    ([GT,EQ .. LT]) = [GT,EQ,LT]
    ([GT,EQ .. EQ]) = [GT,EQ]
    ([GT,EQ .. GT]) = [GT]
    ([GT,EQ .. LT]) = [GT,EQ,LT]
    ([LT,EQ .. LT]) = [LT]
    ([LT,EQ .. GT]) = [LT,EQ,GT]
    take 7 (([LT,LT .. GT])) = [LT,LT,LT,LT,LT,LT,LT]
    take 7 (([GT,GT .. LT])) = []
Testing Enum Bool: 
    (succ False) = True
    (succ (minBound::Bool)) = True
    (succ (maxBound::Bool)) = error "Prelude.Enum.Bool.succ: bad argment"
    (pred True) = False
    (pred (maxBound::Bool)) = False
    (pred (minBound::Bool)) = error "Prelude.Enum.Bool.pred: bad argment"
    (toEnum 0)::Bool = False
    (toEnum 5)::Bool = error "Prelude.Enum.Bool.toEnum: bad argment"
    (fromEnum False) = 0
    (fromEnum True) = 1
    ([False ..]) = [False,True]
    ([True ..]) = [True]
    ([False,True ..]) = [False,True]
    ([True,False ..]) = [True,False]
    (take 7 ([False,False ..])) = [False,False,False,False,False,False,False]
    (take 7 ([True,True ..])) = [True,True,True,True,True,True,True]
    ([False .. True]) = [False,True]
    ([True .. False]) = []
    take 7 ([False,False .. False]) = [False,False,False,False,False,False,False]
    take 7 ([False,False .. True]) = [False,False,False,False,False,False,False]
    take 7 ([False,True .. False]) = [False]
    take 7 ([False,True .. True]) = [False,True]
    take 7 ([True,False .. False]) = [True,False]
    take 7 ([True,False .. True]) = [True]
    take 7 ([True,True .. False]) = []
    take 7 ([True,True .. True]) = [True,True,True,True,True,True,True]
Testing Enum Rational: 
    (succ (0::Rational)) = 1 % 1
    (succ ((-1)::Rational)) = 0 % 1
    pred (1::Rational) = 0 % 1
ken's avatar
ken committed
177 178
    pred (0::Rational) = (-1) % 1
    (map (toEnum::Int->Rational) [1,minBound,maxBound]) = [1 % 1,(-9223372036854775808) % 1,9223372036854775807 % 1]
ken's avatar
ken committed
179 180
    (map fromEnum [(1::Rational),42,45]) = [1,42,45]
    (take 7 [(1::Rational)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1]
ken's avatar
ken committed
181
    (take 7 [(-5::Rational)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1]
ken's avatar
ken committed
182 183 184
    (take 7 [(1::Rational),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1]
    (take 7 [(1::Rational),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1]
    (take 7 [(1::Rational),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1]
ken's avatar
ken committed
185 186
    (take 7 [(1::Rational),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1]
    (take 7 [(5::Rational),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1]
ken's avatar
ken committed
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
    (take 7 ([(1::Rational) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1]
    (take 4 ([(1::Rational) .. 1])) = [1 % 1]
    (take 7 ([(1::Rational) .. 0])) = []
    (take 7 ([(5::Rational) .. 0])) = []
    (take 7 [(5::Rational),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1]
    (take 7 [(5::Rational),3..1]) = [5 % 1,3 % 1,1 % 1]
    (take 7 [(5::Rational),3..2]) = [5 % 1,3 % 1,1 % 1]
    (take 7 [(1::Rational),2..1]) = [1 % 1]
    (take 7 [(2::Rational),1..2]) = [2 % 1]
    (take 7 [(2::Rational),1..1]) = [2 % 1,1 % 1]
    (take 7 [(2::Rational),3..1]) = []
Testing Enum (Ratio Int): 
    (succ (0::Ratio Int)) = 1 % 1
    (succ ((-1)::Ratio Int)) = 0 % 1
    pred (1::Ratio Int) = 0 % 1
ken's avatar
ken committed
202 203
    pred (0::Ratio Int) = (-1) % 1
    (map (toEnum::Int->Ratio Int) [1,minBound,maxBound]) = [1 % 1,(-9223372036854775808) % 1,9223372036854775807 % 1]
ken's avatar
ken committed
204 205
    (map fromEnum [(1::Ratio Int),42,45]) = [1,42,45]
    (take 7 [(1::Ratio Int)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1]
ken's avatar
ken committed
206 207
    (take 7 [(-5::Ratio Int)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1]
    (take 7 [((toEnum ((maxBound::Int)-5))::Ratio Int)..]) = [9223372036854775802 % 1,9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1,(-9223372036854775808) % 1]
ken's avatar
ken committed
208 209 210
    (take 7 [(1::Ratio Int),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1]
    (take 7 [(1::Ratio Int),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1]
    (take 7 [(1::Ratio Int),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1]
ken's avatar
ken committed
211 212 213 214 215
    (take 7 [(1::Ratio Int),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1]
    (take 7 [(5::Ratio Int),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1]
    (take 7 [x, x-1 ..]) = [(-9223372036854775807) % 1,(-9223372036854775808) % 1,9223372036854775807 % 1,9223372036854775806 % 1,9223372036854775805 % 1,9223372036854775804 % 1,9223372036854775803 % 1]
    (take 7 [x, x-1 ..]) = [(-9223372036854775803) % 1,(-9223372036854775804) % 1,(-9223372036854775805) % 1,(-9223372036854775806) % 1,(-9223372036854775807) % 1,(-9223372036854775808) % 1,9223372036854775807 % 1]
    (take 7 [x, (x+1) ..]) = [9223372036854775802 % 1,9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1,(-9223372036854775808) % 1]
ken's avatar
ken committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229
    (take 7 ([(1::Ratio Int) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1]
    (take 4 ([(1::Ratio Int) .. 1])) = [1 % 1]
    (take 7 ([(1::Ratio Int) .. 0])) = []
    (take 7 ([(5::Ratio Int) .. 0])) = []
    (take 7 ([x..y])) = [9223372036854775802 % 1,9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1]
    (take 7 ([x..y])) = []
    (take 7 [(5::Ratio Int),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1]
    (take 7 [(5::Ratio Int),3..1]) = [5 % 1,3 % 1,1 % 1]
    (take 7 [(5::Ratio Int),3..2]) = [5 % 1,3 % 1,1 % 1]
    (take 7 [(1::Ratio Int),2..1]) = [1 % 1]
    (take 7 [(2::Ratio Int),1..2]) = [2 % 1]
    (take 7 [(2::Ratio Int),1..1]) = [2 % 1,1 % 1]
    (take 7 [(2::Ratio Int),3..1]) = []
    (take 7 [x,(x+1)..y]) = [9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1]
ken's avatar
ken committed
230
    (take 7 [x,(x-1)..y]) = [(-9223372036854775803) % 1,(-9223372036854775804) % 1,(-9223372036854775805) % 1,(-9223372036854775806) % 1,(-9223372036854775807) % 1,(-9223372036854775808) % 1]