• This repository has been archived on 12/Mar/2020
  • Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Haskell
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

šŸ‘¾ Importi.fy ā€” it's like Uber, but for Haskell modules.

importify ā€” manage Haskell imports quickly

Build Status Hackage Stackage Nightly Stackage LTS HLint Status License: MIT

Importify in a nutshell.

importify tool helps you to manage the import section of your Haskell project modules. GHC compiler can warn you about unused imports, and it's a good practice to remove such imports immediately. But this becomes tedious, especially if you use explicit import lists.

Importify can remove unused imports automatically.

Before importify After importify
Module with imports mess After removing all unused imports

You can use stylish-haskell after importify to prettify imports.

In the future, we plan for Importify to be able to:

  • Add missing imports automatically, so you won't have to manage imports manually at all.
  • Implement a cache server with the following features:
    • Download caches for Hackage packages to speed up Importify runs.
    • Upload your caches for yet-to-be-published FOSS projects to make it easier to collaborate.
    • Query mappings from any module of every package to symbols exported by it to write your refactoring tools.
  • Convert imports between implicit and explicit, and between qualified and unqualified forms.
  • Resolve merge conflicts in import section automatically. See an example of such conflict.

Installation

Installation process assumes that you have already installed and configured stack build tool. Currently importify works only with projects built with stack.

Installing from Stackage

Install just as every usual package.

stack install importify

Installing from source

Perform the next steps before driving:

git clone https://github.com/serokell/importify.git  # 1. Clone repository locally
cd importify                                         # 2. Step into folder
stack install importify\:exe\:importify              # 3. Copy executable under ~/.local/bin

Usage

In short:

$ cd my-project-which-build-with-stack
$ importify cache
$ importify file path/to/File/With/Unused/Imports.hs

importify has several commands. Most important is

importify --help

Before removing redundant imports run importify cache command. Importify stores local cache for the project under the .importify folder inside your project. This cache stores exported entities for each module for every dependency and for all your local packages. Make sure to re-run importify cache if you change the list of exported functions and types in your project modules. Cache is built incrementally; it builds dependencies only once. But if you add dependencies or use other versions of them (for instance, because of bumping stack lts) you need to run importify cache again. You can always perform rm -rf .importify before caching if you face any troubles.

After the cache is built, you can use importify file PATH_TO_FILE command from your project root directory. This command runs Importify on the file and prints the result in the terminal. If you want to change a file in-place use the following command:

importify file -i PATH_TO_FILE

More Repositories

1

deploy-rs

A simple multi-profile Nix-flake deploy tool.
Rust
1,358
star
2

universum

šŸŒŒ Prelude written in @Serokell
Haskell
176
star
3

nix-npm-buildpackage

Build nix packages that use npm/yarn
Nix
101
star
4

vault-secrets

NixOS tooling for Hashicorp Vault
Nix
71
star
5

tezos-packaging

Various forms of Tezos software distribution for Linux and macOS.
Python
60
star
6

haskell-with-utf8

Get your IO right on the first try
Haskell
52
star
7

xrefcheck

Check cross-references in repository documents
Haskell
51
star
8

o-clock

āŒ› Type-safe time units in Haskell
Haskell
49
star
9

nix-templates

Nix Flake templates for various languages
Nix
48
star
10

serokell-util

Various functions which are used across multiple @serokell packages
Haskell
44
star
11

ariadne

An open source Ada wallet for users who need more
Haskell
40
star
12

systemd-nix

Generate systemd units from NixOS-style descriptions
Nix
38
star
13

servant-util

Servant servers utilities
Haskell
34
star
14

foundry

Morte IDE
Haskell
28
star
15

update-daemon

Nix Flake Update daemon
Rust
25
star
16

serokell.nix

Serokell Nix infrastructure library
Nix
24
star
17

hackage-search

An application that lets you search for anything on Hackage
Haskell
24
star
18

ghc.dev

The https://ghc.dev Website Generator
Haskell
21
star
19

hse-haskell-course-src

Haskell course in the Higher School of Economics
TeX
21
star
20

log-warper

Logging library to provide more convenient, extremely configurable but simple monadic interface with pretty output
Haskell
19
star
21

nixcon2020-talk

NixCon 2020 talk about Nix flakes
Lua
18
star
22

time-warp

Distributed systems execution emulation
Haskell
18
star
23

notion-to-markdown

Export your Notion.so page as markdown
Python
17
star
24

blog-posts

The place for submitting new articles to the Serokell blog.
Haskell
16
star
25

gemini-infra

Internal Services Cluster
Nix
16
star
26

nix-pandoc

An expression to build Pandoc documents with Nix
Nix
16
star
27

haskell-crypto

Haskell cryptography done right
Haskell
15
star
28

fift-asm-dsl

A Haskell eDSL for the TON VM Assembler
Haskell
14
star
29

deploy

(WIP) Simple deploy of multi-profile systems using flakes
Shell
13
star
30

edna

An open-source tool for data analysis aimed to help researchers with their experiments.
Haskell
13
star
31

avl-plus

AVL+ tree
Haskell
12
star
32

style

Collection of programming style guides used in Serokell
12
star
33

