Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

reformatting the HISTORY file

  • Loading branch information...
commit 89ac9dae09af50e8aa9ee80c9bc8a17362a19f3d 1 parent ab46ff3
Matt Parker authored August 21, 2010
94  HISTORY.lhs
... ...
@@ -1,94 +0,0 @@
1  
-# v0.0.18
2  
-
3  
-Basic param processing for POST/PUT's that have the content type "application/x-www-form-urlencoded". e.g.: 
4  
-
5  
-    λ bird hatch StarWars && cd StarWars
6  
-    λ vim StarWars.bird.hs
7  
-
8  
-    > post ["jedi"] = do
9  
-    >   name <- param "name"
10  
-    >   teacher <- param "teacher"
11  
-    >   case teacher of 
12  
-    >     Just "Yoda" -> body "The force is strong with this one!"      >> status 201
13  
-    >     _           -> body "Sorry. The force is not with this one."  >> status 400 
14  
-
15  
-    λ bird nest 
16  
-    λ bird fly &
17  
-    λ curl -i -X POST http://localhost:3000/jedi -d name=Luke -d teacher=Yoda
18  
-        
19  
-        HTTP/1.1 201 Created
20  
-        Connection: close
21  
-        Content-Type: text/html
22  
-        Date: Sat, 21 Aug 2010 21:38:11 GMT
23  
-        Server: Happstack/0.5.0.2
24  
-
25  
-        The force is strong with this one!
26  
- 
27  
-
28  
-# v0.0.17
29  
-You are now free to organize your get/post/put/delete functions freely:
30  
-  
31  
-    > -- blog posts admin actions
32  
-    > get ["admin", "posts"] = do ....
33  
-    > post ["admin", "posts"] = do ....
34  
-    > put ["admin", "posts", id] = do ....
35  
-    > delete ["admin", "posts", id] = do ....
36  
-
37  
-    > -- blog frontend
38  
-    > get ["posts"] = do ....
39  
-    > get ["posts", year, month, day] = do ....
40  
-    > get ["posts", year, month, day, id] = do ....
41  
-    > post ["posts", year, month, day, id, "comments"] = do .... 
42  
-
43  
-In normal haskell, you'd be forced to group ALL of your get functions together, all of your post functions together, etc. etc. But bird lets you fly freely.
44  
-
45  
-
46  
-#v0.0.16
47  
-now includes logging! To add to the log in your get/post/put/delete methods, simply call the "log" action with a string log message.
48  
-if you want to plug in your own custom logger, set it in your MyApp/MyApp/Config.hs file: 
49  
-  
50  
-    > config = 
51  
-    >   def {
52  
-    >     birdLogger = myCustomLogger
53  
-    >   }
54  
-                           
55  
-your custom logger method signature must be: Request -> (Request -> BirdResponder ()) -> IO Reply
56  
-
57  
-#v0.0.14
58  
-better "bird" command, thanks to @jasondew. "bird hatch MyApp" for a new app; "bird help" or "bird --help" for more info.
59  
-
60  
-#v0.0.13
61  
-'bird nest' now cleans up after itself. 
62  
-
63  
-#v0.0.12 
64  
-`mime` and `header` methods available for your get/post/put/delete function bodies. 
65  
-
66  
-e.g.:
67  
-  
68  
-    > get [] = do
69  
-    >   body "Hello, World!"
70  
-    >   mime "text/plain"
71  
-    >   header "X-Powered-By" "bird"
72  
-
73  
-#v0.0.11
74  
-Your application code just got simpler. bird MyApp and check it out. 'get [] = body "Hello World"' constitutes a complete and valid bird app.
75  
-
76  
-#v0.0.4
77  
-Using "Rallod" for forward function application.
78  
-
79  
-#v0.0.3
80  
-Hack.Handler.Happstack is now the default hack server handler. 
81  
-Also, "bird build" has been replaced with "bird nest" and "bird run" with "bird fly"
82  
-
83  
-#v0.0.2
84  
-added support for query string. it's accessible in the request record from "params". 
85  
-it's a Data.Map. 
86  
-e.g.: 
87  
-    > module Blog where
88  
-    > import Bird
89  
-    
90  
-    > get, post, put, delete :: Request -> IO Reply
91  
-    > get r = ok $ "query string = " ++ (show $ params r)
92  
-    > post _ = return notFound_
93  
-    > put _ = return notFound_
94  
-    > delete _ = return notFound_
94  HISTORY.markdown.lhs
... ...
@@ -0,0 +1,94 @@
  1
