
15 Mar
2019
15 Mar
'19
12:47 a.m.
On Thu, Mar 14, 2019 at 10:54:58PM -0500, Vanessa McHale wrote:
encryptionResult :: Int -> EncryptionResult encryptionResult 1 = HasEncryption encryptionResult -1 = EncryptionUnknown encryptionResult _ = error "Internal error."
The way I keep it straight, is that just as one must write: let x = encryptionResult (-1) to evaluate "encryptionResult" at (-1), one must also write: encryptionResult :: Int -> EncryptionResult encryptionResult 1 = HasEncryption encryptionResult (-1) = EncryptionUnknown encryptionResult _ = error "Internal error." to define the function, because binary minus takes precedence over unary minus (which in turn takes precedence over sections, thus (subtract 1), not (- 1)). -- Viktor.