04:42:46 HugoDaniel: how about something like this, http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=16295#a16295 14:52:08 stepcut 14:52:09 thats nice 14:52:14 and quite flexible 14:52:22 but its not as easy as something like django 14:52:23 w8 14:52:33 http://docs.djangoproject.com/en/dev/topics/http/urls/ 14:52:59 the only thing with the django approach is that they have to specify the types, probably because python requires that 14:53:04 in haskell that comes for free 14:53:12 so it might be possible to do it better 14:55:25 another approach is the bfg, which is also nice: http://docs.repoze.org/bfg/current/narr/urldispatch.html#path-pattern-syntax 14:57:46 i just dont like using xml for routing :/ 15:06:33 yeah 15:07:09 fortunately, adding new URL mapping schemes can be done trivially in 3rd party code.. so hopefully we can get some alternatives someday 15:08:29 I think it might be possible to implement something similar to the django one 15:09:58 or looking at your original example, something like this might be possible, "teacher-$id$/$day$-$month$-$year$" ->> myfunc 15:10:38 (->>) :: (MonadPlus m) => String -> (a -> m r) -> m r 15:10:52 except where 'a' is some varargs type thing 15:11:24 but I am not quite sure how to do it 15:12:04 similar to printf, http://cvs.haskell.org/Hugs/pages/libraries/base/Text-Printf.html 15:12:59 i plan to start working on something like that 15:13:14 if you had, "$d$ - $d$" ->> \d1 d2 d3 -> ... 15:13:30 it would just never match, because the string only contains two ints, and the function requires three 15:13:39 but you can detect that at compile time.. 15:13:56 hmm, yes 15:13:59 yikes 15:14:07 you *can not* detect that at compile time 15:14:16 even with template haskell ? 15:15:49 if you want to use template haskell, then you could just write something like, $(mkMatch "$d$ - $d$") and have it generate, (,) <*> int <* str " - " <*> int 15:15:54 or whatever it is supposed to generate 15:17:42 hmm 15:17:52 template haskell is temptative 15:18:04 :) 15:18:04 another approach might be using something like dyre 15:18:17 and use dynamic recompilation 15:18:25 xmonad style 15:19:12 there are many possibilities ! just not enough hackers ! 15:20:21 I personally prefer templating and url mapping solutions which utilize strong typing.. but we could definitely benefit from templating and url mapping solutions which would be friendly to ruby and python developers 15:23:09 yes, strong typing is a great plus haskell gives us 15:23:49 and using parsec ? 15:23:54 maybe its a bit overkill... 15:25:17 why would parsec be overkill? 15:37:00 it seems like a huge canon to kill a fly, i mean, using it to parse a single line 15:37:22 probably regexp, like django does, is a more sensible choice 15:40:52 in my experience regexp and parsec are not good substitutes for each other 15:41:19 each does a job well, but the other job.. not as well 15:42:34 what makes parsec huge and regexp not ? 15:44:14 i dont know, it just feels like huge, being a full fledged parser 15:45:56 i wouldn't define a grammar just to parse a single line... but im lazyyyy 15:46:56 do { string "teacher-" ; int } 15:46:59 ez :) 15:47:23 don't have to remember where to put all those damn \ things 15:49:17 also makes it easy to add structure.. 15:50:42 but, regex would be good for winning ruby and python converts, because they know it 15:51:20 the parsec version gives you strong type checking though 15:52:55 in your code, Parsec is just a few constructors and a few functions.. not really that huge 15:53:21 probably the same as regexp 16:03:57 hmm 16:09:41 yes 16:09:53 codewise parsec is very elegant 17:27:30 good to allow either 20:17:15 http://www.coactivate.org/projects/deliverance/introduction 20:17:19 i really like this app 21:46:17 koeien: is the buildbot offline? 21:46:36 koeien: also, 6.8 is failing now because readline.h is not installed.. 21:56:00 can someone help me to find out what encoding im getting in this http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16323#a16323 ? 21:56:22 'á' is \195\131\194\161 21:57:18 what happens if you use toString from utf8-string 21:57:50 im not able to use toString because this is a regular ByteString, and not a utf8-string ByteString 21:58:00 ?? 21:58:20 oh wait 21:59:02 for á i get 'á' 21:59:28 I still fail to understand what you mean by 'regular ByteString' and 'utf8-string ByteString' 22:00:03 sorry, it was my mistake 22:00:39 because im not able to use the encode functions of utf8-string in bytestrings 22:00:46 it complains about that in ghc 22:01:08 but im not using encoding or decoding, this is straight from the database 22:01:40 one moment 22:02:14 which is a mssql db, strangely if i set my konsole to utf8 and do a select on the db i get the same output that happstack is giving me (that is the 'á' for 'á') 22:02:41 well, perhaps you db is corrupt? 22:02:45 i tried out diff encoding schemes on konsole, but to no success... 22:03:08 hmm, i dont think so, because the characters show up properly if... 22:03:17 let me see if i can find a case where they show up properly... 22:03:44 i already did make them show up properly, just the page was all messed up 22:04:26 ok, so 22:04:28 on freebsd 22:05:05 they show up all messed up no matter what, on linux they show up correctly if i change the browser from utf-8 to iso-8859-1 (this also makes all the other characters on the page to show up messed up) 22:06:16 ok, so the encoding is iso-8859-1 ? 22:07:19 what does the database say the encoding is ? 22:07:52 no 22:07:58 i still haven't found out 22:08:02 i dont know 22:08:12 w8, ill give you two examples of the same code 22:08:15 running on diff OS 22:11:29 okey, so the first is linux, arch linux 22:11:31 http://dev.fcsh.unl.pt/a3es/ 22:11:32 here 22:11:36 login with id: -100 22:11:39 passwd: a 22:11:54 then chose the 3rd link on the table, and go to the bottom of the page 22:11:59 proxy error 22:12:05 oh :( 22:12:07 oh, worked this time 22:12:19 hmm ok 22:12:33 those the 3rd one, the "Adriano duarte rodrigues" 22:12:36 and go to the end of the page 22:13:01 the last table im getting the data from that weird encoding 22:13:08 and the "á" shows up correctly 22:13:27 now, the freebsd version, its the exact same code, on the same db 22:13:57 http://serv.fcsh.unl.pt/a3es/ 22:14:30 oh well... :/ 22:14:39 it looks to me like they are ISO-8859-1 22:16:24 ok 22:16:55 is this some existing database you have no control over? 22:17:19 sort of 22:17:29 this data comes from diff databases 22:18:06 the login part comes from one db, the middle part from another, and the final table in the bottom cames from another one... i can't change these db's 22:18:57 then you probably need to use iconv 22:18:59 http://hackage.haskell.org/package/iconv 22:19:16 and convert the ISO-8859-1 stuff into a String 22:19:34 then i have my own db, where i can change stuff around, this form is stored in my db, the next part is generate some pdf's from it... but thats another war 22:20:08 allright 22:20:14 this seems just the tool i need, thanks :) 22:20:25 I would use iconv to convert the strings from the ISO-8859-1 database to utf-8, and then toString to convert them into a String 22:20:43 and then everything should work automatically from there 22:21:02 and then flame the people that created the ISO-8859-1 database ;) 22:24:16 stepcut: thats my boss :) 22:25:31 even better ! 23:03:49 its not iso-8859-1 23:03:49 but oh well 23:03:49 tomorow ill try to put somebody correcting all those special characters... :/