forked from ndmitchell/hlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ghci
91 lines (79 loc) · 3.04 KB
/
.ghci
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
:set -fwarn-incomplete-patterns
:set -fwarn-unused-binds -fwarn-unused-imports
:set -isrc
:load src\Main.hs src\Paths.hs src\Language\Haskell\HLint3.hs
:def test const $ return ":main test"
:def testfull const $ return ":main test --typecheck --quickcheck"
:def gen const $ return ":!runhaskell data\\HLint_Gen.hs"
:{
let _ghci_make dir flags = ":!" ++
"(if not exist .hpc mkdir .hpc) && " ++
"(if not exist .hpc\\" ++ dir ++ " mkdir .hpc\\" ++ dir ++ ") && " ++
"ghc -threaded -rtsopts --make -isrc -i. src/Paths.hs src/Main.hs -w -odir .hpc/"++dir++" -hidir .hpc/"++dir++" -o .hpc/"++dir++"/hlint "++flags
:}
let _ghci_number def val = show $ case val of "" -> def; x -> read x
let _ghci_make_profile x = let level = _ghci_number 1 x in _ghci_make ("prof" ++ level) ("-O" ++ level ++ " -prof -auto-all -caf-all")
let _ghci_run_profile x args = ":!.hpc\\prof" ++ _ghci_number 1 x ++ "\\hlint " ++ args
:{
:def self \x -> return $ unlines
[":main src --report --hint=misc/HLint_Hints.hs --find=src/Util.hs --find=src/HSE/Util.hs " ++ x]
:}
:{
:def hpc const $ return $ unlines
[_ghci_make "hpc" "-fhpc"
,":!del hlint.tix"
,":!.hpc\\hpc\\hlint --test"
,":!.hpc\\hpc\\hlint src --report=.hpc\\hlint-report.html +RTS -N2"
,":!.hpc\\hpc\\hlint data --report=.hpc\\hlint-report.html +RTS -N2"
,":!hpc.exe markup hlint.tix --destdir=.hpc"
,":!hpc.exe report hlint.tix"
,":!del hlint.tix"
,":!start .hpc\\hpc_index_fun.html"]
:}
:{
:def prof \x -> return $ unlines
[_ghci_make_profile x
,_ghci_run_profile x "src +RTS -p"
,":!start hlint.prof"]
:}
:{
:def memory \x -> return $ unlines
[_ghci_make_profile x
,_ghci_run_profile x "src src src src src src +RTS -hm"
,":!hp2ps hlint"
,":!start /b hlint.ps"]
:}
:{
:def bench \x -> return $ unlines
[_ghci_make "bench" "-O"
,":!timer .hpc\\bench\\hlint src +RTS -N" ++ _ghci_number 1 x
,":!echo."]
:}
:{
:def scope \x -> return $ unlines
[_ghci_make "scope" "-O -eventlog"
,":!.hpc\\scope\\hlint.exe src +RTS -ls -N" ++ _ghci_number 2 x
,":!start /b threadscope hlint.exe.eventlog"]
:}
:{
:def docs_ const $ return $ unlines
[":!cabal configure"
,":!cabal haddock"]
:}
:{
:def docs const $ return $ unlines
[":docs_"
,":!start dist\\doc\\html\\hlint\\Language-Haskell-HLint.html"]
:}
:{
:def extra const $
let msg = [":test - run the test suit"
,":self - run HLint on itself"
,":hpc - run and produce a program coverage report"
,":prof <N> - produce a time profile (N=-O level [1])"
,":memory <N> - produce a memory profile (N=-O level [1])"
,":bench <N> - run the benchmark (should take about 1 second) (N=threads [1])"
,":scope <N> - run with threadscope (N=threads [2])"
,":docs - generate documentation"]
in putStr (unlines msg) >> return []
:}