Posted May 24, 2008
I started using Friendfeed. I'm not sure about the
functionality that it offers. I added a lot of services that I'm using on the
internet. Now FriendFeed will collect all the different things that I do and
write and create a new 'feed' of these. This can be an real feed or a page
which shows all the items.
My feed can be found at
http://friendfeed.com/pstuifzand. So if you
are interested in what I'm doing, feel free to take a look at my feed.
Posted May 15, 2008
I'm trying Haskell for writing Web applications. It should be really easy, but
at the moment I'm missing the examples. The documentation doesn't really help
for generating the XHtml.
The following bit of code is something that I found: Haskell and Web
applications. The article
contains a simple example. I changed the code in the example to use a table
instead of the spans. This turned out to be really easy to do.
renderData :: (Data a) => a -> Html
renderData i = table << mapFields renderField i
where renderField (name, val) =
tr << [ (th << renderFieldName (name ++ ":")) ! [ align "left" ]
, td << (read val :: String)
]
I added the call to read to remove the quotes around the values. The <<
operator adds the objects to the right as the children of the object to the
left. Because of the way this is specified this can a list or a single object.
The ! operator adds an attribute to the object on the left.
There need to be more examples for Haskell that are easy to understand and
change, because it is hard to understand the ways that functions work from the
documentation (types and functions) alone.
I hope this will help some of you trying to write some Haskell code.