FP Laboratory 2
Jump to navigation
Jump to search
Types
- Using the GHCi command
:info
, learn the type of the following functions (and operators):+, sqrt, succ, max
- Using the command
:set +t
it is possible to get the information about the type of the evaluated expressions. With this setting on evaluate expressions:
5 + 8
3 * 5 + 8
2 + 4
sqrt 16
succ 6
succ 7
pred 9
pred 8
sin (pi / 2)
truncate pi
round 3.5
round 3.4
floor 3.7
ceiling 3.3