Skip to content

haslab/HAAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Manual

To install HAAP in a new sandbox, simply run:

cabal sandbox init
cabal sandbox add-source packages/*
cabal install HAAP.cabal

For JavaScript animations you need to have ghcjs installed:

  1. install ghcjs from https://github.com/commercialhaskell/stack/blob/master/doc/ghcjs.md
  2. add ghcjs to your path
  3. install the HAAP ghcjs packages
cabal install --ghcjs packages/codeworld-haap-api packages/ghcjs-extras packages/Xterm

Docker

To try HAAP in a new Docker container, simply run:

docker run -i -t hugopacheco/haap:latest /bin/bash

Since this container has no X window system, it is often useful to bind a directory in your host system, say ~/Desktop, to a path inside your container, say /Desktop, by running the container with the additional argument:

docker run -v ~/Desktop:/Desktop -i -t hugopacheco/haap:latest /bin/bash

Examples

You can then try our examples.

helloworld

A simple hello world example with a simple Hspec specification and Hakyll webpage generation:

cd examples/helloworld
cp ../../cabal.sandbox.config .
cabal exec -- ghc helloworld.hs
./helloworld

The resulting page is generated at _site/index.html.

Check the pre-generated result of this helloworld example.

minimalistic

A minimal example that showcases code analysis tools and CodeWorld integration:

cd examples/minimalistic
cp ../../cabal.sandbox.config .
cabal exec -- ghc minimalistic.hs
./minimalistic
./minimalistic

The resulting page is generated at _site/index.html.

Check the pre-generated result of this minimalistic example.

xterm

An example that showcases xterm.js integration:

cd examples/xterm
cp ../../cabal.sandbox.config .
cabal exec -- ghc xterm.hs
./xterm

The resulting page is generated at _site/index.html.

Check the pre-generated result of this xterm example.

gameworker

An example that showcases a CodeWorld game using JavaScript Web Workers:

cd examples/gameworker
cp ../../cabal.sandbox.config .
cabal exec -- ghc gameworker.hs
./gameworker

The resulting page is generated at _site/index.html. Note that, by default, some browsers (such as Google Chrome) may block local JavaScript Web Workers for security reasons.

Check the pre-generated result of this gameworker example.

plab

A mockup of the Laboratórios de Informática I class feedback page.

cd examples/plab
cp ../../cabal.sandbox.config .
cabal exec -- ghc plab.hs -ioracle
./plab
./plab

The resulting page is generated at _site/index.html.

Check the pre-generated result of this plab example.