Implement attempts for typed tagless-final interpreters
- Typed Tagless-Final Interpretations: Introductory Course
- Kiselyov, Oleg. "Typed tagless final interpreters." Generic and Indexed Programming. Springer, Berlin, Heidelberg, 2012. 130-174.
- CodeWars: Finally tagless interpreter
Install some dependencies:
$ sudo apt-get install libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev libmagic-dev libblas-dev liblapack-dev
Create a new conda
environment named tagless
and activate it:
$ conda create -n tagless python=3.7
$ conda activate tagless
Install Jupyter notebook and its extensions:
$ pip install notebook
$ pip install jupyter_contrib_nbextensions
$ pip install jupytext
Install IHaskell using stack
(if you haven't installed stack
yet, try curl -sSL https://get.haskellstack.org/ | sh
and do not install any new ghc
after installing stack
):
$ git clone https://github.com/gibiansky/IHaskell
$ cd IHaskell
$ pip install -r requirements.txt
$ stack install --allow-different-user --fast
$ ihaskell install --stack
Clone this repository and enter:
$ git clone https://github.com/li-xin-yi/tagless-final
$ cd tagless-final
Start a Jupyter notebook server:
$ stack exec jupyter -- notebook --config=config.py
Open http://localhost:3040/ with your favorite browser and try to run all codes!
If your stack
, Jupyter
and IHaskell
are installed in a remote server (like what I do): on the server, you can run
$ screen -S tagless
Start a subscreen named tagless
, and run all command above on this subscreen, then exit by Ctrl + A + D to make the Jupyter server run in background. You can recover the screen by:
$ screen -r tagless
At any time.
Now, you can access the notebook from your local machine by
$ ssh -N -f -L localhost:3040:localhost:3040 <username>@<server-name>
and open http://localhost:3040/.