3 ms·
I still wonder why Haskell sans IO isn't a thing. Seems like it would be a really great way to define/implement rules for a rules engine that supported it. I gu
by daxfohl 3y ago
I still wonder why Haskell sans IO isn't a thing. Seems like it would be a really great way to define/implement rules for a rules engine that supported it. I guess you'd still have to worry about OOM or CPU thrashing, but in general it seems like it would be a very expressive language offering a secure sandbox and guaranteeing functional purity for such tasks.
- actionfromafar 3y agoAt some point you would need to see the results of the rules applied, thus, you'd need IO.
- curryhoward 3y agoThe suggestion is to use pure Haskell for the rules DSL only. The surrounding system that applies any side effects would presumably not be written in that language. It's a good idea, and Facebook actually does something like this for their spam filtering rules: https://engineering.fb.com/2015/06/26/security/fighting-spam-with-haskell/ https://engineering.fb.com/2015/06/26/security/fighting-spam...
- daxfohl 3y agoLooks like it has become abandonware, or at least the component they open sourced. Oh well, such is life in the Haskell ecosystem. https://github.com/facebook/Haxl https://github.com/facebook/Haxl
- nextos 3y agoSimple Haskell could be a thing, there have been some efforts in the community but none really crystalized. Frankly, I don't think the problem is so much difficult I/O, but rather too many language extensions, competing toolchains, and some missing libraries.
- wubrr 3y ago> I still wonder why Haskell sans IO isn't a thing Isn't that just Haskell without the use of IO... ? Which is already a thing...
- HackerThemAll 3y ago> great way to define/implement rules for a rules engine There are more ways to implement rule engines and rules than to learn Haskell. One of them could be to use Prolog.
- daxfohl 3y agoHaha, that's exactly what I'm trying to avoid. We're looking at adopting openpolicyagent. Which frankly, a modern JSON-oriented datalog may be ideal. But this whole time I keep thinking, this would be so much easier in Haskell. Granted, the rest of my team would probably find it equally confusing. Maybe even moreso? IDK, it'd be an interesting experiment. If such a thing as Haskell-based policy agent existed.