changeset 0:62ce408561ac

add hello
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Tue, 11 Feb 2014 19:13:31 +0900
parents
children 3d8102358d9c
files Makefile hello.hs
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Tue Feb 11 19:13:31 2014 +0900
@@ -0,0 +1,11 @@
+# we should use cabal
+RCPUS = 12
+
+default: hello
+	./hello +RTS -K1G -N$(RCPUS)
+
+hello: *.hs
+	ghc -O2 hello.hs -rtsopts -threaded
+
+clean: 
+	rm *.o *.hi hello
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hello.hs	Tue Feb 11 19:13:31 2014 +0900
@@ -0,0 +1,10 @@
+{-# LANGUAGE OverloadedStrings #-}
+import Network.Wai
+import Network.HTTP.Types (status200)
+import Network.Wai.Handler.Warp (run)
+import Data.ByteString.Lazy.UTF8 (fromString)
+
+application _ = return $
+  responseLBS status200 [("Content-Type", "text/plain")] "hello world"
+
+main = run 8080 application