“Hello world!” in Haskell

Everyone wants “hello world” application for being convinced, that the thing can work. Here is one written in Haskell and web-related. It’s quite straight-forward:

import Network.FastCGI
import Text.XHtml

htmlPage
  = header
    << thetitle
      << "Hello World!"
  +++ body ! [ bgcolor "white"] << "Hi"

main = runFastCGIorCGI (output (renderHtml htmlPage))

To make it working, you need GHC and fastcgi library (with all it’s dependencies)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • DZone
  • FriendFeed
  • Reddit
  • Tumblr
  • Twitter

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

blog comments powered by Disqus