module Pythagoras where import Question pythagoras :: WithHTML x CGI () pythagoras = do h2 $ text "More to do" p <#>If you still have some spare time, try the following a little more demanding exercises: ul $ do li $ p <#>Define a function vectorLength that computes the length of a vector. Represent the vectors in a suitable way. (Maybe you can use two arguments of some numerical type to represent the vector?) li $ p <#>Define a function (operator) +. that adds vectors. Does your function need a pair as result? Use (x, y) to construct a pair that contains x and y. li $ p <#>Define a test that verifies that your vectors satisfy the triangle inequality rule. The triangle inequality states that the vector sum of two vectors never exceeds the total length of these two vectors. p <#>In the next lecture you will see how the above can be done in a nicer way by defining a new type. Those of you who can't wait for the answer may take a peak at the end of the lecture notes.