5 ms·
http://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-Trace.html#v:trace http://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-... For future refer
by pka 8y ago
http://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-Trace.html#v:trace http://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-...
For future reference, this isn’t a good argument for trolling Haskellers.
- fnord123 8y ago>These can be useful for investigating bugs or performance problems. They should not be used in production code.
- pka 8y agoWell yeah, because a logging statement in production can fail (i.e. network connection drops). The type system forces you to deal with that fact instead of letting you write code that e.g. brings down your server unexpectedly because of some random log call. Many would consider that a feature, but if you want to #yolo it anyway, like in most other languages, just use trace in prod and call it a day.
- yogthos 8y agoThe type system forces you to solve this problem in a very specific way by structuring your entire app around pushing IO to the edges. There are plenty of other ways to address the problem that work perfectly fine in practice. For example, you can specify what should happen is IO fails in your logging configuration. This handles the exceptional case consistently and in a single place without forcing you to structure your whole app around it. What's more is that there really isn't a sane way to recover from such a catastrophic failure. If your database goes down, or you lose a disk, the only thing you can do is shut down the app. It's not like it's gonna keep humming along with the logging failing silently. This kind of hyperbole that your either solve all problems via the type system or #yolo is precisely what makes Haskell community so toxic in my opinion.
- antidesitter 8y agoWhat makes you think the Haskell community is toxic? I usually hear the exact opposite.
- yogthos 8y agoI find that the Haskell community is very friendly as long as you buy into their approach to solving problems. However, my experience is that if you question the effectiveness of static typing, or ask for evidence in support of the claimed benefits you'll get a very hostile reaction. The comment above where pka snidely claims that using any alternative to types amounts to yolo is quite representative. He outright dismisses that any valid alternatives are possible, and he indirectly claims that people using other methods are being unprofessional and are cutting corners. That amounts to toxic behavior in my opinion.
- hota_mazi 8y agoFacts have been presented to you multiple times but your adoration of Clojure just makes you dismiss them outright. People who claim dynamic type systems are superior to static ones can be dismissed in much the same way flat earthers can because both choose to dismiss evidence they find inconvenient.
- AlexCoventry 8y agoI was going to suggest that yogthos may just be thinking of that one guy who converted from clojure to haskell and had a convert's typical evangelical zeal in #clojure, but then I read your reply. Ironic.
- bmurphy1976 8y agoYou know he can be wrong about some things but still make a valid point about others. How do you think this reads in relation to his primary claim about the Haskell community? > People who claim dynamic type systems are superior to static ones can be dismissed in much the same way flat earthers can because both choose to dismiss evidence they find inconvenient. Seriously. This only feeds into his narrative.
- gowld 8y agoIn other languages, if the logging facility fails, you can simply continue running the program without logging. This works reliably enough across the world for many years that no one worries about log statements in production being unsafe.
- dwohnitmok 8y agoSome people in the Haskell community think so too. See e.g. http://hackage.haskell.org/package/simple-logger-0.0.4/docs/Control-Logger-Simple.html http://hackage.haskell.org/package/simple-logger-0.0.4/docs/... where you log pure code without introducing a change at the type level.
- kuwze 8y agoRight. If you want to troll Haskellers just ask about the runtime.