Chapter 5 of Real World Haskell covers the creation of our first Haskell module. The chapter seems to come prematurely from my perspective. I am not yet concerned about making a module while I'm still trying to understand the language.
One thing that did catch my attention is the Prelude.undefined special value which allows for easy creation of stub code:
-- This compiles but causes a runtime error if you try to execute it text :: String -> Doc text str = undefined
Bitwise Functions
We also learn in Chapter 5 that the bitwise manipulations we have come to take for granted in C, C++ and similar languages is now a library module. This is the first point at which I can see an obvious point where C++ would make more succinct and readable code than Haskell.
int i = 0x10000 >> 4; int j = 7 & 2;
It seems clear to me that if your code consists of mainly bit manipulations, C++ or C might be the logical choice.
Recent comments
44 min 19 sec ago
3 hours 39 min ago
3 hours 39 min ago
13 hours 53 min ago
15 hours 21 min ago
15 hours 21 min ago
15 hours 21 min ago
22 hours 38 min ago
2 weeks 3 days ago
4 weeks 4 days ago