[Haskell-cafe] Code review request: Library and executable to read USB temperature device

Bram Neijt bneijt at gmail.com
Mon Nov 3 21:49:03 UTC 2014


Dear reader,

I have written a small executable and library to read values from a
USB device and would like someone with more knowledge then hlint to
review my code.

If you find the time to read

https://github.com/bneijt/temper/blob/master/src/lib/Temper.hs

please consider placing comments/issues on Github or mailing the list
or me directly with your comments.

I also have the following doubts about the code:
- It has some bit-shifting code on line 18 to 20. Is there a nicer
"unpack two bytes to an integer" method?
- I'm using test-framework with test-framework-hunit but it feels
clunky, is hspec a more common approach to testing?
- I'm ignoring a lot of return values between lines 61 to 70. In a
language like Python or Java I would add assert statements or checks
with exceptions there. How should I go about that in Haskell?

Greetings,

Bram


More information about the Haskell-Cafe mailing list