I hear that good practice in Haskell to use Text instead of String.
I am trying to follow this rule, and coming up with the following question:
Why parseRoute
of Network-HTTP-Client is designed to work with String and not Text?
What is the general recommendation to use String instead of Text?
https://www.stackage.org/haddock/lts-14.2/http-client-0.6.4/Network-HTTP-Client.html#v:parseRequest
I suspect the most likely answer is, sadly, that String
is still the path of least resistance: the ability to reuse all the familiar list functions (and the very good support for lists in parsing libraries) is so convenient that a largish collection of libraries continue to use String
despite possible technical advantages of choosing a different type.
Until the cost of the "worse" (but more convenient) choice is carefully quantified and a fix written by somebody who cares, you can expect that to pretty much stay unchanged in any given library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With