You are here |
learnyouahaskell.com | ||
| | | |
blog.jle.im
|
|
| | | | Weblog of Justin Le, covering various adventures in programming and explorations in the worlds of computation physics, and knowledge. | |
| | | |
argumatronic.com
|
|
| | | | Occasional writings about Haskell. | |
| | | |
pbrisbin.com
|
|
| | | | In Haskell, functions must always return the same consistent type. There is also no concept of nil or null built into the language. This is not meant to handicap you, and the expressiveness and polymorphic-ness of Haskell's types mean it certainly does not. One way to handle such situations where functions (conceptually) may or may not return a value is through the Maybe type. data Maybe a = Just a | Nothing Maybe is a perfect and simple solution for this situation. | |
| | | |
www.foonathan.net
|
|
| | Let me share a useful insight with you: constexpr is a platform. Just like you write code that targets Windows or a microcontroller, you write code that targets compile-time execution. In both cases you restrict yourself to the subset of C++ that works on your target platform, use conditional compilation if your code needs to be portable, and execute it on the desired target platform. You can thus view constexpr as another platform you can target; it just so happens to be run by your compiler. This insig... |