user187830
user187830

Reputation:

Haskell Conditionals

I'm having some difficulty integrating && within Guards eg:

something :: Char -> Int
something k 
 | ord k >= 77 && ord k <= 98 = 8
 | otherwise = 88

How the heck can i achieve the above without setting off an error?

Cheers.

Upvotes: 1

Views: 1338

Answers (1)

mmarx
mmarx

Reputation: 150

In Haskell, an identifier starting with an uppercase letter designates a type, whereas a function name has to start with a lowercase letter.

Upvotes: 2

Related Questions