use wisdom from alanz/ihaskell

This commit is contained in:
Greg Weber 2014-03-08 18:47:15 -08:00
parent 30d24eec7c
commit bb73ecca55
2 changed files with 34 additions and 18 deletions

View File

@ -1,34 +1,50 @@
# run in the browser
# sudo docker run -rm -p 8778:8778 -i -t <image> IHaskell notebook
#
# run this with a terminal
# sudo docker run -rm -p 8778:8778 -i -t <image>
# sudo docker run -rm -p 8778:8778 -i -t <image> IHaskell console
# browser, but the port is not visible
# sudo docker run -rm -i <image> IHaskell notebook
from zsol/haskell-platform-2013.2.0.0:latest
maintainer IHaskell
maintainer gregweber
RUN sudo apt-get update
RUN sudo apt-get install -y pkg-config libtool git automake libncurses-dev python-dev
RUN sudo apt-get install -yq git pkg-config libtool automake libncurses5-dev python-dev
RUN git clone https://github.com/zeromq/zeromq4-x.git libzmq
RUN cd libzmq && ./autogen.sh && ./configure && make && sudo make install && sudo ldconfig && cd ..
RUN curl -L https://github.com/zeromq/zeromq4-x/archive/v4.0.3.tar.gz > v4.0.3.tar.gz && \
tar xvfz v4.0.3.tar.gz && \
cd zeromq4-x-4.0.3 && \
./autogen.sh && ./configure && \
make && sudo make install && \
sudo ldconfig
RUN cabal update
RUN cabal install happy cpphs
# use local modifications
ADD . /home/haskell/IHaskell
# use master
# RUN git clone https://github.com/gibiansky/IHaskell
RUN cd IHaskell && ./build.sh all
RUN cabal install happy-1.19.3 cpphs-1.18.3
ENV PATH /home/haskell/.cabal/bin:$PATH
# use local modifications of source code
ADD . /home/haskell/IHaskell
# Alternative, use latest master
# RUN git clone https://github.com/gibiansky/IHaskell
RUN cd IHaskell && ./build.sh all
# Alternative, install everything directly from hackage without using a repo
# RUN cabal install ipython-kernel ihaskell-aeson ihaskell-blaze gtk2hs-buildtools ihaskell-diagrams ihaskell-display ihaskell-magic
# The first time this runs it will install stuff
RUN IHaskell console
RUN echo exit | IHaskell console
# Populate with sample notebooks
ADD ./notebooks/ ~/.ihaskell/notebooks/
RUN echo 'c.NotebookApp.ip = "0.0.0.0"' >> ~/.ipython/profile_haskell/ipython_notebook_config.py
# for IHaskell browser
ENV IHASKELL_NOTEBOOK_EXPOSE 1
# ENV IHASKELL_NOTEBOOK_EXPOSE 1
EXPOSE 8778
CMD IHaskell console
ENTRYPOINT ["IHaskell"]
CMD ["notebook"]

View File

@ -14,7 +14,7 @@ module IHaskell.Eval.Parser (
) where
-- Hide 'unlines' to use our own 'joinLines' instead.
import ClassyPrelude hiding (head, tail, liftIO, unlines)
import ClassyPrelude hiding (head, tail, liftIO, unlines, maximumBy)
import Data.List (findIndex, maximumBy, maximum, inits)
import Data.String.Utils (startswith, strip, split)