The fact that we have both lazy and strict Text types without any marker outside of their namespace is rather unfortunate.
In pretty big codebases or modules, it's also easy to forget that Data.Text.Lazy was imported.
This is why, inspired by Kowainik's work, I would like to introduce the following type alias:
import qualified Data.Text.Lazy as LT
-- | Type synonym for 'Data.Text.Lazy.Text'.
type LText = LT.Text
What it does
- Allows the codebase contributor to specify with more clarity to other contributors that the Text flavour that is used is lazy, and reducing the cognitive overhead of said contributors. Very useful in codebase operated by multiple people over a long time with new onboardings.
What it does not
- Provides a magic tool that solves every problem under the sun
- Forces you to use it
- Kills your kitten
A similar ticket was opened in the haskell/bytestring repo: haskell/bytestring#375
The fact that we have both lazy and strict
Texttypes without any marker outside of their namespace is rather unfortunate.In pretty big codebases or modules, it's also easy to forget that
Data.Text.Lazywas imported.This is why, inspired by Kowainik's work, I would like to introduce the following type alias:
What it does
What it does not
A similar ticket was opened in the haskell/bytestring repo: haskell/bytestring#375