Very simple question

Jorge Adriano jadrian@mat.uc.pt
Tue, 11 Feb 2003 22:16:40 +0000


On style, yes. A concrete example of what I asked before.
The following doesn't type check for obvious reasons. 
In your opinion what is the most elegant way to fix it? 

Like I said, I'm starting to feel like defining my own operators is the way to 
go. On the other hand, this kind of situation seems quite common and there 
are no such operators in the standard libraries, so I might be wrong here.
Opinions anyone?

J.A.
------------------
Source Code:
------------------

module TypeCheck where
import Data.Array
import Data.Ix

bigR :: Double
bigR = sum[a!(i,j)*(r!i - n*b!i)*(r!j-n*b!j) | (i,j)<-range(bounds a)]/n


a :: Array (Int,Int) Double
b :: Array Int Double
r :: Array Int Int
n :: Int

a=undefined
b=undefined
r=undefined
n=undefined