... anonymous 27th September, 2007 01:32 (UTC)

module Main where

import Data.Char(toUpper)

sentence (l:left) right = (toUpper l : left) ++ “ leads to ” ++ right ++ “.”

hypozeuxis words = unwords (zipWith sentence words (tail words))

main = print (hypozeuxis Attempt to de-reference null value -- A link must specify the URL in the content field
)

— This comment system is shit.

... Kirit Sælensminde 27th September, 2007 07:07 (UTC)

This comment system is shit.

Unfortunately you hit the edges of the Mediawiki parser the site uses. The open square bracket introduces a hyperlink, and of course there was no hyperlink in the Haskell code. The parser really needs to deal with this in a much nicer way.

There are a number of tags that get allow the parser to be bypassed (for example <nowiki>), but they're all turned off for normal users in order to stop all sorts of scripting attacks. In order to enable a wider range of input from users I'd need to go through all of the tags and attribute and work out which should be allowed. I haven't had time to do that, so there's still no HTML tags for posters.

Here is your code properly formatted, and I'll be adding some test cases to try to improve on the parser.

module Main where

import Data.Char(toUpper)

sentence (l:left) right = (toUpper l : left) ++ “ leads to ” ++ right ++ “.”

hypozeuxis words = unwords (zipWith sentence words (tail words))

main = print (hypozeuxis [ "anger", "hate", "suffering" ])

To join in the discussion you should register or log in