Skip to content

vmchale/hlint-lib

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

hlint-lib

Build Status

Configuration for hlint, as a Dhall library.

Use

As an example:

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

- 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:

───────────────────────────────────────────────────────────────────────────────
 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
───────────────────────────────────────────────────────────────────────────────

About

Library containing some standard HLint helpers

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published