Skip to content

Commit

Permalink
Merge pull request #17 from aleator/master
Browse files Browse the repository at this point in the history
Added a hlint file
  • Loading branch information
tfausak authored Jan 27, 2020
2 parents fd1c8fd + 9cfe19e commit 94a8908
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,27 @@ Flow | Base
`f <! x` | `f $! x`
`apply' x f` | `seq x (f x)`

### Converting existing code

If you want to uniformly use flow operators you can use [HLint] with the
`hlint-flow.yaml` file. For easy use, it is best to extract the
`hlint-flow.yaml` to your project directory and do

``` sh
> hlint -h hlint-flow.yaml <source file>
```

or

``` sh
> hlint --git -h hlint-flow.yaml
```

to check all Haskell source tracked by git.

For more information about Flow, please read [the Haddock documentation][].

[HLint]: https://github.com/ndmitchell/hlint
[Flow]: http://taylor.fausak.me/flow/
[Version badge]: https://www.stackage.org/package/flow/badge/nightly?label=version
[version]: https://www.stackage.org/package/flow
Expand Down
25 changes: 25 additions & 0 deletions hlint-flow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- hint:
lhs: 'f $! x'
note: 'Use `<!`'
rhs: 'f <! x'

- hint:
lhs: 'f $ x'
note: 'Use `<|`'
rhs: 'f <| x'

- hint:
lhs: 'x & f'
note: 'Use `|>`'
rhs: 'f |> x'

- hint:
lhs: 'f . g'
note: 'Use `<.`'
rhs: 'f <. g'

- hint:
lhs: 'f <. g'
note: 'Use `.>` for natural reading direction'
rhs: 'g .> f'

0 comments on commit 94a8908

Please sign in to comment.