Commit 4fd721be authored by Eyal Dechter's avatar Eyal Dechter

Merge 'master' changes to README.md

Clarified the difference between cabal repl and calling ghci directly and added additional language pragmas into the .ghci file.

Conflicts:
	README.md
parents 002fcef2 26c22a77
:set -package ghc
:set -package ghc-paths
:set -optP-include -optPdist/build/autogen/cabal_macros.h
:set -XDoAndIfThenElse -XNoImplicitPrelude -XOverloadedStrings
{-# LANGUAGE PatternGuards #-}
{- | very approximate completion. Seems to generate what is required by
{- | Description : generates tab-completion options
very approximate completion. Seems to generate what is required by
<http://ipython.org/ipython-doc/dev/development/messaging.html#complete>,
but for whatever reason nothing gets added when the liftIO below prints
stuff like:
......
{-# LANGUAGE QuasiQuotes #-}
-- | Description : IPython configuration files are compiled-into IHaskell
module IHaskell.Config (ipython, notebook, console, qtconsole, customjs) where
import Data.String.Here
......
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- | This module exports all functions used for evaluation of IHaskell input.
{- | Description : Wrapper around GHC API, exposing a single `evaluate` interface that runs
a statement, declaration, import, or directive.
This module exports all functions used for evaluation of IHaskell input.
-}
module IHaskell.Eval.Evaluate (
interpret, evaluate, Interpreter, liftIO
) where
......
-- | Description : Shell scripting wrapper using @Shelly@ for the @notebook@, @setup@, and
-- @console@ commands.
module IHaskell.IPython (
runIHaskell,
setupIPythonProfile,
......
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- | This module is responsible for converting from low-level ByteStrings
-- | obtained from the 0MQ sockets into Messages. The only exposed function is
-- | `parseMessage`, which should only be used in the low-level 0MQ interface.
-- | Description : Parsing messages received from IPython
--
-- This module is responsible for converting from low-level ByteStrings
-- obtained from the 0MQ sockets into Messages. The only exposed function is
-- `parseMessage`, which should only be used in the low-level 0MQ interface.
module IHaskell.Message.Parser (parseMessage) where
import ClassyPrelude
......
-- | Generate, parse, and pretty print UUIDs for use with IPython.
-- | Description : UUID generator and data structure
--
-- Generate, parse, and pretty print UUIDs for use with IPython.
module IHaskell.Message.UUID (
UUID,
random, randoms,
......
{-# LANGUAGE CPP #-}
-- | This module contains the @ToJSON@ instance for @Message@.
-- | Description : @ToJSON@ for Messages
--
-- This module contains the @ToJSON@ instance for @Message@.
module IHaskell.Message.Writer (
ToJSON(..)
) where
......
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Description : All message type definitions.
module IHaskell.Types (
Profile (..),
Message (..),
......
-- | The "ZeroMQ" module abstracts away the low-level 0MQ based interface with IPython,
-- | Description : Low-level ZeroMQ communication wrapper.
--
-- The "ZeroMQ" module abstracts away the low-level 0MQ based interface with IPython,
-- replacing it instead with a Haskell Channel based interface. The `serveProfile` function
-- takes a IPython profile specification and returns the channel interface to use.
module IHaskell.ZeroMQ (
......
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Description : Argument parsing and basic messaging loop, using Haskell
-- Chans to communicate with the ZeroMQ sockets.
module Main where
import ClassyPrelude hiding (liftIO)
import Control.Concurrent.Chan
import Data.Aeson
......@@ -39,7 +42,8 @@ main = do
["kernel", profileSrc] -> kernel profileSrc
-- Bad arguments.
[] -> putStrLn "Provide command to run ('setup', 'kernel <profile-file.json>', 'run <app> [args]')."
[] -> putStrLn "Provide command to run ('setup', 'kernel <profile-file.json>', \
\'notebook [args]', 'console [args]')."
cmd:_ -> putStrLn $ "Unknown command: " ++ pack cmd
......
......@@ -90,17 +90,20 @@ Module Quickstart:
- `IHaskell.ZeroMQ`: Low-level ZeroMQ communication wrapper. `serveProfile` starts listening on all necessary sockets, and returns a `ZeroMQInterface` record. This record exposes reading and writing `Chan Message` messages for all the necessary sockets, so then the rest of the application can simply use that interface.
First steps:
- Fork and clone the repository.
- Build IHaskell.
- Fork the repository on Github and clone your fork for editing.
- Build IHaskell as follows:
```bash
cd <path-to-IHaskell>
cd /path/to/IHaskell
cabal configure
cabal build
```
**Loading IHaskell into GHCi for testing:**
Use one of the methods below to access IHaskell files in GHCi. Once inside GHCi, you can load an IHaskell file; for example, `:load IHaskell/Config.hs`.
**Using cabal repl**
If you have the latest version of cabal (>v1.18.0), the simplest thing to do is
......@@ -110,31 +113,15 @@ cd <path-to-IHaskell>
cabal repl
```
The will hide all packages not listed in the
`IHaskell.cabal`
**Using GHCi directly**
Alternatively you can just call ghci with the appropriate options. You can find these in the IHaskell.cabal file.
If you don't want to use cabal repl, you can just call ghci with the appropriate options. You can find these in the IHaskell.cabal file.
```bash
ghci -XDoAndIfThenElse -XNoImplicitPrelude -XOverloadedStrings -package ghc -optP-include -optPdist/build/autogen/cabal_macros.h
```
or you can create a .ghci file in the top level directory, like so:
```bash
# IHaskell .ghci file
:set -package ghc
:set -package ghc-paths
:set -optP-include -optPdist/build/autogen/cabal_macros.h
:set -XDoAndIfThenElse -XNoImplicitPrelude -XOverloadedStrings
```
If you just call ghci, it will use the options present in the .ghci file that comes with the IHaskell repo.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment