-
Set the environment variable DPQ to the dpq project directory. E.g. add
export DPQ=<path-to-dpq-directory>
to your.bashrc
file. -
Install via stack:
stack install
. Please see here for instructions on installing stack. We recommend using stack. -
Or install via cabal (>= 3.0.0.0):
cabal v1-sandbox init
cabal v1-install --only-dependencies
cabal v1-build
-
Once 2 is done, you should have two executables, i.e.,
dpq
anddpqi
somewhere in you computer. Add<path-to-dpqi>, <path-to-dpq>
to yourPATH
variable. -
Optional: if you are an emacs user, you may want to add the following to your
.emacs
file(load "<path>/dpq-mode.el") (require 'dpq-mode)
You should now be able to use
C-c C-l
to type check your dpq file. -
Test your installation. Just type
dpqi
in the terminal to invoke the interpretor. In the dpqi interpretor, type:h
to see a list of options.
Assuming you have managed to install dpqi and dpq. run git pull
first, then redo the second
step in the installation guide.
In command line, run dpq
to see further instructions.
see the lib/
and test/
directory for syntax and examples.
-
Why
export DPQ="~/dpq"
does not work?The '~' symbol in double quotes will not get expanded, so if the dpq installation directory is under you home directory, you may want to use
export DPQ=~/dpq
instead. -
How does the
import
work? Can I tryimport "~/lib/Prelude.dpq"
?The importing mechanism we implemented is not very polished. When you want to import another dpq file, you can either use the absolute path, or a relative path relative to the DPQ environment variable. For example,
import "lib/Prelude.dpq"
will import the file at$DPQ/lib/Prelude.dpq
. On the other hand,import "/home/username/lib/Prelude.dpq"
will import the file at/home/username/lib/Prelude.dpq
. -
Why
C-c C-l
does not work for my emacs?One possible reason is that you forget to restart emacs if you just modified your
.emacs
file, or restart the terminal if you just modified your.bashrc
file.