[commit: packages/Cabal] ghc-head: Docs for 'cabal repl'. (5ffdea6)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:30:52 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=5ffdea66e4e37169f00a28b9f1937b10035f89ed

>---------------------------------------------------------------

commit 5ffdea66e4e37169f00a28b9f1937b10035f89ed
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Fri Aug 23 11:25:26 2013 +0200

    Docs for 'cabal repl'.


>---------------------------------------------------------------

5ffdea66e4e37169f00a28b9f1937b10035f89ed
 Cabal/doc/developing-packages.markdown |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Cabal/doc/developing-packages.markdown b/Cabal/doc/developing-packages.markdown
index f56c6ee..af923ea 100644
--- a/Cabal/doc/developing-packages.markdown
+++ b/Cabal/doc/developing-packages.markdown
@@ -476,6 +476,27 @@ The library section should contain the following fields:
 The library section may also contain build information fields (see the
 section on [build information](#build-information)).
 
+#### Opening an interpreter session ####
+
+While developing a package, it is often useful to make its code available inside
+an interpreter session. This can be done with the `repl` command:
+
+~~~~~~~~~~~~~~~~
+cabal repl
+~~~~~~~~~~~~~~~~
+
+The name comes from the acronym [REPL], which stands for
+"read-eval-print-loop". By default `cabal repl` loads the first component in a
+package. If the package contains several named components, the name can be given
+as an argument to `repl`. The name can be also optionally prefixed with the
+component's type for disambiguation purposes. Example:
+
+~~~~~~~~~~~~~~~~
+cabal repl foo
+cabal repl exe:foo
+cabal repl test:bar
+cabal repl bench:baz
+~~~~~~~~~~~~~~~~
 
 ### Executables ###
 
@@ -1578,3 +1599,4 @@ a few options:
 [happy]:      http://www.haskell.org/happy/
 [Hackage]:    http://hackage.haskell.org/
 [pkg-config]: http://pkg-config.freedesktop.org/
+[REPL]:       http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop





More information about the ghc-commits mailing list