03:18:45 --- log: started haskell/01.12.30 03:18:45 --- quit: clog (^C) 03:18:45 --- log: stopped haskell/01.12.30 03:19:16 --- log: started haskell/01.12.30 03:19:16 --- join: clog (nef@bespin.org) joined #haskell 03:19:16 --- topic: 'spooky. quiet. | we be loggin' http://tunes.org/~nef/logs/haskell/' 03:19:16 --- topic: set by shapr on [Wed Dec 19 05:04:11 2001] 03:19:16 --- names: list (clog dennisb shapr smklsmkl jlb pHa xbill sjanes71) 03:49:26 * shapr wakes up 05:58:22 * shapr fiddles with do notation 06:42:38 * shapr continues parroting the example given by dennisb 06:43:01 some of this stuff I really don't know how to turn into do notation 06:43:38 not that bad 06:43:45 ? 06:43:51 email again? 06:43:58 sure! 06:43:58 shapr: hi 06:44:02 hi dennisb! 06:44:10 I've done some of the do notation stuff 06:44:13 it's up as Hsh3.hs 06:44:23 er http://kungens.kemi.fi/~shae/Hsh3.hs 06:44:25 what's the full adress 06:44:27 yes 06:45:04 some of the functions like commandLoop and processCommand 06:45:11 I'm really not sure how to change those 06:45:13 processCommand s = 06:45:13 parseCommand s >>= \ words -> 06:45:13 parseRedire 06:45:22 (and more) 06:45:40 the first line becomes: words <- parseCommand a 06:45:54 right 06:46:14 run "parseCommand a" and put result in "words" 06:46:25 then you run the next command on the next line 06:47:18 ok 06:47:33 commandLoop is a little bit different since there he does not have a lambda-notation-function on the right hand side of >>= 06:48:42 there is a function, either that takes 3 arguments, but he gives it 2. So it really is a function on the right hand side of >>=, but not in the same format as the rest 06:49:27 you can ofcourse bind the result to a variable and explicity call either with this third argument, or you can just leave that (for now) 06:50:14 processCommand s 06:50:14 = do words <- parseCommand s 06:50:14 do (inFile, outFile, words) <- parseRedirection words 06:50:14 performRedirections inFile outFile 06:50:18 does that look sane so far? 06:50:28 er, the tabs are being pasted wrong :( 06:50:46 the second do should be indented to 'words' on the line above 06:50:49 yes, but just one do 06:50:57 ? 06:51:06 wait, i'll show 06:51:09 ok 06:52:06 http://www.zigo.dhs.org/~dennis/Hsh3.hs 06:52:18 I changed the three first lines of processCommand 06:53:39 ooooohhh 06:53:40 I get it! 06:54:00 putting 'do' at the beginning of the function is like saying "the rest of this function is flowing the other direction" 06:54:01 yes, it's not really anything hard about it 06:54:14 once you've gotten there ;) 06:54:31 puting the do is like saying, transform these things to >>= before you compile 06:54:53 but I thought do only worked for the next line 06:55:03 so I expected nested do statements 06:55:37 exacytly how it works depends on how the >>= works, you can make strange definitions of >>= to run the commands in reverse or do any kind of cool stuff 06:56:03 my haskell-fu is not advanced enough to even consider such things 06:56:07 I'm still a white-belt 06:56:21 --- topic: set to 'spooky. quiet. | we be loggin' http://tunes.org/~nef/logs/haskell/ | welcome to the Haskell Dojo' by shapr 06:57:09 one day, I will understand!! 06:57:56 i'm sure you will 06:58:08 yah, I just gotta keep workin at it 06:58:11 how long did it take you? 06:58:27 it's hard to say, i'm still learning 06:58:51 how long have you been learning Haskell? 06:59:15 4 years maybe 06:59:18 oh 06:59:18 wow 06:59:28 do you actually make money with it? 06:59:38 no 06:59:50 does anyone here make money with Haskell? 06:59:58 I'd like to think of some way I can apply it at work 07:00:02 but I haven't thought of anything yet 07:00:02 I'm not sure. But I know people that do 07:07:56 Can you think of things that are done better or faster in Haskell over Java for example? 07:10:46 Actually, all kinds of advanced programs are done better in haskell 07:10:53 like what? 07:11:06 especially if you want to experiment a lot with the code 07:11:16 embedded languages 07:11:49 a couple of weeks I saw a library to generate and handle dynamic webpages 07:12:11 I'd like to play with HaXml 07:12:37 so far it looks to me like haskell has a notation that can get more concise than Perl and yet still remain readable 07:13:13 functional programming seems to allow the compiler to do more optimisation because you're asking for what you want, rather than telling how to do something 07:14:11 for the web-thing you write som haskellprogram and had something like do { txt <- text_entry; putString txt } and the system created the cgi-page, took care of everything and you just write programs like that, i'll look for an example 07:14:27 oh, I'd like that 07:14:28 shapr: well, it's not that easy to optimise actually 07:14:59 but the optimisation seems somewhat moved from the programmer to the compiler writer 07:15:10 http://www.informatik.uni-freiburg.de/~thiemann/haskell/WASH/ 07:15:19 some cool examples there 07:16:38 shapr: there is a lot left for the programmer also to get good speed, but you have a little less control then for example C, but on the other hand, the C programs are usually 10 times as big and buggy 07:19:51 the tradeoff I see now is speed of development versus speed of execution 07:19:58 I can write the same program in Python or in C 07:20:16 yes, you can always do that 07:20:39 so far, Haskell seems to have the development speed of Python with the the execution speed of C 07:21:13 but some complex programs might not ever be written if you need to do a lot of experimentation in C that can take years 07:22:26 but you can always write every program in assembler and get something faster 07:22:36 true enough 07:23:05 currently at work I'm writing my programs in Jython and then porting them to Java 07:23:29 My experience is that programs in haskell have fewer bugs, but that might be because most people don't write haskell programs 07:23:34 this gives the benefits of prototyping and still lets me evolve the prototype directly into the real app 07:23:37 heh 07:23:37 but I think it would be true anyway 07:24:31 the biggest problem I have with haskell is that there is not enough bindings to other packages 07:24:42 that's true 07:24:49 and it's a pain to use the ones that exist 07:24:55 if you write in C you know that no matter what, things always work with C 07:24:56 I really want to play with HOpenGL 07:25:04 but it's too much trouble to build it myself 07:25:15 I'd also like to get better gtk support in Haskell 07:25:25 yah, C is the lowest common denominator 07:26:46 I'm planning to write a small program that uses gtk+2, and that can run in both windows and unix. I don't think I can use haskell for that even if I would like to.. 07:28:52 (I have written parts of if that uses freetype, I wouldn't want to do that with haskell, it's to much work to create a binding first) 07:28:57 hm 07:29:08 so Haskell needs something like SWIG 07:29:23 with SWIG it's *less* trouble to make a binding than to do it manually. 07:29:27 it needs more people that bind stuff :-) 07:29:55 in that case 07:30:03 the Haskell Tutorial project will help 07:30:12 because I'm finding Haskell difficult to learn 07:30:30 I suspect I would have given up in frustration already if it weren't for #haskell 07:30:31 there is a project to bind gtk+ that uses tools to parse the c header files to do great things 07:38:53 * shapr looks at WASH 07:39:43 the code doesn't look that readable maybe, bit it's advanced stuf going on there. The calculator looks fun 07:39:45 btw, changing processCommand to do notation gives: Hsh3.hs:130: The last statement in a 'do' construct must be an expression 07:39:59 probably somthing about indention?? 07:40:34 the items in the do-construct must be indented at the same level 07:41:02 * shapr tries that 07:41:31 hmm 07:41:33 nope 07:41:43 or show it and I can point on the error 07:41:58 processCommand s = do 07:41:58 words <- parseCommand s 07:41:58 (inFile, outFile, words) <- parseRedirection words 07:41:58 performRedirections inFile outFile 07:41:58 let 07:41:58 cmd = head words 07:42:00 args = tail words 07:42:12 that's not all.. 07:42:22 in 07:42:22 case builtin cmd of 07:42:22 Just f -> 07:42:22 do f args 07:42:22 fdClose stdInput 07:42:23 fdClose stdOutput 07:42:25 Nothing -> 07:42:27 exec cmd args 07:42:45 should work if the indention is correct.. 07:42:59 can you put it up as ex 4? 07:43:10 sure 07:43:53 ok, it's up 07:44:23 http://kungens.kemi.fi/~shae/Hsh4.hs 07:44:29 though I'm having trouble getting to it 07:44:54 ah there it is 07:45:27 hmm, the let is a bit special in do also 07:45:33 how so? 07:45:39 if one put the let in () then it works 07:46:06 from beginning of let to the end of "exec cmd args" ? 07:46:13 yes 07:46:20 and indent the in so it's correct again 07:46:50 wow, spiffy 07:47:08 http://www.zigo.dhs.org/~dennis/Hsh3.hs 07:47:22 I changed my copy to use the let in another way 07:47:29 (that only works in do-notation) 07:49:32 * shapr fails to understand 07:49:37 I don't see a difference 07:49:56 hmm, didn't I put it up.. 07:50:02 whew :) 07:50:12 yes, the let does not have an in after 07:50:42 in a do-construct, when you do let, the in part is automatically the rest of the do-construct 07:51:20 did you put it up? 07:51:23 yes 07:51:29 let cmd = head words 07:51:29 let args = tail words 07:51:29 case builtin cmd of 07:51:45 (as always the wrong idention here) 07:52:00 * shapr tries that 07:52:04 before there was one let, and then an in after 07:53:56 wow, cool 07:54:00 awesome 07:54:55 The translation is in the standard: http://www.haskell.org/onlinereport/exps.html#sect3.14 07:54:59 but it might be hard to read 07:57:07 yah, I think it is 08:12:05 your before and after examples worked better for me 08:21:21 I should probably stick them into the tutorial 08:29:18 * shapr blows a fuse reading about the 'either' function 08:31:08 just look at the type and it's simple 08:31:29 You know about the Either type? 08:32:26 nope, now looking 08:32:36 You know about Maybe? 08:33:03 data Either a b = Left a | Right b 08:33:17 it's just like maybe but you save data in both cases 08:37:33 whoa, Schönfinkeling... what a name 08:54:24 wow, I can't find Jim Mattson's email address at all. 08:56:54 well, bbl 08:56:59 --- quit: shapr ("tribes2") 23:06:46 --- join: teek (ttkurppa@kruuna.helsinki.fi) joined #haskell 23:59:59 --- log: ended haskell/01.12.30