00:00:00 --- log: started haskell/03.05.03 00:20:15 --- join: Radek_MOB (~radek@gprs9211.eurotel.cz) joined #haskell 00:32:33 --- join: irc (sseefried@pill0.orchestra.cse.unsw.EDU.AU) joined #haskell 00:34:12 --- quit: irc (Read error: 54 (Connection reset by peer)) 00:35:40 --- join: seafood2 (sseefried@pill0.orchestra.cse.unsw.EDU.AU) joined #haskell 00:40:20 --- quit: seafood2 (Remote closed the connection) 00:56:21 --- join: Marvin-- (~martin@sjogren.ostkupan.studenthem.gu.se) joined #haskell 00:59:27 --- quit: Radek_MOB (Connection timed out) 02:08:02 I'm trying to get rid of calls to unsafePerformIO. I'm stuck on how to check whether a value of type IO String has zero length. I can write a function that returns IO Bool, but I'm not sure how to code a test (such as == True) for an IO Bool 02:11:04 if you're in IO, you're in IO, you cannot safely get out (that's why it's called *unsafe*PerformIO :) 02:12:02 you could write an ifM :: IO Bool -> IO a -> IO a -> IO a function 02:13:11 Let me be more specific. I have a recursive function, and one of the arguments is set by a call to hGetLine. I want to terminate the recursion when hGetLine returns IO "". 02:13:22 Is there a pattern for that? 02:13:28 Or something I can use in a guard? 02:14:25 uh, what does the call look like? What's the type of the recursive function? 02:14:54 Socket -> IO String -> [IO String] -> [IO String] 02:15:13 and what is it supposed to do? 02:15:32 no IO will "happen" in that function 02:15:37 If the IO String parameter is not "", add it to the list of [IO String] 02:16:00 but IO String is not String, you can't compare IO String to a String 02:16:03 OK, then let's back up. I want to read lines from a file, add them to a list of lines, and stop when I read a blank line 02:16:07 IO is a type, like any other 02:16:25 OK, but IO String is the only thing that the IO functions return. 02:16:25 then you most likely want IO [String] as return type 02:16:40 Oh, OK, but I don't see how that solves this problem. 02:16:45 yes, you have to be in a function of type IO a for some a to be able to inspect the result 02:17:02 I am, but I still don't see where that helps. 02:17:32 what do the various parameters do? What does the [IO String] do? and what is the IO String? 02:17:36 where is the actual reading? 02:18:10 Again, instead of looking at my code, which is probably wrong, let's talk about what I need to do. I have a socket. I read lines from the socket, and I put the lines in a list until I read a blank line. 02:18:21 How do I do that? 02:18:47 I can do it with unsafePerformIO, but as I understand it I should try to avoid that 02:19:01 no you cannot do it with unsafePerformIO, that will break sooner or later :) 02:19:12 ok, then what is the correct way to do it? 02:19:48 I'd do it like this: getLines sock = do { l <- hGetLine sock ; if null l then return [] else do { ls <- getLines sock ; return (l:ls) } } 02:20:02 (feel free to break it up in lines :) 02:20:34 getLines :: Socket -> IO [String] in this case 02:20:42 @type hGetLine 02:20:50 * Marvin-- prods lambdabot 02:20:58 Its IO String 02:21:07 let me try that. 02:22:35 I can't do it that way, because I have to process the hGetLine output before I test it, but maybe I can fit that into this method. 02:23:10 I can just make a function that does what I need and returns IO String, and call that instead of hGetLine 02:24:18 Oh, I see what you did, you put the recursive call inside of a nested combinator 02:24:59 the point is that inside 'do', you use x <- f to be able to inspect the result of f 02:25:35 That's not the point at all. I didn't have any trouble inspecting the string. I had trouble doing something useful after I inspected the string. 02:25:43 uh, okay 02:26:22 I often get the wrong advise, because everyone assumes that the problem is getting the String from IO String. But that is trivial. 02:26:43 well, I simply must not understand what it is you want 02:26:57 The problem in this case is that I was trying to inspect the string in a separate function, or inspect the string in a guard. 02:27:25 And a separate function returns IO Bool instead of Bool, which doesn't help. And you apparently can't use the tricks for removing the IO within a guard 02:27:53 The reason that what you wrote may work is that you nested a do within another do, and made the recursive call from within the nested do. 02:27:56 of course not, a guard takes a boolean expression, not a monadic expression 02:28:10 well, that's what you always do 02:28:30 Nowhere, in ANY documentation, will you find a single word about that. 02:28:53 And, in a normal (that is, not monadic) setting, you don't have to do that at all. 02:29:07 you can have a pattern like func whatever "" whatever = do something 02:29:16 which you can't do in the monadic setting 02:29:40 but all the documentation shows examples like that, and ONLY examples like that. 02:29:40 huh? I'm not following 02:30:15 I'm just trying to explain why the documentation is so confusing. 02:30:37 because, in most cases, you can't do in the monadic settings any of the techniques shown in all the books and papers. 02:31:16 And you won't find, in Thompson's book, or Hudak's book, a single example with nested do's. I know, I've read both twice. 02:31:49 if you think about it, it's pretty natural though, the if expression is a function :: Bool -> a -> a, and in the monadic code, you've got (>>=) :: Monad m => m a -> (a -> m b) -> m b, so both branches of the if must also have monadic values, how do you usually create monadic values? Using do 02:32:28 You are missing the point. The problem is not that I don't know how to create monadic values. 02:32:50 That's explained in the second paragraph in Thompson's book when talking about monads 02:32:59 and at least Thompson's book doesn't have a whole lot about monads at all 02:33:06 That's quite true. 02:33:41 But look at any of the docs, in wiki, in the doc pages for the various monads. You won't see examples of how to do anything typical. 02:33:55 My point is this. 02:34:15 I'm looking at page 388 in Thompson here.. putNtimes n str = if n <= 1 then putStrLn str else do { putStrLn str ; putNtimes (n-1) str } 02:34:25 well, all right, still only one 'do' 02:34:29 exactly 02:34:35 and not the same situation at all. 02:34:57 The key here is where you make the recursive call, not monadic values. 02:35:01 okay 02:35:15 Now that you showed me, I see it, but it isn't obvious. 02:35:36 on page 392 he creates a while function... while test action = do { res <- test ; if res then do { action ; while test action } else return () } 02:35:44 I think I'll write a "monads for the functionally challanged" 02:35:49 heh 02:36:05 but that won't work, because in any real situation test action would have to be monadic, and we just said you can't do that. 02:36:24 if I could have written "while test xxx" where xxx is that my string is empty, it would have been no problem. 02:36:32 although it is a nested do which I missed. 02:36:38 but test *is* monadic, it's Monad m => m Bool 02:36:44 but the first test action is outside the do 02:36:59 no, that's the lhs of the function definition 02:37:07 you can't say if XXXXX then, if XXXXX is IO Bool 02:37:29 exactly, which is why the code says do { res <- test ; if res then ... 02:37:59 no, you don't get there unless the while test action is true, so that is the wrong part of the statement to look at. 02:38:11 it's not the same situation at all. 02:38:16 I'm not following 02:38:36 I know, I'm not explaining it correctly. 02:39:02 let me finish coding this function and see if the compiler accepts it. 02:39:41 --- join: tic (~vision@h47n2c1o1003.bredband.skanova.com) joined #haskell 02:40:31 no, it almost works, but says: 02:40:42 Couldn't match `[a]' against `IO String' 02:40:43 Expected type: [a] 02:40:43 Inferred type: IO String 02:40:43 In the first argument of `null', namely `li' 02:40:43 In the predicate expression: null li 02:40:57 can you put the code online somewhere? 02:41:13 OK, hold on. 02:41:14 or we could go to #flood 02:41:24 let's do #flood, it isn't very big. 02:44:47 --- join: Radek_MOB (~radek@gprs9211.eurotel.cz) joined #haskell 02:46:14 --- quit: Radek_MOB (Client Quit) 02:48:02 --- join: BlitzNL (DonCo66@node-c-c143.a2000.nl) joined #haskell 02:51:57 --- join: Radek_MOB (~radek@gprs9211.eurotel.cz) joined #haskell 02:56:55 I have this large program almost completed implemented in Haskell (and Ruby and ocaml), and I was stuck there. 02:57:20 ocaml didn't force me to really do functional programming 02:58:21 that's the bad thing about ocaml :) 02:58:58 when I did the first pass from ruby, I implemented a lot of things as classes. Then I went back to see where I _really_ needed a class. Answer: nowhere. 02:59:39 there wasn't a single case where using a class was better. which surprised me a bit. 03:04:23 classes in single instances are irrelevent. 03:04:33 its reuse and interaction that make them useful. 03:05:12 you get exactly the same reuse from a properly constructed module. 03:05:24 The class is only better if dynamic dispatching is necessary 03:06:38 *shrug* 03:16:39 --- quit: ChoJin ("bye !!!") 03:31:41 I am working on my haskell skills lately and it seems that I run into the situation where I want to apply a function 'n' times and eventually apply it to the initial value. To accomplish this I wrote a function exec, but there must be a better way, right ;) 03:31:42 exec f i ini 03:31:42 | i > 0 = f (exec f (i-1) ini) 03:31:42 | otherwise = f ini 03:37:02 --- join: systems (systems@62.12.124.107) joined #haskell 03:37:12 --- part: systems left #haskell 03:46:44 --- part: Jerub left #haskell 03:47:39 --- join: hdaume (~hdaume@c-24-126-229-242.we.client2.attbi.com) joined #haskell 03:51:01 --- quit: hdaume (Client Quit) 03:57:19 --- nick: kani^^off -> kaninchen 04:07:45 BlitzNL: there isn't anything especially wrong with that. 04:07:52 You could do it this way: 04:08:07 no, forget it. 04:08:24 I was going to use a pattern, but that won't work with i > 0, only with i == 0 04:08:40 but wait 04:09:18 is f a function of one variable? 04:10:43 hmm.. what do you guys use to typeset haskell in latex? 04:11:51 opet: I'm not one of the guys who knows that. :) 04:12:33 seth_: f is a function 04:12:51 BlitzNL: right, with how many arguments? 04:12:59 BlitzNL: One? 04:13:17 no two 04:13:37 then I don't think the | otherwise = f ini is what you want. Did you intend a partial application there? 04:14:37 why not it works but it just looks like something that is in the prelude or something. I can paste the rest wait 04:14:54 BlitzNL: no reason why not, if that is what you meant to do. 04:14:55 BlitzNL: take a look at iterate 04:15:05 unbwt enc = exec (shiftenc enc) (length enc - 3) initcolumns 04:15:05 where 04:15:05 initcolumns = sort (shiftenc enc ((map (\c -> [c])) (sort enc))) 04:15:05 shiftenc enc rest = sort (zipWith (\a b -> a : b) enc rest) 04:15:13 dennis: mm ok i will 04:15:37 http://www.haskell.org/onlinereport/standard-prelude.html#$viterate 04:24:42 --- join: tWip (~nobody@ttarvain-dsl.oulu.fi) joined #haskell 04:30:56 dennis: using iterate works fine 'last (take (length n) (iterate (shiftenc enc) initcolums))', thnx 04:31:36 BlitzNL: it's not much easier then to write your own function, but at least it's a prelude function 04:32:10 dennis: yeah my goal is indeed to use as much prelude as possible 04:33:30 dennis: and it also turns out to be slightly more efficient ((3600 reductions, 7856 cells) against (3531 reductions, 7763 cells)) ;-) 04:34:51 BlitzNL: you could make your more efficent also I think. Also, this is in the interpreter, a compiler might take away the difference 04:35:28 BlitzNL: you don't have to pass around ini in each recursive call, maybe it would make it faster 04:35:45 dennis: don't spoil my moment ;) 04:36:06 BlitzNL: ehhh... last (take (length n) ...) sounds silly, why not head (drop (length n - 1) ...) ? 04:37:11 or use !! if one never use it with negative values 04:38:29 Marvin--, dennis: mmm 04:44:49 Marvin--: you're right, it much better thnx 05:07:21 * shapr boings happily 05:07:25 tmoertel: you called? 05:12:02 --- quit: jemfinch (Read error: 60 (Operation timed out)) 05:12:07 --- quit: lambdabot (Remote closed the connection) 05:14:21 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 05:15:51 shapr! ;) 05:16:02 y0 sjj 05:16:03 wassup? 05:16:15 doing a bit of work, hacking selectmodule.c .. you? 05:16:23 --- join: esap (~esap@212-246-110-78.adsl.tpo.fi) joined #haskell 05:16:27 doing a bit of paying work 05:16:35 *nod* 05:16:48 and playing with lambdabot in the bits of spare time 05:17:01 I know this is the wrong channel, but do you know much about hotshot? 05:19:10 never heard of it 05:19:40 what is it? 05:19:42 profiler module 05:20:35 oh, for python 05:28:24 * shapr wishes for a Haskell nntp module 05:29:33 no genie about? 05:30:38 I have a nice little art deco lamp here I could rub 05:30:49 though it might electrocute me if I'm not careful 05:34:31 I can do something like 'data Bla = ... deriving Show', but can I influence the way a datatype is pprinted ? 05:35:40 do the instance declaration yourself 05:37:02 opet: ok I'll look into it thnx 05:46:58 --- nick: kaninchen -> kani^^off 06:07:14 --- join: nerdlor (~hjass@Waterloo.fw.opentext.com) joined #haskell 06:08:34 --- join: elmex (~elmex@pandora.labs.dn-systems.de) joined #haskell 06:10:15 --- join: Vincenz (Vincenz@D5770839.kabel.telenet.be) joined #haskell 06:10:48 hey, i don't want to post this to the ghc-users-mailing list, maybe it's a stupid question, but when looking at the examples in the directory ghc/misc/examples/ (in the current ghc­5.05.20030430 tarball) and trying to compile them, it comes out that it is missing readSocket 06:11:00 (compiled with ghc -o tet Main.hs -package net) 06:19:02 * shapr looks 06:19:24 hi elmex 06:19:25 it's using SocketPrim, which seems to be moved to Network.Socket 06:19:31 shapr: hi ;-)) 06:20:57 the name of your gateway box is cute 06:21:11 pandora.labs.dn-systems.de ? 06:21:22 it's just temporary... from my company 06:21:30 it should be elmex.x-paste.de ;-) 06:21:34 I call a computer a "box" so that would be "pandora's box" 06:21:42 ;-)) 06:22:12 btw. how experimental is the Concurrent stuff? 06:22:23 has it at least a bit matured? ;-) 06:22:25 works for me 06:22:29 okay 06:22:31 lambdabot is using concurrent 06:23:01 lambdabot: @hello 06:23:05 well *g* i just thinking about some irc-client too... but argh... it just sucks writing an irc-clinet in every new language i learn 06:23:22 * shapr pokes lambdabot 06:23:23 lambdabot: y0 06:23:35 oh, it's lagging 06:23:41 Hello world. 06:23:42 Sorry, I'm not a very smart bot yet, try "lambdabot: @listcommands" 06:23:47 does it understand ping? 06:24:01 oh, no, he doesn't know ctcp ;-) 06:24:04 I don't think so 06:24:08 you could add that ;-) 06:24:09 @fact source 06:24:09 http://sf.net/projects/haskell-libs/, http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/haskell-libs/libs/lambdabot/ 06:24:28 oh, I have to update the chess plugin 06:24:30 lambdabot: @quit 06:24:30 --- quit: lambdabot (Remote closed the connection) 06:26:45 hm, i guess, i will look for some other crap to create some code for, nooone ever needs 06:27:08 I need an nntp module 06:27:21 elmex: look at http://sf.net/projects/haskell-libs/ 06:27:23 uh, hm, i don't read much usenetnews 06:27:33 bunch of people getting together to write libraries for Haskell 06:28:31 i'm not much of a haskell/functional programmer (yet) 06:28:57 that sourceforge projects is sort of a cvs-wiki for this channel 06:29:05 and for haskell developers in general 06:29:18 cvs-wiki? everyone throws code in? 06:29:30 something like that, yah 06:29:49 right now we have a web-server, an irc 'bot, chess playing code, some crypto code, some email code 06:29:58 exact real number code 06:30:02 lots of interesting bits 06:30:24 you need a ircd in haskell ;-))) 06:30:42 but i hate to write the routing-code for it. so i won't write any ;))) 06:31:25 lambdabot uses two threads, one for reading one for writing 06:31:35 I bet it would fun to extend it to bridging between networks 06:31:57 you mean, using a client as gateway? 06:32:03 yah 06:32:06 between two networks 06:32:16 uh, hm, why? 06:32:24 I wonder if there's a #haskell on oftc, EFNet, etc 06:32:34 just for the fun of writing code :-) 06:32:44 ;-)))) well, yes 06:32:45 it's virtually empty on efnet 06:32:47 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 06:32:55 @listmodules 06:32:55 I have the following modules installed: ["chess","dict","eval","fact","fortune","hello","karma","more","searchml","state","system","topic","type","yow"] 06:33:05 and only has ibid in on oftc 06:33:20 i wrote a quick and dirty client with my knowledge of haskell yet, here is the main routine: 06:33:29 do args <- getArgs 06:33:30 case args of 06:33:30 [] -> putStr "Usage: client \n" 06:33:30 x -> do putStr $ "Connecting " ++ (head args) ++ " ...\n" 06:33:30 conn $ head args 06:33:37 wait 06:33:53 the cool thing, i love are those forkIO 06:33:54 forkIO $ readLines sock 06:33:54 forkIO $ sendLines sock 0 06:33:54 readConsole sock 06:34:14 elmex: lambdabot will stretch your brain 06:34:27 at some points this is MUCH easier in haskell than in Perl 06:34:46 @board 06:34:46 r n b q k b n r 06:34:46 p p p p p p p p 06:34:46 - - - - - - - - 06:34:46 - - - - - - - - 06:34:46 - - - - - - - - 06:34:47 - - - - - - - - 06:34:49 P P P P P P P P 06:34:51 R N B Q K B N R 06:34:57 stretch my brain? 06:35:17 ohmygodachessinircchannelpleasenot 06:35:21 yah, lambdabot sources range in difficulty from the simplicity of writing plugins to the insanity of layered monad transformers 06:35:55 monad transformers? 06:36:19 you know about monads? 06:36:44 * tmoertel makes steel-cut oats for breakfast 06:36:45 well, yes, i know how to do some stuff with it and that >> >>= stuff. and do and all that. 06:37:02 right, so you know that "IO a" is the IO monad, yah? 06:37:11 good morning tmoertel! 06:37:21 'morning, shapr! 06:37:38 tmoertel: I saw the new dict commands, spiffy! 06:37:45 shapr: well.. uh.. hm. not really 06:37:55 i'm still a bit confused about that type-stuff 06:37:59 @prelude monad 06:38:01 *** "monad" prelude "Haskell Standard Prelude": text follows 06:38:01 Monad 06:38:01 class Monad m where 06:38:01 return :: a -> m a 06:38:02 (>>=) :: m a -> (a -> m b) -> m b 06:38:04 (>>) :: m a -> m b -> m b 06:38:06 fail :: String -> m a 06:38:09 -- Minimal complete definition: (>>=), return 06:38:14 @more 06:38:15 tmoertel: whoa, where'd that come from? 06:38:15 p >> q = p >>= \ _ -> q 06:38:15 fail s = error s 06:38:18 [ DONE ] 06:38:21 @dict-help 06:38:23 I perform dictionary lookups via the following 13 commands: 06:38:23 @all-dicts .. Query all databases on dict.org 06:38:24 @devils ..... The Devil's Dictionary 06:38:26 @easton ..... Easton's 1897 Bible Dictionary 06:38:28 @elements ... Elements database 06:38:30 @foldoc ..... The Free On-line Dictionary of Computing 06:38:32 @gazetteer .. U.S. Gazetteer (1990) 06:38:34 @hitchcock .. Hitchcock's Bible Names Dictionary (late 1800's) 06:38:35 oy 06:38:36 @jargon ..... Jargon File 06:38:41 @more 06:38:41 @prelude .... Haskell Standard Prelude 06:38:41 @vera ....... V.E.R.A.: Virtual Entity of Relevant Acronyms 06:38:42 @web1913 .... Webster's Revised Unabridged Dictionary (1913) 06:38:44 aha 06:38:44 @wn ......... WordNet (r) 1.7 06:38:45 there it is! 06:38:46 @world02 .... CIA World Factbook 2002 06:38:59 wow, that's handy 06:39:21 that was kind of the point of the dict module 06:39:27 :-) 06:39:29 the other dictionaries are icing on the cake, so to say 06:39:57 I'd like to write a haddock module, but I rely on ghci to play with the code I've written, and FastMutInt.hs kills ghci 06:40:41 I had to tease the definitions out of the Prelude code in Hugs 06:41:01 I hacked -- and I *do* mean hacked -- together a bit of Perl to do it 06:41:04 have you seen fit.c2.com ? 06:41:10 * tmoertel looks 06:41:31 lets you use a wiki to input unit tests 06:42:11 interesting 06:43:20 I have this idea for some combination of haddock and hws-wp to allow you to input unit tests and see the results immediately on the haddock docs 06:44:55 any thoughts? 06:44:59 So you specify a category for test cases in your source code? 06:45:14 And haddock/hws-wp/shapr-thing then grabs all the cases in that 06:45:26 category, runs them, and places the results into the commentary for 06:45:31 your code in the haddock docs? 06:46:17 yup 06:47:16 shapr: the type IO a means i have to use this action stuff >> or do? 06:47:20 of course, haddocks could include both quickcheck and hunit tests 06:47:32 elmex: yah, sort of 06:47:58 shapr: hmm, ok... well 06:48:13 elmex: thing is, there's some invisible state being passed along with the >> or >>= calls 06:48:40 tmoertel: one advantage would be the ability to write demo code that is both unit test and demo 06:48:49 tmoertel: what do you think? would it be useful/interesting? 06:49:07 shapr: ah, ok 06:49:27 elmex: http://www.dcs.gla.ac.uk/~nww/Monad.html 06:49:31 it would be useful in that the results of test cases would be visible to users of the docs 06:50:25 might make it easier to get unit tests for ghc stuff also 06:50:36 shapr: ah, okay. thanks. will read that... once i got out of this flirt-chat here ;-)) 06:50:42 (not #haskell) 06:50:45 * shapr laughs 06:50:46 aww 06:51:54 there is no other way for a geek to find contact to girls 06:57:11 'He, 18, searchs a girl for sex and exchanging haskell sources.' 06:57:37 well, my fiancee just fixed her mandrake installation today 06:57:43 and I wasn't able to do that yesterday ;-) 07:04:15 mandrake... uh 07:04:32 she got tired of having to ask me to fix her debian installation. 07:04:43 she wanted one she could install and admin by herself 07:04:44 whats bad about debia? 07:04:45 an 07:04:50 uh, ok 07:09:43 --- part: nerdlor left #haskell 07:18:16 --- quit: BlitzNL (Read error: 60 (Operation timed out)) 07:18:47 haskell r0xx0rs! 07:19:53 hm 07:20:01 ? 07:20:02 h42k311 07:20:09 whoa 07:20:10 ah, no 07:20:12 h45k311 07:20:17 that too 1337 for me 07:21:52 hm, my post-code is totally eleet 07:22:08 it's 31137 07:22:24 post code? 07:22:29 power on self test? 07:22:44 hm, no i mean for the mail-delivery (real mail ;) 07:22:50 it's germany 07:22:59 i don't know how to translate it 07:23:31 oh 07:23:48 for the US it's zip code, we use post code in the UK 07:23:49 well, post is the correct british way to say it 07:24:25 yes, postcode, or zipcode 07:32:18 --- nick: kani^^off -> kaninchen 07:34:21 --- quit: o3 (sterling.freenode.net irc.freenode.net) 07:34:40 * shapr bounces happily 07:37:00 anyone here knows whether MS Access supports "select * from bar where bar.foo like '%blah%';" ? 07:37:32 I've been unable to figure out a valid Jet 4.0 query that uses "like" 07:37:36 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 07:41:33 shapr: is there no grammar for valid queries? 07:41:37 (hi btw) 07:41:40 hi 07:41:42 I don't know 07:41:58 hmm. got no docs? 07:42:01 I don't own a copy of ms access, but the mdac components come with the Jet 4.0 engine 07:42:15 what's jet 4.0? 07:42:25 the actual engine that ms access uses 07:42:32 ah 07:43:50 a client asked me to do some MS Access work, and I don't feel like putting more money into Bill's pocket. 07:45:39 hmm. I only found a 3.0 quickref which doesn't seem to completely describe where clauses. 07:46:26 I found an intro that shows an example with one single percent wildcard 07:46:33 maybe it just doesn't like me using two wildcards 07:47:23 hmm 07:54:14 --- quit: o3 (sterling.freenode.net irc.freenode.net) 07:54:17 * shapr wishes for a working HaskellDB 07:54:56 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 07:55:13 y03 07:55:37 --- quit: kawfee (Read error: 110 (Connection timed out)) 08:03:10 * shapr boings 08:03:16 @yow 08:03:16 My LIBRARY CARD expired... 08:03:22 hi dnm 08:11:40 <-- graduate! 08:11:45 * Igloo bounces 08:12:25 * Smerdyakov has to take 4 final exams before graduating =( 08:12:31 Igloo: you graduated? 08:13:12 Yup 08:13:19 So. Does anyone want to recommend interesting summer jobs that I could still arrange? 08:13:31 I can travel anywhere, especially if you pay ;-) 08:14:07 Igloo: cool, congratulations 08:14:18 Igloo: congraduations! 08:14:51 shapr: *groan* 08:15:09 :-) 08:21:32 --- quit: o3 (sterling.freenode.net irc.freenode.net) 08:22:36 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 08:28:12 --- quit: o3 (sterling.freenode.net irc.freenode.net) 08:28:35 * shapr boings 08:31:02 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 08:37:45 * Segora bum-tchaks. 08:38:21 * shapr shebangs 08:45:12 hrm, how does UNIQUE fit into a SQL query? 08:45:15 I've forgotten :-/ 08:46:00 I don't think it has to do with queries, but rather with table definitions. 08:46:38 I thought I could "select unique foo from bar" 08:46:47 Do you mean DISTINCT? 08:46:53 ohhh maybe so 08:47:34 Smerdyakov: thanks! 08:47:41 that was a braino on my part 08:47:48 Draino in the braino? 08:48:46 yah, something like that 08:50:17 --- join: jak (~jak97@holt.doc.ic.ac.uk) joined #haskell 08:50:22 hi jak 08:50:30 yo shapr 08:50:34 wassup? 08:50:37 lol 08:50:45 trying to build a debian kernel atm 08:50:55 but I am sorely confused by --initrd option to make-kpkg 08:51:54 what you up to? 08:54:21 I've never used the initrd option with make-kpkg 08:54:29 but I do like make-kpkg lots 08:55:15 --- quit: Darius (Read error: 104 (Connection reset by peer)) 08:56:17 --- quit: o3 (sterling.freenode.net irc.freenode.net) 08:57:28 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 08:57:28 --- quit: o3 (sterling.freenode.net irc.freenode.net) 08:59:08 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 09:02:38 the hawiki is pretty cool 09:02:59 --- quit: archie_sihir (Remote closed the connection) 09:04:10 yah it is 09:04:22 btw. is there some mysql binding for haskell? 09:04:35 @fact htoolkit 09:04:35 http://sf.net/projects/htoolkit, postgresql mysql and odbc bindings 09:04:49 the @fact plugin is using the postgresql binding 09:05:22 do you understand the 'pass' function for MonadWriter class? 09:05:28 not me 09:07:37 --- join: Darius (~ddarius@66-44-61-78.s332.tnt4.lnhva.md.dialup.rcn.com) joined #haskell 09:20:08 --- join: HunterPrey (Ruppy123@async-115.sydney-isp1.cisco3.goanna.net.au) joined #haskell 09:25:49 hi HunterPrey 09:32:16 jak: it looks like 'pass' is used to modify what's "inside" the writer 09:33:52 --- quit: o3 (sterling.freenode.net irc.freenode.net) 09:36:03 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 09:37:42 --- quit: o3 (sterling.freenode.net irc.freenode.net) 09:41:00 hey 09:41:58 My take on pass is it's the most general primitive for filtering in a Writer monad. I imagine censor would be a more common usage. 09:42:39 any odbc clueful people here? 09:42:52 I'm getting a unicode conversion error with code and data that formerly worked... 09:49:34 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 09:49:34 --- quit: o3 (sterling.freenode.net irc.freenode.net) 09:49:34 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 09:51:00 tmoertel: yes, it's a bit strange -- I don't understand why the wiki stresses the "first" argument 09:56:37 I wrote that 09:57:27 It's because I think of it as filtering what is written, but it's only what is written in the first argument, which is the same thing that's returning the filtering function. 09:58:28 However, I haven't really used Writer and I'm somewhat fuzzy on what pass is used for. tell and listen are obvious enough 09:58:38 yeah 09:58:45 same here 09:59:09 So HaskellWiki uses MoinMoin? 09:59:13 yup 09:59:25 that is, if you mean the new HaWiki 09:59:38 the older one used PyWiki, and was called HaskellWiki 10:00:05 hmm 10:00:10 what about curses bindings? 10:00:31 too many ;-) 10:00:31 hat irgendjemand lust mal was f?r mich zu testen ? 10:00:34 Do you recommend MoinMoin, then? 10:00:38 ich habbe keine ahnung! 10:00:40 Smerdyakov: I do 10:01:13 OK. Any reasons? 10:01:56 yah, lots 10:02:30 OK. A fellow in #wiki is telling me to use it, too. =) 10:02:33 macro support, lots of extra charset support, subpages, file attachments, various per-user customizations, access controls 10:02:41 if it's snibril, then that's the author ;-) 10:02:55 No, though I know snibril from ancient days in #c on EFNet. =) 10:03:01 wow, cool 10:05:12 kaninchen: ja? 10:05:41 elmex: so you wanna test sth for me ? (actually it was an amsg for quakenet but nevermind) 10:05:54 quakenet? lol 10:05:59 you are hanging around there too? 10:06:20 kaninchen: what are you doing over there? 10:06:26 hehe sure, I was once playing cs (about 6 months ago) 10:06:41 oh, hm.. i don't like cyber sex that much 10:06:42 so I'm an ex player ... 10:06:52 hmm cs = counterstrike :) 10:06:57 cs sucks, quakeworld for ever 10:07:03 hehe :) 10:07:04 nevermind 10:07:09 quake is atleast GPL!!! 10:07:12 do you still want to test sth for me ? :) 10:07:14 and that cs-engine is still closed 10:07:20 kaninchen: i don't know, what is it? 10:07:21 yepp 10:07:49 and the cs engine is still one of the worst one could emagine 10:08:03 elmex: http://lotux.homelinux.org:1000/~camold/page/ 10:08:19 The requested URL /~camold/page/ was not found on this server. 10:08:23 it is yet a login system but it will be more in within the next week :) 10:08:36 hmm mom 10:08:38 crappy mozilla 10:08:39 wait 10:08:41 i got it 10:08:52 what the heck??? 10:08:59 you didn't typ the port ? 10:09:00 thats a fuckn big picture 10:09:10 hmm well yes :) 10:09:13 kaninchen: well, somehow it wasn't copied correctly 10:09:27 ahh ok 10:09:37 kaninchen: so, waht are you doing in #haskell? 10:09:51 haha,cool. at least apache :) 10:09:54 I made several projects in haskel 10:10:03 kaninchen: what kind of projects? 10:10:05 :%s/haskel/haskell/ 10:10:16 elmex: http://lotux.homelinux.org/ 10:10:56 lotux? 10:11:14 and brandubh 10:11:26 scary 10:11:48 i'm not into game development... i somehow love to write never finished network-applications 10:11:48 why ? 10:11:56 elmex: hehe 10:12:14 elmex: so if you like that -> write a graphical client for the brandubh server !!! 10:12:19 I still have none :) 10:12:55 hmm 10:13:07 i'm more into playing Go not other board games 10:13:16 :) 10:13:26 and why is that page in php and not even perl or haskell? 10:13:56 haskell was to dificult as cgi scripts (php is more simple for such purposes ...) 10:14:08 and I cannot write in perl 10:14:15 ah, yes... 10:14:24 perl is too easy for people who come from php 10:14:29 Were you writing CGI programs directly, instead of using a functional CGI library? 10:14:47 if you know perl, and you are going to php, you feel like being shot into both legs and you have to run 10:15:30 elmex: really ? hmm perhaps I will try perl in the next time ... 10:15:33 we'll see that 10:16:08 kaninchen: well, perl isn't exactly something you can plugin for php or something. but there are good perl-modules who are much easier for CGI than php 10:16:41 hmm well ok 10:16:50 perhaps in the next project :) 10:17:17 currently I have no time to learn new languages but perhaps in 2 weeks or so 10:17:46 well, i don't promise everthing to be easier or something. but perl is much more flexible somehow. and it's just cool for writing system-scripts and all 10:18:07 aha 10:18:11 sounds great 10:19:14 hm... that cvs server for ghc seems to be a bit slow 10:19:24 --- quit: o3 (sterling.freenode.net irc.freenode.net) 10:19:49 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 10:23:35 what is that Network.CGI good for? 10:26:19 --- quit: o3 (sterling.freenode.net irc.freenode.net) 10:26:44 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 10:26:50 elmex: it's a CGI library 10:27:01 shapr: what does a CGI library do? 10:27:10 CGI is short for common gateway interface 10:27:23 long ago and far away, web servers only served static html 10:27:39 some bright person had a brilliant idea... 10:28:15 whenever an executable was requested, instead of returning the raw source of that executable, give it a bunch of environment variables, and return whatever the executable returned 10:28:36 that set of environment variables and calling conventions is CGI 10:30:07 scary 10:30:33 i somehow want at least some ... more complete CGI lib 10:30:38 what is about file-uploads? 10:30:47 i never got around implementing a cgi lib for that 10:30:58 (don't want to read the MIME rfc ;-)) 10:31:57 just grab the POST env var 10:32:06 There are more complete CGI libraries. 10:32:14 shapr: nope 10:32:16 --- quit: Radek_MOB (Excess Flood) 10:32:34 shapr: the file-upload isn't handled by POST env vars 10:33:08 back in a sec 10:33:10 --- quit: jak ("Client exiting") 10:33:31 --- join: Radek_MOB (~radek@gprs9211.eurotel.cz) joined #haskell 10:35:20 --- quit: o3 (sterling.freenode.net irc.freenode.net) 10:35:24 --- join: o3 (andrep@c17736.belrs2.nsw.optusnet.com.au) joined #haskell 10:36:22 elmex: I'm pretty sure it is 10:36:27 --- quit: Radek_MOB (Client Quit) 10:37:13 --- join: Radek_MOB (~radek@gprs9211.eurotel.cz) joined #haskell 10:37:14 elmex: I've done it that way before 10:39:15 shapr: i can't see the functions which catch the multipart/form-data 10:40:03 the way I've done it in the past is to POST a file, and then look in the environment variable to find the filename that was saved into 10:40:18 shapr: and you don't want a 40MB big file in a ENV var 10:40:32 no, the *filename* is in the env var 10:40:47 shapr: that saving is done in the CGI lib 10:41:10 --- quit: flippo ("Client Exiting") 10:41:27 ok 10:41:37 if you say so :-) 10:41:39 at least it is done in the perl CGI lib 10:42:22 shapr: the http server transmitts that file mime encoded as mulripart/form-data, and the CGI script has to save that somewhere 10:43:02 I think you get to choose how the file is encoded when you design the form 10:43:38 yes, but any other encoding isn't really good....well... 10:45:24 why is that? 10:47:05 because multipart/form-data is for files, and the other application/x-www-form-urlencoded is for small data normally. 10:52:10 hm, from this rfc thre is some part saying: 10:52:11 5.8 File transfer with ENCTYPE=x-www-form-urlencoded 10:52:11 If a form contains elements but does not contain an ENCTYPE in the enclosing
, the behavior is not specified. It is probably inappropriate to attempt to URN-encode large quantities of data to servers that don't expect it. 10:52:15 http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1867.html 10:56:05 --- join: lament (~lament@h24-78-145-92.vc.shawcable.net) joined #haskell 10:57:37 --- quit: HunterPrey () 11:00:07 oy 11:03:11 --- join: jak (~jak97@holt.doc.ic.ac.uk) joined #haskell 11:11:24 --- nick: kaninchen -> kani^^off 11:13:36 --- quit: lambdabot (Remote closed the connection) 11:18:55 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 11:19:23 --- nick: kani^^off -> kaninchen 11:23:13 --- quit: lament ("Celebrate Discoflux!") 11:23:27 --- join: ChoJin (~ask@adsl-63-201-39-90.dsl.snfc21.pacbell.net) joined #haskell 11:23:37 oy 11:35:38 --- quit: Smerdyakov ("bumbling about") 11:37:50 --- quit: lambdabot (Remote closed the connection) 11:50:03 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 11:57:36 --- join: jao (~jao@103.Red-80-33-152.pooles.rima-tde.net) joined #haskell 11:58:13 --- join: pesco (~pesco@c226118.adsl.hansenet.de) joined #haskell 12:01:52 --- nick: kaninchen -> kani^^off 12:13:29 --- quit: pesco ("party") 12:25:25 --- quit: lambdabot (Remote closed the connection) 12:25:45 --- quit: shapr ("argh") 12:37:52 --- nick: kani^^off -> kaninchen 12:49:33 --- nick: kaninchen -> kani^^off 13:00:25 --- quit: Radek_MOB (Connection timed out) 13:13:19 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 13:13:26 --- join: shapr (~user@h224n1fls32o1017.telia.com) joined #haskell 13:15:34 anyone here dealt with the arrowp preprocessor? 13:19:32 I've run the small Eval.as demo through the preprocessor, but the resulting output won't compile 13:23:13 what's the param to give ghc a custom preprocessor? 13:27:36 I can't find where -F is documented... 13:27:37 hmm 13:28:57 The parser doesn't like the ~(Num u) etc. 13:29:15 oh is that it? 13:29:32 do you also get the conflicting definitions for `u' 13:29:34 ? 13:29:54 Yes before removing the ~'s it compiles after. 13:30:03 * shapr tries 13:31:23 Arrow notation isn't 100% correct the same for refutable patterns. Perhaps the preprocessor handles making the irrefutable patterns automatically now. 13:31:38 s/the same// 13:32:04 where do you get your Arrow import? 13:32:12 Control.Arrow 13:32:14 oh 13:34:27 yay, it compiles! 13:38:25 hm 13:40:50 --- join: kaninc872 (~camold@p3EE226D3.dip.t-dialin.net) joined #haskell 13:41:06 --- nick: kaninc872 -> kaninchen 13:42:04 what's the trick to using arrowp on .las files? 13:45:58 heck if I know. Try putting it through GHC first with the appropriate phase option, or alternatively insert arrowp as a replacement for cpp. 13:46:05 hm 13:46:28 ok 13:46:33 Does hmake handle arrow files? 13:46:55 * shapr tries 13:47:33 doesn't seem so 13:54:12 --- quit: kani^^off (Read error: 110 (Connection timed out)) 14:14:14 --- quit: smklsmkl (Read error: 110 (Connection timed out)) 14:17:51 --- join: Radek_MOB (~radek@gprs9211.eurotel.cz) joined #haskell 14:41:53 * shapr read about Arrows 14:42:25 * shapr boings 14:44:09 I wonder if the rpSwitch combinator is a good way to represent a collection of units in a realtime strategy game 14:45:16 * shapr is reading the "yampa continued" paper 15:12:32 --- quit: ChoJin ("bye !!!") 15:12:42 --- join: ChoJin (~ask@adsl-63-201-39-90.dsl.snfc21.pacbell.net) joined #haskell 15:18:07 --- quit: tWip (Read error: 54 (Connection reset by peer)) 15:20:03 --- join: tWip (~nobody@ttarvain-dsl.oulu.fi) joined #haskell 15:20:39 yargh 15:20:52 Hey shapr 15:21:33 I have two functions, which I'd like to combine into one, but I can't figure out exactly how. Here are the two functions (just 6 lines): 15:21:35 hi Igloo 15:21:42 mrex re str = 15:21:42 do mme <- regexec re str 15:21:42 if (isNothing mme) then throwDyn exInternalError else (return (fromJust mme)) 15:21:42 shortenUrl url = 15:21:42 do re <- reShortUrl 15:21:43 (b,m,a,s) <- mrex re url 15:21:45 return m 15:21:59 Igloo: I'm reading the yampa continued paper repeatedly, trying to find an RTS starting point 15:22:14 the problem is I can't figure out how to first treat the output of regexec as Maybe x, and then treat the x as (b,m,a,s) 15:22:24 shapr: I got distracted half way through writing a do-nothing SDL app 15:22:43 * Igloo probably shouldn't work on it before May 22nd :-/ 15:22:52 what happens may 22nd? 15:23:23 HW deadline 15:23:25 oh! 15:23:47 I'm trying to get all the framework bits worked out, like getting the arrowp preprocessor to work smoothly 15:24:07 Bea is going to germany for a week or so 15:24:25 I'm hoping I'll be able to dedicate my time during that week to fun projects. 15:24:47 sadly, I've forgotten exactly when she's going. 15:25:00 shortenUrl url = 15:25:01 do re <- reShortUrl 15:25:01 mme <- regexec re url 15:25:01 (b,m,a,s) <- if (isNothing mme) then throwDyn exInternalError else return (fromJust mme) 15:25:04 return m 15:26:58 Igloo: thanks.. That's obvious, now that you point it out. 15:27:11 :-) 15:27:50 I was trying (b,m,a,s) <- fromJust mme 15:27:58 those return's again 15:40:03 --- quit: Marvin-- ("Linux - the choice of a GNU generation") 15:41:31 --- quit: Vincenz () 15:43:36 simple question: In the regex and posix.regex docs, I don't see functions for replace. Are these somewhere else, or do I need to code them myself? 15:46:13 seth_: i don't think that posix has substitution 15:46:28 didn't see it. so I code that part myself? 15:46:35 seth_: i geuss so 15:46:58 ok, just wanted to check that I wasn't missing something obvious. :) 15:50:10 elmex = putStr "ZzZz" >> elmex 15:50:22 good night 15:50:33 night 15:51:00 --- quit: elmex ("leaving") 16:01:38 --- quit: ChoJin ("bye !!!") 16:06:49 --- nick: mgoetze|away -> mgoetze 16:30:47 --- join: Smerdyakov (adamc@VOID.RES.cmu.edu) joined #haskell 16:30:53 --- quit: esap ("zzzz") 16:41:44 --- quit: tic ("BeOS - Because you don't eat soup with a fork!") 16:44:09 --- join: tic (~vision@h47n2c1o1003.bredband.skanova.com) joined #haskell 16:53:09 --- join: mp00 (5645@r9acci-a89-35.acci.gr) joined #haskell 16:53:13 hello 16:53:24 --- join: jemfinch (~jfincher@ts31-4.homenet.ohio-state.edu) joined #haskell 16:53:29 there is a Haskell to C or Haskell to Java converter around ? 16:55:41 what about -fvia-C 16:55:41 ? 16:55:54 dunno 16:55:56 any good ? 16:56:14 it's one of the normal boring ways of compiling Haskell programs. 16:56:15 mp00 : ghc can compile to C code... 16:56:37 z 16:56:39 a 16:56:50 p? 16:56:58 can convert the code to C? 16:56:58 g? 16:57:01 heh 16:57:21 mp00: have you used Haskell before? 16:57:40 yeap 16:58:24 y? 16:59:17 f? 16:59:24 s? 16:59:29 q! 16:59:48 a 16:59:50 k? 17:00:05 heh, since I'm playing with expressions like "putStrLn $ unlines $ map show $ take 100 $ zip [1..] $ map (^3) fib" now, I think I should go to sleep :) 17:00:23 * shapr grins 17:01:41 What, you use $ and not . in most of those cases? 17:02:29 Weirdo. 17:02:43 heh 17:03:00 doesnt . only work if the last function in the chain requires args? 17:03:36 The last one should be $. 17:03:40 Hence 'most.' 17:04:14 --- join: flwr (~flwr@203-206-88-52.dial.froggy.com.au) joined #haskell 17:04:37 ah 17:05:59 what's the precedence of . ? 17:06:35 RTFSC. 17:06:44 *ChessModule Control.Arrow Control.Monad.Writer> :info . 17:06:44 -- . is a variable 17:06:44 infixr 9 . 17:06:44 (.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c 17:06:54 ah 17:07:07 thanks 17:07:14 :info is useful 17:07:16 and :browse 17:07:19 so . does bind more tightly than $ 17:07:46 --- quit: jemfinch (Read error: 54 (Connection reset by peer)) 17:10:35 Igloo: are you there? 17:10:44 shapr: much! 17:11:18 but I prefer f $ g $ h $ x rather than f . g . h $ x 17:11:22 @prelude (.) ($) 17:11:25 *** "(.)" prelude "Haskell Standard Prelude Dictionary": text follows 17:11:25 (.) 17:11:25 infixr 9 . 17:11:25 (.) :: (b -> c) -> (a -> b) -> (a -> c) 17:11:25 (f . g) x = f (g x) 17:11:31 -DONE- 17:11:35 *** "($)" prelude "Haskell Standard Prelude Dictionary": text follows 17:11:35 mmmm 17:11:37 ($) 17:11:39 infixr 0 $ 17:11:41 ($) :: (a -> b) -> a -> b 17:11:45 that's awesome 17:11:45 @more 17:11:47 -DONE- 17:13:34 0 and 9, I'd say that's a pretty big difference in binding strength 17:14:26 could all of the ghc docs be in @prelude? 17:14:42 @predule hGetLine 17:14:43 Sorry, I don't know the command "predule", try "lambdabot: @listcommands" 17:14:45 er 17:14:52 @prelude hGetLine 17:14:53 --- quit: mp00 () 17:14:54 *** "hGetLine" prelude "Haskell Standard Prelude Dictionary": text follows 17:14:54 hGetLine 17:14:54 hGetLine :: Handle -> IO String 17:14:54 hGetLine h = do c <- hGetChar h 17:14:54 if you can fit them into a dict, which isn't too difficult 17:14:55 if c=='\n' then return "" 17:14:56 oh 17:14:57 else do cs <- hGetLine h 17:14:58 wow 17:14:59 return (c:cs) 17:15:06 @prelude run 17:15:08 No match for "run". 17:15:53  17:15:55 --- quit: seafood ("[BX] The name's X. BitchX.") 17:19:05 --- join: Arnia (Arnia@modem-1306.python.dialup.pol.co.uk) joined #haskell 17:20:02 hi Arnia 17:20:10 Heya 17:20:30 what's up? 17:22:25 Just getting freaked out by watching Harry Potter and the Chamber of Secrets and seeing where I've matriculated, where I've sat down and revised, where I've got drunk... where I've watched things being filmed thirty yards from my bedroom window 17:23:42 heh :-) 17:24:06 shapr: would you mind pulling the most-recent dict module? 17:24:25 * tmoertel fixed a bug that caused -DONE- to be printed more than once in a multi-lookup query 17:24:28 I have to say that seeing Durham as Hogwarts worries me 17:24:36 tmoertel: sure 17:24:41 tmoertel: er, I wouldn't mind 17:24:41 thx! 17:28:17 @quit 17:28:18 --- quit: lambdabot (Remote closed the connection) 17:29:03 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 17:29:18 @listcommands dict 17:29:19 Module dict provides the following commands: ["dict","dict-help","all-dicts","devils","easton","elements","foldoc","gazetteer","hitchcock","jargon","prelude","vera","web1913","wn","world02"] 17:29:30 * tmoertel tests via /msg 17:30:35 seems to be working 17:30:40 @dict-help prelude 17:30:41 @prelude .... Haskell Standard Prelude 17:30:57 shapr: thanks! 17:31:00 sure 17:31:16 it's fun to get new lambdabot code to play with 17:31:43 Arnia: the chamber is open! 17:32:26 --- join: ChoJin (~ask@adsl-63-201-39-90.dsl.snfc21.pacbell.net) joined #haskell 17:32:36 * tmoertel is thinking about seeing the new X-Men movie 17:32:37 tmoertel: any suggestions for lambdabot improvements? 17:32:59 shapr: it ought to let you know when there is @more 17:33:12 yah, I agree 17:34:22 how 'bout: @stock aapl ibm rhat 17:34:28 :-; 17:34:33 * shapr grins 17:34:47 is there a stock lookup service? 17:35:10 probably, but if not we could just scrape ticker info from a web site 17:35:19 sounds like fun 17:35:58 * shapr adds a "there's @more" message 17:38:28 how many lines (or chars) can lambdabot write before getting kicked? 17:38:37 (or being labled a bad citizen?) 17:38:40 I'm not exactly sure 17:38:50 it seems execessive to send one message per line 17:39:14 you're thinking of refilling output to turn short lines into longer ones? 17:39:20 er, reformatting? 17:39:36 more like sending two or three lines at once 17:39:54 ? 17:40:02 --- join: archie_sihir (~archie_si@219.94.89.131) joined #haskell 17:40:06 hi archie 17:40:11 hi shapr 17:40:13 what's up? 17:40:28 hehe playing around with nhc98 17:40:43 right now each line of a response (via ircPrivmsg) is send via its own call to ircWrite 17:41:16 --- join: seafood (~sseefried@alonzo.cse.unsw.EDU.AU) joined #haskell 17:41:55 tmoertel: you want to send multiple lines at a time? 17:42:02 shapr: yes 17:42:02 --- quit: flwr (Read error: 104 (Connection reset by peer)) 17:42:23 I don't think you can send multi-line messages to the irc server 17:42:39 but I do think we can send multi-line batches to ircWrite 17:42:44 * tmoertel does a test via Chatzilla 17:42:46 if it can handle them 17:43:08 part of the reasond I think this is that @fact originally didn't escape anything, 17:43:15 --- join: tmoertel_moz (~thor@ns1.moertel.com) joined #haskell 17:43:24 this 17:43:26 is 17:43:28 more than one line 17:43:36 shapr is correct ! 17:43:37 factoids with \n in the output would end up sending everything after the the first \n as a command to the server 17:44:07 --- quit: archie_sihir (Remote closed the connection) 17:46:10 --- quit: jak (Remote closed the connection) 17:46:21 @fact test 17:46:22 Nothing 17:46:27 @fact test foo\nbar\nbaz 17:46:27 set test to foo\\nbar\\nbaz 17:46:32 @fact test 17:46:33 foo\nbar\nbaz 17:46:39 happily, I escaped \n 17:46:49 and tmoertel escaped some other stuff 17:47:07 --- join: archie_sihir (~archie_si@219.94.89.131) joined #haskell 17:47:12 re archie 17:47:20 did nhc98 eat your machine? 17:47:45 hehe 17:48:43 * Riastradh imagines a fuzzball labeled 'compiler' walking up to a computer and taking a big bite out of a computer. 17:49:05 *chomp* 17:49:18 does that mean that fuzzball on userfriendly is a compiler? 17:49:31 ? 17:49:36 'On userfriendly?' 17:49:42 have you seen the web cartoon called userfriendly? 17:49:47 No. 17:50:04 look at userfriendly.org 17:50:19 Is the fuzzball that you referred to labeled 'compiler?' 17:50:36 no, I've forgotten his name.. 17:50:56 Well, then, no, I doubt it's a compiler. 17:51:29 I think his name might be peter. 17:51:37 he's an animated ball of dust I think 17:51:38 * Riastradh prefers fuzzballs named Crunchly. 17:52:51 --- quit: Arnia (Connection timed out) 18:01:18 --- quit: lambdabot (Remote closed the connection) 18:01:48 --- join: kunphuzil (~jtmendes@69.10.101.130) joined #haskell 18:02:27 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 18:02:42 @jargon clue-by-four 18:02:44 *** "clue-by-four" jargon "Jargon File (4.3.0, 30 APR 2001)" 18:02:44 clue-by-four [Usenet: portmanteau, clue + two-by-four] The notional 18:02:44 stick with which one whacks an aggressively clueless person. This term 18:02:44 derives from a western American folk saying about training a mule 18:02:44 "First, you got to hit him with a two-by-four. That's to get his 18:02:46 attention." The clue-by-four is a close relative of the {LART}. Syn. 18:02:48 `clue stick'. This metaphor is commonly elaborated; your editor once 18:02:50 heard a hacker say "I smite you with the great sword Cluebringer!" 18:02:52 there's @more 18:03:14 @more message added 18:03:14 -DONE- 18:03:38 ha! "there's more" -> "-DONE-" ;-) 18:03:47 it wasn't much @more 18:03:54 nope. 18:04:09 Maybe the "there's more" code should add the "-DONE-" notice. 18:05:03 I'm not sure 18:05:35 it's the only code that knows whether the output is broken into multiple-@more segments 18:05:48 that's a good point 18:06:01 when would you add the -DONE- then? 18:06:17 the logic would work like this: 18:06:30 ircPrivmsg gets a block of lines 18:06:47 if the number of lines is more than the cutoff, it adds "-DONE-" after 18:07:01 the last line, prints the first block of lines, and waits for a @more 18:07:11 that's it. 18:07:26 ok 18:07:42 finished :-) 18:07:49 just have to recompile lambdabot 18:07:59 * tmoertel takes the -DONE- out of DictModule 18:09:02 * tmoertel checks it in 18:09:11 * shapr rebuilds 18:09:16 lambdabot: @quit 18:09:16 --- quit: lambdabot (Remote closed the connection) 18:10:20 the only disadvantage to this is that one line factoids will have -DONE- also 18:10:23 --- join: lambdabot (~lambdabot@h224n1fls32o1017.telia.com) joined #haskell 18:10:29 @fact foo 18:10:29 foo\bar 18:10:29 -DONE- 18:10:40 It should only kick in for multipart messages. 18:10:54 Only add the -DONE- *if* the output is broken into segments. 18:11:21 And we should say "[there is @more]" and "[DONE]" so that people won't think the lambdabot-added messages are part of the result text. 18:11:27 ok 18:12:37 hrm 18:16:22 --- nick: jao -> jao_zZzZ 18:18:31 --- join: mp00 (5645@r9acci-a89-35.acci.gr) joined #haskell 18:19:23 Agrrrr 18:19:29 stack again in the same thing 18:19:46 inside my funciton I got : do char 'f' digit 18:19:55 but still can't figure out what this do 18:20:00 * tmoertel is leaving to see the new X-Men movie ! 18:20:19 * tmoertel hopes it is good 18:20:46 * mp00 It is nice , DreamCatcher SAX though 18:20:54 I'm getting can't find module `Network.Socket' from ghci, but it finds all other modules in the same file. What's that about? 18:21:06 the same file compiles fine with ghc 18:22:34 inside my funciton I got : I now know that with do I add a parsing parameter to my parser (using Parselib) but char 'f' digit is not easy to fin what it does , which string add to my parser 18:23:36 --- join: lament (~lament@h24-78-145-92.vc.shawcable.net) joined #haskell 18:28:01 seth_: :set -package network 18:29:05 shapr: I found it. But why didn't -i/usr/local/..../imports/network work with ghci? 18:31:44 see what "ghc-pkg -s network" gives you 18:32:41 show me Package {name = "network", etc. 18:33:01 I have imported ParseLib lib and I have the following code inside a function : 18:33:02 char 'f' digit 18:33:06 what this do ? 18:33:16 mp00: are you using Parsec? 18:33:27 mp00: a hex digit? 18:33:53 nope , Parser 18:34:35 hex digit.. hm.. that's the only thing I havent tried :) 18:34:38 I would assume it's looking for the character 'f' and then a digit 18:34:48 oh.. 18:34:56 that good Idea as well 18:35:40 shapr got it !!!! ;) 18:35:49 exactly what you said 18:36:23 so .. if I have many (char 'f' digit) 18:36:33 mp00: read the Parsec tutorial 18:36:57 means that the parsing data should have from 0 to 1 times char 'f' digit 18:37:27 heh.. I think I got it :) 18:41:25 how do I convert an Int to a Word16? 18:42:39 with I16#? 19:03:14 --- quit: lament ("I AM NOT A DENTIST") 19:04:28 --- quit: ChoJin ("bye !!!") 19:19:07 --- join: lament (~lament@h24-78-145-92.vc.shawcable.net) joined #haskell 19:43:45 --- quit: mp00 () 20:27:40 Hey, all, I'm working with threads. forkIO takes no arguments. So how to I pass information to a thread? I can do something indexed by the thread identifier, but maybe there is an easier way? 20:29:18 Looks to me like forkIO takes IO () as an argument. 20:32:49 Well, yes, but you can't pass info with IO (), or am I wrong? 20:32:57 Pass info to what? 20:33:16 whatever data I need to use in the thread. 20:33:40 How would you "use this data"? 20:33:59 it depends on the thread. What difference does it make? 20:34:24 I think there is no reasonable definition of what it means for an IO () to "use data," and you are confused. 20:34:49 Smerdyakov: that's silly. For example, I spawn a thread to handle a new connection, and I have to pass the socket handle to the thread 20:35:06 So? How is that different from doing the same thing in the current thread? 20:35:26 because the current thread receives the connection and spawns a new thread to handle it. 20:35:32 So? 20:35:42 the new thread needs the socket descriptor 20:35:56 Why doesn't it have access to it the same way you would without spawning a new thread? 20:36:22 because I don't use global variables. 20:36:35 even in a C program I would never to that. 20:36:51 besides, if I have 20 active descriptors, how would the thread know which one to fetch? 20:36:53 Nonetheless, the Haskell compiler magically makes sure all threads have access to the appropriate values. 20:37:22 It's done with the same lexical scoping as everywhere else. 20:37:23 You aren't making sense. If I call, for example, hGetLine, I have to give it the file handle as part of the call. 20:37:40 Yes. You have the file handle. 20:37:46 how? 20:37:55 All you're doing is adding an extra call to forkIO around what you would have done before. 20:38:02 be specific 20:38:28 How about YOU be specific and give me a concrete code example showing your claimed problem? 20:38:44 It isn't a claimed problem. It is functionality that I have to implement. 20:38:45 ok. 20:38:55 I make a call: forkIO func 20:39:04 where func is a function that handles the processing for the thread. 20:39:14 But.... forkIO takes an IO () as a parameter. 20:39:16 in func, I want to invoke: hGetLine handle 20:39:17 It can't take a function. 20:39:40 No, that's not true. I have it running with the function already. Besides, from the docs: 20:39:58 This sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread. 20:40:16 Yes, I have type: forkIO :: IO () -> IO ThreadId 20:40:21 You pass it a function of type IO () 20:40:24 IO () is NOT a function type. You must be mistaken. 20:40:42 No, I'm not. its easy enough to create a function with type IO () 20:40:49 OK. Example of one? 20:41:16 func1 :: IO () 20:41:21 That's not a function. 20:41:23 func1 = do putStrLn "hello" 20:41:24 It's an IO action. 20:41:27 There is a difference. 20:41:40 please, don't quibble about words. I'm trying to do something here. 20:41:47 besides, this isn't a function? 20:41:51 OK, but it's good not to misuse standard terminology. 20:41:53 func1 = do putStrLn "hello"? 20:41:56 No 20:42:05 Every function takes exactly one parameter. 20:42:09 Your func1 has no parameter. 20:42:16 whatever. the fact remains that I need to pass information to the whatever you want to call it. 20:42:47 OK. So, in the expression let x = 3 in x + 9, how do you pass information to the inner expression x + 9? 20:42:54 So that it gets the right value of x? 20:43:16 you don't, it's implied. But you don't get it 20:43:29 The same "action" is invoked for many different threads 20:43:31 OK. How does this "implied passing" not solve your problem? 20:43:38 OK, so how about this. 20:43:42 addone x = x + 1 20:43:59 first of all, I think even you will admit that this is a function 20:44:02 How do we pass information to x + 1 for each call to the function, and make sure it always gets the right x? 20:44:12 After all, the function is invoked many times. 20:44:17 contextually. You haven't written threaded programs. 20:45:01 The values of variables in the IO () you pass will be those dictated by lexical scope..... 20:45:15 They are preserved by the wonderfulness that is the Haskell compiler, garbage collector, etc.! 20:45:20 OK, how do I associate a variable with an IO () 20:45:50 You use that variable in the expression that creates the IO ().... 20:46:46 show mean an expression to create an IO () with a value, any value, say 10 20:47:02 What does it mean to "create an IO () with a value"? 20:47:28 you said "You use that variable in the expression that creates the IO ()...." and I'm asking you how to do that. Please don't quibble over language. 20:47:54 I'm not being testy. I am genuinely not understanding you. 20:48:07 if you can "use that variable in the expression that creates the IO ()", then you must be able to create the IO (), no? 20:48:11 let val mystring = "Hi there" in putstr mystring 20:48:19 That uses mystring in an IO () expression. 20:48:44 I don't know if putstr is a real function, but I hope you can guess what I mean for it to do if it isn't. =) 20:49:17 I don't see how I could provide that as an argument to forkIO 20:49:20 And remove the "val" above =) 20:49:25 Why not? 20:49:30 show me how 20:49:34 forkIO (let mystring = "Hi there" in putstr mystring) 20:51:43 Got it? 20:51:49 I'm trying it 20:52:55 well, it compiles, but I can't use mystring in the thread's context. 20:53:11 What do you mean? 20:53:51 I think I may see what you are getting at. I'll have to play with this. 20:54:26 But it isn't clear to me that I can call other functions from within the ( ) defined code 20:54:30 Good. If it works out for you, you'll see that there are no special mechanisms at play here and what you are really learning is lexical scoping. 20:55:05 Why wouldn't you be able to? It's an expression like any other.... 20:55:58 People here are always thinking that I don't know something entirely different than what I don't know. I understand lexical scope perfectly. I didn't know that I could define a function in line that way by putting it in parentheses in the forkIO invocation. 20:56:54 First, you're not defining a function. 20:56:58 thanks for the help, that let's me continue. 20:57:01 ok, action. 20:57:06 You're not defining anything. 20:57:10 It's just an expression. 20:57:19 It's not a special type of expression. It's a regular expression. 20:57:50 And, if you really do understand lexical scoping, then what you don't understand is expressions, types, or something equally central. 20:59:34 there is a difference between not understanding expressions and not understanding all the contexts in which you can _use_ expressions. You can't do _anything_ in this context, can you? For example, I don't think you can use guards. 21:00:32 That's right. Guards are parts of declarations, not expressions. 21:00:55 Maybe you still use them with anonymous functions, though. 21:01:05 so it isn't entirely surprising that I didn't know that, in a context where I can't use guards, I _can_ use let 21:01:29 I didn't know it, of course, but it isn't 100% stupid 21:02:32 Yes, like I said, it just means you don't understand what an expression is yet. 21:02:36 Plus, you could just as easily do: 21:02:46 let mystring = "Hi" in forkIO (putstr mystring) 21:14:40 Oh, and I hope you can also see that forkIO (putstr "Hi") is equivalent..... 21:44:49 the last one is the only one I thought of. :) 21:46:32 --- join: kunphuzi1 (~jtmendes@69.10.104.38) joined #haskell 21:47:11 So you have it all worked out now? 21:48:30 yes, I think so. 21:51:22 * tmoertel liked the X2 X-Men movie 21:52:13 actually, no. 21:52:40 well, maybe. 21:52:42 let me try it. 21:54:22 --- quit: kunphuzil (Read error: 60 (Operation timed out)) 22:01:33 seth_: you need to understand something about the type system 22:01:37 and partial functions 22:01:56 seth_: ok, forkIO takes in one argument, which is of type "IO ()" 22:02:06 right 22:02:11 seth_: the way you pass that function some information is this ... 22:02:23 the type of the function is IO () 22:02:34 that means that you can call whatever function you want as long as it returns an IO () 22:02:41 for example 22:02:44 main :: IO () 22:02:52 main = foo 22:03:10 as long as foo's type is IO (), that's okay. but how about this ... 22:03:12 I understood that all along. The problem I was having is: how do I pass arguments _to_ that function. 22:03:17 bar :: Int -> IO () 22:03:22 bar n = putStrLn (show n) 22:03:25 main :: IO () 22:03:26 main = bar 5 22:03:31 that's how you do it 22:03:47 as long as the "return type" of the function is IO (), that's ok 22:03:52 so I can say: forkIO (xyz arg1 arg2 arg3) 22:03:58 yes 22:04:08 that is really all I needed to know. 22:04:10 and as long as xyz's type is :: a -> b -> c -> IO () 22:04:12 it's ok 22:04:23 right. 22:04:39 well, it's one of the powerful things about haskell, you are allowed to have partial functions 22:04:47 you could do something like 22:04:56 square :: Int -> Int -> Int 22:04:59 square n = n * n 22:05:07 err 22:05:10 let's try again :) 22:05:14 multiply :: Int -> Int -> Int 22:05:20 multiply n = n * n 22:05:26 and then you could have a bunch of other functions 22:05:33 multiply4 :: Int -> Int 22:05:48 I know about partial application, but I don't see how it applies the forkIO call. 22:05:50 multply4 = multiply 4 22:06:35 well, i guess it's not really partial application, but imho it uses the same idea 22:06:52 o3: OK, I just don't want to miss the point. 22:06:56 even though forkIO takes in a single argument, you can call your own function and just 'fill in' its arguments 22:07:05 to make the types match up 22:07:08 that's how i think of it, anyway 22:07:12 seth_: see the use of forkIO in http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/haskell-libs/libs/hws-wp/hws-wp/src/Main.hs?rev=1.1&content-type=text/vnd.viewcvs-markup 22:07:34 seth_: the nice thing is that you can do this for any function 22:07:50 tmoertel: Thanks a lot. It appears, not that I'm beginning to understand it, that it is fact much easier than what you have to do in other languages. 22:07:55 s/not/now/ 22:08:25 and the people who designed forkIO expect you to know this, because it means you don't need to have some special "callback function" type in which you're only allowed to pass, e.g. one argument 22:08:30 seth_: yes, much more convenient than, say, Java 22:08:59 tmoertel: that kind of goes without saying. :) But also much more convenient than ocaml and Ruby 22:09:14 you just call whatever function you write and fill in the arguments as necessary; haskell doesn't care as long as the final type of that function is IO () 22:09:32 anyway 22:09:32 Another good forkIO example: http://icfpcontest.cse.ogi.edu/simulator/pfe.cgi?Server 22:09:38 you get it now, i think 22:09:58 anyway, time to watch x2 :) 22:10:05 o3, tmoertel, Yes, I think I'm getting it, thanks much for the help. 22:10:05 --- quit: dnm (Read error: 60 (Operation timed out)) 22:10:14 o3: I just saw it. Good. 22:10:19 all good then 22:10:21 later 22:10:23 tmoertel: thanks for both of those examples. 22:10:30 seth_: no problem 22:11:04 I'm doing well today. I think I actually understand the basics of monads, too. 22:16:42 --- nick: archie_sihir -> archie_lunch 22:31:11 * tmoertel is going to bed 22:49:20 --- join: smklsmkl (~sami@glubimox.yok.utu.fi) joined #haskell 22:56:42 --- quit: lament ("THE TRUTH IS NOT OUT THERE") 22:57:03 --- join: lament (~lament@h24-78-145-92.vc.shawcable.net) joined #haskell 23:14:17 --- nick: archie_lunch -> archie_sihir 23:58:45 I'm using forkIO, and when I try to use as an argument a function defined in another file (and imported), the compiler says it can't resolve the symbol. 23:59:59 --- log: ended haskell/03.05.03