00:00:00 --- log: started haskell/02.03.21 01:11:17 --- join: ChoJin (~ask@cha213245038031.chello.fr) joined #haskell 01:50:01 --- join: Yurik (~yrashk@gw.telcos.net.ua) joined #haskell 01:50:02 --- quit: Heffalump (Read error: 104 (Connection reset by peer)) 02:41:17 --- quit: clausen ("send all money to /dev/clausen") 03:53:53 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 03:54:28 hey shapr. 03:55:10 hi rik, whatcha doin? 03:55:29 a cpu emulator :) 03:55:37 nifty! 03:55:54 indeed. 03:56:02 plus i get to relearn all the haskell i've forgotten 03:56:30 functional programming is great, but i was taught it badly, and never got myhead around it properly. 03:57:04 sounds like me and math 03:57:16 heh 03:58:23 I agree that functional programming is good stuff 03:59:23 --- quit: ChoJin ("bye !!!") 04:12:19 --- quit: shapr (Remote closed the connection) 04:12:56 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 04:13:10 uhh. hm. 04:13:33 what's the equivalent of Python's "None" ? 04:13:56 What does Python's "None" so? 04:14:20 it's a class that has a false value... 04:14:30 basically used like most C programmers use NULL. 04:15:07 It sounds like you might want Maybe 04:15:13 data Maybe a = Just a | Nothing 04:15:42 ahh 04:15:43 'k 04:28:47 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 04:29:40 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 04:31:04 meh. 04:31:18 i could avoid some of these newbie questions if i knew where my haskell book was. 04:31:48 is there a good way to get an item from somewhere in the middle of a list? 04:32:35 other than getItem x [y:ys] = | x == 0 = y | getItem x - 1 [ys] ? 04:33:46 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 04:34:00 hi Heffalump! 04:34:02 'lo 04:34:09 wassup in the world of SML? 04:34:21 not a lot, spent this week writing a paper 04:34:34 something nifty? 04:34:43 on "path logic programming" 04:35:12 is that like how to navigate through a maze? 04:35:31 nah, specifiying program transformations in prolog 04:35:34 oh 04:35:52 as prolog programs that impose conditions on paths in the flow graph, basically 04:37:08 that does sound interesting, though possibly above my head 04:37:34 I've only recently discovered connected graphs, and viewing programs as directed graphs sounds quite useful 04:38:09 I'm still curious about the connection between state machines and directed graphs, they seem *very* similar to me. 04:38:48 do you have the paper online yet? 04:41:03 no, but I'll probably put it online this afternoon when we submit it 04:41:12 my research page could do with some tidying up anyway 04:45:33 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 04:45:33 --- quit: smkl (carter.openprojects.net irc.openprojects.net) 04:45:33 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 04:45:33 --- quit: rik (carter.openprojects.net irc.openprojects.net) 04:45:33 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 04:45:33 --- quit: Yurik (carter.openprojects.net irc.openprojects.net) 04:45:33 --- quit: Jiriki (carter.openprojects.net irc.openprojects.net) 04:52:46 --- quit: xbill (carter.openprojects.net irc.openprojects.net) 04:52:46 --- quit: arete (carter.openprojects.net irc.openprojects.net) 04:52:46 rik: ys !! x 04:52:50 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 04:52:50 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 04:52:50 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 04:52:50 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 04:52:50 --- join: Yurik (~yrashk@gw.telcos.net.ua) joined #haskell 04:52:50 --- join: smkl (~sami@glubimox.yok.utu.fi) joined #haskell 04:52:50 --- join: Jiriki (sjh@Sprint967.tbaytel.net) joined #haskell 04:52:50 --- join: xbill (wli@DOMINIA.MIT.EDU) joined #haskell 04:52:50 --- join: arete (arete@greenland.spottedfly.com) joined #haskell 04:52:50 exactly. 04:52:50 an array (indexable) would be better 04:52:50 yah, I understand that. 04:52:52 what about the Array module? 04:53:14 --- quit: rik (carter.openprojects.net irc.openprojects.net) 04:53:14 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 04:53:15 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 04:53:15 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 04:53:15 --- quit: smkl (carter.openprojects.net irc.openprojects.net) 04:53:22 --- quit: Yurik (carter.openprojects.net irc.openprojects.net) 04:53:22 --- quit: Jiriki (carter.openprojects.net irc.openprojects.net) 04:53:22 --- quit: arete (carter.openprojects.net irc.openprojects.net) 04:53:22 --- quit: xbill (carter.openprojects.net irc.openprojects.net) 04:53:43 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 04:53:47 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 04:53:47 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 04:53:47 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 04:53:52 --- join: Yurik (~yrashk@gw.telcos.net.ua) joined #haskell 04:53:52 --- join: Jiriki (sjh@Sprint967.tbaytel.net) joined #haskell 04:53:52 --- join: smkl (~sami@glubimox.yok.utu.fi) joined #haskell 04:54:17 hmm 04:54:29 i wonder what "infixl 9 !, //" means. 04:54:30 * rik shrugs 04:54:44 * shapr pulls up a ghci window 04:54:51 oh. i see. 04:54:55 really? explain it to me? 04:55:01 it's a binding thing. 04:55:02 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 04:55:14 eh? 04:55:19 binds the ! and // to the left with a strength of 9, 04:55:24 --- join: xbill (wli@DOMINIA.MIT.EDU) joined #haskell 04:55:24 --- join: arete (arete@greenland.spottedfly.com) joined #haskell 04:55:33 oh 04:55:33 so that arrayname!index works 04:55:34 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 04:55:36 oh I see 04:55:45 and likewise for //, but i haven't worked out what that does.. 04:55:47 is that what you want? 04:55:58 --- quit: arete (carter.openprojects.net irc.openprojects.net) 04:55:58 --- quit: xbill (carter.openprojects.net irc.openprojects.net) 04:55:58 --- quit: rik (carter.openprojects.net irc.openprojects.net) 04:55:58 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 04:55:58 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 04:56:07 --- join: arete_ (arete@greenland.spottedfly.com) joined #haskell 04:56:30 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 04:56:30 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 04:56:30 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 04:56:42 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 04:57:07 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 04:57:09 but i'm looking at /usr/local/share/hugs/demos/ArrayEx.hs now. 04:57:23 ohh 04:57:26 I hadn't seen that dir before! 04:57:50 heh 04:58:15 --- join: xbill (wli@18.208.0.43) joined #haskell 04:58:29 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 04:58:54 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 04:59:01 --- quit: rik (carter.openprojects.net irc.openprojects.net) 04:59:01 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 04:59:01 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 04:59:36 Did you see me say ys !! x, Rik? 04:59:46 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 04:59:46 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 04:59:46 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 04:59:48 --- quit: arete_ (carter.openprojects.net irc.openprojects.net) 04:59:48 --- quit: Yurik (carter.openprojects.net irc.openprojects.net) 04:59:49 --- quit: Jiriki (carter.openprojects.net irc.openprojects.net) 05:00:08 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 05:00:24 * Igloo gives up 05:00:33 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 05:00:35 --- join: arete_ (arete@greenland.spottedfly.com) joined #haskell 05:00:35 --- join: Yurik (~yrashk@gw.telcos.net.ua) joined #haskell 05:00:35 --- join: Jiriki (sjh@Sprint967.tbaytel.net) joined #haskell 05:00:55 the examples imply that's it's either a static array of data indexed by offset, or a function treated as a static set of data 05:00:59 is that true? 05:01:13 --- quit: jewel (carter.openprojects.net irc.openprojects.net) 05:01:14 massive netsplits today 05:01:25 --- quit: rik (carter.openprojects.net irc.openprojects.net) 05:01:25 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 05:01:25 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 05:01:38 --- join: jewel (~jleuner@spamisevil.test.ie.vianw.net) joined #haskell 05:01:50 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 05:01:50 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 05:01:50 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 05:20:47 --- log: started haskell/02.03.21 05:20:47 --- join: clog (nef@bespin.org) joined #haskell 05:20:47 --- topic: 'Have a library you'd like to donate, or one you'd like to see? Talk to us at http://sf.net/projects/haskell-libs/ | we be loggin' http://tunes.org/~nef/logs/haskell/ | welcome to the Haskell Dojo | julien is up to white belt! jewel and shapr are up to green belt!' 05:20:47 --- topic: set by shapr on [Wed Jan 30 14:36:17 2002] 05:20:47 --- names: list (clog smkl xbill arete_ Yurik Jiriki Igloo Heffalump shapr rik jewel) 05:20:51 I don't think there is an implementation in Haskell'98 05:21:01 I'd go for Array if I were you 05:21:16 I have a /usr/local/share/hugs/lib/exts which contains FiniteMap 05:21:31 That's an extension, not Haskell'98 05:21:35 Igloo: what're the good and bad points of sticking with Haskell '98? 05:21:36 oh. right. 05:21:47 Then again, you are using Int32 anyway 05:21:57 okay.. i'll try with Array then 05:21:58 thanks. 05:22:12 shapr: Good points are portability and the knowledge that you are doing the Right Thing 05:22:25 Bad points you lose some of the wizzier functionality 05:22:52 In this case you could just distribute a FiniteMap.lhs with your source, it's not actually using non-standard features 05:23:12 But I suspect Array is O(1) as opposed to O(log n) in at least some implementations 05:23:51 Oh, standard scripts are better futureproofed too 05:23:56 in Python I get to do spiffy import stuff like try: import cStringIO ; except ImportError: import StringIO 05:23:56 where cStringIO is the fast C version of StringIO 05:23:56 does Haskell have something like that? conditional spiffiness? 05:23:56 er, conditional wizziness, that is 05:24:34 hm 05:24:43 The best you can do is CPP conditionals 05:24:47 maybe conditional compilation? 05:24:49 oh.. f00 05:26:28 --- quit: rik (carter.openprojects.net irc.openprojects.net) 05:26:28 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 05:26:51 Hmmm, OPN is fun today 05:26:56 very bouncy 05:27:08 Still, at least it's not Oxford wibbling again 05:29:38 yah, that's true 05:30:14 Well, it doesn't affect you much except Heff and I bouncing all over your client :-) 05:33:01 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 05:33:01 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 05:44:35 --- join: gene9 (~andrey@194.158.216.76) joined #haskell 05:45:23 gene9: hi. thanks for the correction :) 05:47:42 hi gene9 05:48:28 shapr: hi 05:52:03 --- quit: gene9 ("Client Exiting") 06:01:48 --- quit: rik (carter.openprojects.net irc.openprojects.net) 06:01:48 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 06:01:49 ok 06:03:00 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 06:03:00 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 06:04:22 --- log: started haskell/02.03.21 06:04:22 --- join: clog (nef@bespin.org) joined #haskell 06:04:22 --- topic: 'Have a library you'd like to donate, or one you'd like to see? Talk to us at http://sf.net/projects/haskell-libs/ | we be loggin' http://tunes.org/~nef/logs/haskell/ | welcome to the Haskell Dojo | julien is up to white belt! jewel and shapr are up to green belt!' 06:04:22 --- topic: set by shapr on [Wed Jan 30 14:36:17 2002] 06:04:22 --- names: list (clog smkl xbill arete_ Yurik Jiriki Igloo shapr jewel Heffalump rik) 06:06:59 --- quit: smkl (Remote closed the connection) 06:07:34 --- join: smkl (~sami@glubimox.yok.utu.fi) joined #haskell 06:09:55 whee 06:10:13 Oxford wibbling? 06:10:19 hi jewel! 06:10:21 what's up? 06:11:46 Oxford spends it's entire life wibbling :( 06:17:57 * shapr tries to find an IPv6 compatible ssh in debian 06:19:24 oh, I've already got one 06:20:34 yeah 06:21:04 it's just that sshd isn't binding to ::1 06:21:05 weird 06:21:12 look in /etc/ssh/sshd_config 06:21:36 either get rid of all ListenAddress directives 06:21:41 or stick in ListenAddress :: 06:21:54 (or ListenAddress ::1 if you really just want it to listen on loopback) 06:23:45 there aren't any ListenAddress directives 06:24:04 what version of openssh do you have? 06:25:00 dpkg -s ssh shows: 06:25:01 Source: openssh 06:25:01 Version: 1:3.0.2p1-8 06:25:55 maybe I should install ssh2? 06:26:00 don't think so 06:26:23 hrm 06:26:31 hmm, mine isn't listening either, now I check 06:26:48 (most of my testing has been with redhat) 06:27:02 I'd like to go IPv6 at home and at work 06:27:19 if I set it up at work, it's likely that several of my coworkers will follow my lead 06:27:20 Mine has "#ListenAddress ::" commented out 06:27:36 yah, same here, I just set "ListenAddress ::1" and restarted.. let's see 06:27:42 igloo: and is it listening? 06:27:44 Restarting OpenBSD Secure Shell server: sshdbad addr or host: ::1 (Address family for hostname not supported) 06:27:46 f00 06:27:50 urchin's has the whole lot commented out 06:27:56 and it just works (TM) 06:28:00 but urchin is RH not Debian 06:28:35 what version is urchin running? 06:28:40 er, version of sshd? 06:29:33 No 06:29:51 who, spiffy.. zope shows up on ::1 without needing a restart at all 06:30:05 as in, it shows up immediately after modprobe ipv6 06:30:11 http://[::1]:9673/ 06:30:12 yay! 06:30:31 bad addr or host: :: (Address family for hostname not supported) when I uncomment it 06:30:36 yah, same here 06:32:34 I think I'll try to install ssh2, maybe it comes with a different server 06:32:35 * Igloo shouldn't play around now,but you might try seeing if you can make it work with -6 06:32:46 ok, I'll try that, thanks 06:33:03 * Igloo would advise sticking with OpenSSH 06:33:20 yah, I agree 06:33:28 I just found -6 in the manpage, so it can do it 06:33:33 sshd, or ssh? 06:33:54 gah, where's our house gone 06:34:01 sshd 06:34:05 * Heffalump apologises to all other random listeners for the completely non-haskell related conversation 06:34:20 --- join: JustRay (~ray@folsom.officedepot.com) joined #haskell 06:34:21 Indeed 06:34:22 Heffalump: hey, they're not saying anything, it's not like we're stealing bandwidth from them :) 06:34:28 hi JustRay! 06:35:42 JustRay: do you use Haskell at officedepot.com? 06:53:06 heh 06:53:28 hahaha 06:53:33 "where's our house gone" 06:53:40 how do you misplace a house? 06:53:46 quite easily, IP-wise 06:53:51 ohh 06:53:52 i see. 06:54:03 see, that's why I have home.rikrose.net :) 06:54:10 yay! 06:54:24 we have a private crypto network to it, but something had broken temporarily 06:54:26 Subject: GHC for MacOS X: Success! 06:54:28 hence my complaint 06:54:39 Did you add the ping options to the config? 06:54:42 * rik nods 06:54:51 * rik notes heavy use of crypto between his machines. 06:54:51 I don't actually use MacOS, but it's cool anyway 06:54:58 mi ca'o gunka 06:55:12 igloo: I just cronned a ping. I'd forgotten there's a ping option in the config. 06:55:30 coi djul .i xu do pilno la'o gy. MacOS X .gy 06:55:32 oh, you're not using it either 06:57:51 llnn: connection reset by ceri 06:57:53 hahah 06:57:59 ceri? 06:58:01 markov chain bots++ 06:58:08 someone ese in the channel at the time 06:58:10 oh 06:58:10 No, I did have a screened ping as a temporary measure but that got lost in the reboot 06:59:01 does [_] work as "a list of anything", or am i deluding myself? 06:59:18 rik: nah, it means "match and discard" 06:59:25 In a pattern context it matches a singleton list 06:59:31 * rik nods 06:59:31 er, wait, I'm wrong.. 06:59:32 doh 06:59:34 heh 06:59:39 It's illegal in any other context 06:59:40 oh wait. 06:59:46 i already solved this with an array 06:59:50 i just haven't implemented it. 07:00:03 * shapr tries to figure out how to connect Haskell to Zope 07:00:18 shapr: mod_haskell and mod_backhand :) 07:00:42 is there really a mod_haskell? 07:00:51 yup 07:00:55 I had no idea 07:01:05 modules.apache.org will confirm this 07:01:11 yep 07:01:14 it uses hugs though 07:01:22 so it's not that useful 07:01:29 * rik shrugs 07:01:35 we use hugs at university... 07:01:40 By useful do you mean fast? 07:01:49 igloo: yeah. In particular for something like MAG 07:01:55 rik: what uni? 07:02:02 *nod* 07:02:16 Bristol.ac.uk 07:02:58 what year? 07:03:09 I'll be going into the third year. I'm on a year out at the moment. 07:03:23 ah - do you know Paul Duff and/or Michael Ashton? 07:04:31 yes, both of them 07:04:48 mister duff was my Vice President when i was head of the computer society there. 07:04:50 how do you know theM 07:04:52 ? 07:05:06 ahh. you're an ox.compsoc person? 07:05:12 yeah 07:05:20 are you also an earthling then? 07:05:22 yep 07:05:29 ahh. I know Martin Ling too 07:05:40 Small world... 07:05:42 * rik nods 07:05:43 like I said before 07:05:45 * Heffalump just realised you were a pkl.net type person :-) 07:05:48 especially the Haskell world 07:05:52 indeed. 07:05:58 yeah, i co-own hogan.opn. 07:06:24 gee, I've only re-met one person on irc so far. 07:06:25 and i vaguely know huggie and noodles too. the latter hosting my DNS. 07:06:27 Michael Ashton I know through someone he was at school with (another earthling) 07:06:33 * rik nods 07:08:07 I need more geeky social connections. 07:08:31 you're connected to most of the FreeBSD hackers and security geeks. 07:08:33 but you didn't know. 07:08:49 no, I didn't. how am I connected to them? danl? 07:08:55 no. me 07:08:57 oh! 07:09:00 cool! 07:09:15 do you know of the north sweden BSD contingent? 07:09:42 uhm 07:09:43 sorta. 07:09:46 there's a few of them. 07:09:58 you know the guy who runs codefactory.se? 07:10:17 not from the domain name 07:10:20 there's a lot of people 07:10:25 daniel lundin? 07:10:31 they all idle on #bsdcode on efnet though 07:10:44 * Heffalump emerges from trying to untangle the various pkl.net/printf.net/earth.li connections 07:10:58 what can you do with mod_haskell? 07:11:00 heh 07:11:53 jewel: it's just hugs integrated into an apache module 07:12:15 so you can configure a haskell script to be run for HTTP requests 07:12:36 it's the same principle as mod_perl 07:14:39 * rik realises what he actually has to do. 07:15:03 do_add :: VirtualMachine -> VirtualMachine 07:15:04 :/ 07:16:11 hum. that means i need to figure out types and stuff. 07:16:20 * rik goes to garage to find Haskell book. 07:24:29 --- join: dennisb (~dennis@as2-4-3.an.g.bonet.se) joined #haskell 07:27:05 hi dennisb 07:29:10 * rik frowns, and finds not his copy of Haskell: The Craft of Fun/ 07:29:33 --- quit: shapr (Remote closed the connection) 07:30:33 aha 07:30:35 found it. 07:31:07 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 07:31:19 hi all! 07:31:30 hello. 07:38:01 * rik hrms and knows not how to model this. 07:39:21 What's the problem? 07:39:53 The overall design? 07:40:59 yeah. i'm not that hot with functional programming, as you may hae noticed, and i know the things i eventually want to do 07:41:22 the problem is that i am going to have a single lump of memory, and several processors 07:41:31 each processor has its own set of registers 07:41:46 and every 497 instructions, an interrupt is fired 07:41:47 Well start with the visible interface - what functions do you want to export, what arguments must they take and what will they return? 07:41:57 deoce 07:42:01 kill that. 07:42:14 fetch :: Integer -> Instruction 07:42:34 decode :: Instruction -> (function, value) 07:42:47 The 497 thing and the memory you will probably want to bundle upo into a State type and pass that around, quite possibly monadically 07:43:49 * rik nods 07:43:53 uhm 07:43:55 yPresumably fetch also needs to take a Memory? 07:44:03 07:44:11 yes, it probably will do 07:44:19 There are some things worth reading about monads on haskell.org 07:44:33 because I think each function that the virtual CPU knows about will have to return the new state ofthe memory. 07:49:55 * rik fails to understand some more. 07:50:35 ? 07:50:43 shapr: http://web.comlab.ox.ac.uk/oucl/work/ganesh.sittampalam/iltrans.ps 07:50:50 (yay, paper submitted!) 07:51:21 Congrats :-) 07:51:29 * Igloo fails to subscribe to the lout mailing list 07:51:51 Oh, no, it was just very slow. Or maybe it was waiting for me to complain 07:51:54 Igloo: just being dumb, and not getting my head into the functional ways yet. 08:02:31 * rik suspects type State = (Memory, [Processor], InterruptsEnabled) where type Memory = Array Int32 Instruction, Processor = (Int32, Int32, Int32, Int32) 08:02:35 or something similar. 08:03:06 Are the Int32s registers? 08:03:15 yes, exactly 08:04:15 is there a better way to declare the processor type, given that the registers have names? 08:04:22 Looks OK, although you may want some abstraction in case you need to add things to State later on 08:04:30 You could use records 08:05:05 data Processor = Processor { ax, bx :: Register } type Register = Int32 08:05:05 hm. 08:06:40 why data Processor, rather than type? 08:07:18 type just creates type synonyms 08:07:32 oh right. 08:07:36 like typedef in C 08:08:01 Yup; data is like struct if you like 08:08:24 * rik nods 08:09:35 okay, so a Machine data type is, in fact the entire state of the machine. 08:11:42 Heffalump: nifty paper 08:12:20 how similar are IL and Joy? 08:13:48 I'm sure I could actually use my brain and read up on IL... 08:13:55 but that would be far too easy ;) 08:14:39 Heffalump: sounds like you've read the Refactoring Browser thesis 08:14:54 * rik suspects that having a list of constants is probably not The Right Thing in Haskell. 08:16:31 shapr: why? (re the refactoring stuff) 08:16:36 If you mean like procesors :: Int processors = 4 then that's what I do 08:17:26 oh good. 08:17:38 Heffalump: because your rewrite stuff looks a lot like the regex-style search and replace on abstract syntax trees that's done in the Refactoring Browser 08:17:46 I've got a whole bunch of constants like that for instruction enumeration 08:18:01 shapr: got a URL? 08:18:09 Heffalump: sure, just a moment 08:18:27 hm 08:18:29 http://st-www.cs.uiuc.edu/~droberts/thesis.pdf 08:18:39 * Heffalump checks whether Oege put in a reference, cos he did most of the related work stuff 08:18:42 * rik wonders how to access members of the Processor data type now. 08:18:59 Heffalump: I started a Python Refactoring Browser project, sadly, the project required more than I know how to do. 08:19:33 Oege did RB stuff? 08:20:01 no, but he knows about everything 08:20:25 heh, ok :) 08:20:47 rik: what I typed above would declare functions ax,bx :: Processor -> Register 08:20:47 imho, the RB should be extended to be a language agnostic refactoring framework 08:21:09 oh. 08:21:14 OH. 08:21:29 * rik may have just understood something important 08:21:53 I think the RB and Simonyi's idea of IP (storage as AST) should merge at some point into a *real* development environment. 08:22:16 notice that refactoring a method from one class to another goes right over the head of something like CVS 08:22:58 I'm interested in writing a cvs replacement, incidentally 08:23:08 so are we :-) 08:23:10 heh 08:23:23 in haskell, or in any language that's appropriate? 08:23:23 we had a project going at one point, but it died out due to lack of time 08:23:45 anything appropriate. Initial implementation was going to be in perl. I think Igloo wrote a bit of code for it, but I can't remember 08:23:54 * rik nods 08:24:07 Did you notice subversion and something shorter being talked about on KT as LK potential OS concurrent versioning systems? 08:24:11 well, vital things for me are atomic commits of entire chunks. not just one file. 08:24:36 and better authetntication support for people you don't trust to have a proper shell account 08:24:47 and gid support 08:24:47 etc. 08:25:05 * rik notes that gids cause a lot if his problems. 08:25:11 s/if/of/ 08:25:19 I want my refactoring browser and my cvs to be smart enough to talk to each other 08:26:02 Heffalump: Don Roberts and Ralph Johnson's stuff is quite spiffy 08:26:05 igloo: arch. yeah. 08:26:23 shapr: so the difference with our stuff is that ours stuff uses regexes on the program flow graph, not the syntax tree 08:26:59 well, I'm still not sure what a program flow graph is exactly.. I'll keep reading :) 08:27:06 it's just a flowchart 08:27:09 oh 08:27:11 that's easy enough 08:27:23 draw a box for each statement 08:27:33 then draw lines to indicate how control flow can be transferred 08:28:06 * rik notes imperative language optimizers do this too. 08:28:13 only without the pen and paper 08:28:19 rik: do what? construct a flow graph? 08:28:21 * rik Einsteins another description. 08:28:24 Heffalump: yes. 08:28:27 yeah 08:28:34 jumps and targets of jumps are grahped 08:29:18 where you have a chunk of code that is between a source and target of a jump, it doesn't matter what order it's executed in, and can, therefore, be reordered and generally messed with, in order to get the best performance out of it at the CPU level 08:30:00 errm, assuming you respect the data dependencies :-) 08:30:09 well, yes. 08:31:12 but compiler generated temporary variables are also (handily) guarenteed not to be alive (ie, with live data in them) after each address that is the target of a jump 08:31:35 depends on the compiler surel 08:31:36 y 08:31:41 so that the compiler can immediately reuse temporary variables, therefore shortening the lifetime of them, and pushing more of them into CPU registers. 08:32:05 hmm. possibly. 08:32:16 hum 08:32:54 wait. i'm thinking imperative again. i need to keep thinking functionally, otherwise i'll never get this done :) 08:33:13 hum 08:33:41 i still don't understand what Igloo told me, about what I'm thinking of as structure member access. 08:33:49 I have a line of code: 08:33:55 > data Processor { A, B, PC, SP :: Register } 08:34:07 Given that Register exists as a type. 08:34:20 That's not valid Haskell 08:34:25 it's not? 08:34:25 oh. 08:34:34 well, that would go some way to explaining it. 08:34:40 Variables have to start with [a-z_] 08:35:00 oh 08:35:01 So either a, b, cp, sp or rA, rB, rCP, rSP 08:35:04 initial capital letters indicate data constructors 08:35:08 * rik rewrites a lot of code and constants. 08:35:45 brb. gotta drive mum to pick up her car. 08:37:00 actually, back much later. things to do. 08:40:06 * shapr considers working 08:40:16 * shapr gets over the urge to do real work 08:40:18 whew 08:40:24 :-) 08:40:41 man, I almost did something useful 08:44:43 I tried to do something useful, but then I found it was lout that was broken rather than me 08:46:21 what's lout? 08:47:33 A typesetting system, similar to LaTeX 08:51:24 * Yurik is away: for a bit, 10 minutes or so 08:57:21 * Yurik is back (gone 00:05:56) 09:12:11 * rik hrms. 09:14:02 right. 09:14:11 I've changed all my variables to lowercase. 09:16:16 okay. 09:16:41 > data Processor { a, b, pc, sp :: Register } 09:16:45 that's what I now have. 09:17:24 the question is, how do I access a, b, pc and sp ? 09:19:18 errm, does that actually load ok in hugs or whatever? 09:19:29 I'd have thought you needed something like 09:19:29 dunno. not tested it yet. 09:19:38 > data Processor = Processor { a, b, pc, sp :: Register } 09:20:02 indeed. 09:20:21 and then you'll get functions a, b, pc and sp all of type Processor -> Register 09:21:59 and they'll access the relevant values? 09:22:08 yep 09:22:21 good good. 09:22:41 what would a function declaration look like? 09:23:01 eg: do_ldc :: Machine -> Integer -> Machine 09:23:21 like that, yes 09:23:25 right. 09:23:49 and the access to the functions would be Processor.a ? 09:25:06 sorry? 09:25:13 uhm, okay. 09:25:18 in the scope where Processor was defined the accessor functions would be just "a" 09:25:26 s/scope/module/ 09:25:30 right. 09:25:31 uhm 09:25:43 i don't understand how to do what I'm trying to do then 09:25:48 Foo.bar is for accessing bar from module Foo in another module when you did "import qualified Foo" in that module 09:26:09 right. 09:26:45 okay, I've got this data Processor = Processor ... as above 09:27:02 I have a function as so: foo :: Processor -> Processor 09:27:24 which is going to modify the incoming processor, and return the changed version 09:27:35 right 09:27:41 lets say all it does is add 1 to a 09:27:48 ok 09:27:50 how would you right that function? 09:28:07 YM write 09:28:33 foo proc = proc { a = a proc + 1 } 09:28:58 the { } after a record variable notation is the way updates are done 09:29:05 okay 09:29:14 the "a proc + 1". 09:29:25 is the proc a qualifier for a ? 09:29:29 no 09:29:38 a :: Processor -> Register 09:29:38 "a proc" is the function a applied to the variable proc 09:29:38 so a proc :: Register 09:29:45 oh i see. 09:31:20 can I modify more than one thing at once, by doing proc { a = b, a = value } ? 09:32:09 yep 09:32:14 excellent. 09:32:24 except you'd want different "a"s there :-) 09:32:27 otherwise it doesn't make much sense 09:32:28 that's going to make this easier. 09:32:40 oh yes. heh. poor example :) 09:35:11 hmmm 09:35:38 * rik works with this. 09:51:50 uhm 09:51:51 meh. 09:52:04 meow 09:52:11 * rik decides Array of processors would be better than list of processors. 09:52:14 * rik miaows. 09:52:26 * shapr tries to understand suffix trees 09:53:15 oh bah. 09:53:23 name collision. i think. 09:55:13 hm 09:55:18 suffix trees are nifty 09:55:20 ya know... 09:55:35 it should be easy to construct a prefix tree from any existing suffix tree... 09:55:36 hmm 09:56:33 oh this Giegrich and Kurtz paper on lazy suffix tree construction in Haskell is great fun! 09:56:52 oops, Giegerich 10:00:03 uhm 10:00:05 hum 10:00:59 f00 10:05:23 uhm 10:05:25 * rik frowns. 10:05:44 * rik www's his source so far, to work out what's wrong. 10:05:59 URL? 10:06:20 just making now. 10:07:21 http://rikrose.net/haskell/ 10:07:35 there's a file (the only file) called instruction.lhs 10:07:50 the error is, emarrasingly, the first line. 10:08:02 Capital I in Instruction on line 7 10:08:18 Module names must start with [A-Z] 10:08:21 bah, Igloo's too fast :-) 10:08:23 okay 10:08:30 does this mean the source file too ? 10:08:35 (like Java classes) ? 10:08:46 The name of the source file only matters if you import it with other modules 10:08:59 * rik nods 10:09:28 Oh, and if you don't then you probably want to call the module Main 10:09:28 okay. the next error appears to be line 65. complaining about my guards. 10:09:42 I'll make Main later. 10:09:55 You don't want the first = when you have guards 10:10:01 you shouldn't have = signs before the guards 10:10:06 bah :-) 10:10:06 ahh 10:10:46 okay, next one is line 18. Illegal type. 10:11:04 ERROR "instruction.lhs":18 - Illegal type "Array Processor -> Bool -> Machine" in constructor application 10:11:44 Array needs two arguments 10:11:54 you can't partially apply type constructors 10:11:58 * rik nods 10:12:14 That's a pretty poor error 10:12:23 yeah 10:12:36 I wouldn't have noticed if it wasn't for the other use of Array a bit further up 10:13:04 I hadn't noticed that and was about to look at it's definition 10:13:07 right. it's only complaining about functions I've not defined now.. so i *think* that i can accomplish something vaguely useful now. 10:13:33 foo = undefined is useful for such functions 10:13:43 But give them the correct type too 10:13:49 ahhh 10:13:53 I'll do that now :) 10:17:33 uhm 10:17:38 * rik looks up bitwise & 10:18:55 I think hugs uses .&. - it's in Bits.hs, anyway 10:19:14 nhc uses (or at least used) something different, which is all good fun 10:19:15 thanks. 10:24:12 urgh. 10:24:13 uhm 10:24:58 can you have another look at that file, please 10:25:11 I've got another problem with the { } notation 10:25:33 in fac,t you already have the relevant lines. the do_ldc function 10:25:36 huh? 10:25:51 You are trying to update something of type Machine 10:25:55 state { reg_b = reg_a, reg_a = val } where 10:25:59 yes. 10:26:07 it fails. 10:26:17 Machine has field names mem, processors, int 10:26:32 yes. I want to refer to them with a shorthand. 10:26:51 because otherwise they're either not clear, or will go straight off the right hand side of the screen. 10:27:06 you can't, I don't think 10:27:14 What you are actually doing is updating processors 10:27:16 you could define updating functions, though 10:27:31 so update_a machine x = machine { ... x } 10:27:56 hmmm 10:28:01 I'll come back to this later. 10:28:09 this is.. uhm. 10:28:16 making me even later for meeting people. :) 10:28:16 You're also trying to apply a to a list of processors rather than a single processor 10:28:43 am I ? 10:28:44 oh 10:28:54 i thought I was applying it to one, with the processors!proc 10:28:57 You probably want something like 10:29:49 Ugh 10:30:07 indeed. 10:30:10 another time. :) 10:30:16 * rik vanishes off. 10:30:20 thanks for the help so far. 10:31:28 * shapr transcribes the Haskell source from the suffix tree paper 10:32:20 Possibly 10:32:21 > do_ldc state proc val = state { processors = p } where 10:32:21 > p = processors state { b = a (p!proc), a = val } 10:32:33 But you have other bugs elsewhere too 10:33:13 Ooops, that probably won't work, missed something in the merge 10:33:22 > do_ldc state proc val = state { processors = p' } where 10:33:29 > p = processors state 10:33:43 > p' = p { b = a (p!proc), a = val } 10:41:42 * shapr realizes he has much to learn 10:43:40 Oh, I must be tired, that won't work either. You need to extract the correct Processor first and then work on it. I think I will go back to what I am meant to be doing :-) 10:43:48 --- quit: JustRay ("Client Exiting") 10:44:07 suffixes aw@(_:w) = aw:suffixes w 10:44:10 what does that mean? 10:44:26 I remember reading about the @ sign used in pattern matching... but I don't recall what it does exactly. 10:44:30 * shapr hunts about for his book 10:44:39 @ notation is just giving another name to the argument 10:44:58 so that pattern matches the argument for :, binds the entire list to aw, and the tail of the list to w 10:45:08 oh 10:45:10 cool :) 10:45:12 thanks! 10:45:15 they could have written suffixes (a:w) = let aw = a:w in aw : suffixes w 10:45:23 but the above is shorter, obviously 10:45:25 I see 10:45:27 nifty 10:47:58 man, some of this guys code is really scary 10:50:51 elimNested :: (Eq alf) => [[alf]] -> [[alf]] 10:50:52 elimNested [s] = [s] 10:50:52 elimNested awss@((a:w):ss) | [] == [0 | c:_<-ss, a /= c] = [a:s | s<-rss] 10:50:52 | otherwise 10:50:52 where (cpl,rss) = edge_cst (w:[u | _:u<-ss]) 10:51:03 that looks really scary to me, though maybe not to you experience Haskellers :) 10:52:11 I don't think using list comprehensions always promotes readability 10:52:15 I assume you've lost some of it? 10:52:17 although they can help write concise code 10:52:25 [] == [0 | c:_<-ss, a /= c] is just bad code AFAICS 10:52:39 I can't figure out what it does.. 10:53:05 it appears to be looking for elements that are not a in map head ss 10:53:29 Igloo: yes, I'm about 50 lines into transribing the code in this paper about suffix trees. 10:53:33 clog:_ <- ss will get the first element of each of the lists in ss 10:53:34 I'd write null $ filter ((c /=) . head) ss (at least I think that's right) 10:53:39 s/clog/c/ ! 10:53:45 YM a/= 10:53:48 but yeah 10:53:51 Oh, yes 10:55:48 --- quit: shapr (Read error: 104 (Connection reset by peer)) 10:56:52 maybe it all got too much for him 11:36:12 another way to write the predicate you talked about is: any (/=a) $ map head ss 11:36:18 it's almost readable 11:38:22 hmm, shapr is not here.. 11:40:23 or even: any ((/=a).head) ss 11:40:46 which is more or less what Igloo wrote 11:41:31 Yeah, that is slightly nicer 11:46:29 and doesn't build up an evil intermediate list 11:48:19 --- join: ChoJin (~ask@cha213245038031.chello.fr) joined #haskell 11:56:42 --- join: Yurik_ (~yrashk@gw.telcos.net.ua) joined #haskell 12:01:16 --- quit: Yurik (Read error: 113 (No route to host)) 12:16:51 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 12:18:03 well, that was exciting. 12:19:29 --- nick: Yurik_ -> Yurik 12:19:35 Whatever Oxford's electrons have must be infectious 12:19:57 my drives all died at the same time, and I couldn't read/write anything to disk 12:20:26 I ended up doing a manual fsck in maintenance mode. 12:20:41 my advice is "don't buy motherboards with via chipsets" 12:21:09 at least most of my transcribed suffix tree code made it 12:21:20 Eeeep 12:21:48 I only lost a few fonts, and fixed that with "apt-get --reinstall install gsfonts" 12:21:49 scary ... 12:21:58 in any case... back to suffix trees 12:35:05 * shapr really isn't sure how to indent this code 12:54:35 wow, this is the kind of code that makes Haskell infamous 13:08:50 why? 13:09:38 http://kungens.kemi.fi/~shae/GKSuffixTree.hs 13:09:43 that's what I've got so far 13:10:03 lines like "g cusnes@(cusn@(cus@(cu@(c:u),culen),node):es')" are pretty scary 13:11:22 or to see what it looks like with my lovely Emacs color-theme called mistyday: 13:11:23 http://kungens.kemi.fi/~shae/GKSuffixTree.html 13:13:02 the author says in the paper that he thinks he's written a very simple and easily understandable suffix tree algorithm 13:14:46 what do you think? is that easily readable source to you? 13:15:04 it looks like something I would have refactored thoroughly before releasing upon an unsuspecting world 13:16:54 or maybe suffix trees are just a really complicated thing, and the author really *did* a good job of making them clearly coded. 13:18:19 shapr: you missed my addition to the predicate when you (got) logged out: any ((/=a).head) ss 13:18:32 almost as before, but I like the word any 13:18:46 oh 13:19:05 the same as "any (/=a) $ map head ss" which is maybe even easier to read (hard to say) 13:19:41 but needs deforestation :-) 13:19:46 instead of "[] == [0 | c:_<-ss, a /= c]" which is unreadable 13:20:00 Heffalump: who knows what happens when you compile 13:20:03 I think most of this guys code is unreadable :) 13:20:34 shapr: yea, i just looked at the page you showed, it does not look very nice 13:20:42 dennisb: true, that ought to be automatically deforested 13:22:13 igloo: can I borrow your computer vacuum? I'm fed up of dusting these pieces. 13:22:17 oops, sorry 13:22:19 wrong window. 13:22:33 Sure (please paste this into the window of your choice) 13:22:42 it probably does, but I never know. I usually don't care about these things until the program is to slow when I profile to find the hot spot 13:22:47 heh :) 13:27:30 hm, possible indent bug in haskell-mode... 13:27:51 I of course ment when it is too slow, then i start to profile. Now I leave you again, just wanted to tell you about the nice any function to enhance readability 13:27:52 it's full of 'em IME 13:27:56 shapr: yes 13:28:08 let in do-notation for example 13:28:18 thanks for the nice function dennisb 13:28:40 ok, I'm done transcribing the source.. yay! 13:30:05 and uploaded as well, though now I don't have time to play with it :-/ 13:30:11 * shapr goes off to do dishes before woman gets home 15:28:50 --- quit: ChoJin ("bye !!!") 15:33:59 --- quit: smkl (Remote closed the connection) 15:34:27 --- join: smkl (~sami@glubimox.yok.utu.fi) joined #haskell 15:40:31 wheee 16:15:49 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 16:16:09 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 16:53:55 --- join: juhp (~petersen@firebox-ext.jp.redhat.com) joined #haskell 16:57:05 --- nick: juhp -> jens 17:01:25 --- quit: Yurik (Read error: 113 (No route to host)) 17:01:32 --- join: Yurik (~yrashk@gw.telcos.net.ua) joined #haskell 17:03:20 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 17:03:21 --- quit: rik (carter.openprojects.net irc.openprojects.net) 17:03:21 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 17:03:44 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 17:04:53 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 17:04:53 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 17:52:16 --- quit: rik (carter.openprojects.net irc.openprojects.net) 17:52:16 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 17:53:01 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 17:53:01 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 17:56:49 --- quit: rik (carter.openprojects.net irc.openprojects.net) 17:56:49 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 17:56:49 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 17:57:29 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 18:01:27 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 18:01:27 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 18:15:05 --- quit: rik (carter.openprojects.net irc.openprojects.net) 18:15:05 --- quit: Heffalump (carter.openprojects.net irc.openprojects.net) 18:15:05 --- quit: shapr (carter.openprojects.net irc.openprojects.net) 18:16:05 --- join: shapr (~user@p-c2fbab7e.easy.inet.fi) joined #haskell 18:16:38 --- join: Heffalump (ganesh@munchkin.comlab.ox.ac.uk) joined #haskell 18:16:38 --- join: rik (spamtrap@dsl-212-23-24-254.zen.co.uk) joined #haskell 18:49:23 --- quit: xbill ("host going down") 20:32:44 --- join: clausen (~andrew@c17997.eburwd3.vic.optusnet.com.au) joined #haskell 21:30:14 --- join: jlb (~ktk@jeremeydsl-3.mylinuxisp.com) joined #haskell 23:21:15 --- join: ADEpt_ (~adept@80.255.64.5) joined #haskell 23:21:50 Yurik : re 23:30:45 --- join: camel__ (~duraid@idesign.fl.net.au) joined #haskell 23:30:52 god damn haskell sucks ass 23:30:58 caml forever#!@%@!% 23:30:58 ;) 23:30:59 --- part: camel__ left #haskell 23:50:10 anybody can give a hint about how to process binary file efficiently? Right now i do something like: 23:50:21 readBinFile fname = 23:50:27 do ifh <- readFile fname 23:50:28 return (readSr8Records (map (fromIntegral.ord) ifh)) 23:51:50 and it obviously sucks due to a large number of allocated Chars, which are shredded by gc seconds after that (at least that's how i interpret ghc's heap trace). What can be done about that? 23:59:59 --- log: ended haskell/02.03.21