
May 6th, 2007, 08:12 AM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 2
Time spent in forums: 1 h 47 m 17 sec
Reputation Power: 0
|
|
|
Instance of Monad
Hi all,
I hope here is the correct place where i can find the answer that i'm looking for.
I'm writing a code for the xxtea, it is a modification for the Tiny encryption algorithm. The problem is that when i am running my code it is giving me this:
"Instance of Monad (Array Word32) required for definition of coding"
the code is below; hope some one will reply and tell what is the problem.thnx
type TEA_arr = Array Word32 Word32
coding :: TEA_arr -> Word32 -> Word32 -> [Word32] -> Word32 -> Word32 -> TEA_arr
coding v s e k 0 _ = v
coding v s e k q p = do
let sum = getSum s
e = shiftSum sum
y = v ! (p+1)
z = v ! p
mx = getMx y z sum k e p
newarr = v // [(p,(v ! p)+ mx)]
coding newarr sum e k (q - 1) (p+1)
|