small-updates #30

Merged
mfocko merged 2 commits from small-updates into main 2021-02-07 13:29:51 +01:00
5 changed files with 4 additions and 67 deletions

View file

@ -8,8 +8,3 @@
template:
src: templates/ghci.conf.j2
dest: ~/.ghc/ghci.conf
- name: Install HLint.hs
template:
src: templates/HLint.hs.j2
dest: ~/.ghc/HLint.hs

View file

@ -1,60 +0,0 @@
import "hint" HLint.Builtin.All
import "hint" HLint.Default
import "hint" HLint.Dollar
import Data.Map
import Control.Arrow
import Control.Monad
import Control.Monad.State
warn = (\ x -> f $ g x) ==> f . g
-- List
warn = cycle [c] ==> repeat c
warn = x == [] ==> null x where note = "generalize"
warn = [] == x ==> null x where note = "generalize"
warn = x /= [] ==> not (null x) where note = "generalize"
warn = [] /= x ==> not (null x) where note = "generalize"
warn = fst (unzip x) ==> map fst x
warn = snd (unzip x) ==> map snd x
warn "Use not . null" = length x > 0 ==> not (null x) where note = "increases laziness"
warn "Use not . null" = length x >= 1 ==> not (null x) where note = "increases laziness"
-- Map
warn = map fst (Data.Map.toList x) ==> Data.Map.keys x
warn = map snd (Data.Map.toList x) ==> Data.Map.elems x
warn = foldr f v (Data.Map.elems x) ==> Data.Map.foldr f v x
warn = Data.Maybe.fromMaybe d (Data.Map.lookup k m) ==> Data.Map.findWithDefault d k m
-- Arrows
warn = id *** id ==> id
warn = Control.Arrow.first id ==> id
warn = Control.Arrow.second id ==> id
warn = Control.Arrow.first f (Control.Arrow.second g x) ==> (f Control.Arrow.*** g) x
warn = Control.Arrow.second f (Control.Arrow.first g x) ==> (g Control.Arrow.*** f) x
warn = Control.Arrow.first f (Control.Arrow.first g x) ==> Control.Arrow.first (f . g) x
warn = Control.Arrow.second f (Control.Arrow.second g x) ==> Control.Arrow.second (f . g) x
warn = (a *** b) ((c &&& d) x) ==> ((a . c) Control.Arrow.&&& (b . d)) x
warn = (a *** b) ((c *** d) x) ==> ((a . c) Control.Arrow.*** (b . d)) x
warn = Control.Arrow.first f ((a *** b) x) ==> ((f . a) Control.Arrow.*** b) x
warn = Control.Arrow.second f ((a *** b) x) ==> (a Control.Arrow.*** (f . b)) x
warn = (a *** b) (Control.Arrow.first f x) ==> ((a . f) Control.Arrow.*** b) x
warn = (a *** b) (Control.Arrow.second f x) ==> (a Control.Arrow.*** (b . f)) x
warn = Control.Arrow.first f ((a &&& b) x) ==> ((f . a) Control.Arrow.&&& b) x
warn = Control.Arrow.second f ((a &&& b) x) ==> (a Control.Arrow.&&& (f . b)) x
-- State
warn = fmap f Control.Monad.State.get ==> Control.Monad.State.gets f
warn = Control.Monad.liftM f Control.Monad.State.get ==> Control.Monad.State.gets f

View file

@ -26,3 +26,6 @@ cursor:
key_bindings:
- key: F11
action: ToggleFullscreen
- key: N
mods: Control|Shift
action: SpawnNewInstance

View file

@ -1,4 +1,4 @@
set -g default-terminal "xterm-256color"
set -g default-terminal "screen-256color"
set -g default-command "${SHELL}"
set-window-option -g automatic-rename off

View file

@ -18,7 +18,6 @@ export CXXFLAGS="-std=c++14 -Wall -Werror"
export LDLIBS="-lm"
export LANG="en_US.UTF-8"
export TERM="xterm-256color"
export GPG_TTY=$(tty)
alias q="exit"