5 ms·
Haskell definitely takes the cake in terms of leveraging parser combinators, but you’re still stuck with Haskell to deal with the result.
by PittleyDunkin 2y ago
Haskell definitely takes the cake in terms of leveraging parser combinators, but you’re still stuck with Haskell to deal with the result.
- instig007 2y agodon't make it sound as if it's bad, it's actually superb on all these levels: the typelevel, the SMP runtime, and throughput.
- pjmlp 2y agoFor some of us, "being stuck with Haskell" isn't a problem.
- anilakar 2y agoFor the rest, being stuck with real-world problems instead of self-inflicted ones is preferable :-)
- instig007 2y agore-inventing known language features in inferior languages isn't more real-world, it's a self-inflicting kool-aid thirst ^_^
- HKH2 2y agoHas Cabal been fixed yet?
- ryandv 2y agoYes. Use stack [0]. [0] https://docs.haskellstack.org/en/stable/ https://docs.haskellstack.org/en/stable/
- kreetx 2y agoYes, a long time ago [0]. Depending on your needs, stack might still have advantages as the direct tool used by the developer (as it uses cabal underneath anyway). [0] https://stackoverflow.com/a/51016806/4126514 https://stackoverflow.com/a/51016806/4126514
- instig007 2y agoAt least since August 2017: https://downloads.haskell.org/~cabal/Cabal-3.0.0.0/doc/users-guide/nix-local-build.html https://downloads.haskell.org/~cabal/Cabal-3.0.0.0/doc/users... You don't need switching to Stack (as other commenters suggest) to have isolated builds and project sandboxes etc. If you want to bootstrap a specific compiler version, a-la nvm/pyenv/opam, use GHCup with Cabal project setup: https://www.haskell.org/ghcup/ https://www.haskell.org/ghcup/
- pjmlp 2y agoDoesn't seems so, otherwise the computing world wouldn't be so full of NIH syndrome. :)
- PittleyDunkin 2y agoI like haskell a lot, but it's not like there's any shortage of reasons why people don't use it. Replicating parser-combinators in other languages is a huge win.
- wesselbindt 2y agoThat's what they call a "win-win".
- fuzztester 2y ago$ echo "Haskell" | sed 's/ke/-ki' Has-kill $
- fuzztester 2y ago| sed '/k/sk' Has-skill $
- orf 2y agoWrite the full transform in Haskell?
- itishappy 2y ago{-# LANGUAGE OverloadedStrings #-} import Prelude hiding (putStrLn) import Data.Text (Text, replace) import Data.Text.IO (putStrLn) transform :: Text -> Text transform = replace "k" "sk" . replace "ke" "-ki" main :: IO () main = putStrLn $ transform "Haskell"
- fuzztester 2y agoLooks good to me, even as a Haskell ignoramus. I had tried it long back, but found it tough at the time. What is the reason for hiding the putStrLn of Prelude and importing that of Data.Text.IO?
- itishappy 2y agoPrelude takes a `String`, Data.Text.IO works with `Text`. Strings are linked lists of of chars, Text is a more traditional data structure. I tend to write small scripts and use Strings more, but Text is much more efficient for big blocks of text (unsurprisingly). The main reason I used it here was because I couldn't find a `replace` function for `String`, lol.
- fuzztester 2y ago
- zxexz 2y agoAs someone who really enjoys Haskell, I used to think like that. But I realized for problems like parsing, it really is just excellent.