cardano-sl

Cryptographic currency implementing Ouroboros PoS protocol
Haskell
12
star
34

upload-daemon

A daemon that asynchronously copies paths to a remote store.
Haskell
11
star
35

blockchain-util

Haskell
10
star
36

private-tezos-blockchain

Scripts for running private Tezos blockchain
Shell
10
star
37

qtah

Qt bindings for Haskell.
Haskell
9
star
38

rscoin

Moved to https://github.com/input-output-hk/rscoin-haskell
9
star
39

mix-to-nix

Generate sandbox buildable Nix expression from Mix lock file
Nix
9
star
40

tzbot

Timezone bot for Slack
Haskell
7
star
41

derivery

Continuous integration and delivery hook for Nix projects
Erlang
7
star
42

tztime

Safe timezone-aware handling of time
Haskell
6
star
43

github-app

Haskell API for authenticating as a GitHub App
Haskell
6
star
44

lootbox

Toolbox for your cool project
Haskell
6
star
45

xrefcheck-action

GitHub action for xrefcheck
Shell
6
star
46

opam-nix

A handy nix library to package OCaml software from OPAM repositories
Haskell
5
star
47

stack-to-nix

Generate sandbox buildable Nix expression from Stack file
Nix
5
star
48

GPLVMHaskell

Gaussian Process Latent Variable Models implemented in Haskell
Haskell
4
star
49

hermetic

Slack bot that links to YouTrack issues
Elixir
4
star
50

coffer

Multi-backend password store with multiple frontends
Haskell
4
star
51

time-warp-nt

Moved to https://github.com/input-output-hk/cardano-sl/tree/master/networking
4
star
52

nyan-interpolation

Flexible and extensible interpolation for Haskell
Haskell
4
star
53

gui-haskell-app

An example of making a GUI app in Haskell
Haskell
4
star
54

pegasus-infra

Web App Cluster
Nix
4
star
55

aeson-options

Various options to configure field and constructor names in JSON
Haskell
4
star
56

srk-nixpkgs

Moved to https://github.com/input-output-hk/iohk-ops
3
star
57

lightning-network

A Haskell interface for the Lightning Network
Haskell
3
star
58

cobwebhook

Set of webhook Plug middleware
Elixir
3
star
59

ton-paychan

Fast and cheap off-chain micro-transactions for the Telegram Open Network
Makefile
3
star
60

metatemplates

A template repo with common files used in Serokell
Makefile
2
star
61

haskell-algorand-sdk

A Haskell SDK for the Algorand blockchain
Haskell
2
star
62

vendix

libc shim that proxies /nix/store FS calls to a vendored location
C
2
star
63

ton.nix

A Nix overlay for building the Telegram Open Network tools
Nix
2
star
64

nixage

Dismantle stack because who needs it when we have Nix and Stackage
Haskell
2
star
65

serokell-closure

Overlaid Nixpkgs closure for Serokell build systems
Nix
2
star
66

co-log-sys

Syslog implementation on top of co-log-core
Haskell
2
star
67

overcight

A tool that will tell you how well your CI pipelines exercise the files in the repository
Haskell
2
star
68

serokell-stackage

Stackage for your Nix
HTML
2
star
69

github-ops-access

Make sure a certain team always has admin access to all repositories in the organisation
Haskell
1
star
70

rebar3-to-nix

Generate buildable Nix expression from Rebar3 lock file
Erlang
1
star
71

junkscraper

GitHub pull request branch garbage collector
Erlang
1
star
72

avl-example

An example implementation of blockchain using AVL-plus
Haskell
1
star
73

serokell.github.io

Moved to https://serokell.io
1
star
74

tezos-globacap

Haskell
1
star
75

frontend-task

Description of the old test task for frontend developers
1
star
76

async-combinators

Async combinators
Haskell
1
star
77

weird-ghc

Reproduction of a bug in GHC: https://gitlab.haskell.org/ghc/ghc/-/issues/16608
Haskell
1
star
78

hsblst

Haskell bindings and high-level interface to BLST -- a BLS12-381 cryptography library
Haskell
1
star
79

lambda_cache

Polling zero-arity function cache
Elixir
1
star
80

mon

Serokell monitoring library
Haskell
1
star
81

nixos-packet

iPXE images and configuration tools for NixOS deployments on Packet
Nix
1
star
82

stakerdao-infra

Machines and resources for the part of the StakerDAO infrastructure operated by Serokell OƜ
HCL
1
star
83

zipp

Universal zipper (iterator)
Haskell
1
star
84

beamer-theme-serokell

a beamer theme that tries to conform to Serokell brand identity guide
TeX
1
star
85

zeromq-haskell

Fork of the https://gitlab.com/twittner/zeromq-haskell
Haskell
1
star
86

config_macro

Macro that defines Mix.Config.config/3 compatible getters
Elixir
1
star
87

haskell-nix-weeder

Nix library to run weeder on haskell projects built with haskell.nix
Nix
1
star
88

trac11042

Trac #11042 GHC bug reproduction
Nix
1
star
89

morley-zurihac

Hacking on developer tools for the smart contract language of Tezos with Serokell and TQ
CSS
1
star