3 ms·
long? There's 1 import statement, 1 optional type declaration, and 2 lines of code. It could be just the import and 1 line of code, but that would violate 2 Ha
by kscaldef 15y ago
long? There's 1 import statement, 1 optional type declaration, and 2 lines of code. It could be just the import and 1 line of code, but that would violate 2 Haskell best practices: include explicit type declarations for your public interface, and separate pure and impure functionality.
Honestly, if the intent were to be pedagogical in this specific regard (which is isn't), I would say that the example is unnecessarily terse (which is why you describe it as "weird").