Hello,
I found a bug in GHC which causes it to crash. I believe it is related to my
experimentation with the unboxed tuple. It was not clear to me from the
manual as to whether or not this was legal. My version of GHC reports via -v
that it is "Glasgow Haskell Compiler, Version 6.4.1, for Haskell 98,
compiled by GHC version 6.4". I am running on Windows XP.
A simplified repro of the bug follows:
{-# OPTIONS_GHC -fglasgow-exts #-}
import qualified Array;
import qualified Ix;
type Array a b = Array.Array a b
type Matrix a b = Array (a, a) b
-- Imports from Array.Array for convenience
(!) :: Ix.Ix a => Array a b -> a -> b
(!) = (Array.!)
fweval :: (Ix.Ix a, Integral b) => Matrix a (Maybe b) -> a -> a -> a ->
[((a, a), Maybe b)] -> [((a, a), Maybe b)]
fweval m i j k upd = case (# m!(i, k), m!(k, j), m!(i, j) #) of
(# Nothing, _, _ #) -> upd
(# _, Nothing, _ #) -> upd
(# Just ik, Just kj, Nothing #) -> ((i, j), Just
(ik+kj)):upd
(# Just ik, Just kj, Just ij #) -> if (ik+kj) < ij
then ((i, j), Just (ik+kj)):upd else upd
main :: IO ()
main = return ()
-Matt
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs