Get evaluation timings in GHCi

If you enter :set +s in GHCi, then timing and memory info will be printed after the evaluation of every expression. Example: Prelude> :set +s Prelude> sum [1..2^20] 549756338176 it :: (Num a, Enum a) => a (0.34 secs, 169,197,008 bytes) Note that this will be the timing of the expression as evaluated in the … Read more

Difference in performance of compiled accelerate code ran from ghci and shell

I investigated accelerate and accelerate-cuda and put some debug code to measure a time both under ghci and in a compiled, optimised version. Results are below, you can see stack trace and execution times. ghci run $ ghc -O2 -dynamic -c -threaded Main.hs && ghci GHCi, version 7.8.3: http://www.haskell.org/ghc/ 😕 for help … Loading package … Read more

I taught ghci to compile my StackOverflow posts. Can I make it slicker?

I would try to make a standalone preprocessor that runs SO preprocessing code or the standard literary preprocessor, depending on file extension. Then just use :set -pgmL SO-preprocessor in ghci.conf. For the standard literary preprocessor, run the unlit program, or use Distribution.Simple.PreProcess.Unlit. This way, :load and filename completion just work normally. GHCI passes 4 arguments … Read more

How can I import a Haskell module in GHCi?

When you use import ModuleName in GHCi, it works (mostly) in the same way import Data.List works: GHC checks your local package database for the module, loads it, and brings its (exported) contents into scope. However, Geometry isn’t a module of a package installed with ghc-pkg. Therefore, GHC doesn’t know that a module Geometry exists … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)