• Software
  • Leadership
  • Agile
  • Events
  • Other Topics
    • Finance
    • Robotics & AI
    • System Administration
    • Books
    • Life Experiences
    • Environment
  • Write and Earn
  • About Us
    • About Us
    • Our Contributors
    • Contact Us
    • Article Submission Guidelines
    • Logo demystified
  • Follow @MeJaneve
    Janeve.Me
  • Categories

    Browse through following categories for articles written by professionals.
    • Agile
      4
    • Books
      5
    • Environment
      1
    • Events and Conferences
      7
    • Featured
      9
    • Finance
      1
    • Leadership
      6
    • Life Experiences
      8
    • Robotics & AI
      1
    • Software
      30
    • System Administration
      2
  • Software
  • Leadership
  • Agile
  • Events
  • Other Topics
    • Finance
    • Robotics & AI
    • System Administration
    • Books
    • Life Experiences
    • Environment
  • Write and Earn
  • About Us
    • About Us
    • Our Contributors
    • Contact Us
    • Article Submission Guidelines
    • Logo demystified
Home » Software

Haskell – GHCI prompt commands

Janeve George Posted On March 2, 2012
0
3.1K Views


0
Shares
  • Share On Facebook
  • Tweet It

-- Commands available from the prompt:
 
  <statement>                 evaluate/run <statement>
  :                           repeat last command
  :{\n ..lines.. \n:}\n       multiline command
  :add [*]<module> ...        add module(s) to the current target set
  :browse[!] [[*]<mod>]       display the names defined by module <mod>
                              (!: more details; *: all top-level names)
  :cd <dir>                   change directory to <dir>
  :cmd <expr>                 run the commands returned by <expr>::IO String
  :ctags[!] [<file>]          create tags file for Vi (default: "tags")
                              (!: use regex instead of line number)
  :def <cmd> <expr>           define a command :<cmd>
  :edit <file>                edit file
  :edit                       edit last module
  :etags [<file>]             create tags file for Emacs (default: "TAGS")
  :help, :?                   display this list of commands
  :info [<name> ...]          display information about the given names
  :kind <type>                show the kind of <type>
  :load [*]<module> ...       load module(s) and their dependents
  :main [<arguments> ...]     run the main function with the given arguments
  :module [+/-] [*]<mod> ...  set the context for expression evaluation
  :quit                       exit GHCi
  :reload                     reload the current module set
  :run function [<arguments> ...] run the function with the given arguments
  :type <expr>                show the type of <expr>
  :undef <cmd>                undefine user-defined command :<cmd>
  :!<command>                 run the shell command <command>
 
-- Commands for debugging:
 
  :abandon                    at a breakpoint, abandon current computation
  :back                       go back in the history (after :trace)
  :break [<mod>] <l> [<col>]  set a breakpoint at the specified location
  :break <name>               set a breakpoint on the specified function
  :continue                   resume after a breakpoint
  :delete <number>            delete the specified breakpoint
  :delete *                   delete all breakpoints
  :force <expr>               print <expr>, forcing unevaluated parts
  :forward                    go forward in the history (after :back)
  :history [<n>]              after :trace, show the execution history
  :list                       show the source code around current breakpoint
  :list identifier            show the source code for <identifier>
  :list [<module>] <line>     show the source code around line number <line>
  :print [<name> ...]         prints a value without forcing its computation
  :sprint [<name> ...]        simplifed version of :print
  :step                       single-step after stopping at a breakpoint
  :step <expr>                single-step into <expr>
  :steplocal                  single-step within the current top-level binding
  :stepmodule                 single-step restricted to the current module
  :trace                      trace after stopping at a breakpoint
  :trace <expr>               evaluate <expr> with tracing on (see :history)
 
-- Commands for changing settings:
 
  :set <option> ...           set options
  :set args <arg> ...         set the arguments returned by System.getArgs
  :set prog <progname>        set the value returned by System.getProgName
  :set prompt <prompt>        set the prompt used in GHCi
  :set editor <cmd>           set the command used for :edit
  :set stop [<n>] <cmd>       set the command to run when a breakpoint is hit
  :unset <option> ...         unset options
 
 Options for ':set' and ':unset':
 
   +r            revert top-level expressions after each evaluation
   +s            print timing/memory stats after each evaluation
   +t            print type after evaluation
   -<flags>      most GHC command line flags can also be set here
                        (eg. -v2, -fglasgow-exts, etc.)
                   for GHCi-specific flags, see User's Guide,
                   Flag reference, Interactive-mode options
 
-- Commands for displaying information:
 
  :show bindings              show the current bindings made at the prompt
  :show breaks                show the active breakpoints
  :show context               show the breakpoint context
  :show modules               show the currently loaded modules
  :show packages              show the currently active package flags
  :show languages             show the currently active language flags
  :show <setting>             show value of <setting>, which is one of
                                 [args, prog, prompt, editor, stop]

 

Post Views: 3,135
0
Shares
  • Share On Facebook
  • Tweet It




Author

Janeve George

A Technology Leader, Software Engineer, and Agile Methodologies enthusiast. Currently, working as Lead Software Development with Zeta Suite. He has more than 1.8 decades of experience spanning different verticals predominated by hosting, cloud, and media delivery technologies.

Function Oriented Programming in Haskell
Read Next

Function Oriented Programming in Haskell

  • Follow @MeJaneve
    Janeve.Me
  • Categories

    Browse through following categories for articles written by professionals.
    • Agile
      4
    • Books
      5
    • Environment
      1
    • Events and Conferences
      7
    • Featured
      9
    • Finance
      1
    • Leadership
      6
    • Life Experiences
      8
    • Robotics & AI
      1
    • Software
      30
    • System Administration
      2

  • Popular Posts

  • Recent Posts

    • 3Es to Supercharge your Career Journey and Performance Review Ratings
    • Java Asynchronous Programming using CompletableFuture - Part 1
    • The Java Stream API
    • Functional Interfaces in Java
  • Keep In Touch

    Follow us on social media to get latest articles on Programming, System Architecture, Agile Development Methodologies, Product and Project Management, Personal Development, BigData, Robotics, Upcoming Events and more...


Copyright © 2020 | Janeve.Me. All rights Reserved.
Press enter/return to begin your search