00:00:00 --- log: started haskell/02.01.21 00:52:33 --- join: shapr (~user@195.156.199.178) joined #haskell 02:22:12 --- join: wicky (~wicky@cc11277-a.ensch1.ov.nl.home.com) joined #haskell 02:22:57 --- part: wicky left #haskell 02:59:49 if YouSay = "Vb sucks" then youwrong = true 03:01:32 what's good about vb? 03:03:02 vb is easy to make GUIs with 03:03:13 the language is not conducive to good programming habits though 04:24:34 The type system scares me 04:25:54 * jewel wonders what a good project would be for a yellow belt 04:34:09 oh, good question 04:34:15 hey, we need to come up with a system for belt colors 04:34:18 or I need to ): 04:34:20 :) 04:34:24 oops, mis-smile 04:35:50 ok... 04:36:03 white belt is where you get any kind of program to work in Haskell, even helloworld 04:36:15 --- join: Vutr__ (~ss@port-212.169.142.151.flat4all.de) joined #haskell 04:36:20 yellow belt is where you write a small program of your own and it works 04:36:28 I guess my Mandelbrot.hs is sufficient 04:36:42 Well then you'll have to change the topic 04:36:46 yah, I agree 04:36:54 What's a good project for orange then? 04:37:10 --- topic: set to 'Functional Programming, that's the opposite of Dysfunctional Programming (like VB) | we be loggin' http://tunes.org/~nef/logs/haskell/ | welcome to the Haskell Dojo | jewel and julien are up to white belt! shapr is up to yellow belt!' by shapr 04:37:13 oh 04:37:14 hmm 04:37:19 are you up to yellow belt also? 04:37:54 btw 04:37:58 what are all the belts? 04:38:07 white, yellow, orange, ... black 04:38:16 isn't your Mandelbrot.hs fairly complicated, in the way it uses type classes and stuff? 04:38:22 er, hm. 04:38:25 yah, now it is 04:38:28 it wasn't before 04:38:50 I added type class support because Luke wanted to Show a MandelData 04:38:59 that might qualify as orange belt... maybe 04:40:04 I'd say creating your own datatypes and using typeclasses could be called orange belt 04:40:35 but in that case I'd say being proficient with one of several things could be sufficient 04:40:39 not just typeclasses 04:40:58 --- nick: Vutr__ -> Vutral 04:43:02 I guess Monad proficiency would be black belt :) 04:43:14 and input/output proficiency would be brown belt 04:43:20 or whatever is below black 04:43:52 is the haskell wiki down? 04:44:15 there's quite a bit more complicated stuff than Monads, but once you've got to that stage you're doing pretty well generally 04:44:30 like arrows? 04:44:44 monads as brown belt then? and arrows as black belt? 04:44:59 arrows are fairly specialised, they're not in common use yet 04:45:09 oh 04:45:23 what's more complicated than Monads and less than arrows? 04:45:29 yeah I think I'm yellow belt too 04:45:37 I reckon Monads for black belt makes sense; you just have to recognise that there's more stuff you can learn once you get to Black belt 04:45:47 but in a sense your "apprenticeship" is over 04:45:48 It depends on the system, but you usually have about 10 kyu 04:46:00 --- topic: set to 'Functional Programming, that's the opposite of Dysfunctional Programming (like VB) | 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 yellow belt!' by shapr 04:46:28 white, yellow, orange, green, blue, brown, black is common (with purple and variations on each belt making up the rest) 04:46:42 cool, sounds like a good system to go with. 04:47:08 Are you going to make a wiki page for the gradings? 04:47:11 yup 04:47:15 if I can get to the haskell wiki 04:47:33 can you? 04:47:48 I can't seem to get to sf.net either 04:47:49 :( 04:48:08 I may need to restart gnome 04:49:12 me neither 04:50:12 working now 04:50:42 * shapr goes back to working also 04:54:23 --- quit: Vutra_ (Success) 05:07:56 http://haskell.org/wiki/wiki?HaskellIrcChannel 05:07:58 ok, it's up 05:22:50 you might want to have datatype and type aliases as Orange, and type classes as green 05:23:20 Heffalump: it's wiki, change it ;) 05:23:36 I opine that you know better than I do 05:24:44 what are datatype and type aliases, what would be an example of their use? 05:26:33 I just added some to Mandelbrot-0.2.hs 05:27:31 http://kungens.kemi.fi/~shae/Mandelbrot-0.2.hs 05:28:26 see the line of code that has "instance" in it 05:29:31 haskell type classes are much like Java Interfaces 05:30:15 some examples are Eq (for equality testing) Ord (ordered types) and Show (for getting a text represenation of a type) 05:33:49 last week Luke_ tried to play with Mandelbrot interactively, but the type alias MandelData was not an instance of Show 05:38:11 Ok, that's not hard 05:38:19 I thought your mandelbrot used a GUI 05:39:11 nah, I wish :) 05:40:56 I'd like to use gtk, but debian doesn't have it by default, and building ghc with gtk support is not simple 05:46:15 it can't be dynamically linked? 05:46:28 --- join: LoganH (~logan@up112.blacksburg.ntc-com.net) joined #haskell 05:46:45 hi LoganH 05:46:48 Hello. 05:46:49 jewel: I don't know. 05:46:55 I'd like to though. 05:46:56 I'm trying to learn haskell. 05:47:08 you've come to the right place. 05:47:12 this and #loty 05:47:13 How might I transform a string containing whitespace-delimited integers to a list of integers? 05:47:41 er, readInt ? 05:48:02 I think it's read("1") :: Int 05:48:07 or something really close to that 05:48:18 you'll probably want to split the string first 05:49:05 if you want to join a group of people who are learning Haskell: http://pragmaticprogrammer.com/loty 05:49:06 Yeah, the splitting is what I don't know how to do (easily). 05:49:08 check that website 05:49:27 one of the Prelude's List functions does that simply 05:49:31 luckily splitting has been well discussed :-) 05:49:38 yah, very well discussed 05:49:47 I wrote one, PragDave wrote one, 05:49:52 and there's one in the standard lib 05:50:12 I guess I chose a good year to learn Haskell. 05:50:14 http://haskell.org/onlinelibrary/ 05:50:17 I agree! 05:50:44 The documentation on haskell.org has little in the way of examples, and I can only glean so much about what a function does by the types it operates on and returns. 05:50:52 if you check the List module of the onlinelibrary, you'll see many useful things 05:50:58 yah, I agree with you there 05:51:14 there's also YetAnotherHaskellTutorial starting up at the same time 05:51:52 the #loty and YAHT people are going to work together, and hopefully end up with an excellent tutorial, and some programmers with excellent knowledge of Haskell 05:52:42 I thought a good way to dive in and learn it is to try some simple problems from ACM contests (where you're normally expected to solve it in C). 05:52:49 an unfoldr there 05:52:55 I find the solving part is sometimes very nice, but the I/O I can't do yet. 05:53:11 yah, IO is challenging because of referential transparency 05:54:02 hey jewel, I emailed the LL1 guy about Joy, and he said that FP is very powerful, but that he finds Haskell too difficult to "grok" 05:54:10 I replied and told him about #loty ;) 05:54:41 hehe 05:55:55 I can understand that it's more fun and easier to learn stuff with others, but I don't think anything is too complicated or too esoteric to learn. 05:57:11 It's purely a matter of changing old habits and thinking a bit differently 05:57:34 yah, I agree 05:58:33 he also said what you figured out about that thread, that they would like to give optimization information to the compiler in the source 05:59:40 I didn't say that 05:59:42 Where has this splitting "been well discussed"? 05:59:54 heh, just locally 06:00:02 No archive for me to look at? :P 06:00:08 yes, there is :) 06:00:16 the channel topic has the url for logging 06:00:33 Good point. 06:01:00 I don't know which day had the splitting discussion 06:02:27 * Heffalump reappears 06:02:35 * shapr gasps 06:02:41 Was it referred to as the splitting discussion? 06:02:43 and edits the page as suggested :-) 06:03:27 which channel was it? 06:04:03 I think part or all of it was here on #haskell 06:04:11 oh wait 06:04:16 maybe it happened on #loty 06:04:22 in which case, it wasn't logged :( 06:06:23 I found a little discussion. 06:06:26 wget + grep :P 06:06:55 good method 06:07:59 --- join: Vutra_ (~ss@port-212.169.142.239.flat4all.de) joined #haskell 06:08:21 Now I know to look in PreludeList, which has a lot of stuff I didn't notice before. 06:09:47 yah, it's handy 06:09:55 we have all kinds of good advice here. 06:11:23 I have the #loty from friday till now 06:11:48 oh, good 06:12:02 I should ask nef to get clog over there 06:13:47 LoganH: you want it? there's a lot of idle chatter in there too 06:14:19 * shapr is the primary guilty party in that case ;) 06:20:08 jewel: Sure. 06:20:25 How do I make a non-IO something into an IO something? 06:20:46 you should ask one of the black belts about that. 06:20:53 return 06:21:16 Like, I have an Int and an IO [Int], and I want to add that Int to the head of that IO [Int] 06:21:31 f x ioxs = do xs <- ioxs 06:21:39 So like return x : y ? 06:21:40 return (x:xs) 06:22:04 does that make sense? 06:22:08 Yeah. 06:22:28 Is there a more concice way of doing it? 06:22:32 umm 06:22:54 possibly, but do you want your code to be readable? 06:23:09 LoganH: are you a former Perl programmer? ;) 06:23:19 Sometimes... :P 06:23:23 aha! 06:23:58 This would be easier if I knew how to just temporarily hold a value in a variable. :P 06:24:10 that's what the "xs <- ioxs" does, roughly 06:24:22 liftM (x:) ioxs 06:24:29 is more concise, btw 06:24:47 and looks scary 06:24:48 but you'll need to "import Monad" 06:24:58 shapr: hence my comment about "more readable" above :-) 06:25:13 shapr: actually, if you read the definition of liftM it's just a more general form of my code above 06:25:27 yah, I've heard about lifting 06:25:31 so it's not really scary, but it does require a bit more knowledge of the library (I had to go and look it up first myself) 06:25:33 liftM takes an x and lifts it into a monad? :P 06:25:33 I'm still not sure why you need to... 06:25:54 LoganH: no, it takes a function from as to bs and lifts it into a function from monad as to monad bs. 06:26:01 if that makes sense 06:26:02 oh 06:26:07 that does make sense 06:26:18 it's a 2nd order ... whatever you call it 06:26:21 like map 06:26:23 yeah 06:26:27 exactly 06:26:32 * shapr tries to remember the name of those things 06:26:41 in fact, liftM on the list monad is precisely map. 06:26:52 2nd order function? 06:26:54 aha! 06:26:56 that's the word 06:26:58 though it's not, it's third order 06:27:06 yah, makes sense 06:27:12 well, depending on how you define order, but by the definition I generally use it is 06:27:14 --- quit: Vutral (Read error: 110 (Connection timed out)) 06:27:25 map is 2nd order, because it takes a function 06:27:25 values (6, "foo") etc are first-order 06:27:38 liftM takes a function and turns it into a Monadizer 06:27:42 functions that take only first-order things as parameters are second-order 06:27:57 functions that take only first or second-order things as parameters are third-order. Etc. 06:28:00 * shapr avoids the Monadic tribes of graduate students roaming the halls of the CS building 06:28:05 but other people's definitions of order might vary 06:28:12 er 06:28:20 so why is liftM third-order then? 06:28:29 cos (a -> b) is second-order 06:28:58 oh, so map is 3rd order? 06:29:00 yep. 06:29:04 --- nick: Vutra_ -> Vutral 06:29:04 by my definition 06:29:08 ok, I got it. 06:29:19 (which is common in the literature of the subject of my thesis, but might not be elsewhere) 06:29:24 treerec in Joy is fourth order then 06:29:40 if you say so :-) 06:29:46 according to your definition 06:29:59 well, I don't know what it is, so I can't agree or disagree 06:29:59 because it requires something like map as one of its args 06:30:03 right 06:36:46 Heh, I just realized that lazy evaluation is my friend. :P 06:36:57 as always :-) 06:38:47 --- quit: Vutral (Read error: 104 (Connection reset by peer)) 06:39:23 --- join: Vutral (~ss@port-212.169.142.239.flat4all.de) joined #haskell 06:41:58 So why loty, as opposed to lotm? 06:44:19 LoganH: loty is based on some advice given in 'the pragmatic programmer', namely that programmers should learn at least one new language a year 06:44:21 have you read "The Pragmatic Programmer" ? 06:47:01 * LoganH shakes his head. 06:47:14 it's very much worth reading 06:47:17 it's in my top two books. 06:47:37 I don't know whether I'd recommend it over SICP, but then, I'm not sure I'd recommend SICP over it... 06:47:44 who wrote it? 06:48:07 Dave Thomas and Andy ... someone 06:48:16 Hunt 06:48:18 right 06:48:33 it's a great book. 06:48:56 content-wise, 50% of it is just about managing any kind of projects 06:49:15 my fiancee has been a project manager in several european projects, and she likes the book too. 06:49:23 --- join: PragDave (~dave@pragdave210.august.net) joined #haskell 06:49:24 the other 50% don't interest her at all. 06:49:34 in fact, PragDave is the Dave Thomas we just spoke of. 06:50:02 ah 06:50:12 * PragDave 's ears were burning 06:50:14 PragDave: my fiancee wants me to tell you that about 50% of PP is excellent advice for anyone managing projects. 06:50:26 she's managed several european projects. 06:50:44 she says the other 50% is just geeky stuff 06:50:46 * shapr grins 06:51:00 shapr: there's the pragmatic half, and the programming half :-) 06:51:06 right, exactly. 06:51:14 * PragDave signs dblack as his agent 06:51:19 happily, this means that she and I can read the book together. 06:51:23 PragDave: think you can afford me? 06:51:28 I consider that a great benefit. 06:51:36 Beatrice doesn't really want to read Haskell books with me. 06:51:43 * PragDave fires dblack on consideration of the financial side 06:51:46 even if she did buy them for me as presents. 06:52:05 wow, that's life in the fast lane dblack 06:52:09 * dblack_ sues PragDave for 5 times what would have been his salary 06:52:22 --- join: chad (trilluser@65.15.137.250) joined #haskell 06:52:29 * PragDave pays 06:52:34 * shapr laughs 06:53:15 shapr: we're actually looking at putting together some kind of workshop or course for managers 06:53:24 I think this would be wise. 06:53:29 along the lines of "How To Herd Cats" 06:53:38 *exactly* !! 06:54:40 i think many managers fail to realize just how to help developers do their jobs 06:54:47 they view is as carrot and stick 06:54:59 while it's really opportunity and cost 06:55:07 yea, as if developers *don't want* to work. ;) 06:55:30 so we're doing somethig about setting up an environment where developers and projects can flourish 06:55:33 some negative reviews on amazon 06:55:44 count yourself lucky if management even wants to help you do your job... 06:57:10 ignore my three dots 06:57:14 ignore the negative reviews on amazon 06:57:34 jewel: of? 06:57:42 your book, on amazon.co.uk 06:58:20 oh - there's that really quite hurtful one at the top over there "Garden Variety Programming" or somesuch 06:58:56 yeah 07:00:07 some folks come to books with a particular expectation. If the bok doesn;t match, then it fails them. 07:00:47 jewel: and another thing.... 07:01:01 note that the people who liked it (of that small sample of reviews) are the ones who used it for something 07:01:15 the people who didn't are doing a kind of literary-history take on it, or something 07:01:50 yes, comparing it to their favourite book 07:03:37 jewel: if you're an experienced developer who stays on top of modern practices, then the book probably won't tell you much you don't know 07:03:54 You'll be surprise at what other titles you've authored: http://www.amazon.co.uk/exec/obidos/Author=Thomas%2C%20Davis/026-0863672-4490001 07:05:28 I can never get patterns to work the way I want... 07:05:41 I have: 07:05:42 output :: [Cell] -> [Cell] -> IO () 07:05:47 output [oc:orest] [c:rest] = do 07:05:48 putStrLn ("Cell data in " ++ (show oc) ++ " " ++ (getResult c)) 07:05:48 output orest rest 07:05:55 Is that not correct? 07:06:54 no 07:06:57 i'm new to this, but try it without the '[]'s 07:07:03 yeah, use ( ) instead of [ ] 07:07:15 : is a constructor that gives you a list 07:07:36 so you don't need the [ ] - that ends up giving you a list of lists 07:07:37 : is an infix operator? 07:07:41 yep. 07:07:42 Oh. 07:07:56 Much better now. (: 07:07:57 Thanks. 07:10:03 PragDave: I've worked in Birmingham, Alabama; Seattle, Washington; and Tornio, Finland. I think your book rocks, and I haven't met any developer who did *not* need to read it. 07:10:20 oh yes, that's what I was getting at, shapr should write a review 07:10:25 heh :) 07:10:46 yah, I will. 07:11:19 I think my nifty/sucks meter is pretty accurate, and I rate tPP neck-and-neck with SICP. 07:11:52 what is SICP? 07:11:58 (having failed to find it in scrollback) 07:12:15 Structure and Interpretation of Computer Programs by Ablesson, Sussman, and Sussman 07:12:23 ah 07:12:46 have you read it? 07:12:56 nope 07:13:01 you should 07:13:13 * jewel finishes his SQL Server service pack download and prepares to go over the top 07:13:13 I'm an academic, I don't go in for practical things like that :-p 07:13:29 SICP is both academic and practical. 07:13:33 though actually I'm currently thinking about whether to take a software development job 07:13:54 Heffalump: no! not the red pill! 07:14:00 er, blue pill? 07:14:06 crap I can't remember which was which. 07:14:23 red was what he took, IIRC 07:14:28 oh 07:14:34 then I said it correctly. 07:14:51 :-) 07:15:05 Keanu Reeves is a wizard programmer 07:15:13 * shapr blinks 07:15:17 er, really? 07:15:21 not! 07:15:26 * shapr grins 07:16:00 speaking of which, the only show/movie I've seen that has *good* geek graphics is DarkAngel 07:18:43 --- join: smklsmkl (~sami@glubimox.yok.utu.fi) joined #haskell 07:18:43 --- quit: smkl (Read error: 104 (Connection reset by peer)) 07:23:05 What's the simplest way to sort integers in descending order? 07:23:52 sort ? 07:24:07 just guessing from looking at the List module 07:24:11 sortBy probably 07:24:15 cos he wants reverse order 07:24:23 or reverse . sort , but that'll be less efficient 07:24:58 sortBy (flip compare) 07:25:00 should do the job 07:25:12 shapr: thank's very kind of you (sorry - I'm on a non net-connected box most of today) 07:25:18 Didn't know I had to import List. 07:25:45 That works perfectly, thanks. 07:26:14 jewel: so, did you charge the enemy successfully? 07:26:21 do you see why? (I don't like just providing canned answers without explaining why they work) 07:27:09 no, still rebooting the machine 07:27:24 I'm still trying to figure out the correct DER encoding of an IMPLICITly tagged [0] SET in ASN.1 07:27:28 Yes. 07:27:35 cool 07:27:58 (flip compare) is the comparison operator for the sort operation, the flip just makes the comparator give opposite answers. 07:28:23 Not that I knew any of that before I saw the example (shows the value of having lots of nice small examples around :P) 07:28:44 I saw a neat project, someone providing implementations for everything that's in the Perl Cookbook in various languages (Haskell being one of them)... 07:28:56 that would be cool 07:28:59 The only bad thing is that it's worthless, because all those problems are kind of perl specific, and all the solutions are very perlish. 07:29:13 So there's a big helper library for Haskell that contains all these functions that provide perl-like routines. 07:29:17 You can't really learn much from it. 07:29:28 I think a more basic cookbook would be really n ice. 07:30:23 yah, I agree. 07:30:47 I tried to create a Haskell User Submitted Libraries project on sourceforge, I haven't heard whether it's been approved or not. 07:31:10 when it's up, I'd like for it to be a central repository for useful libs 07:31:27 are there any regex libs for haskell? (or should i just throw that paradigm away?) 07:31:35 yah, there are 07:31:48 rumor has it they're very nice 07:31:51 I haven't tried them 07:32:16 if only I could persaude my boss to let me prototype in Haskell :) 07:33:52 Heh, it only took me 4 hours, but I got this simple ACM problem implemented, complete with proper I/O. :P 07:34:04 cool! 07:34:15 And I even did the algorithmic part functionally. :P 07:34:27 :-) 07:34:38 Though that was the easy part. 07:35:06 btw flip compare works by swapping the arguments to compare, not by taking the opposite value of the result (I'm not sure which of the two you meant above) 07:35:18 Ok, that makes more sense. :P 07:35:25 (that flip woudl be more general like that) 07:35:26 what was the problem? 07:35:44 Problem G from the '98 ACM ICPC... 07:35:55 Basically, you're given a sequence of spreadsheet commands... 07:36:14 Each command is either a list of rows to delete, a list of rows to insert (that is, positions to insert new rows), or two cells to exchange. 07:36:30 Then after that you're given a list of cells, and you're supposed to output their locations after all the commands are applied. 07:36:35 It really lends itself to a functional solution. :P 07:36:58 url? 07:37:48 http://icpc.baylor.edu/past/default.htm seems to have a list of past contests 07:38:07 http://icpc.baylor.edu/past/icpc98/Finals/Report/Problems/Problems98.pdf is the specific set of problems 07:38:07 Oops, my mistake, it was '97 07:38:08 http://icpc.baylor.edu/past/icpc97/Finals/ProblemsF97.pdf 07:38:19 ah :-) 07:39:46 I should try a problem that calls for some sort of data structure now. 07:39:51 Like A. 07:40:12 yeah, I was thinking A would be an ideal candidate 07:40:33 Yeah, basically a tree of records, and some tree modifying routines. 07:40:47 * jewel curses microsoft for shipping buggy software 07:41:06 DAG of records, rather. 07:41:09 The 50 MB service pack indeed fixed our obscure problem 07:42:00 wow 07:42:09 apt-get upgrade ;) 07:42:15 dist-upgrade 07:42:25 I love apt. 07:42:46 The whole notion of "shipping" or a "release" of an OS is foreign to me now. :P 07:43:17 well, dist-upgrade isn't a good idea unless you're really going from potato to sid or something 07:43:52 What in Haskell has similar functionality to associative arrays? 07:47:00 FiniteMap 07:47:02 shapr: it's quite often needed to cope with package changes in woody, IME 07:52:20 I use sid 07:53:00 I'd guess the same would apply when someone reorganises packages there 07:53:12 probably so 07:53:14 it did when woody was unstable too, IIRC 07:53:48 What provides FiniteMap? 07:53:50 but I haven't done a dist-upgrade since I went from potato to sid 07:54:09 LoganH: FiniteMap 07:54:42 shapr: have you had to install certain packages manually? 07:55:14 loganH: see Manuel Chakravarty's stuff 07:55:25 I think it's in GHC too, but I just use his version all over 07:56:24 No, I haven't. 07:56:28 I'm using GHC. 07:56:47 It's in ghc 07:58:04 Heffalump: yah, I've done that 07:59:24 shapr: ah, ok, I generally just do dist-upgrade to avoid that hassle :-) 08:00:10 Do I have to import something to get these FiniteMap functions? 08:01:26 have you found the module? just import it, if so 08:01:56 I can't tell what the name would be. 08:02:47 run ghc with -syslib data 08:02:52 then import FiniteMap should work 08:03:52 * Heffalump isn't quite sure how to work out the module interface without downloading the GHC source, though... 08:03:58 or at least hslibs 08:04:04 Ahhh. 08:04:23 if you look in /usr/lib/ghc-5.00.2/imports/ 08:04:32 (replace 5.00.2 with whatever you have installed) 08:04:37 That took care of it. 08:04:45 then you'll see a bunch of subdirectories each of which has some hi files 08:04:45 It added several packages I didn't have before. 08:05:11 Yeah, I saw FiniteMap.hi in imports/data. 08:05:30 -syslib is the way to get at those subdirectories 08:05:38 there is a packages mechanism too, but I haven't really looked at that 08:05:48 so I can't tell you how it works :-) 08:06:07 I do :set -package data 08:06:12 that gives me access to lots more stuff 08:06:30 I wonder if there's a file I can edit that does all this by default. 08:06:53 strace ghci and see what files it reads? :-) 08:07:04 or read the documentation? 08:07:17 apt-get -uf install ghc5-doc 08:08:44 that's no fun 08:09:18 ~/.ghci :P 08:09:55 ah 08:09:56 ghc-5.02: panic! (the `impossible' happened, GHC version 5.02): 08:09:58 Haha. 08:10:10 lol 08:10:17 try upgrading to 5.02.2, then report a bug 08:10:30 I think I accidentally modified a file. 08:10:58 Yep. 08:13:11 anyone mind if I post some code that's giving me problems? 08:13:33 go for it! 08:13:37 type Validator = Validations -> Validations 08:13:37 validate :: (Validations,Validator) -> Validations 08:13:37 validate (tups,func) = [ (x,y) | (x,y) <-tups, (func(x) == y)] 08:13:53 throws: 08:13:53 ERROR "Challenge.hs":24 - Type error in application 08:13:53 *** Expression : func x 08:13:53 *** Term : x 08:13:53 *** Type : [Char] 08:13:53 *** Does not match : [([Char],[Char])] 08:14:24 * chad is a little deeper into Haskell on this one than his capabilities safely allow him to be 08:15:24 chad: i'm really guessing... but maybe func x instead of func(x) ? 08:15:24 try leaving out the type signature for validate 08:15:36 dblack: they're equivalent 08:15:50 chad: see what type it infers (with hugs or ghci or something) 08:15:57 then see what type you should have written 08:16:00 * dblack_ is multitasking and should shut up :-) 08:16:13 * shapr is semitasking 08:16:14 how do i do that, heffalump? i'm in hugs. is it :type? 08:16:22 semitasking = doing several things, all of them badly 08:16:26 like windows 3.x 08:16:33 chad: yep 08:16:41 shapr: me too :( 08:17:09 validate :: Eq a => ([(b,a)],b -> a) -> [(b,a)] 08:17:28 now I just have to figure out what that means :) 08:17:38 I'm not familiar with the "Eq a" stuff yet. 08:18:29 Eq a just says that the "a"s can be tested for equality 08:18:38 bah, I'm going home. 08:18:42 --- quit: shapr ("hometime") 08:18:45 ok, thanks 08:19:32 basically its giving your function a more general type than you would have written 08:19:41 s/its/it's 08:19:43 / 08:21:08 btw ":t" is a shorthand for ":type" 08:21:14 ok 08:28:07 What does a custom compare function look like? 08:29:31 read compare in the Prelude 08:30:07 if you define an instance of class Ord for something, you'll actually get compare for free 08:30:13 if you just define <=, that is 08:30:28 alternatively define compare and you might get a more efficient implementation 08:34:26 I haven't gotten into comprehending instances and classes and all that in Haskell yet. :P 08:35:26 you'll have to to define compare, unfortunately 08:35:53 you could just define a function with a different name of type (a -> a -> Ordering) 08:35:59 again, look in Prelude.hs for that 08:46:42 --- nick: smklsmkl -> smkl 08:49:35 How would I test if a string contains a particular character? 08:50:53 a string is just a list of characters 08:51:59 * LoganH nods. 08:52:09 How does one typically check for existance of a value in a list? 08:52:18 (short of writing a simple boolean function) 08:53:09 I think you might need to write the simple boolean function 08:53:25 note that using sectioned operators, said boolean function is just (=='c') 08:54:05 oh, no, turns out that the "elem" function exists in the Prelude 08:54:12 Oh yeah. 08:54:14 I forgot about that. 08:54:17 'c' `elem` str 08:54:22 yep. 08:54:30 * Heffalump ought to have remembered that :-) 09:03:39 How does Maybe work? 09:06:18 Maybe it's time for me to get some sleep. :P 09:06:27 Maybe is just a datatype 09:06:44 it's used when there might or might not be a result 09:07:54 Couldn't match `Char' against `Maybe elt' 09:07:55 Expected type: key -> Char 09:07:55 Inferred type: key -> Maybe elt 09:11:31 ok, so you're getting a result that might or might not have something in it, and trying to assume that there always will be something in it 09:12:57 Yeah. 09:13:02 And it's a pretty safe assumption. 09:13:07 ok, then use fromJust, IIRC 09:13:32 looks like you'll need to import Maybe 09:14:17 Ok, now I have to figure out how to use this with map... 09:14:23 map (lookupFM morsecode) word 09:14:25 is what I have. 09:14:34 But lookupFM returns the Maybe value. 09:15:37 look at function composition 09:19:31 --- join: shapr (~user@p-c2fbabb9.easy.inet.fi) joined #haskell 09:21:04 so... did I miss anything? 09:21:30 not a huge amount, just me helping LoganH with some stuff 09:24:27 Heffalump: Thanks for all the help. 09:24:33 I need some sleep now. 09:25:21 good night :-) 09:25:26 what timezone are you in? 09:25:38 EST 09:26:03 getting your sleeping cycle that screwed takes some doing :-) 09:26:26 the last time I managed it was playing Civ III over Christmas 09:26:33 I find it pretty easy to do. 09:26:40 It's harder not to do it, in fact. 09:26:59 people tend to expect to see me in work sometime between 9 and 5 09:27:11 Last week I was alternating 3 hours of sleep one night followed by 12 hours of sleep the next (I have stuff I have to get up for every other day). 09:27:32 This is my way of self-adjusting so that this week won't be as bad. :P 09:27:34 Good night. 09:27:51 * shapr waves 10:08:39 --- quit: shapr (Read error: 104 (Connection reset by peer)) 10:14:32 --- join: MrCode (usr2345@206.157.248.34) joined #haskell 10:14:54 hello 10:15:06 hi :) 10:16:12 'lo 10:17:32 hey Heffalump, I'm one of those Ruby guys taking part in the LotY project 10:18:21 I was wondering what the "Haskeller's" opinion was on learning some Lambda Calculus to help in understanding the functional programming paradigm 10:20:16 ? 10:21:12 umm, you don't really need to learn most of the theoretical aspects of the lambda calculus 10:21:22 if any, really 10:21:25 OK 10:21:43 knowing that Haskell is based on this really simple language that just has abstraction and application is perhaps useful 10:22:24 OK 10:23:15 I have some other Haskell related questions 10:23:41 what is the significance of the "Gofer" module in the Hugs demo directory? 10:23:49 where does that name come from? 10:24:25 Gofer is a predecessor of Hugs 10:24:34 OIC 10:24:36 that makes sense 10:24:41 I figured it was something like that 10:24:42 it was for a language quite similar to Haskell 10:24:52 OK 10:24:59 Hugs actually stands for "Haskell users gofer system" 10:25:14 so in that module they just add some functions from Gofer's Prelude 10:25:22 ahhh...now there is some trivia 10:25:33 I was wondering that too 10:26:55 what an educational #haskell session! 10:27:40 heh 10:27:46 :-) 10:28:22 why can't you define functions on Hugs' command line? 10:28:58 I don't think there's any intrinsic reason, it's just a feature that's not there 10:29:10 OK 10:29:35 so generally you just :e to create functions, then :l and then test your functions in hugs 10:29:39 ? 10:30:03 personally, I edit stuff in a separate window 10:30:10 sure 10:30:18 what editor do you use? 10:30:23 emacs 10:30:27 OK 10:30:28 well, xemacs 10:30:31 sure 10:30:40 oh, :r is faster than :l foo after the first time you do the :l 10:30:46 I use VIM...wasn't sure if you had any Haskell related VIM tricks 10:30:55 no, but a friend probably does 10:30:57 OK, I will use :r then 10:31:13 also, where are the files you :e stored? 10:31:27 umm, no idea. Probably the current working directory 10:31:55 hehe, OK 10:32:08 you know there's syntax highlighting for Haskell in VIM? 10:32:18 yeah 10:32:37 but for some reason the lhs highlighting seems broken (at least on my install) 10:32:58 are you using the lhaskell highlighting for that? 10:33:16 yeah 10:33:30 it has problems loading the hs highlighting, which I guess it uses 10:33:46 but that is a VIM problem, not a Haskell one :) 10:34:18 so have you made any big programs in Hskl 10:36:00 one of ~5000 lines, not all written by me 10:36:02 where Hskl = Haskell (for the lazy typist) 10:36:11 OK 10:37:02 [18:34] What exactly is he doing? 10:37:02 [18:35] :set syntax=lhaskell :syntax on should work 10:37:18 --- join: Igloo (~ian@pc3-oxfo3-0-cust1.oxf.cable.ntl.com) joined #haskell 10:37:32 I just pasted your two lines :-) 10:37:33 Hello 10:38:29 'lo 10:38:39 * Heffalump pokes MrCode for signs of life 10:38:51 it is just some stupid error in the lhaskell.vim file 10:38:55 I need to fix it 10:39:59 VIM rule: if version < 600 EXCLUDES version 6 10:40:20 actually wait... 10:40:31 yes that is right 10:40:50 but that should not be the problem in this case 10:42:37 well the point is that the lhaskell.vim file does not work right in VIM 6.0 10:42:46 even though it includes a check for version 6 10:44:07 What do you get when you md5sum lhaskell.vim and haskell.vim? 10:44:23 let's see 10:44:33 well I've modified lhaskell.vim now 10:44:41 the problem is just this line: 10:44:57 source syntax/haskell.vim 10:45:12 which is what it does for version >= 600 10:45:18 I have this 10:45:19 if version < 600 10:45:19 source :p:h/haskell.vim 10:45:19 else 10:45:19 source $VIMRUNTIME/syntax/haskell.vim 10:45:19 endif 10:45:35 (after let b:hs_literate_comments=1) 10:45:35 that makes sense 10:45:40 yeah 10:45:53 somewhere on my system the $VIMRUNTIME part was lost 10:45:56 no clue why 10:46:44 OK that fixed it 10:46:45 thanks 10:46:48 I *might* have added that actually 10:46:54 heh 10:47:06 you must have 10:47:37 you could email the maintainer, John Williams 10:47:54 or I could ;) 10:48:41 Yeah, I meant to take a proper look at it but never quite got round to it 10:48:47 do you also have an error with vim.vim? 10:48:51 line 462? 10:49:04 where there is an < where there probably should be < 10:49:13 actually I think I changed that one so you prolly don't 10:49:32 I don't now, I can't remember if I fixed it before or not 10:49:46 I suspect vim.vim is one that is likely to be quickly spotted, though 10:50:16 yeah...I think I downloaded a fancier version with Ruby highlighting support...and stupid IE turned the < into < 10:50:28 I have Winblows on this laptop 10:50:29 for work 10:50:30 heh 10:50:35 :-) 10:50:42 IE did *WHAT*? 10:51:01 try saving a text file without .txt at the end as a text file in IE 10:51:04 YM it tried to render something that was presumably text/plain as HTML? 10:51:08 it turns it into HTML 10:51:21 hehe 10:51:30 * MrCode suspects Heffalump is being sarcastic 10:51:32 hehe 10:52:47 so what is your opinion on the best Haskell book? 10:53:06 IFP by Bird is the only one I have seen 10:53:11 likewise 10:53:28 And given I was lectured by him there may have been bias in his recommendation of it :-) 10:53:44 But from what I've seen on the lists it does seem to be well respected 10:54:11 OK 10:54:26 so it introduces Func Programming using Haskell? 10:54:37 Yup 10:54:42 The second edition does 10:55:45 IC 10:55:49 --- part: Vutral left #haskell 10:56:07 the other ppl in the "LotY" thing are reading the Thompson and Hudak books 10:56:24 Oh, right, you're one of them 10:56:59 yeah...I'm outta the country at the moment though so I am relying on the net 10:57:04 hmm, yes, that is broken. (having just experimented with IE and content types) 10:57:13 thank you :) 10:57:16 * Igloo goes to get dressed and cook and stuff 10:57:19 told yah 10:57:22 :-p 10:57:49 though you do get an option to choose to save it in another format 10:58:02 but in my opinion the Haskall stuff to be found on the net leaves a bit to be desired :) 10:58:11 too academic 10:58:12 heh 10:58:20 it's mostly used in academia 10:58:28 yeah I figured that 10:58:39 --- join: shapr (~user@p-c2fbabb9.easy.inet.fi) joined #haskell 10:58:41 both Igloo and myself are academics, essentially 10:58:43 for example 10:58:47 * MrCode and his friends in the LotY are trying to change that 10:58:49 well maybe 10:58:57 sure 10:59:00 I was about to say you lot seem like a good chance of changing that 10:59:02 :-) 10:59:16 yeah we are very pragmatic 10:59:24 Pragmatic Programmers to be exact 10:59:35 since that book inspired the LotY project :) 10:59:51 cool, new people! 10:59:54 though I personally so have some academic interests as well 10:59:55 are people likely to try to write decent sized programs to do real tasks in Haskell? 11:00:02 always like to expand my mind and all 11:00:16 I'm likely to write stuff in Haskell 11:00:17 Heffalump: yes quite likely 11:00:39 cool. 11:00:58 I suspect you'll run into some problems with the interfaces and stuff, so it'll be interesting to see how it goes 11:01:12 graphical user interfaces? 11:01:17 interfaces? 11:01:23 interfaces to other stuff 11:01:28 like using external libraries 11:01:37 ah yes...hmmm 11:01:40 cos there's not that many that have had Haskell interfaces written 11:01:43 that is always an issue 11:02:15 and it's a bit of a job, since the types and stuff have to be translated 11:02:41 does Haskell have SWIG-like programs? 11:02:45 SWIG? 11:03:17 it automatically generates glue code for libraries for several higher level languages 11:03:20 swig.org 11:03:28 simple wrapper and interface generator 11:03:38 perl, python, lua, at least I think 11:03:43 possibly ruby 11:03:58 umm, I'm not actually sure 11:04:10 Ruby yes 11:04:17 the FFI (foreign function interface) stuff keeps changing and I never really know what it does 11:04:22 I've never used it though 11:04:26 don't code in C much ;) 11:51:20 well good talking to you guys...I'll see you around 11:51:53 --- quit: MrCode ("bye") 11:55:35 Wrote a fastCGI interface using greencard. Found it to be really nice. 12:03:33 fastCGI? 12:11:35 persistent cgi interpreter == fast cgi 12:12:26 it's a protocol and implementation for having long-running processes sit behind a web server and handle CGI-ish requests. 12:12:38 right 12:12:39 what he said 12:12:44 saves on process startup costs.... 12:13:01 and allows the developer on the back end to do things like database connection pooling and other various caching-ish things. 12:14:36 * shapr considers playing tribes2 12:14:43 hm, do I shoot people, or do I write code... 12:14:49 sorry, attention elsewhere 12:14:56 heh 12:15:00 hi jsw, do you have any of your code online? 12:15:10 no, not yet 12:15:31 I sent an email to a guy at britishairways.com who's doing ASN.1 encoding and decoding with Haskell 12:15:32 not sure what terms I want to distribute yet 12:15:46 he says he'll probably have a webpage and some code online in a week 12:19:31 Dominic Steinitz? 12:20:28 that sounds like him 12:20:49 he posts to the Haskell list 12:21:02 yah, that's where his name went past 12:35:20 bah, I'll shoot people 12:35:27 --- quit: shapr ("shooting people") 12:39:25 ? 12:39:39 But, why shapr? "I don't like mondays." 12:59:47 --- join: shapr (~user@p-c2fbabb9.easy.inet.fi) joined #haskell 13:08:11 --- quit: chad (Read error: 104 (Connection reset by peer)) 13:25:58 --- quit: Igloo (carter.openprojects.net irc.openprojects.net) 13:27:52 whee 13:28:17 --- join: Igloo (~ian@pc3-oxfo3-0-cust1.oxf.cable.ntl.com) joined #haskell 14:00:43 hey, where can I find docs on operators like $, !, $!, etc? 14:03:04 umm, wdym by docs? 14:03:08 * Heffalump tries to remember what ! does 14:04:10 it's something about strict evaluation. 14:05:05 that's $! 14:05:20 watch your language ;) 14:05:24 * shapr snickers 14:05:25 $ is like the space that is function application, but it has very low precedence 14:05:26 :-p 14:05:40 yah, I just figured that out 14:05:51 section 6.2 of the report 14:06:05 f $ g $ h x = f (g (h x)) 14:06:15 $! is like $ but forces its argument to head-normal form first (IIRC) 14:06:28 f $! x = x `seq` f x 14:06:49 er 14:06:56 it looks like it's the opposite of $ 14:07:12 umm, I'm not sure what its precedence is 14:07:34 same as $ 14:07:37 the lowest 14:07:52 $,$!,`seq` are all at zero 14:07:55 ok 14:08:15 so a `seq` b eventually evaluates to whatever b does. 14:08:31 But how a `seq` b differs from b is that it first forces a to head-normal form, *then* evaluates b. 14:08:50 er, the docs say that seq forces evaluation to get rid of unnecessary laziness 14:09:47 right 14:10:00 --- quit: PragDave (Remote closed the connection) 14:35:22 anyone know if haskell runs on more than windows and linux? 14:36:12 solaris 14:36:15 freebsd 14:36:21 ok, non-unixy? 14:36:25 for example... 14:36:33 like? 14:36:37 could I get a binary for an ARM9 running SymbianOS? 14:36:54 I'd be amazed if you could for ghc 14:36:59 you might be able to compile hugs yourself 14:37:12 hm 14:37:18 well, it seems that ghc can output C code 14:37:30 or am I confused? 14:37:42 yes, it can 14:37:49 that's the way it gets ported, using the "hc" boot files 14:37:52 hm 14:37:55 but it's not exactly easy to actually do it 14:38:04 hm 14:38:13 (I've been trying to get a recent ghc to work on Intel Solaris for a while without luck) 14:39:25 did you ask on the ghc-users list? 14:39:53 nope 14:39:55 I probably should 14:40:32 it'd probably make your life easier 14:41:08 wow cooool 14:41:13 I haven't been trying that hard 14:41:16 ghc has macros of some flavor 14:41:24 you can do rewrite rules in the source 14:41:26 errm, they are done with cpp. 14:41:30 oh, that's slightly different 14:41:36 it's not exactly macros 14:44:52 --- join: PragDave (~dave@pragdave210.august.net) joined #haskell 14:45:07 hi Dave 14:45:13 hi there 14:46:11 * shapr tries to figure out if the debian ghc5 package has concurrent haskell support 14:46:30 * PragDave looks on in awe 14:46:39 yes 14:46:45 oh, that's coool 14:46:53 I have thirty machines at work that aren't doing anything 14:47:06 I bet I can make pretty fractals really quickly 14:50:48 * shapr laughs at haskell docs 14:51:06 whoever wrote these docs was bored and looking for excitement 14:51:13 shapr: so you're liking haskell? 14:51:17 or maybe an avid reader of PTerry Pratchett 14:51:24 heck yeah, haskell is nifty 14:51:27 I like Joy also 14:51:33 but haskell is reallly cool 14:51:49 * jemfinch is getting enamoured with SML lately. 14:51:50 jemfinch: what about you? 14:51:53 ah 14:52:04 * Heffalump has been losing his temper with SML lately 14:52:17 Haskell programmers generally know Functional Programming better than any other set of programmers, so that's why I'm here. 14:52:20 but functors are nice 14:52:40 I really *like* functional programming. 14:52:52 Heffalump: what's making you lose your temper with SML? 14:52:52 and I'm finding out that most programmers don't understand FP in the least 14:53:03 the syntax. It's horrible. 14:53:06 And the lack of type classes. 14:53:14 shapr: no, they don't -- most think that Lisp/Scheme are the end-all-be-all of FP, and they're not even close to *real* functional programming. 14:53:37 Heffalump: I'm coming from O'Caml, so I'm used to the syntax. And I'm not quite sure if I like type classes :) 14:53:52 do you like equality types? :-) 14:54:02 I dislike O'Caml too, but I haven't used it for ages 14:55:03 * jemfinch goes to do laundry and read Greek. 14:55:12 yah, I've realized that Lisp/Scheme flavors are halfway between FP and procedural 14:55:24 shapr: they're far too focused on mutation. 14:56:25 yah I agree 14:56:44 I like Haskell/ML's focus on immutable data structures. 14:58:15 Heffalump: the main reason I'm becoming enamoured with SML is because (a) a lot of research goes on in it, (b) it's not so hard to do imperative stuff. 14:58:36 for instance, there's an SML compiler that does *compile-time* garbage collection. 14:59:16 which one? 14:59:21 I don't think imperative stuff is so hard in Haskell 14:59:26 quite a bit of research goes on in Haskell 14:59:31 shapr: it is, really 14:59:54 it can be done, but it doesn't fit as nicely with the language as it does in ML 14:59:56 it can't 15:00:30 SML also has first class continuations, which I haven't had a chance to work with yet, and want to play around with :) 15:00:59 * Heffalump doesn't really grok continuations properly 15:01:05 me neither, not yet :) 15:01:19 but they're hella-powerful. 15:01:38 I would have thought Haskell could handle them nicely given that there's a monad of continuations, though 15:02:12 * jemfinch has to go. 15:02:15 Heffalump: Recent ghc releases have had problems with porting, see my messages on one of the ghc lists. 5.02 may be better but I haven't seen hc files appear yet and don't really have time right now to prod it anyway 15:02:28 igloo: oh, ok 15:02:39 I shouldn't have wasted my time then :-) 15:03:09 I want to play with first class continuations 15:03:24 I wish Stackless Python would get moving 15:03:34 I understand continuations well enough to use them in Python at least 15:03:40 dunno what I'd do with them in Haskell 15:07:00 btw, has anyone noticed that stack-based functional programming languages appear much like some of the library manipulation decks in Magic : The Gathering? 15:07:09 or was that comment way off-topic? 15:07:39 * Heffalump has never played it, sorry :-) 15:07:49 it's way too addictive anyway 15:07:51 don't try it 15:10:15 * Heffalump stomps on a bug he found while trying to track down a different bug he found while trying to track down the bug he found trying to track down a bug someone pointed out on Monday 15:10:31 where Monday = a week ago 15:13:39 --- quit: dmiles (Read error: 104 (Connection reset by peer)) 15:19:33 shapr: stackless python is pretty much dead, I think. 15:20:13 --- quit: jewel (Read error: 110 (Connection timed out)) 15:24:52 jemfinch: nah, it's been reborn as of two days ago 15:25:09 really? 15:25:10 stackless.com? 15:25:49 yup 15:26:39 it looks the same as it always has... 15:27:25 the cvs repository is up as of yesterday 15:27:40 I don't know how much of it has made it to the website, but the mailing lists are alive 15:28:24 the license on stackless sux0rs. 15:28:39 what is the license? 15:29:01 same as python, with one additional clause: "This code can't be integrated into Python unless it *becomes* Python" 15:29:32 apparently he did some significant amount of optimization, and didn't want them stealing that without putting continuations into Python like he had them implemented. 15:30:38 adding first-class continuations should make a language *slower*, but he got an 8% speed improvement in windows. 15:30:46 so he did a lot more than just add continuations. 15:34:26 * jemfinch leaves again. 15:39:56 if you ask Andy Appel continuations and heap allocation are the way everything should be. 15:44:24 * Igloo looks at FOLDOC 15:44:35 So what's the great advantage of it? 15:45:05 It seems most unnatural to me 15:47:18 Hmmm, I should go to bed 15:52:41 continuations are much more flexible and powerful than functions, because functions are a subset of continuations 15:52:48 * shapr looks up Andy Appel 15:56:15 wow, he's prolific 15:56:24 yes 15:56:43 *AND* he thinks heap allocation is cheap 15:57:18 that means nothing to me 15:57:23 I don't have enough context 15:57:37 is he right? 15:57:57 I don't buy his argument. 16:30:54 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 17:56:41 --- quit: dmiles (Read error: 104 (Connection reset by peer)) 18:42:51 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 22:01:36 --- quit: kepler (Read error: 110 (Connection timed out)) 22:03:54 --- quit: smkl (Remote closed the connection) 22:03:55 --- join: smkl (~sami@glubimox.yok.utu.fi) joined #haskell 23:46:55 --- join: juhp (~petersen@firebox-ext.jp.redhat.com) joined #haskell 23:47:47 hi juhp! 23:48:53 hi there! 23:48:58 how's it going? 23:49:22 have an annoying problem with popenhs 23:55:27 it's going well 23:55:32 I don't know anything about popenhs 23:55:48 but maybe if you describe your problem to me, then it will suddenly become clear to you? 23:58:03 --- part: shapr left #haskell 23:58:38 --- join: shapr (~user@p-c2fbabb9.easy.inet.fi) joined #haskell 23:59:59 --- log: ended haskell/02.01.21