3 ms·
With Haskell, you learn to discover in a different way. Just think about the shape of the function you’d want, then type that into Hoogle. I learned Rust before
by skavi 4y ago
With Haskell, you learn to discover in a different way. Just think about the shape of the function you’d want, then type that into Hoogle. I learned Rust before Haskell, but prefer Hoogle to Rust’s searching via dot chaining.
- still_grokking 4y ago> Just think about the shape of the function you’d want, then type that into Hoogle. Do you really think this is a adequate replacement for proper IDE support?
- likeclockwork 4y agoAll you work with is method calls? No free functions? No library functions? I perform operations on stuff, if I don't know the name of the operation I intend to perform I clearly have some reading to do. Integrated look up for one specific class of operation which isn't even omnipresent in Class-oriented languages isn't a killer feature for me. Nor is structuring every module even if it's completely stateless as a class, just to benefit from IDE driven development a reasonable price to pay.
- still_grokking 4y ago> Nor is structuring every module even if it's completely stateless as a class, just to benefit from IDE driven development a reasonable price to pay. That's a question of language. object SomeModule: def someMethod(someRandomNumber: 42) = s"The answer is: $someRandomNumber." def someOtherMethod = someMethod(42) @main def entryPoint = val someTheory = SomeModule.someMethod(23) import SomeModule.someOtherMethod import StringExtension.* (someOtherMethod :: "No!" :: someTheory :: Nil) .fold("")(_ + _ + "\n") .printLine() object StringExtension: extension (s: String) def printLine() = println(s) // Because methods compose better in a fluent style… // You don't need to read your code backwards! https://scastie.scala-lang.org/Zt6xTucJRyK1IEQQgFNRLQ https://scastie.scala-lang.org/Zt6xTucJRyK1IEQQgFNRLQ That's Scala. Two cute stateless modules. Nicely wrapped in singletons. Not quite sure why I had to add the handy `printLine()` method to the String class myself, after the fact… But as extending arbitrary classes with new methods without touching them is trivial, who cares. (Frankly it does not compile. It says something like `Found: (23 : Int); Required: (42 : Int)`. No clue)