You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
761 B
761 B
Chapter Exercises
length :: [a] -> Int(Why notInteger?)- Answers:
- 5
- 3
- 2
- 5
(/)takes twoFractionaltypes.lengthreturns andIntwhich is notFractional. (FloatandDoubleare)- Use
divinstead:div 6 $ length [1, 2, 3] Bool.True(Note:(+)has higher precedence)Bool.False- Answers:
- Works.
Bool.True - Won't work. List needs to have elements of the same type.
- Works.
Int.5 - Works.
Bool.False - Won't work.
(&&)needs twoBool's,9isn't one.
- Works.
- see src/chapter4.hs
- see src/chapter4.hs
- see src/chapter4.hs
Correcting syntax
see src/chapter4.hs
Match the function names to their types
- (c)
- (b)
- (a)
- (d)