-
ozten comments on The new LLVM backend to GHC is ready to merge in!
"Yo Dawg, we heard you like Haskell's compiler, so we put a JIT in your Haskell so you can compile while you run your compiled code." -- I don't think dons likes my comedy.
-
The Design and Implementation of XMonad « xmonad
The slides from the Haskell Workshop 2007 talk on the design and implementation of xmonad are now online.Original PDF
- Tags:
- haskell
- presentation
- xmonad
-
DEFUN 2009: Multicore Programming in Haskell Now! « Control.Monad.Writer
Overview of concurrency and ghc for Haskell programming
-
hello world in CGI FastCGI and Happstack FastCGI
Just as a sanity check for Help! Can you run Happstack as a CGI? I made sure your Haskell CGI and FastCGI setup is working.CGI -- ghc --make -o CgiPlay.cgi CgiPlay.hs import Network.CGI
cgiMain :: CGI CGIResult cgiMain = output "Hello World!"
main :: IO () main = runCGI (handleErrors cgiMain) FastCGI -- ghc -package fastcgi -threaded --make -o FCgiPlay.fcgi FCgiPlay.hs import Control.Concurrent import System.Posix.Process (getProcessID)
import Network.FastCGI
test :: CGI CGIResult test = do setHeader "Content-type" "text/plain" pid <- liftIO getProcessID threadId <- liftIO myThreadId let tid = concat $ drop 1 $ words $ show threadId output $ unlines [ "Process ID: " ++ show pid, "Thread ID: " ++ tid]
main = runFastCGIConcurrent' forkIO 10 test Happstack on FastCGI import Happstack.Server.FastCGI import Happstack.Server.SimpleHTTP (askRq, getData, RqData, ToMessage) import Happstack.Server (look, fromData, FromData, simpleHTTP, Conf(..), toResponse, ServerPartT)
simpleCGI :: (ToMessage a) => ServerPartT IO a -> IO () simpleCGI = runFastCGIConcurrent 10 . serverPartToCGI
main = simpleCGI handleRequest
handleRequest = return $ toResponse "Howdy From Happstack on FastCGI"
-
Where can I put my debug statements?
I'm not much on debuggers and rely on the REPL or println statements to learn what a piece of code is doing (or not doing). A frustration I've been having when learning Haskell, is not knowing where I could use Debug.Trace's trace function in my code. The module Debug.Trace provides two methods. putTraceMsg :: String -> IO () trace :: String -> a -> aI chose to go with putTaceMsg... because what the heck is that a -> a all about? Okay, so I plopped it into my code and voila, it compiles and I get to see my output. A day later I added it to a different chunk of code and it won't compile.I was frustrated and confused. Then I noticed that it worked in an IO() context, but not in a pure function... Hmm.I got a clue from reading totherme's post Development with Types and it's comments. I re-read chapters 4 and 7 of RWH focusing on Types, I see that I've been having trouble internalizing "everything is an expression. I need to unlearn the imperative statement oriented languages.I think I'm starting to see what the basis is for where I can use trace. I've got to focus on the "shape" of the main function or within my pure functions. Like lego bricks, the input Type and output Type of each component must match. The overall type must be satisfied by the expression. An expression can be broken up by if, let, where, case, and function calls. The various branches, must all have the same type. Doh, but realizing this difference from weakly typed, statement oriented languages really takes some time.Okay, so now I understand why trace has the signature String -> a -> a. This allows you to "hide" your tracing by not changing the Type of your expression. You are effectively wrapping a sub-expression in a trace.Example: To inject a bit of tracing, just wrap an expression in trace. Before and after, it retains the same shape: some f becomes
trace "hello world" (some f) Related learning, while trying to figure this out: I've been avoiding declaring the Type signature of functions, until I had them "figured out". It sounds like I need to go the other way around, so that I'll be sure that the pile of function calls maintains the correct shape. -
Biting the bullet and reading some Monad tutorials, as I'm getting stuck on playing with Happstack and what is possible with the given context.
-
Why Haskell is beyond ready for Prime Time « Integer Overflow
Why Haskell is beyond ready for Prime Time
-
Haskell Platform Download (Beta)
This is the beta release of the Haskell Platform, version 2009.2.0: a single, standard Haskell distribution for every system.
The Haskell Platform is a blessed library and tool suite for Haskell culled from Hackage, along with installers for a wide variety of systems. The contents of the platform are specified here: Haskell: Batteries Included.
-
Amazon.com: Real World Haskell: Bryan O'Sullivan, John Goerzen, Don Stewart: Books
Oh crap. A book for the masses? I might have to take a stab at Haskell in 2009.

