Ozten Recent Activities - tagged with haskell http://www.ozten.com/sweetcron/feed en-us http://blogs.law.harvard.edu/tech/rss Sweetcron shout@ozten.com ozten comments on The new LLVM backend to GHC is ready to merge in! http://www.ozten.com/sweetcron/items/view/3470/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.

]]>
Thu, 18 Feb 2010 18:46:00 -0800 http://www.ozten.com/sweetcron/items/view/3470/ozten-comments-on-the-new-llvm-backend-to-ghc-is-ready-to-merge-in
GHC to JavaScript backend - Trac http://www.ozten.com/sweetcron/items/view/2800/ghc-to-javascript-backend-trac

GHC to JavaScript backend

]]>
Fri, 18 Sep 2009 10:34:00 -0700 http://www.ozten.com/sweetcron/items/view/2800/ghc-to-javascript-backend-trac
The Design and Implementation of XMonad « xmonad http://www.ozten.com/sweetcron/items/view/2745/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

]]>
Thu, 10 Sep 2009 08:36:00 -0700 http://www.ozten.com/sweetcron/items/view/2745/the-design-and-implementation-of-xmonad-xmonad
DEFUN 2009: Multicore Programming in Haskell Now! « Control.Monad.Writer http://www.ozten.com/sweetcron/items/view/2733/defun-2009-multicore-programming-in-haskell-now-controlmonadwriter

Overview of concurrency and ghc for Haskell programming

]]>
Tue, 08 Sep 2009 10:07:00 -0700 http://www.ozten.com/sweetcron/items/view/2733/defun-2009-multicore-programming-in-haskell-now-controlmonadwriter
ozten: hello world in CGI FastCGI and Happstack FastCGI http://www.ozten.com/sweetcron/items/view/2718/ozten-hello-world-in-cgi-fastcgi-and-happstack-fastcgi

I made sure your Haskell CGI and FastCGI setup is working. Here are Hello World CGI, Fast-CGI, and Happstack on FastCGI

]]>
Thu, 03 Sep 2009 18:10:00 -0700 http://www.ozten.com/sweetcron/items/view/2718/ozten-hello-world-in-cgi-fastcgi-and-happstack-fastcgi
hello world in CGI FastCGI and Happstack FastCGI http://www.ozten.com/sweetcron/items/view/2719/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"

]]>
Thu, 03 Sep 2009 18:09:00 -0700 http://www.ozten.com/sweetcron/items/view/2719/hello-world-in-cgi-fastcgi-and-happstack-fastcgi
Where can I put my debug statements? http://www.ozten.com/sweetcron/items/view/2619/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.

]]>
Mon, 24 Aug 2009 09:21:00 -0700 http://www.ozten.com/sweetcron/items/view/2619/where-can-i-put-my-debug-statements
Introduction http://www.ozten.com/sweetcron/items/view/2531/introduction

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.

]]>
Wed, 12 Aug 2009 21:54:00 -0700 http://www.ozten.com/sweetcron/items/view/2531/introduction
Another Year Another Language http://www.ozten.com/sweetcron/items/view/2435/another-year-another-language

oztenphoto

Be afraid... be very afraid. So far it's like SICP++.

]]>
Fri, 10 Jul 2009 15:25:00 -0700 http://www.ozten.com/sweetcron/items/view/2435/another-year-another-language
Why Haskell is beyond ready for Prime Time « Integer Overflow http://www.ozten.com/sweetcron/items/view/2395/why-haskell-is-beyond-ready-for-prime-time-integer-overflow

Why Haskell is beyond ready for Prime Time

]]>
Tue, 30 Jun 2009 23:52:00 -0700 http://www.ozten.com/sweetcron/items/view/2395/why-haskell-is-beyond-ready-for-prime-time-integer-overflow
Haskell Platform Download (Beta) http://www.ozten.com/sweetcron/items/view/2019/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.

]]>
Wed, 06 May 2009 16:40:00 -0700 http://www.ozten.com/sweetcron/items/view/2019/haskell-platform-download-beta
Amazon.com: Real World Haskell: Bryan O'Sullivan, John Goerzen, Don Stewart: Books http://www.ozten.com/sweetcron/items/view/712/amazoncom-real-world-haskell-bryan-osullivan-john-goerzen-don-stewart-books

Oh crap. A book for the masses? I might have to take a stab at Haskell in 2009.

]]>
Sat, 06 Dec 2008 23:08:00 -0800 http://www.ozten.com/sweetcron/items/view/712/amazoncom-real-world-haskell-bryan-osullivan-john-goerzen-don-stewart-books