For some types, it is sufficient to use Read to parse
the String into a value. RqData provides
functions such as lookRead to assist with this. The advantage of using lookRead instead of calling look and applying read yourself is that lookRead ties into the RqData error handling system neatly.
Here is a trivial example where we create a lookInt function which looks for an Int parameter named int.
[Source code for the app is here.]
Now if we visit http://localhost:8000/?int=1, we will get the message:
Read the int: 1
If we visit http://localhost:8000/?int=apple, we will get the error:
Read failed while parsing: apple