An open API service indexing awesome lists of open source software.

https://github.com/vmchale/hlint-lib

Library containing some standard HLint helpers
https://github.com/vmchale/hlint-lib

dhall dhall-lang hlint library

Last synced: 27 days ago
JSON representation

Library containing some standard HLint helpers

Awesome Lists containing this project

README

        

# hlint-lib

[![Build Status](https://travis-ci.org/vmchale/hlint-lib.svg?branch=master)](https://travis-ci.org/vmchale/hlint-lib)

Configuration for [hlint](http://hackage.haskell.org/package/hlint), as a Dhall
library.

## Use

As an example:

```dhall
let hlint = ./constructors.dhall

let recursion = ./recursion.dhall

let fixity = ./fixity.dhall

let base = ./base.dhall

let bannedFunctions =
[ hlint.functions { functions = [ hlint.globalBan "fromJust" ] } ]

in fixity.defFixities # bannedFunctions # recursion # base
```

Save this as `hlint.dhall`, run `dhall-to-yaml --file hlint.dhall` and you should
get

```yaml
- fixity: "infixr 3 ***"
- fixity: "infixr 3 &&&"
- fixity: "infixr 2 +++"
- fixity: "infixr 2 |||"
- fixity: "infixr 1 <=<"
- fixity: "infixl 4 <$"
- fixity: "infixl 4 $>"
- fixity: "infixl 1 <&>"
- fixity: "infixl 4 *>"
- fixity: "infixl 4 <*"
- fixity: "infixl 3 <|>"
- fixity: "infixl 4 <**>"
- functions:
- name: fromJust
within: []
- error:
lhs: "hylo embed"
name: "Use ananorphism"
rhs: ana
- error:
lhs: "hylo f project"
name: "Use catamorphism"
rhs: "cata f"
- error:
lhs: "hyloM (pure . embed)"
name: "Use monadic anamorphism"
rhs: anaM
- error:
lhs: "hyloM f (pure . project)"
name: "Use monadic catamorphism"
rhs: "cataM f"
- error:
lhs: "fmap (const x)"
rhs: "(x <$)"
- error:
lhs: "fmap (const ())"
name: "Use void"
rhs: void
- error:
lhs: "fromMaybe []"
name: Use concat
rhs: concat
```

...containing prepackaged hints for working with recursion schemes as well as
fixity declarations for various operators in `base`.

## Contents

Lovingly provided by [polyglot](http://github.com/vmchale/polyglot):

```
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Code Comments Blanks
───────────────────────────────────────────────────────────────────────────────
Dhall 7 141 117 0 24
Makefile 1 9 6 0 3
Markdown 2 90 73 0 17
YAML 1 26 24 0 2
───────────────────────────────────────────────────────────────────────────────
Total 11 266 220 0 46
───────────────────────────────────────────────────────────────────────────────
```