[Haskell-cafe] How to preload the module of my own

zaxis z_axis at 163.com
Fri Sep 4 22:56:46 EDT 2009


My module is not in any package. Your solution is VERY elegant. 
thanks!


mf-hcafe-15c311f0c wrote:
> 
> 
> echo ':load ~/money/Money.hs' >> ~/.ghci
> 
> works for me.  this adds a line to the startup script that loads a
> file that is not in any package.  if this module loads other modules,
> you may need to play with ':cd' in addition to ':load'.
> 
> hope this helps,
> matthias
> 
> 
> On Fri, Sep 04, 2009 at 06:14:50PM -0700, Alexander Dunlap wrote:
>> To: zaxis <z_axis at 163.com>, Haskell Cafe <haskell-cafe at haskell.org>
>> Cc: 
>> From: Alexander Dunlap <alexander.dunlap at gmail.com>
>> Date: Fri, 4 Sep 2009 18:14:50 -0700
>> Subject: Re: [Haskell-cafe] How to preload the module of my own
>> 
>> On Fri, Sep 4, 2009 at 6:08 PM, zaxis<z_axis at 163.com> wrote:
>> >
>> > I want to preload the module automatically when starting ghci. The
>> module
>> > located in ~/work directory contains some functions i use everyday.
>> >
>> > Now i use an alias: alias ghci='ghci -i ~/money/Money.hs' which works
>> fine.
>> > However i feel there maybe are more elegant way.
>> >
>> > thanks!
>> >
>> 
>> If the module is part of a package you can put 'import NameOfModule'
>> in your ~/.ghc/.ghci file. That file contains commands that are run
>> when ghci starts. I'm not sure if you can load a module that isn't
>> installed.
>> 
>> Alex
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>> 
>>  
>>  ** ACCEPT: CRM114 PASS osb unique microgroom Matcher ** 
>> CLASSIFY succeeds; success probability: 1.0000  pR: 11.8869
>> Best match to file #0 (nonspam.css) prob: 1.0000  pR: 11.8869  
>> Total features in input file: 2936
>> #0 (nonspam.css): features: 758386, hits: 2835097, prob: 1.00e+00, pR: 
>> 11.89 
>> #1 (spam.css): features: 1686574, hits: 2959087, prob: 1.30e-12, pR:
>> -11.89 
>>  
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-preload-the-module-of-my-own-tp25304154p25304648.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list