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
- Host: GitHub
- URL: https://github.com/vmchale/hlint-lib
- Owner: vmchale
- License: bsd-3-clause
- Archived: true
- Created: 2018-10-20T21:21:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-02T15:10:35.000Z (over 4 years ago)
- Last Synced: 2025-02-25T23:17:17.846Z (3 months ago)
- Topics: dhall, dhall-lang, hlint, library
- Language: Dhall
- Size: 32.2 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hlint-lib
[](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.dhalllet 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
───────────────────────────────────────────────────────────────────────────────
```