Commit 26c22a77 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Merge pull request #27 from aavogt/master

documentation update
parents 4f162ffc dfc3ec51
:set -package ghc
:set -package ghc-paths
:set -optP-include -optPdist/build/autogen/cabal_macros.h
:set -XOverloadedStrings
{-# LANGUAGE PatternGuards #-} {-# 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>, <http://ipython.org/ipython-doc/dev/development/messaging.html#complete>,
but for whatever reason nothing gets added when the liftIO below prints but for whatever reason nothing gets added when the liftIO below prints
stuff like: stuff like:
......
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE QuasiQuotes #-}
-- | Description : IPython configuration files are compiled-into IHaskell
module IHaskell.Config (ipython, notebook, console, qtconsole, customjs) where module IHaskell.Config (ipython, notebook, console, qtconsole, customjs) where
import Data.String.Here import Data.String.Here
......
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# 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 ( module IHaskell.Eval.Evaluate (
interpret, evaluate, Interpreter, liftIO interpret, evaluate, Interpreter, liftIO
) where ) where
......
-- | Description : Shell scripting wrapper using @Shelly@ for the @notebook@, @setup@, and
-- @console@ commands.
module IHaskell.IPython ( module IHaskell.IPython (
runIHaskell, runIHaskell,
setupIPythonProfile, setupIPythonProfile,
......
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
-- | This module is responsible for converting from low-level ByteStrings -- | Description : Parsing messages received from IPython
-- | obtained from the 0MQ sockets into Messages. The only exposed function is --
-- | `parseMessage`, which should only be used in the low-level 0MQ interface. -- 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 module IHaskell.Message.Parser (parseMessage) where
import ClassyPrelude 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 ( module IHaskell.Message.UUID (
UUID, UUID,
random, randoms, random, randoms,
......
{-# LANGUAGE CPP #-} {-# 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 ( module IHaskell.Message.Writer (
ToJSON(..) ToJSON(..)
) where ) where
......
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
-- | Description : All message type definitions.
module IHaskell.Types ( module IHaskell.Types (
Profile (..), Profile (..),
Message (..), 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 -- replacing it instead with a Haskell Channel based interface. The `serveProfile` function
-- takes a IPython profile specification and returns the channel interface to use. -- takes a IPython profile specification and returns the channel interface to use.
module IHaskell.ZeroMQ ( module IHaskell.ZeroMQ (
......
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-} {-# 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 ClassyPrelude hiding (liftIO)
import Control.Concurrent.Chan import Control.Concurrent.Chan
import Data.Aeson import Data.Aeson
...@@ -39,7 +42,8 @@ main = do ...@@ -39,7 +42,8 @@ main = do
["kernel", profileSrc] -> kernel profileSrc ["kernel", profileSrc] -> kernel profileSrc
-- Bad arguments. -- 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 cmd:_ -> putStrLn $ "Unknown command: " ++ pack cmd
......
...@@ -100,18 +100,8 @@ cabal build ...@@ -100,18 +100,8 @@ cabal build
``` ```
Loading IHaskell into GHCi for testing: Loading IHaskell into GHCi for testing:
If you want to play around with IHaskell by loading it into GHCi, you need to include the ghc package and the cabal macros file. cabal_macros.h is generated by the ```cabal build``` command and the file is placed in the build directory. You will also need to use the OverloadedStrings language extension. So if you are at the top level of the IHaskell project, you can load GHCi as follows: If you are at the top level of the IHaskell project, you can load GHCi with
```bash `cabal repl` or `ghci`. The first option hides all packages not listed in the
ghci -XOverloadedStrings -package ghc -optP-include -optPdist/build/autogen/cabal_macros.h `IHaskell.cabal`, while the second option only sets a couple options given in
``` the `.ghci` file in the repo. Once in ghci, it can then be useful to `:load
*IHaskell/Config` or similar.
or you can create a .ghci file in the top level directory, like so:
```bash
# In the IHaskell .ghci file
:set -package ghc
:set -package ghc-paths
:set -optP-include -optPdist/build/autogen/cabal_macros.h
:set -XOverloadedStrings
```
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