49 ms·
...or anywhere you're using a 'let' statement. I write a lot of OCaml, and I write a lot of multi-line anonymous functions that aren't stateful. I think it's le
by samdk 14y ago
...or anywhere you're using a 'let' statement. I write a lot of OCaml, and I write a lot of multi-line anonymous functions that aren't stateful. I think it's less common to do this in Haskell, but that's more because it's Haskell than because there aren't any side effects.
Random other tidbit that doesn't deserve its own comment:
In Python, instance.method is the same as doing ClassName.method(instance). This can be helpful when using map/filter, because you get to do map(ClassName.method,lst) instead of map(lambda x: x.method,lst).
- koenigdavidmj 14y agoOr you can do operator.methodgetter("method") and not need to know the class name.
- ville 14y agooperator.methodcaller('method') #ftfy