logoalt Hacker News

fuzztester11/10/20241 replyview on HN

Looks 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?


Replies

itishappy11/10/2024

Prelude 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.

show 1 reply