Haskell, possible indentation error that I can't get rid of -
i have problem , cannot find out is. have reindented again on , over, cannot find solution. there else can dependent on?
code:
type triple = (prime, quot, gen) correctness :: triple -> bool correctness (p,q,g) = prime && plength && qlength && divisor && orderq prime = probablyprime n 5 qlength = q < 2^1024 plength = p < 2^160 divisor = (p-1 `mod` q) == 0 orderq = (g^q mod p == 1) && (g > 1)
error message (line 94 corresponds "correctness :: triple -> bool"):
crypt.hs:94:0: parse error (possibly incorrect indentation)
edit: solved problem. problem syntax error in above function. had otherwise m_ify m*2
instead of otherwise = m_ify m*2
you might need add backticks around mod
in final line. wouldn't cause indentation error report, following compiles me:
n = undefined probablyprime = undefined type prime = int type quot = int type gen = int type triple = (prime, quot, gen) correctness :: triple -> bool correctness (p,q,g) = prime && plength && qlength && divisor && orderq prime = probablyprime n 5 qlength = q < 2^1024 plength = p < 2^160 divisor = (p-1 `mod` q) == 0 orderq = (g^q `mod` p == 1) && (g > 1)
the change here (apart first 5 lines) in last line.
Comments
Post a Comment