Commit 85310fb8 authored by Joshua Price's avatar Joshua Price Committed by Marge Bot

Add missing Ix instances for tuples of size 6 through 15 (#16643)

parent 81704a6f
Pipeline #21687 failed with stages
in 925 minutes and 27 seconds
......@@ -530,9 +530,8 @@ Large tuple support
The Haskell Report only requires implementations to provide tuple
types and their accompanying standard instances up to size 15. GHC
limits the size of tuple types to 62 and provides instances of
``Eq``, ``Ord``, ``Bounded``, ``Read``, and ``Show`` for tuples up
to size 15. However, ``Ix`` instances are provided only for tuples
up to size 5.
``Eq``, ``Ord``, ``Bounded``, ``Read``, ``Show``, and ``Ix`` for
tuples up to size 15.
.. _bugs:
......
This diff is collapsed.
......@@ -27,6 +27,8 @@
small lists will now compile to a simple case statement more often.
* Add `MonadFix` and `MonadZip` instances for `Complex`
* Add `Ix` instances for tuples of size 6 through 15
## 4.14.0.0 *TBA*
* Bundled with GHC 8.10.1
......
module Main (main) where
import Data.Ix
main :: IO ()
main =
if 2^6 == rangeSize r6 && 2^7 == rangeSize r7 && 2^8 == rangeSize r8 &&
2^9 == rangeSize r9 && 2^10 == rangeSize r10 && 2^11 == rangeSize r11 &&
2^12 == rangeSize r12 && 2^13 == rangeSize r13 && 2^14 == rangeSize r14 &&
2^15 == rangeSize r15
then putStrLn "Success"
else putStrLn "Error in large tuple Ix instances"
where
r6 = ((0,0,0,0,0,0),(1,1,1,1,1,1))
r7 = ((0,0,0,0,0,0,0),(1,1,1,1,1,1,1))
r8 = ((0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1))
r9 = ((0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1))
r10 = ((0,0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1,1))
r11 = ((0,0,0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1,1,1))
r12 = ((0,0,0,0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1,1,1,1))
r13 = ((0,0,0,0,0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1,1,1,1,1))
r14 = ((0,0,0,0,0,0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1,1,1,1,1,1))
r15 = ((0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
Success
\ No newline at end of file
......@@ -254,3 +254,4 @@ test('T16111', exit_code(1), compile_and_run, [''])
test('T16943a', normal, compile_and_run, [''])
test('T16943b', normal, compile_and_run, [''])
test('T17499', [collect_stats('bytes allocated',5)], compile_and_run, ['-O -w'])
test('T16643', normal, compile_and_run, [''])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment