-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ghci
45 lines (44 loc) · 1.36 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
-- Loads the appropriate .ghci file
-- (.ghci880, .ghci860, .ghci820, .ghci800)
--
:{
:def agda_load_ghci_by_version \varcmd ->
let
ghcVersion = Data.Version.versionBranch System.Info.compilerVersion
in
if (length ghcVersion /= 2)
then return "putStrLn \"Strange GHC version…\""
else if ghcVersion >= [8,8]
then return ":script .ghci880"
else if ghcVersion >= [8,6]
then return ":script .ghci860"
else if ghcVersion >= [8,2]
then return ":script .ghci820"
else if ghcVersion >= [8,0]
then return ":script .ghci800"
else return "putStrLn \"Unsupported GHC version\""
:}
:agda_load_ghci_by_version
:undef agda_load_ghci_by_version
-- Loads a ".ghci.local" file if it exists.
-- That file is gitignored, so you may edit it freely.
--
-- Put any local .ghci customizations there and they will not be overwritten
-- by checkouts, nor cause git to appear dirty. Some nice ideas for you which
-- may become defaults at some point in the future:
-- :set +c
-- :set -fdefer-out-of-scope-variables
-- :set -fdefer-type-errors
-- :set -fdefer-typed-holes
-- :set -ferror-spans
-- :set -fhelpful-errors
:{
:def agda_load_local_ghci \_ -> do
let localGhci = ".ghci.local"
exists <- System.Directory.doesFileExist localGhci
return $ if exists
then ":script " ++ localGhci
else ""
:}
:agda_load_local_ghci
:undef agda_load_local_ghci