Scrap your qualified import clutter

Most of the time we find ourselves following this pattern in Haskell:

import Data.Text (Text) import qualified Data.Text as Text import Data.ByteString (ByteString) import qualified Data.ByteString as ByteString

require adds a new keyword that abstracts this. The former code snippet can be reduced to

require Data.Text require Data.ByteString

Here, the last part of the module is converted to a qualified alias, and a type corresponding to it:

require Data.Text

Will import Data.Text qualified as Text and the Text type.

There are more options, you can check them out in the require docs.

How to use require