What is the are differences between -> and => ?
In the declaration of a function?
foobar :: Integer -> Integer -> [Integer]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
->is for function takes. The signaturex -> ymeans “a function that takes anxand returns ay“.=>is for dealing with classes. It can appear only once per type signature. The stuff to the left of it is a “context”, listing which types must be instances of what classes. The stuff on the right is a normal type signature.For example,
(Num x, Show y) => x -> y -> Stringwould indicate thatxhas to be a number type andyhas to be a displayable type.