Editing 1312: Haskell
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
==Explanation== | ==Explanation== | ||
− | The comic pokes fun at {{w|Haskell (programming language)|Haskell}}, a {{w | + | {{incomplete|Incomplete}} |
+ | The comic pokes fun at {{w|Haskell (programming language)|Haskell}}, a {{w|functional programming language}}. Functional programming languages are based on the mathematical concept of a function. Side effects are effects of a function other than returning a value. As a simple example, if a <code>sum</code> function prints the sum before returning it, that is a side effect. Real functions in most languages also have side effects, many of which are more complex, and sometimes hard to analyze. Functional programming languages seek to avoid side effects when possible. When side effects are required (for instance input and output), they are isolated to {{w|monad|monads}}, which are ways of representing sequential steps in functional programming. | ||
− | The first joke | + | The first joke is that Haskell only has no side effects merely because no one ever uses Haskell programs. Even in a traditional procedural programming language like {{w|C (programming language)|C}}, no side effects can occur if the program does not run. |
− | + | The title text describes Haskell's {{w|lazy evaluation}}. The basic concept is that a value is not computed until it is actually used. Thus, it is possible to have a variable representing the entire infinite list of {{w|Fibonacci numbers}}. However, until a particular element of the list is accessed, no work is actually done. Thus, the joke is that while Haskell may have potential, no one has "called" it (referencing calling a function), so nothing has actually been done. | |
− | + | In reality, Haskell is actively used, but not one of the most used languages. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | In reality, Haskell is | ||
==Transcript== | ==Transcript== | ||
− | + | :Megan: Code written in Haskell is guaranteed to have no side effects. <br> | |
− | :Megan: Code written in Haskell is guaranteed to have no side effects. | + | :Cueball: ... Because no one will ever run it? |
− | :Cueball: ... | ||
{{comic discussion}} | {{comic discussion}} | ||
[[Category:Comics featuring Cueball]] | [[Category:Comics featuring Cueball]] | ||
[[Category:Comics featuring Megan]] | [[Category:Comics featuring Megan]] | ||
[[Category:Programming]] | [[Category:Programming]] |