IntersectMBO / IntersectMBO/cardano-ledger

Consistent qualified imports

Open
#5,835 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 7h
Merged PRs (30d)
29

Description

## Text
It is more consistent to import `Text` qualified as `T`, instead of `Text`, so we should make it consistent and switch all `Data.Text*` occurnaces to `as T`:
```
[nix-shell:~/iohk/cardano-ledger]$ git grep "import qualified Data.Text as Text$" | wc -l
14
[nix-shell:~/iohk/cardano-ledger]$ git grep "import qualified Data.Text as T$" | wc -l
49
```

## ByteString
Other qualified imports that needs fixing:
```
import qualified Data.ByteString as BS
import qualified Data.ByteString.Short as SBS
import qualified Data.ByteString.Lazy as BSL
```
Here is some proof for anyone that wants to object:
```
[nix-shell:~/iohk/cardano-ledger]$ git grep "import qualified Data.ByteString.Lazy as LBS" | wc -l
19
[nix-shell:~/iohk/cardano-ledger]$ git grep "import qualified Data.ByteString.Lazy as BSL" | wc -l
57
```

## Others:

* `Data.List.NonEmpty as NE`, not `as NonEmpty`, etc.
```haskell
import qualified Data.List.NonEmpty as NE
```
* `import qualified Data.Foldable as F`, not `as Foldable`, etc.
```haskell
import qualified Data.Foldable as F
```
* `Data.Aeson*`, eg.:
```haskell
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.Key as Aeson
import qualified Data.Aeson.Encoding as Aeson
```

* BaseX encoding
```
import qualified Data.ByteString.Base16 as BS16
import qualified Data.ByteString.Base64 as BS64
```
More bullet points are likely to be added later

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.