+# v0.0.18
  2
+
  3
+Basic param processing for POST/PUT's that have the content type "application/x-www-form-urlencoded". e.g.: 
  4
+
  5
+λ bird hatch StarWars && cd StarWars
  6
+λ vim StarWars.bird.hs
  7
+
  8
+> post ["jedi"] = do
  9
+>   name <- param "name"
  10
+>   teacher <- param "teacher"
  11
+>   case teacher of 
  12
+>     Just "Yoda" -> body "The force is strong with this one!"      >> status 201
  13
+>     _           -> body "Sorry. The force is not with this one."  >> status 400 
  14
+
  15
+λ bird nest 
  16
+λ bird fly &
  17
+λ curl -i -X POST http://localhost:3000/jedi -d name=Luke -d teacher=Yoda
  18
+    
  19
+    HTTP/1.1 201 Created
  20
+    Connection: close
  21
+    Content-Type: text/html
  22
+    Date: Sat, 21 Aug 2010 21:38:11 GMT
  23
+    Server: Happstack/0.5.0.2
  24
+
  25
+    The force is strong with this one!
  26
+ 
  27
+
  28
+# v0.0.17
  29
+You are now free to organize your get/post/put/delete functions freely:
  30
+  
  31
+> -- blog posts admin actions
  32
+> get ["admin", "posts"] = do ....
  33
+> post ["admin", "posts"] = do ....
  34
+> put ["admin", "posts", id] = do ....
  35
+> delete ["admin", "posts", id] = do ....
  36
+
  37
+> -- blog frontend
  38
+> get ["posts"] = do ....
  39
+> get ["posts", year, month, day] = do ....
  40
+> get ["posts", year, month, day, id] = do ....
  41
+> post ["posts", year, month, day, id, "comments"] = do .... 
  42
+
  43
+In normal haskell, you'd be forced to group ALL of your get functions together, all of your post functions together, etc. etc. But bird lets you fly freely.
  44
+
  45
+
  46
+#v0.0.16
  47
+now includes logging! To add to the log in your get/post/put/delete methods, simply call the "log" action with a string log message.
  48
+if you want to plug in your own custom logger, set it in your MyApp/MyApp/Config.hs file: 
  49
+  
  50
+> config = 
  51
+>   def {
  52
+>     birdLogger = myCustomLogger
  53
+>   }
  54
+                           
  55
+your custom logger method signature must be: Request -> (Request -> BirdResponder ()) -> IO Reply
  56
+
  57
+#v0.0.14
  58
+better "bird" command, thanks to @jasondew. "bird hatch MyApp" for a new app; "bird help" or "bird --help" for more info.
  59
+
  60
+#v0.0.13
  61
+'bird nest' now cleans up after itself. 
  62
+
  63
+#v0.0.12 
  64
+`mime` and `header` methods available for your get/post/put/delete function bodies. 
  65
+
  66
+e.g.:
  67
+  
  68
+> get [] = do
  69
+>   body "Hello, World!"
  70
+>   mime "text/plain"
  71
+>   header "X-Powered-By" "bird"
  72
+
  73
+#v0.0.11
  74
+Your application code just got simpler. bird MyApp and check it out. 'get [] = body "Hello World"' constitutes a complete and valid bird app.
  75
+
  76
+#v0.0.4
  77
+Using "Rallod" for forward function application.
  78
+
  79
+#v0.0.3
  80
+Hack.Handler.Happstack is now the default hack server handler. 
  81
+Also, "bird build" has been replaced with "bird nest" and "bird run" with "bird fly"
  82
+
  83
+#v0.0.2
  84
+added support for query string. it's accessible in the request record from "params". 
  85
+it's a Data.Map. 
  86
+e.g.: 
  87
+> module Blog where
  88
+> import Bird
  89
+
  90
+> get, post, put, delete :: Request -> IO Reply
  91
+> get r = ok $ "query string = " ++ (show $ params r)
  92
+> post _ = return notFound_
  93
+> put _ = return notFound_
  94
+> delete _ = return notFound_

0 notes on commit 89ac9da

Please sign in to comment.
Something went wrong with that request. Please try again.