Opened 13 years ago

Closed 10 years ago

Last modified 8 years ago

#276 closed task (fixed)

ghci compile option

Reported by: goronsf Owned by: simonmar
Priority: normal Milestone: 6.8.1
Component: GHCi Version: None
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by igloo)

Sometimes you want to develop something using ghci, but
a lot of files are just interpreted everytime (which
takes a lot time), while they could also had been
compiled. (An option is writing a simple script each
time (but that's not what users want.) So what I want
(and some people on #haskell): an interface to compile
everything instead of interpretate it.  

So inside ghci I want to have an option: 
:compile which compiles everything (except maybe for
the module you are currently working on.) 

This is how people in #haskell would appreciate it:

21:13 < goron> Is there some command to say in ghci:
precompile everything?
21:13 < goron> I had to write some scripts to do it.
21:14 < Lemmih> goron: ghc --make, perhaps.
21:15 < goron> Lemmih: I meant inside ghci. My approach
was ghc --make, but I had to include a lot of
21:15 < goron> And it seems something useful.
21:17 < Lemmih> Agreed.
21:18 < Lemmih> But unfortunately I haven't heard of
such feature.
21:18 < Somebody else> Yep, would be immensly useful.

Change History (8)

comment:1 Changed 11 years ago by igloo

Architecture: Unknown
Component: NoneGHCi
Description: modified (diff)
difficulty: Moderate (1 day)
Milestone: _|_
Operating System: Unknown

comment:2 Changed 11 years ago by simonmar

Milestone: _|_6.8
Owner: changed from nobody to simonmar
Status: assignednew
Type: feature requesttask

I'll take this one. I'm removing the duplication between GhcMode and HscTarget, and one nice side-effect should be that it will be possible to compile to object code from inside GHCi.

comment:3 Changed 11 years ago by simonmar

See also #934

comment:4 Changed 10 years ago by simonmar

Resolution: Nonefixed
Status: newclosed

Now done, patch is:

Wed Apr 11 03:18:02 PDT 2007  Simon Marlow <>
  * Rationalise GhcMode, HscTarget and GhcLink

To compile to object code inside GHCi, use either ghci -fobject-code or :set -fobject-code.

comment:5 Changed 10 years ago by igloo

Milestone: 6.8 branch6.8.1

comment:6 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:7 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:8 Changed 8 years ago by simonmar

difficulty: Moderate (1 day)Moderate (less than a day)
Note: See TracTickets for help on using tickets.