Available formats: content-negotiated html turtle (see SIOC for the vocabulary)
Back to channel and daily index: content-negotiated html turtle
These logs are provided as an experiment in indexing discussions using IRCHub.py, Irc2RDF.hs, and SIOC.
| 00:01:45 | <dainanaki> | hey is anyone in here using ghc 6.6.1 on an intel mac? |
| 00:05:07 | <nominolo> | me |
| 00:05:41 | <nominolo> | whaddoyouwannaknow? |
| 00:05:52 | <ChilliX> | dainanaki: me, too, works fine |
| 00:19:09 | <dainanaki> | well i get the following error: ian$ /usr/local/bin/ghci |
| 00:19:11 | <dainanaki> | dyld: Library not loaded: GNUreadline.framework/Versions/A/GNUreadline |
| 00:19:11 | <dainanaki> | Referenced from: /usr/local/lib/ghc-6.6.1/ghc-6.6.1 |
| 00:19:11 | <dainanaki> | Reason: image not found |
| 00:19:11 | <dainanaki> | Trace/BPT trap |
| 00:23:28 | <nominolo> | yes, you have to install that separately |
| 00:23:40 | <nominolo> | isn't there a link on the homepage? |
| 00:23:52 | <dainanaki> | not that i saw... |
| 00:24:43 | <dainanaki> | and as a side note, how do i set PATH? |
| 00:24:54 | <Binkley> | dainanaki: that depends what shell you're using |
| 00:25:34 | <dainanaki> | the standard whatever that comes with os x? |
| 00:25:39 | <nominolo> | dainanaki: ok, it's buried in a link to a mail message. not quite obvious |
| 00:25:43 | <dainanaki> | looks like bash |
| 00:26:07 | <nominolo> | i had 6.6 installed before, so i got that |
| 00:26:19 | <dainanaki> | nominolo, could you post the link perhaps? |
| 00:27:16 | <Binkley> | dainanaki: declare -x PATH=$PATH:[whatever] |
| 00:27:42 | <dainanaki> | thank you Binkley |
| 00:27:59 | <nominolo> | dainanaki: i'm looking. i think i installed libreadline when ghc wasn't a macports package yet. |
| 00:28:40 | <dainanaki> | would i have to install via macports now? |
| 00:30:06 | <dainanaki> | well it looks like it'll let me get the GNUreadline-framework, but I'm getting a 404 on the GMP.framework |
| 00:31:13 | <nominolo> | uh. |
| 00:31:54 | <nominolo> | ok, my first ghc installation was the 6.5.20060608 that installed GMP for me |
| 00:32:20 | <nominolo> | since then i no longer had to care. i assume macports now takes care of this |
| 00:33:00 | <illusionalSin> | hi |
| 00:33:00 | <dainanaki> | well i installed 6.6 thinking that would take care of it since 6.6.1 is a more incremental relaese, but for some reason it won't recognize the 6.6 data? |
| 00:33:18 | <dainanaki> | when i install 6.6.1 again, that is |
| 00:34:21 | <nominolo> | hm, that shouldn't make a difference for the installed frameworks |
| 00:34:46 | <Igloo> | The 6.6 bindist included some frameworks, I think |
| 00:35:05 | <dons> | ?users |
| 00:35:06 | <lambdabot> | Maximum users seen in #haskell: 340, currently: 285 (83.8%), active: 43 (15.1%) |
| 00:35:27 | <nominolo> | maybe this helps? http://www.haskell.org/pipermail/glasgow-haskell-users/2007-May/012576.html |
| 00:35:30 | <lambdabot> | Title: ghc-6.6.1 Mac (Darwin) Binary Dists, http://tinyurl.com/2hya9r |
| 00:35:31 | <chessguy> | @quote |
| 00:35:31 | <lambdabot> | SamB says: * SamB wonders why oh. |
| 00:36:12 | <dainanaki> | nominolo, that third link gives me a 404 |
| 00:36:54 | <chessguy> | and a bunch of german cursing |
| 00:36:54 | <nominolo> | yeah, it should be "GMP-Framework" |
| 00:37:05 | <nominolo> | ie, s/./-/ |
| 00:37:19 | <nominolo> | the first link has a link to the correct address |
| 00:37:31 | <nominolo> | http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/hets/mac/GMP-framework.zip |
| 00:37:35 | <lambdabot> | http://tinyurl.com/265yrp |
| 00:38:01 | <nominolo> | chessguy: no, that's no cursing |
| 00:38:16 | <dainanaki> | awesome, so where do i stick these frameworks |
| 00:38:21 | <chessguy> | technically, s/./-/ wouldn't work in this case, but i guess i shouldn't be pedantic about it... |
| 00:38:22 | <dibblego> | > let fac = \n -> if n == 1 then 1 else n * fac (n -1) in fac 5 -- how do I write this without referring to fac? |
| 00:38:23 | <lambdabot> | 120 |
| 00:38:29 | <ChilliX> | IMHO, the easiest way to get GHC on an intel mac is to install macports and type "sudo port install ghc" (the rest is automatic) |
| 00:38:39 | <chessguy> | > product [1..5] |
| 00:38:41 | <lambdabot> | 120 |
| 00:38:48 | <dibblego> | good poit |
| 00:39:05 | <chessguy> | > let fac n = product [1..n] in fac 5 |
| 00:39:06 | <lambdabot> | 120 |
| 00:39:10 | <dainanaki> | ok is X11 installed when i install xcode? |
| 00:39:22 | <chessguy> | @pl f n = p [1..n] |
| 00:39:23 | <lambdabot> | f = p . enumFromTo 1 |
| 00:39:36 | <chessguy> | cute |
| 00:39:40 | <nominolo> | dibblego: /Library/Frameworks |
| 00:39:47 | <ChilliX> | dainanaki: no, you need to install X separately from the install disks that came with yoru mac |
| 00:39:49 | <nominolo> | i think it's described on the first link |
| 00:40:11 | <dibblego> | nominolo, I don't know what you mean |
| 00:40:17 | <nominolo> | uh, sry, dibblego |
| 00:40:28 | <nominolo> | meant to address dainanaki |
| 00:40:35 | <dibblego> | ok |
| 00:42:39 | <dainanaki> | ok well for macports i don't see on the install disk where the X11 stuff is |
| 00:43:53 | <nominolo> | no it's on the macosx dvd |
| 00:44:08 | <ChilliX> | dainanaki: you should have got some DVDs with your mac |
| 00:44:16 | <dainanaki> | yeah i have os x install disk 1 and 2 |
| 00:44:21 | <nominolo> | same as where xcode is on, i think |
| 00:44:29 | <ChilliX> | put disk 1 into your mac |
| 00:44:34 | <dainanaki> | oh lemme look |
| 00:44:49 | <ChilliX> | the macports page has a description of how to do it |
| 00:45:00 | <ChilliX> | (there is X11 in macports, but they recommend to not use it) |
| 00:45:15 | <ChilliX> | ( but use the Apple one instead) |
| 00:47:59 | <zorg0f> | hey, im having some problems getting my head around wildcards / pattern matching and i was hoping someone could help explain |
| 00:48:20 | <Binkley> | we're all ears |
| 00:48:59 | <zorg0f> | for example: tail x:xs = xs . what's the difference with tail(_:xs):xs |
| 00:49:10 | <zorg0f> | sorry, that last colon should be an equals |
| 00:49:50 | <dmwit> | nothing |
| 00:50:15 | <dmwit> | well |
| 00:50:20 | <zorg0f> | just a different method? |
| 00:50:39 | <Binkley> | zorg0f: in the first one, you're giving a name to the first element of the list, and in the second, you're saying "I don't care what the first element is" |
| 00:50:39 | <Eelis> | the _ makes it more explicit that the term is not used |
| 00:50:40 | <dmwit> | The only difference is that 'x' is bound on the right-hand side of the '='; but since it is not used there, in practice there is no difference. |
| 00:50:45 | <Binkley> | but the two versions are equivalent because x isn't used |
| 00:51:01 | <zorg0f> | so, basically using the _ wildcard "bins" *whatever*? |
| 00:51:13 | <Eelis> | within the bounds of the type, yes :) |
| 00:51:46 | <zorg0f> | ah ok. i think it was just the example that was confusing me. i assumed there would be more of a difference |
| 00:51:49 | <zorg0f> | cheers |
| 00:53:20 | <zorg0f> | im not sure haskell could ever become my daily language of choice - but im beginning to get the hang of it :D |
| 00:53:36 | <Eelis> | give it time ;) |
| 00:54:22 | <Binkley> | ?quote vending |
| 00:54:22 | <lambdabot> | JohnMeacham says: I liken learning haskell to tipping over a vending machine. you can't just push it, you gotta rock it back and forth a few times building up momentum until bam! suddenly the flash |
| 00:54:22 | <lambdabot> | of insight hits and it all makes sense. |
| 00:54:41 | <zorg0f> | heh |
| 00:55:25 | <zorg0f> | unfortunately i have an exam coming up, so i gotta tip the vending machine a little :P |
| 00:55:38 | <illusionalSin> | heh, i had a haskell test 2day...just thought id say |
| 00:56:00 | <zorg0f> | how did it go? |
| 00:56:11 | <illusionalSin> | well i past :D |
| 00:56:27 | <illusionalSin> | got A, worth 20% tho overall |
| 00:56:59 | <zorg0f> | nice |
| 00:57:19 | <illusionalSin> | ta :) |
| 01:04:19 | <chessguy> | @quote machine |
| 01:04:19 | <lambdabot> | tibbe says: I will definately check it out, the thing is that someone turned on the laundry machine in the room next door so my internet connection isn't working well ;) |
| 01:04:33 | <chessguy> | @quote rock.machine |
| 01:04:33 | <lambdabot> | No quotes match. stty: unknown mode: doofus |
| 01:04:35 | <zorg0f> | [x|x<-[1..10],x 'mod' 3 == 0] |
| 01:04:43 | <chessguy> | @quote tip.machine |
| 01:04:43 | <lambdabot> | No quotes match. Do you think like you type? |
| 01:04:46 | <zorg0f> | i'm getting: Improperly terminated character constant |
| 01:04:52 | <monochrom> | @quote machine.tip |
| 01:04:52 | <lambdabot> | No quotes match. You speak an infinite deal of nothing |
| 01:04:58 | <monochrom> | @quote machine.*tip |
| 01:04:58 | <lambdabot> | No quotes match. And you call yourself a Rocket Scientist! |
| 01:05:06 | <monochrom> | @quote rock |
| 01:05:06 | <lambdabot> | JohnMeacham says: I liken learning haskell to tipping over a vending machine. you can't just push it, you gotta rock it back and forth a few times building up momentum until bam! suddenly the flash |
| 01:05:06 | <lambdabot> | of insight hits and it all makes sense. |
| 01:05:12 | <monochrom> | THat one! |
| 01:05:17 | <chessguy> | > [x|x<-[1..10],x `mod` 3 == 0 |
| 01:05:17 | <lambdabot> | Parse error |
| 01:05:23 | <chessguy> | > [x|x<-[1..10],x `mod` 3 == 0] |
| 01:05:28 | <lambdabot> | [3,6,9] |
| 01:05:44 | <chessguy> | zorg0f: ^^ you need back-ticks |
| 01:06:21 | <zorg0f> | oh right |
| 01:06:23 | <zorg0f> | tta |
| 01:06:25 | <zorg0f> | ta* |
| 01:06:57 | <zorg0f> | :) |
| 01:08:51 | <zorg0f> | that's quite a nice bot, actually. |
| 01:09:46 | <monochrom> | @botsnack |
| 01:09:46 | <lambdabot> | :) |
| 01:12:29 | <chessguy> | @quote bot |
| 01:12:29 | <lambdabot> | SamB says: [<lambdabot> emertens says: screw ruby on rails, I'm using snakes on a plane] <SamB> is that a Python web framework? |
| 01:13:06 | <SamB_XP_> | @quote bot |
| 01:13:06 | <lambdabot> | dibblego says: [in ##c] <dibblego> ?type map <SamB> no lambdabot in ##c, silly! <dibblego> I'm so used to lambdabot following me around |
| 01:13:27 | <SamB_XP_> | @quote bot |
| 01:13:27 | <lambdabot> | Lemmih says: Two lambdabot days is probably like 8 human days. |
| 01:14:03 | <mlh> | @quote vending |
| 01:14:03 | <lambdabot> | JohnMeacham says: I liken learning haskell to tipping over a vending machine. you can't just push it, you gotta rock it back and forth a few times building up momentum until bam! suddenly the flash |
| 01:14:03 | <lambdabot> | of insight hits and it all makes sense. |
| 01:14:17 | <mlh> | as long as it doesn't fall on you I guess |
| 01:19:05 | <nominolo> | @quote human |
| 01:19:05 | <lambdabot> | monochrom says: krad! I'm reading Bird's haskell book now. It has fusion, parser monad, and monad transformers! If I read this book instead of Paulson's ML book ten years ago, the history of the |
| 01:19:05 | <lambdabot> | entire human race would have to be rewritten! |
| 01:21:44 | <migraine> | ugh I need it to be more lazy... |
| 01:23:36 | <dainanaki> | haskell, where laziness is a good thing |
| 01:24:16 | <augustss> | but with a sprinkle of strictness |
| 01:28:00 | <zorg0f> | i should really go to bed. thanks for the help folks. |
| 01:28:02 | <zorg0f> | nite |
| 01:32:31 | <migraine> | i <- hGetContents hndl >>= sequence (map (hPutStr hndl) ((processInput . lines) i)) |
| 01:32:38 | <migraine> | if processInput is "Somestring" : somefunc |
| 01:32:47 | <migraine> | shouldn't somestring get printed before somefunc is called? |
| 01:34:48 | <stmartin> | How can I cast a Char to an Int? Char seems not to be an Integral, and I need to use Data.Bits ops on it. |
| 01:35:05 | <Igloo> | Use ord and chr |
| 01:35:33 | <stmartin> | Ah, of course. |
| 01:35:43 | <augustss> | fromEnum |
| 01:35:46 | <dainanaki> | string manipulation = fun |
| 01:36:08 | <dons> | heya augustss. how's code? |
| 01:36:18 | <stmartin> | augustss: excellent. Thanks |
| 01:36:38 | <augustss> | oh, same same |
| 01:36:41 | <stmartin> | dainanaki: not exactly. Making a UTF8 encoder for the fun of it. |
| 01:37:40 | <dons> | hey ndm. up late. |
| 01:37:54 | <dons> | i wonder if localtime works on cgi interfaces... |
| 01:37:55 | <dons> | ?time ndm |
| 01:37:57 | <lambdabot> | Local time for ndm is Mon May 21 20:37:56 2007 |
| 01:37:59 | <dons> | yeah |
| 01:38:07 | <ndm> | hi dons, yeah, couldn't sleep |
| 01:38:27 | <ndm> | i talked to my supervisor, and he said i shouldn't release Catch until after the ICFP reviewing result |
| 01:38:37 | <ndm> | since they specifically say "don't introduce new results in" |
| 01:38:49 | <dons> | hmm. |
| 01:38:59 | <dons> | that's in the review rebuttal though. |
| 01:39:10 | <dons> | i guess that does stop you saying, 'yo, look here' |
| 01:39:21 | <ndm> | yeah, but i guess it holds until after they've made the decision |
| 01:39:36 | <dons> | but that doesn't really prevent you from releasing. |
| 01:39:38 | <ndm> | especially now its no longer anonomous |
| 01:39:41 | <dons> | you just can't cite stuff that was released. |
| 01:39:54 | <ndm> | it doesn't really, but my supervisor says its probably best - given its only a month to wait |
| 01:40:06 | <dons> | was that colin's opinion? that we shouldn't release during the review period? |
| 01:40:18 | <dons> | or do you have a new supervisor ? :-) |
| 01:40:33 | <ndm> | yes - since it can give the impression that you are trying to sneak in new results - even if you aren't |
| 01:40:39 | <ndm> | always colin :) |
| 01:40:41 | <dons> | yeah, i see. |
| 01:40:44 | <ndm> | (for 5 years now) |
| 01:40:53 | <ndm> | i was going to make a pre-release, to you and a few others, private but not particularly secret |
| 01:41:09 | <augustss> | i can't say i agree with colin on this |
| 01:41:10 | <ndm> | and then as soon as the review is done, i can fully release that - treat you lot as alpha testers |
| 01:41:10 | <dons> | yeah, i'd like to get a bit more catch into the xmonad dev cycle |
| 01:41:20 | <dons> | i.e. run it on every commit, like with QC. |
| 01:41:29 | <dons> | but i need a widely available tarball for that |
| 01:41:43 | <ndm> | i don't particularly agree either, but it is only a month to wait, so its not that big an issue |
| 01:41:48 | <dons> | yeah |
| 01:42:08 | <ndm> | dons, it still depends on Yhc being installed, which may be too much to ask of everyone |
| 01:42:21 | <dons> | yeah, that's a bit problematic |
| 01:42:37 | <ndm> | i do have an agreement that my Haskell Workshop paper will be based on code already in hackage before i submit the paper |
| 01:42:38 | <dons> | so it uses yhc as a compiler frontend library? |
| 01:42:42 | <ndm> | yep |
| 01:42:52 | <ndm> | could just as easily use GHC, if they didn't have a broken Core library |
| 01:43:02 | <dons> | i wonder if you could break off the frontend as a standalone. or yeah, fix core. |
| 01:43:24 | <dons> | it would be ideal to just cabal-install yhc-frontend ; cabal-isntall catch |
| 01:43:48 | <dons> | to be used widely, the yhc dep has to be avoided somehow |
| 01:43:48 | <ndm> | Yhc front end will be cabal-install'able in about 2 months, after Andrew finishes his phd |
| 01:43:53 | <dons> | ah ok. |
| 01:44:13 | <ndm> | and once the GHC.Core thing is done, I can map GHC.Core -> Yhc.Core trivially |
| 01:44:28 | <dons> | yeah, i can't really adopt it as a foundational tool in xmonad, till basic hackage install works for the toolchain. |
| 01:44:41 | <dons> | ah so you could -fext-core, and then process that with catch (and no yhc?) |
| 01:45:20 | <ndm> | yep, easily |
| 01:45:24 | <dons> | augustss: btw, do you know of any other useful static checkers done for haskell? we're using QuickCheck and Catch (ndm's pattern match verifier). but there must be some other good extended static checking tools we could dig up, to apply to xmonad. |
| 01:46:14 | <ndm> | dons, my research turned up a few tools, but none that ever supported H98 even... |
| 01:46:28 | <dons> | hmm. what kind of things? |
| 01:46:34 | <dons> | (oh ,they're in the paper?) |
| 01:46:36 | <ndm> | there were strictness analysers |
| 01:46:51 | <ndm> | no, none of them were within a million miles of practical enough to get into the paper |
| 01:46:59 | <dons> | ah yes, there's julian sewards anna. |
| 01:47:03 | <ndm> | plus there are crazy types |
| 01:47:16 | <dons> | there's Agda, of course. ghc core + proof checking. |
| 01:47:22 | <dons> | but that's hmm, maybe that's too much. |
| 01:47:27 | <ndm> | ESC/Haskell is the perfect one to use |
| 01:47:31 | <ndm> | (if it worked...) |
| 01:47:38 | <dons> | yeah. that's what we want. |
| 01:47:50 | <ndm> | me too! |
| 01:47:51 | <dons> | we need to get dana on here, so we can pester her about it. |
| 01:48:10 | <ndm> | she's years away from a practical tool, from what i saw |
| 01:48:17 | <dons> | there's HPC as well. that's pretty practical. |
| 01:48:27 | <ndm> | but the tool is exactly what you want, when it arrives |
| 01:48:31 | <dons> | so we could use that to check that QC tests exercise the code we think it does. |
| 01:48:43 | <ndm> | yep, HPC is cool |
| 01:48:59 | <ndm> | although the integrated one is 6.8 only |
| 01:49:06 | <dons> | yeah. |
| 01:49:10 | <ndm> | you can of course use the stand alone hpc |
| 01:49:47 | <dons> | any other checkers floating around your research group? |
| 01:49:53 | <dons> | colin has some secret tools? |
| 01:50:28 | <ndm> | yes, there is one secret tool floating around our group, but i'm not allowed to tell you what it is... |
| 01:50:35 | <dons> | heh |
| 01:50:43 | <ndm> | its a really good one as well |
| 01:50:44 | <dino-> | The generators in list comprehensions, are those "drawn from" actions in the list monad? |
| 01:51:05 | <ndm> | dons, you've changed StackSet - it now uses pattern guards again! |
| 01:51:22 | <dons> | yeah, sorry, i mean to h98 it again. |
| 01:51:35 | <dainanaki> | oh to be more knowledgable in the ways of haskell :| |
| 01:51:39 | <ndm> | plus the comment in view reads a bit like "pain for neil" |
| 01:51:46 | <ndm> | -- 'Catch'ing this might be hard. Relies on monotonically increasing |
| 01:51:52 | <ndm> | -- workspace tags defined in 'new' |
| 01:51:58 | <dons> | ndm. yeah. hmm. i'm thinking of replacing error with 's' |
| 01:52:11 | <ndm> | ACTION suspects thats not true, and not an automatic proof even if it was |
| 01:52:54 | <ndm> | dons, actually - i was talking to Matt today and he says he's aiming to release Reach (the cool verifier) within a few weeks, so may you can have more super-funky proofs |
| 01:54:15 | <dons> | ooh. oo. well, let him know we're keen for more checking, and will happily try out alpha software. |
| 01:54:43 | <ndm> | will do |
| 01:54:54 | <Nomius> | Can I do? case (something that gives me maybe) of Nothing -> Nothing Just x -> if x then ? |
| 01:55:29 | <dons> | yeah |
| 01:55:49 | <dons> | > case Just 2 of Nothing -> Nothing ; Just x | x == 2 -> Just 7 | otherwise -> Nothing |
| 01:55:50 | <lambdabot> | Just 7 |
| 01:56:15 | <Nomius> | Thanks dons |
| 01:56:31 | <dons> | the guard could just as easily be an if/then/else or arbitrary expression |
| 01:58:13 | <ndm> | dons, are you willing to move to abort x = error x in xmonad? |
| 01:58:19 | <migraine> | nevermind, I found the problem... g'night |
| 01:58:30 | <dons> | ndm, yeah. |
| 01:58:35 | <dons> | ndm, if you want to patch that. |
| 01:58:49 | <ndm> | ok, i'll make sure i hack that in to the release of Catch |
| 01:59:04 | <ndm> | not right now - it doesn't Yhc compile for me |
| 01:59:18 | <ndm> | if you are happy though i'll send in a patch once i've got the Catch supported sorted |
| 01:59:49 | <dons> | ok. |
| 02:01:49 | <dainanaki> | so what are you guys working on anyways? |
| 02:02:47 | <dons> | dainanaki: we're using ndm's pattern match verifier to check that the xmonad window manager core contains no unhandled patterns |
| 02:03:25 | <ndm> | did we come to any end decision as to where the SOC projects would be hosted? |
| 02:03:37 | <dons> | i think maybe we can use the new community server! |
| 02:03:47 | <dons> | otherwise, d.h.o/soc/ again seems reasonable |
| 02:03:53 | <dainanaki> | oh i heard about xmonad |
| 02:04:05 | <dainanaki> | that sounds like a neat project you guys have going |
| 02:04:15 | <dons> | its quite fun. |
| 02:04:33 | <dainanaki> | perhaps once i learn things about haskell i can help out |
| 02:11:32 | <ndm> | dons, if i suggested doing guihaskell with hs-plugins, what would you say? |
| 02:11:42 | <ndm> | its too bitrotted and you'd be in for a world of pain? |
| 02:11:58 | <dons> | hmm. i'd suggest going with ghc-api |
| 02:12:06 | <dons> | works for yi 0.2 |
| 02:12:09 | <ndm> | and if it was developed with clean separation between components, how hard would it be to hs-plugins/ghc-api it afterwards |
| 02:12:14 | <dons> | and is likely to be maintained into the future |
| 02:12:22 | <dons> | whereas hs-plugins will be bare bones, I think. |
| 02:12:32 | <dons> | hmm. good question. |
| 02:12:46 | <dons> | dynamicity really influences the app architecture |
| 02:13:02 | <dons> | i think unless you're really careful, best to start with the ghc-api model, first, rather than try to retrofit it |
| 02:13:16 | <ndm> | i can see that guihaskell will merely parameterise by allow buttons to be added, i doubt it will be much more |
| 02:13:28 | <dons> | we tried hIDE on h-splugins, if you recall. too heavyweight. |
| 02:13:36 | <ndm> | yes, i remember |
| 02:13:40 | <dons> | and yi 0.2 on ghc-api has got much further, much faster. |
| 02:13:48 | <dons> | in particular, full expression eval on the fly works |
| 02:13:58 | <dons> | somethiing difficult to do with module-based hs-plugins |
| 02:14:04 | <ndm> | yeah |
| 02:14:13 | <ndm> | thats something that we don't require for guihaskell though |
| 02:14:15 | <dons> | the downside is that hs-plugins gives optimised native code |
| 02:14:29 | <dons> | so for rarely changing components, optimised native code is probably an advantage |
| 02:15:44 | <dons> | ndm, i wonder if asking for more static checking tools on haskell-cafe@ is worthwhile? |
| 02:15:45 | <ndm> | hmm, i think i'll recommend guihaskell goes without hs-plugins/ghc-api for now |
| 02:15:50 | <dons> | maybe it'll uncover some other secret tools |
| 02:16:07 | <dons> | ndm, probably best to get something working :-) |
| 02:16:10 | <ndm> | dons, perhaps, who knows whats out there and secret - i bet the programmatica people have something hidden |
| 02:16:11 | <mdmkolbe|home> | I'd like to try Yi, but don't have darcs and only a minimal GHC (university machine). The only snapshots I could find are at least a year old. Are there any options for installing it? |
| 02:16:29 | <dons> | ndm, yeah, those guys have stacks of code we don't see. |
| 02:16:40 | <dons> | mdmkolbe|home: hmm. its on hackage now. |
| 02:17:35 | <ndm> | i bet galois also have something |
| 02:20:09 | <dainanaki> | how long would i reasonably wait for ghc to compile before deciding it has frozen on a macbook pro |
| 02:21:56 | <ndm> | dainanaki: 1 day |
| 02:22:11 | <Korollary> | heh |
| 02:22:20 | <ndm> | dainanaki: compiling GHC, or using GHC to compile a program? |
| 02:22:30 | <dainanaki> | compiling GHC |
| 02:22:31 | <ndm> | 1 day or 1 minute, depending on the question |
| 02:22:43 | <dainanaki> | its been sitting here for like an hour |
| 02:22:50 | <ndm> | no new messages? |
| 02:22:51 | <Korollary> | on the same module? |
| 02:22:55 | <dainanaki> | yeah |
| 02:23:04 | <dainanaki> | oh wait |
| 02:23:12 | <dainanaki> | i just killed it and cleaned the dir |
| 02:23:13 | <dainanaki> | and restarted |
| 02:23:19 | <dainanaki> | woosh its past |
| 02:23:23 | <dainanaki> | nvm |
| 02:26:41 | <ndm> | anyway, sleep time now |
| 02:26:46 | <ndm> | night all! |
| 02:28:30 | <mdmkolbe|home> | dons: ok, I found it |
| 02:28:58 | <mdmkolbe|home> | does Setup install default to my home directory if I'm not root? |
| 02:29:59 | <Korollary> | are you talking about cabal? |
| 02:30:10 | <mdmkolbe|home> | Korollary: yeah, I've never used Cabal before |
| 02:31:04 | <Korollary> | you need to pass a --prefix arg to configure |
| 02:34:59 | <dainanaki> | i've heard mixed reviews of hopengl |
| 02:35:03 | <dainanaki> | is it any good? |
| 02:36:39 | <mdmkolbe|home> | foiled ... no alex preprocessor available |
| 02:37:34 | <dons> | is that just a cabal warning? |
| 02:37:38 | <dons> | not actually a requirement? |
| 02:37:55 | <mdmkolbe|home> | $ runghc Setup.hs build |
| 02:37:56 | <mdmkolbe|home> | Preprocessing library yi-vty-0.2... |
| 02:37:56 | <mdmkolbe|home> | Setup.hs: Yi/Syntax/Haskell.x: no alex preprocessor available |
| 02:37:59 | <mdmkolbe|home> | it's a build error |
| 02:38:06 | <Korollary> | yi-vty requires it |
| 02:38:16 | <SamB_XP_> | huh. |
| 02:38:17 | <Korollary> | @where alex |
| 02:38:17 | <lambdabot> | http://www.haskell.org/alex/ |
| 02:39:46 | <mdmkolbe|home> | ACTION builds alex |
| 02:42:42 | <mdmkolbe|home> | hmm, it seems cabal doesn't mkdir a prefix directory that doesn't exist yet (I noticed b/c I use stow) |
| 02:43:07 | <Korollary> | that sounds right. does autoconf's configure create it? |
| 02:46:32 | <mdmkolbe|home> | aha! cabal dosn't expand the ~ in a prefix |
| 02:52:16 | <mdmkolbe|home> | yi haw, it built |
| 02:55:45 | <mdmkolbe|home> | does yi have a tutorial yet? (other than the paper) |
| 02:57:13 | <monochrom> | ~ is expanded by the shell |
| 02:58:18 | <mdmkolbe|home> | monochrom: not if I do '--prefix=~/stow/yi', I had to do '--prefix=`echo ~/stow/yi`' |
| 02:59:07 | <monochrom> | ' tells the shell to not expand |
| 02:59:23 | <monochrom> | err nevermind |
| 02:59:41 | <mdmkolbe|home> | monochrom: the ' was meta syntax (I only typed it in IRC) |
| 02:59:53 | <monochrom> | some shells don't expand ~ |
| 03:00:00 | <mdmkolbe|home> | it was bash |
| 03:00:35 | <monochrom> | fun. it may have something to do with = immediately preceding ~ |
| 03:01:28 | <LoganCapaldo> | yep its the equal sign |
| 03:01:32 | <LoganCapaldo> | or at least IME |
| 03:01:57 | <LoganCapaldo> | or not the equal sign per se but the lack of a space |
| 03:03:47 | <LoganCapaldo> | an alt. method is to do --prefix=$HOME/stow/yi instead of ~ |
| 03:04:05 | <mdmkolbe|home> | LoganCapaldo: good idea |
| 03:06:44 | <dibblego> | what does "Catch (Neil's pattern match verifier)" do? makes sure your pattern matching is exhaustive? |
| 03:07:38 | <monochrom> | Makes sure if your pattern matching is not exhaustive, no usage triggers the missing cases. |
| 03:07:59 | <dibblego> | how can you do that? it seems impossible |
| 03:08:35 | <TSC> | I guess can you figure out which constructors are used, and follow their possible existence around |
| 03:09:57 | <monochrom> | It is as possible as writing correct programs. |
| 03:10:20 | <dons> | dibblego: static analysis (i.e. the same way the human reader knows there's no pattern failures :) |
| 03:10:30 | <dibblego> | I guess |
| 03:10:36 | <dons> | an exapmle: |
| 03:10:36 | <dons> | with :: b -> (Stack a -> b) -> StackSet i a s -> b |
| 03:10:36 | <dons> | with dflt f s = case stack (workspace (current s)) of Empty -> dflt; v -> f v |
| 03:10:52 | <dons> | catch was able to check that the function 'f' only ever gets a non-Empty Stack value |
| 03:11:03 | <dons> | so that this code is fine: |
| 03:11:05 | <dons> | index = with [] $ \(Node t l r) -> reverse l ++ t : r |
| 03:11:13 | <dons> | even though the right hand side only matches on Node, not on Empty. |
| 03:11:26 | <dibblego> | I see |
| 03:11:41 | <dons> | you interested in more static checking too , eh? |
| 03:12:01 | <dibblego> | it certainly interests me |
| 03:12:16 | <dibblego> | I had a debate with a Lisper this morning, but felt most inept at defending my position |
| 03:12:20 | <monochrom> | Half a year of studying static checking or model checking or formal methods will rewrite your mind forever. |
| 03:12:51 | <monochrom> | You will never look at program bugs the same way again. |
| 03:13:07 | <dons> | definitely. |
| 03:13:19 | <dibblego> | I have a feeling that I already look at them that way |
| 03:13:26 | <dons> | i boggle now when I see comments such as " a fully developed human being with moderate programming experience should be able to verify correctness without resorting to convulved automatic checking." |
| 03:13:26 | <jfredett> | monochrom, rewrite my mind? sounds like fun, where do I sign up? |
| 03:13:30 | <dibblego> | or tend toward that way anyway |
| 03:13:30 | <dons> | :-) |
| 03:13:42 | <monochrom> | U of Toronto has formal method courses. |
| 03:13:47 | <dons> | monochrom: it teaches you not to trust humans to get things right. :-) |
| 03:13:51 | <dibblego> | dons, I find that quite audacious |
| 03:13:59 | <jfredett> | monochrom, hmm, too far for me... know any good books? |
| 03:14:10 | <dons> | dibblego: yeah, only someone who never verified code would say that :-) |
| 03:14:33 | <dons> | and it helps to subscribe to the view that difficult of formal verification, corresponds to difficulty of human reasoning about the same code |
| 03:14:50 | <monochrom> | It depends on program structure. |
| 03:17:38 | <monochrom> | My interpretation of that statement is: A program should be so well modularized that a fully developed human being with moderate programming experience should be able to verify correctness without resorting to convulved automatic checking. This is a requirement of program compartmentalization clarity rather than an assertion of the ease of verification of pathalogically convolved programs. |
| 03:17:47 | <byteshack> | in reading the xmonad 2 article, not sure why a doubly linked list would not have done what the zipper is doing |
| 03:17:59 | <byteshack> | can someone enlighten me? |
| 03:18:18 | <dons> | byteshack: how do we track focus? |
| 03:18:42 | <dons> | the zipper is a doubly linked list (since we traverse left and right) with a hole punched in it, recall. |
| 03:19:20 | <dons> | and the hole is used to denote focus, so there's no possibility of focus being on a non-visible window |
| 03:19:37 | <LoganCapaldo> | Zippers are cool |
| 03:19:48 | <dons> | byteshack: btw, what would the doubly linked data type look like? |
| 03:20:23 | <byteshack> | I have no idea what it would look like in haskell, but I guess you would have to have that extra pointer to the "focused" window |
| 03:20:24 | <mdmkolbe|home> | byteshack: doubly linked lists get tricky in Haskell especially if you want to change it |
| 03:20:34 | <byteshack> | which is what you where wanting to get rid of |
| 03:20:58 | <dons> | byteshack, right. the idea was not to track focus with a separate index. |
| 03:21:10 | <dons> | previously, we used a (cycled) list, [a], with an index for focus |
| 03:21:16 | <dons> | which i think is what you're proposing. |
| 03:21:22 | <dibblego> | yeah how do you write one of those anyway? I've tried to write one in my head several times and failed |
| 03:21:33 | <byteshack> | I see how that is what I was thinking |
| 03:21:38 | <dons> | but that then requires dynamic consistency checks to force the focus index to always be valid. == too much bookkeeping. |
| 03:21:50 | <dons> | dibblego: a zipper for a structure? |
| 03:22:04 | <dons> | dibblego: probably easiest to start with a list, then imagine punching a hole in it, to make the current spot. |
| 03:22:06 | <dibblego> | no a double-linkred list (I don't know what a zipper even is) |
| 03:22:17 | <dibblego> | ?where zipper |
| 03:22:17 | <lambdabot> | I know nothing about zipper. |
| 03:22:24 | <dons> | ?google The Zipper |
| 03:22:27 | <lambdabot> | http://inventors.about.com/library/weekly/aa082497.htm |
| 03:22:27 | <lambdabot> | Title: The History of the Zipper |
| 03:22:31 | <byteshack> | nice article again dons :) |
| 03:22:31 | <dons> | ?google The Zipper site:wikipedia.org |
| 03:22:34 | <lambdabot> | http://en.wikipedia.org/wiki/Zipper |
| 03:22:34 | <lambdabot> | Title: Zipper - Wikipedia, the free encyclopedia |
| 03:23:01 | <dons> | dibblego: sorry, the best article is on the haskell wikibook |
| 03:23:05 | <byteshack> | I very much appreciate the insides and the walk through on why things where chosen |
| 03:23:06 | <dibblego> | ok |
| 03:23:22 | <dons> | byteshack: cool, that's the idea :-) |
| 03:26:16 | <syntaxfree> | how does Mercury compare to Mozart/Oz and Prolog? |
| 03:26:20 | <dibblego> | is that tree supposed to represent the labyrinth on the left of it? |
| 03:26:27 | <dibblego> | http://en.wikibooks.org/wiki/Haskell/Zippers (that tree) |
| 03:26:29 | <lambdabot> | Title: Haskell/Zippers - Wikibooks, collection of open-content textbooks |
| 03:27:17 | <dons> | dibblego: the one that says "An example labyrinth and its representation as tree." ? |
| 03:27:30 | <dibblego> | yes |
| 03:27:34 | <dibblego> | :) |
| 03:30:40 | <lokadin> | when I try to compile using cabal I'm told "Could not find module `System'" |
| 03:31:04 | <byteshack> | from the article |
| 03:31:06 | <byteshack> | delete :: -> StackSet a -> StackSet a |
| 03:31:17 | <byteshack> | did you eat a: :: a -> in there? |
| 03:31:35 | <dons> | oh oops. |
| 03:31:36 | <dons> | yes. |
| 03:31:36 | <lokadin> | if I am to remove import System, then it states that getArgs not found |
| 03:31:44 | <dons> | byteshack: it should not have the -> |
| 03:31:51 | <dons> | byteshack: since it deletes the window currently in focus only. |
| 03:31:54 | <lokadin> | so what do I import? |
| 03:31:58 | <byteshack> | ah, ok |
| 03:32:03 | <dons> | lokadin: System.Environment |
| 03:32:06 | <dons> | ?index getArgs |
| 03:32:07 | <lambdabot> | System.Environment |
| 03:32:12 | <lokadin> | kk thanks :) |
| 03:37:27 | <jfredett> | hmm, I need a good problem to solve. any suggestions? |
| 03:37:52 | <monochrom> | Add arrows to HaXML |
| 03:38:12 | <jfredett> | okay, something less substantial? |
| 03:38:19 | <bos> | @seen cosmicray |
| 03:38:19 | <lambdabot> | I saw cosmicray leaving #haskell 6h 37m 19s ago, and . |
| 03:38:28 | <monochrom> | learn arrows |
| 03:38:39 | <ddarius_> | monochrom: HXT... |
| 03:38:46 | <mdmkolbe|home> | jfredett: what kind of problem do you want? there a nice list of improvements for GHC |
| 03:39:16 | <jfredett> | hmm, i guess thats the real problem that needs solving, what kind of problem do I want. |
| 03:39:37 | <jfredett> | something along the lines of N-queens I guess, just something to hack on for a while |
| 03:40:03 | <jfredett> | I just finished an N-queens and a sudoku solver, so I've had enough covering problems for one day. |
| 03:40:15 | <mdmkolbe|home> | jfredett: solve substring in linear time |
| 03:40:30 | <mdmkolbe|home> | (or maybe it's n log n) |
| 03:40:32 | <jfredett> | been there, suffix trees for life. |
| 03:40:38 | <jfredett> | i dont know if it was linear |
| 03:40:44 | <jfredett> | but it was fun. |
| 03:40:57 | <jfredett> | though, i did it in scheme, so maybe i could do it in haskell |
| 03:40:58 | <jfredett> | hmm |
| 03:41:13 | <mdmkolbe|home> | jfredett: write a unification algorithm or a type checker |
| 03:41:25 | <jfredett> | holy crap, that sounds awesome, |
| 03:41:32 | <jfredett> | whats a unification algorithm. |
| 03:41:38 | <jfredett> | *stares blankly* |
| 03:41:49 | <jfredett> | ACTION is a mathematician... |
| 03:41:54 | <dibblego> | something that makes General Relativity and Quantum Mechanics co-exist |
| 03:41:58 | <bos> | @google unification algorithm |
| 03:41:59 | <monochrom> | Many people like HaXML. Lazy parser. Bridge haskell data types to DTDs. It would be nice if arrows are brought to HaXML too. In fact even, exactly the same XML DOM combinators for both, i.e., HaXML implements HXT's ArrowXML type class too. I'm a big fan of HXT because of arrows. |
| 03:41:59 | <mdmkolbe|home> | jfredett: do you know anything about type inference (not checking) or maybe about prolog or logic programming |
| 03:42:01 | <lambdabot> | http://www.cs.rpi.edu/~freems/proj3/Unification_and_Variables.htm |
| 03:42:01 | <lambdabot> | Title: Unification and Variables |
| 03:42:03 | <dibblego> | just kidding |
| 03:42:34 | <mdmkolbe|home> | ACTION switches to scheme notation |
| 03:42:58 | <jfredett> | I tried learning prolog once, and I've messed around with Coq, but I've only just started learning haskell, so I was aiming for something less awesome, |
| 03:43:06 | <jfredett> | I guess I could just learn about type calculus |
| 03:43:07 | <Korollary> | whats that website for math puzzles? |
| 03:43:13 | <jfredett> | Mathschallenge.net |
| 03:43:15 | <TSC> | projecteuler.net ? |
| 03:43:19 | <Korollary> | yeah euler |
| 03:43:25 | <mdmkolbe|home> | if I have literals `(a (,b)) and `(,c (d)) then the only substituion that makes them the same is b |-> d, c |-> b |
| 03:43:49 | <mdmkolbe|home> | jfredett: have you written a lambda calculus interpreter? |
| 03:43:56 | <jfredett> | no- that could be fun |
| 03:43:56 | <ddarius_> | Unification = (categorical) limits |
| 03:44:17 | <ddarius> | How involved a problem do you want? |
| 03:44:22 | <jfredett> | I think i'll try that |
| 03:44:45 | <mdmkolbe|home> | jfredett: writting a lambda calculus interpreter and a type checker (and if you're advanced a type inferencer with unification) is a right of passage for Haskell programers |
| 03:45:01 | <monochrom> | rite |
| 03:45:06 | <ddarius> | And takes about five minutes unless you write a parser as well. Then it takes 15. |
| 03:45:11 | <mdmkolbe|home> | jfredett: but it would help if you have a good prof. to help you |
| 03:45:17 | <jfredett> | oh, rite of passage, *grabs his wizard hat and peace pipe* I'm ready |
| 03:45:18 | <monochrom> | You will never think of mathematical notations the same way again. |
| 03:45:38 | <jfredett> | sounds like fun to me |
| 03:45:49 | <Korollary> | write a new DRM scheme. wait. scratch that. |
| 03:46:03 | <jfredett> | Haskell has already blown my mind in terms of math + programming |
| 03:46:06 | <monochrom> | write a new DRMacIver |
| 03:46:07 | <mdmkolbe|home> | Benjerman Peirce (sp?) has a read book on it |
| 03:46:14 | <Korollary> | Pierce |
| 03:46:20 | <ddarius> | Benjamin |
| 03:46:25 | <Korollary> | Benjermam needs a trademark |
| 03:46:33 | <monochrom> | hehehehe |
| 03:46:49 | <jfredett> | I was working in Scheme for quite some time, and someone said, "Joe! Learn Haskell" I said, "okay" and at that moment I was enlightened. |
| 03:47:12 | <Korollary> | there are actually a few online books that cover pretty much the same basics as TaPL. Of course TaPL goes quite a bith further. |
| 03:47:43 | <ddarius> | Depressingly there are almost no languages that combine Haskell practicality and closeness to mathematics. |
| 03:48:14 | <jfredett> | ddarius, my ultimate goal in haskell is to do just that |
| 03:48:21 | <Korollary> | Concoqtion sounds interesting |
| 03:48:50 | <jfredett> | add all the brilliance of a CAS and Matlab-esque numerical system, with the power and syntax of haskell |
| 03:49:24 | <jfredett> | basicly, Haskell + CAS + Matlab as one language, with a unified syntax, etc. |
| 03:49:50 | <monochrom> | That's a hell of a type system. |
| 03:49:54 | <jfredett> | yep, |
| 03:49:57 | <Korollary> | I don't know if matlab is a good model. |
| 03:50:03 | <araujo> | it isn't |
| 03:50:17 | <jfredett> | well, I really just want to have the numerical capabilitys |
| 03:50:30 | <monochrom> | Take it to mean "something that fills the same niche as matlab but sane like haskell" |
| 03:50:34 | <jfredett> | yah |
| 03:50:39 | <jfredett> | monochrom, exactly |
| 03:50:59 | <dainanaki> | i hate not having precompiled ghc binaries |
| 03:51:03 | <ddarius> | Matlab sounds more and more interesting every day. |
| 03:51:11 | <syntaxfree> | the Mercury tutorial is amazing. A Haskell tutorial could be modelled against it, at least the type system chapter. |
| 03:51:12 | <Korollary> | dainanaki: which platform? |
| 03:51:15 | <jfredett> | the final goal would be something that does what Mathematica, Matlab, and Haskell all at once |
| 03:51:17 | <dainanaki> | os x |
| 03:51:27 | <monochrom> | When someone expresses a dream of unification of X+Y+Z, don't take him too literally about X,Y,Z! The true dream is beyond speech. |
| 03:51:31 | <syntaxfree> | for one, Haskell should have a matrix data type by now. |
| 03:51:45 | <dainanaki> | well it's not that there aren't it's just that they don't seem to work for me |
| 03:51:51 | <ddarius> | syntaxfree: Why? |
| 03:51:56 | <jfredett> | syntaxfree, I totally agree, maybe I'll write that after I do the lambda calc interpreter |
| 03:52:07 | <Korollary> | dainanaki: ah. Try the haskell-cafe mailing list. |
| 03:52:20 | <syntaxfree> | ddarius: because from matrix algebra most other scientific stuff present in Matlab is trivial to construct. |
| 03:52:44 | <syntaxfree> | I'd like to be able to do my econometric modelling in Haskell instead of R/Stata. |
| 03:52:56 | <ddarius> | syntaxfree: Are you talking about a built-in or standard matrix type? If not, I'm sure there are libraries. If so, I mostly disagree. |
| 03:52:56 | <dainanaki> | thanks Korollary, but i've already had the bootstrap and source code stuff going for like 2 hours, so might as well let it finish |
| 03:53:06 | <jfredett> | from Matrix Algebra, just about all other algebras follow |
| 03:53:15 | <ddarius> | Not in a very sane way. |
| 03:53:26 | <jfredett> | ddarius, granted, but it does follow |
| 03:53:27 | <syntaxfree> | ddarius: there are probably three or four half-baked matrix algebra libraries out there. |
| 03:53:38 | <syntaxfree> | Having a proper Data.Matrix should be a priority GHC project. |
| 03:53:47 | <syntaxfree> | optimized, etc. etc. |
| 03:53:50 | <Korollary> | It wouldnt be my priority |
| 03:54:02 | <mdmkolbe|home> | ACTION is actually a specialist in that area |
| 03:54:17 | <jfredett> | syntaxfree, I don't know about priority, It's still kind of a valence thing, but it should be on the list of things to do |
| 03:54:18 | <ddarius> | syntaxfree: There may recently be the tools to make that a worthwhile endeavor... |
| 03:54:21 | <mdmkolbe|home> | any particular requeists? |
| 03:54:25 | <syntaxfree> | for what I know of scientific computing, it's pretty much what's holding the larger scientific community from adopting Haskell. |
| 03:54:38 | <jfredett> | mdmkolbe|home, which area? |
| 03:54:54 | <syntaxfree> | Even crazy stuff like numerically solving hyperbolic PDEs ends up boiling down to matrix algebra. |
| 03:54:55 | <mdmkolbe|home> | jfredett: high performance matrix computation |
| 03:55:02 | <syntaxfree> | with the appropriate sparse matrix optimizations. |
| 03:55:11 | <jfredett> | syntaxfree, I think whats holding (at least the Mathematical) community back, is the lack of understanding of how to program period, much less in haskell |
| 03:55:24 | <ddarius> | Haskell wasn't and may still not be particularly good for scientific computing. At least the mass number crunching knid. |
| 03:55:42 | <mdmkolbe|home> | jfredett: I've written kernels that are faster than any other vendor's libraries, but that was in C and I like haskell much better |
| 03:55:45 | <syntaxfree> | there's a lot of mid-sized number-crunching where Haskell would be helpful. |
| 03:55:50 | <dainanaki> | its kind of sobering to realize that any program may be basically converted into an equation |
| 03:56:02 | <jfredett> | My advisor at school can hardly send emails, and she's got a pair of Phd's, its kinda sad.. :( |
| 03:56:13 | <Korollary> | Ow |
| 03:56:13 | <ddarius> | dainanaki: Why? |
| 03:56:16 | <syntaxfree> | Maybe not inverting a 10^5x10^5 matrix, but hell, do I need more code reusability than R and Stata afford on my day-to-day work,. |
| 03:56:29 | <jfredett> | dainanaki, I live to do that to CS students... :) I solved Nqueens like that w/ GAP |
| 03:56:41 | <jfredett> | mdmkolbe|home, That sounds like fun, |
| 03:56:44 | <ddarius> | dainanaki: We've known since the 30's that you can program with "arithmetic". |
| 03:56:48 | <dainanaki> | i know |
| 03:57:06 | <dainanaki> | but i'm talking like thinking what the "pdf format" algorithm would be for example |
| 03:57:11 | <monochrom> | Kleene's recursion theorem |
| 03:57:15 | <jfredett> | mdmkolbe|home, It would be neat to write a kernel in haskell... though it probably lacks the appropriate memory access abilities. |
| 03:57:32 | <syntaxfree> | there is an entire bootable OS in Haskell. |
| 03:57:36 | <syntaxfree> | @google house haskell |
| 03:57:37 | <mdmkolbe|home> | jfredett: by kernel I ment matrix math kernel |
| 03:57:37 | <dainanaki> | are there any plans for haskell' to have better memory access stuff? |
| 03:57:38 | <lambdabot> | http://programatica.cs.pdx.edu/House/ |
| 03:57:39 | <lambdabot> | Title: House |
| 03:57:40 | <ddarius> | jfredett: You'd be surprised what you can do with Haskell. |
| 03:57:42 | <syntaxfree> | with a GUI and all. |
| 03:58:10 | <jfredett> | mdmkolbe|home, ah, I see. mea culpa |
| 03:58:14 | <syntaxfree> | and I mean, not a GUI based on X or anything. Everything built from the ground up. |
| 03:59:05 | <jfredett> | ddarius, I'm surprised by haskell alot. I died of happiness when I saw some of the stuff I'd been missing out on when I started w/ it |
| 03:59:24 | <Korollary> | jfredett: what kind of stuff? |
| 04:00:08 | <jfredett> | The completely different take on Type Checking, for one. I'd always viewed types as a passive thing |
| 04:00:27 | <jfredett> | but Haskell makes them active, and with great effect. |
| 04:01:16 | <Korollary> | I don't quite follow. What's the difference? |
| 04:02:01 | <ddarius> | Korollary: I can think of a difference that would not be completely ill-described by that terminology, but I don't think it is what jfredett had in mind. |
| 04:02:26 | <jfredett> | Well, When I used Java, My view was that the type I assigned to data was relatively arbitrary, It only classified a small amount of information about the data type |
| 04:02:34 | <mdmkolbe|home> | Korollary: I think what jfredett is saying is that in C, types are just a consession to the machine having to choose a representation, but in Haskell types are more than memory representation |
| 04:02:48 | <jfredett> | mdmkolbe|home, exactly |
| 04:03:07 | <ddarius> | Types are not a memory representation. |
| 04:03:17 | <dibblego> | jfredett, would you argue the same way against a Lisp proponent who has never used Haskell? |
| 04:03:18 | <mdmkolbe|home> | ddarius: in C they are |
| 04:03:29 | <jfredett> | I saw the types in haskell and thought "Type Calculus" and not "32 bit int" |
| 04:03:50 | <jfredett> | dibblego, Well, I am a lisp proponent, so I really cant be objective about that, |
| 04:03:54 | <ddarius> | mdmkolbe|home: I worded what I said poorly, but nevertheless I was objecting to "in Haskell types are more than memory representation". |
| 04:04:11 | <dibblego> | jfredett, at least, you see some value to type checking? |
| 04:04:11 | <dons> | dainanaki: better memory access than the current FFI? |
| 04:04:12 | <Korollary> | it is said that types correspond to algebras and what matters is their behavior. However, some other languages make it look like types are sets. That's as close as I can get. |
| 04:04:19 | <jfredett> | dibblego, absolutely |
| 04:04:22 | <dainanaki> | dons, yes |
| 04:04:39 | <dons> | dainanaki: what's wrong with the current api? how could it be improved? |
| 04:04:56 | <dibblego> | jfredett, my knowledge of Lisp is limited, so I was not able to argue very well in a particular debate I had with a Lisp proponent |
| 04:05:19 | <jfredett> | There are benefits to both lisp and haskell |
| 04:05:20 | <ddarius> | dibblego: You must learn all languages. |
| 04:05:28 | <dibblego> | I've come to realise that |
| 04:05:29 | <ddarius> | @where Liskell |
| 04:05:29 | <lambdabot> | http://clemens.endorphin.org/liskell |
| 04:05:32 | <dainanaki> | dons, idunno i just hear that it is the one thing haskell lacks in comparison to c is low level memory access as far as performance ability |
| 04:05:32 | <Korollary> | dibblego: and quit arguing with lisp proponents ;) |
| 04:05:33 | <jfredett> | I love lisp for its syntax, mostly. |
| 04:05:52 | <dibblego> | Korollary, it was friendly banter more than anything |
| 04:05:56 | <jfredett> | I often write lisp programs that construct lisp programs on the fly |
| 04:05:59 | <ddarius> | @where Liskell jfredett |
| 04:05:59 | <lambdabot> | http://clemens.endorphin.org/liskell |
| 04:06:03 | <jfredett> | not like, function passing |
| 04:06:31 | <jfredett> | I mean actually constructing a list w/ functions- its the best fun in the world. :) |
| 04:06:37 | <jfredett> | ddarius, I read about that |
| 04:06:49 | <jfredett> | ddarius, it looked interesting |
| 04:06:57 | <ddarius> | ACTION has no interest in it. |
| 04:07:11 | <Korollary> | I feel for the author, though. |
| 04:07:23 | <jfredett> | I think everything looks interesting, though-- |
| 04:07:40 | <jfredett> | "interesting till proven stupid", thats my motto |
| 04:07:49 | <monochrom> | Yeah! |
| 04:07:55 | <ddarius> | @where+ liskell http://liskell.org/ |
| 04:07:55 | <lambdabot> | Done. |
| 04:08:00 | <Korollary> | Proving stupidity is hard. |
| 04:08:09 | <jfredett> | Korollary, thats the point |
| 04:08:16 | <ddarius> | Korollary: About ideas... ... |
| 04:08:31 | <dibblego> | @where+ zippers http://en.wikibooks.org/wiki/Haskell/Zippers |
| 04:08:32 | <lambdabot> | Done. |
| 04:09:11 | <jfredett> | brb |
| 04:10:23 | <Korollary> | I've been reading some database theory. It's interesting. I have a feeling that nulls correspond to _|_, but they don't use the same terminology. Although they do say things like 'type constructor'. |
| 04:12:23 | <allbery_b> | nulls sometimes correspond to _|_ |
| 04:12:38 | <allbery_b> | they're kind of overloaded |
| 04:13:10 | <Korollary> | When don't they? |
| 04:13:25 | <allbery_b> | they can mean "no value", "any value", or "failure" depending on context |
| 04:13:30 | <MyCatVerbs> | Korollary: nulls are a surprisingly controversial topic of discussion around databases. |
| 04:13:43 | <allbery_b> | ("no value" meaning "uninitialized") |
| 04:13:51 | <MyCatVerbs> | Korollary: you won't find a single (competent) Haskell programmer on Earth who thinks _|_ is silly or unneccessary =) |
| 04:14:58 | <MyCatVerbs> | (Well, unless they believe that the features of Haskell which make _|_ a mathematically neccessary concept are silly. Which is fair game, whether one agrees with the proposition or not.) |
| 04:15:52 | <allbery_b> | admittedly I'm not talking about database *theory*, I'm talking about what SQL oes in practice |
| 04:16:01 | <allbery_b> | ACTION is kinda short on theory |
| 04:16:18 | <Korollary> | allbery_b: The theory is not that deep. It's about two midsized chapters. |
| 04:16:41 | <Korollary> | minus the database-specific things like integrity, security, etc. |
| 04:16:49 | <allbery_b> | much as I'm not much on the theory behind FP in genral or Haskell in particular, but I'm somewhat proficient at using it in practice |
| 04:17:17 | <Korollary> | Does Xquery have bottom? |
| 04:18:42 | <allbery_b> | and I've let the database bits rot a bit since I haven't used them in over 10 years, once upon a time I knew the difference between 3nf and bcnf... |
| 04:23:16 | <ddarius> | Bah I forget that everytime I learn it. |
| 04:23:28 | <Korollary> | Maybe it's not worth remembering. |
| 04:23:37 | <ddarius> | It isn't really. |
| 04:26:41 | <allbery_b> | yeh, I have the vague recollection that it wasn'tpractically useful |
| 04:27:25 | <ddarius> | There is no difference except for some crazy off the wall cases. |
| 04:29:16 | <davidL> | > read $ concatMap show [1,2,3] --is this the best way of going from [1,2,3] to 123::Int ? |
| 04:29:17 | <lambdabot> | 123 |
| 04:29:41 | <Korollary> | that's one way |
| 04:30:26 | <Korollary> | I'd normally go the 1*10^2 + ... route. |
| 04:36:49 | <sieni> | > foldl (+) 0 $ zipWith (\x y -> 10^x * y) [0..] $ reverse [1,2,3] |
| 04:36:50 | <lambdabot> | 123 |
| 04:37:33 | <sieni> | @pl \x y -> 10^x * y |
| 04:37:33 | <lambdabot> | (*) . (10 ^) |
| 04:38:17 | <davidL> | > (sum . zipWith ((*) . (10 ^)) . reverse) [1,2,3] |
| 04:38:18 | <lambdabot> | Couldn't match expected type `[a]' |
| 04:38:32 | <dons> | some people might be interested in this, |
| 04:38:34 | <dons> | http://www.handbook.unsw.edu.au/undergraduate/courses/2007/COMP4181.html |
| 04:38:35 | <lambdabot> | Title: UNSW Handbook Course - Language-based Software Safety - COMP4181, http://tinyurl.com/2ez5ba |
| 04:38:43 | <dons> | "Language-based Software Safety" -- in Haskell |
| 04:38:56 | <sieni> | @pl foldl (+) 0 $ zipWith (\x y -> 10^x * y) [0..] $ reverse |
| 04:38:57 | <lambdabot> | foldl (+) 0 (zipWith ((*) . (10 ^)) [0..] reverse) |
| 04:39:03 | <davidL> | > (sum . zipWith ((*) . (10 ^)) [0..] . reverse) [1,2,3] |
| 04:39:05 | <lambdabot> | 123 |
| 04:39:14 | <sieni> | oh sum :-D |
| 04:39:19 | <davidL> | thanks sieni |
| 04:39:27 | <chessguy> | ... |
| 04:46:04 | <chessguy> | > 135 / 3630 |
| 04:46:05 | <lambdabot> | 3.71900826446281e-2 |
| 04:46:29 | <chessguy> | hmm, i beat 96% of the field in that tourney |
| 04:47:19 | <Korollary> | > 1 - 135/3630 |
| 04:47:20 | <lambdabot> | 0.9628099173553719 |
| 04:47:35 | <Korollary> | you are being humble |
| 04:48:25 | <chessguy> | :) |
| 05:06:53 | <lispy> | chessguy: sorry, 97% or better for an A |
| 05:07:29 | <chessguy> | i'll have to try again tomorrow :) |
| 05:07:49 | <dibblego> | what tourney? |
| 05:15:40 | <jmob> | Is Data.Time.Clock part of the standard ghc 6.6 distribution? |
| 05:16:25 | <lispy> | jmob: hmm...i think so |
| 05:16:28 | <dons> | hmm? really? |
| 05:16:32 | <dons> | isn't that in the 'time' package? |
| 05:16:39 | <dons> | ?hackage time |
| 05:16:40 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/time |
| 05:16:52 | <lispy> | ACTION stands corrected |
| 05:16:59 | <dons> | yes, that's it. |
| 05:17:02 | <dons> | http://hackage.haskell.org/packages/archive/time/1.0/doc/html/Data-Time-Clock.html |
| 05:17:06 | <lambdabot> | http://tinyurl.com/28tdzs |
| 05:17:34 | <jmob> | thanks, guess google can't find everything |
| 05:17:49 | <Korollary> | hoogle it |
| 05:18:14 | <ddarius> | Google can't find everything?! |
| 05:18:46 | <lispy> | google can't find my keys :( |
| 05:19:07 | <jmob> | lispy: my dog can find my keys |
| 05:19:07 | <dons> | ?google where are my keys? |
| 05:19:10 | <lambdabot> | http://them.ws/keys/index.php |
| 05:19:11 | <lambdabot> | Title: Where Are My Keys? |
| 05:19:25 | <dons> | ?google who ate the last donut? |
| 05:19:29 | <lambdabot> | http://answers.yahoo.com/question/index?qid=20070328092503AA0zQe2&show=7 |
| 05:19:29 | <lambdabot> | Title: Yahoo! Answers - Whats the last donut u ate? |
| 05:19:36 | <dons> | doesn't know very much at all |
| 05:19:37 | <Korollary> | If you can't find your keys, then you're not worth targeting with ads anyway. |
| 05:19:41 | <dons> | heh |
| 05:20:28 | <lispy> | does google still use ads? i guess ad-block plus beats them |
| 05:20:40 | <kaol> | has anyone planned on adding ByteString support for hdbc? |
| 05:20:59 | <ddarius> | kaol: You? |
| 05:21:02 | <Korollary> | This is why there ought to be project wikis |
| 05:21:03 | <lispy> | kaol: i'd venture a guess that it's not that hard if you're interested |
| 05:21:24 | <Korollary> | There are eight billion things that could use bytestring support. |
| 05:21:46 | <lispy> | heh, yeah when well bytestring be the default string for ghc? |
| 05:21:54 | <jfredett> | gnite folks |
| 05:21:57 | <kaol> | would it be possible to change Strings to be ByteStrings everywhere? |
| 05:22:12 | <Korollary> | you mean automatically |
| 05:22:23 | <lispy> | kaol: if you're going to do something that sweeping you can use the lazy version and sometimes get good results |
| 05:22:32 | <kaol> | ACTION wants his cake and eat it too |
| 05:23:13 | <lispy> | kaol: to do it *right* you need to also look at the way the strings are created/consumed...but, just converting everything to lazy bytestrings isn't always a bad way to go |
| 05:23:50 | <dons> | yeah, that often makes sense, since the complexity of operations are the same (always?) |
| 05:24:03 | <lispy> | kaol: i added bytestring support to HaXml by doing this naive approach and receive significant improvements...10x memory reduction for example |
| 05:24:13 | <dons> | whereas changing naively to strict bytestrings can change complexity (in particular, concat!) confusing some people |
| 05:24:33 | <Korollary> | and there's the unicode thing |
| 05:24:40 | <kaol> | if I ever get rid of the feeling that I can't yet code anything in Haskell... |
| 05:24:56 | <dons> | maybe you should code something in haskell :) |
| 05:24:58 | <Korollary> | even hello world? |
| 05:25:01 | <lispy> | yes and the unicode thing could be quite important...so it's best if people still have the traditional interface when they need it |
| 05:25:17 | <dons> | don't worry, i think it takes hmm, 3 years full time to get competent in the full range of haskell idioms. |
| 05:25:29 | <Korollary> | the idioms also change as you go |
| 05:25:33 | <dons> | yeah. |
| 05:25:57 | <lispy> | kaol: how do you feel about the m word? |
| 05:26:19 | <lispy> | ACTION goes to bed |
| 05:26:22 | <lispy> | ACTION & |
| 05:27:33 | <dons> | here's my conjecture: after 3 years you should be able to write (mostly) bug free code, using the right libraries, using QuickCheck, with static separation enforced with monad transformers, and some data type checking with GADTs. it should be efficient, solve real problems, and be shorter than competiting products. it should also be easier to maintain. I think getting to that point takes at least 3 years with the language. |
| 05:28:32 | <bos> | not all that different from any other language, really. |
| 05:28:49 | <dons> | of course, if we had a book that taught these techniques, you could get there faster. |
| 05:28:53 | <dibblego> | how is "(mostly) bug free" not different from any other language? |
| 05:29:05 | <dons> | dibblego: mostly bug free in the strong sense |
| 05:29:09 | <kaol> | well... so-so. I think I understand some aspects about them, but I still couldn't use something like State, Reader or Writer on my own. And I'm still too scared to even look at monad transformers. |
| 05:29:17 | <dons> | only spec errors. |
| 05:29:19 | <bos> | "optimal bug-free haskell in 21 days! for dummies!" |
| 05:29:33 | <dibblego> | in other languages, I see mostly bug-ridden code |
| 05:29:45 | <dons> | well, ok. that's true. :-) |
| 05:29:50 | <Korollary> | It depends on where you look. |
| 05:30:03 | <dons> | considering it took the first generation of haskellers 10 years to get to this position, |
| 05:30:10 | <dibblego> | I look in the pits of software hell |
| 05:30:10 | <Korollary> | You can write high quality C. It just needs more foreplay. |
| 05:30:20 | <dons> | and i'm saying for those starting at h98, it takes 3 years. with a good book, we could bring that down to 12 months perhaps ? :-) |
| 05:30:43 | <bos> | someone ought to write one. |
| 05:30:48 | <dons> | yeah. |
| 05:31:02 | <Korollary> | I don't think books are the future anyway. |
| 05:31:17 | <thoughtpolice> | pragmatic programmers apparently signed on for a 'pragmatic haskell' book |
| 05:31:20 | <dibblego> | yes, there needs to be a book that doesn't necessarily appeal to the beginner |
| 05:31:25 | <Korollary> | I kinda wish for a more interactive method for learning. |
| 05:31:25 | <bos> | the neural shunts aren't working yet. |
| 05:31:57 | <ddarius> | Korollary: You mean like the various classes that use Haskell? |
| 05:32:21 | <Korollary> | ddarius: Oh no, I mean for self study. Classes are better of course. |
| 05:32:29 | <bos> | it'll be interesting to see how that prag book turns out. |
| 05:32:42 | <ddarius> | Probably depressing. |
| 05:33:04 | <bos> | why do you think? |
| 05:33:11 | <dons> | its better than it used to be. in the 90s you had to go to Oxford or Glasgow or Chalmers, and have Richard Bird teach you programming pearls to get the "haskell way" . now you can hang out here, and get it on the cheap. |
| 05:33:21 | <Korollary> | For instance, every learner runs into what's foldr and foldl, why do I have a space leak, why doesn't this typecheck etc. Those could all be guided in a IDE/teaching env. Something like DrScheme, but better. |
| 05:33:29 | <cdsmith> | dons: and thank goodness for that. |
| 05:33:41 | <dons> | yeah |
| 05:33:46 | <cdsmith> | (Though I wouldn't mind taking classes at oxford. ;) |
| 05:33:53 | <dons> | and just in the last 6 months we've suddenly started you know, writing on the web. |
| 05:33:56 | <dons> | that helps. |
| 05:34:12 | <dons> | these intertubes are good for documenting how to do things. |
| 05:34:12 | <thoughtpolice> | the internet is a wonderul thing. |
| 05:34:15 | <bos> | ACTION remembers being plunged into the icy waters of ghc internals in 1993. there was a way to learn! |
| 05:34:24 | <dons> | yeah, bos was lucky. :-) |
| 05:34:56 | <dons> | I think Chalmers is just about haskell central now, though. the number of undergrads who can use ContT they turn out is amazing. |
| 05:35:09 | <Korollary> | What? You know haskell since 1993 and don't have your own compiler? |
| 05:35:26 | <cdsmith> | dons: Chalmers, you say? I need to figure out which grad schools to apply to. |
| 05:35:33 | <dons> | actually, the SoC has been useful. |
| 05:35:47 | <dons> | that's brought in a number of longer term contributors, outside the grad school crowd |
| 05:35:52 | <dons> | thanks google! |
| 05:36:11 | <dons> | cdsmith: chalmers wouldn't be bad, at all. |
| 05:36:55 | <cdsmith> | ACTION also needs to do something work being accepted to a grad school for; but that's a minor detail. |
| 05:37:13 | <Speck> | I'm looking to collect code examples of Parsec's token lexer on complex languages (as in not simple expressions). Does anyone know of any tutorial/paper/repository with this kind of Haskell code? |
| 05:37:35 | <dons> | Speck: hmm, there's a number of parsec examples on the blog articles page on haksell.org |
| 05:37:50 | <dons> | and on hackage, look for libs that use 'parsec' dependencies |
| 05:37:57 | <dons> | there's a java script parser there, iirc (?) |
| 05:38:13 | <dons> | c2hs's huge C parser isn't in parsec, though, notably. |
| 05:38:22 | <Speck> | dons: I'll check that out. Most uses of Parsec don't use the tokenizer. |
| 05:39:25 | <dons> | btw, guys, xmonad now supports the xrandr extension. |
| 05:39:27 | <Korollary> | Maybe someone who uses bytestrings |
| 05:39:31 | <dons> | so you can rotate screens on the fly |
| 05:39:32 | <Speck> | how do I search hackage? |
| 05:39:56 | <dons> | might be nice for the quants here, with their 8 screen tiling setups, using haskell ;-) |
| 05:40:10 | <dons> | or anyone who happens to be at fermilab |
| 05:40:30 | <Korollary> | What kinda monitor do you need for that? |
| 05:40:44 | <dons> | or if you're involved in putting up info screens in public places like airports, and wondering how best to tile data displays on a single rotated monitor |
| 05:40:45 | <kaol> | @google haskell programming pearls |
| 05:40:45 | <Korollary> | They should just get 2 or more LCDs |
| 05:40:48 | <lambdabot> | http://www.haskell.org/haskellwiki/Research_papers/Functional_pearls |
| 05:40:48 | <lambdabot> | Title: Research papers/Functional pearls - HaskellWiki |
| 05:41:35 | <dons> | Korollary: sure, but then you want to display the lcd rotated 90 degrees, you use randr for that. |
| 05:41:53 | <Korollary> | Yay |
| 05:41:56 | <dons> | so i think it should even be possible to bind xmonad to screen rotation functoins. hmm. |
| 05:42:08 | <Korollary> | it is a good thing for reading pdfs |
| 05:42:31 | <dons> | yeah, you could have a dedicated rotated lcd for pdfs |
| 05:42:40 | <dons> | mmm. tasty |
| 05:43:00 | <Korollary> | But it's solving the wrong problem. |
| 05:43:27 | <Korollary> | Why don't the current pdf readers show the pdf sans margins? |
| 05:43:50 | <bos> | rotated lcds are great for xterms, too. |
| 05:43:58 | <dons> | ah yes. nice idea bos. |
| 05:44:10 | <dons> | yeah, i'd love a couple of rotated lcds side by side. that'd be perfect |
| 05:44:19 | <bos> | i can fit 8 big xterms on mine, and my twin emacs windows are 80 cols x 160 rows. |
| 05:44:44 | <Korollary> | Why do you have two emacs windows? |
| 05:45:08 | <sebell> | Korollary: Editor and REPL! |
| 05:45:32 | <Korollary> | Not two buffers. Two windows. You can split the single window if you want. |
| 05:46:13 | <bos> | i like having a permanent split. it's too easy to C-x 0 away a buffer. |
| 05:46:14 | <sebell> | Actually, you would have two windows. You'd be splitting the frame |
| 05:46:20 | <quicksilver> | two 'frames' (which is the emacs word for window) is useful |
| 05:46:38 | <quicksilver> | manual page in one, code in other; repl in one, code in other, etc |
| 05:46:51 | <sebell> | I'm chatting in one frame, for example. |
| 05:46:58 | <quicksilver> | as box says, you don't want the C-x {0,1} stuff to kill them |
| 05:47:10 | <quicksilver> | you still want to be able to split them individually |
| 05:47:17 | <quicksilver> | s/box/bos/ (sorry!0 |
| 05:47:28 | <Eelis> | dons: i see the current TODO has no mention of tabs. has that idea been dropped? |
| 05:47:29 | <Korollary> | Is C-x 0 the only way to get rid of a buffer? |
| 05:47:34 | <dons> | morning quicksilver, btw. |
| 05:47:45 | <dons> | Eelis: its likely that will be done by contrib modules, not in the core. |
| 05:47:47 | <quicksilver> | morning dons |
| 05:47:55 | <Eelis> | dons: i see. interesting |
| 05:48:13 | <dons> | all the experimental layout strategies, bindings, tiling systems, are done via contrib extensions |
| 05:48:26 | <sebell> | Korollary: Well, C-x 0 doesn't kill a buffer, it kills a window. And no, there are other ways. C-x 1 for example, kills all other windows in the frame and keeps the current one only |
| 05:48:26 | <Eelis> | sounds good |
| 05:50:32 | <cdsmith> | ACTION keeps misreading "command" as "comonad" in the book I'm reading. |
| 05:51:05 | <Korollary> | I know what they do. I'm just trying to point out to the braindead practice of, say, M-x man's splitting the current window. If it didn't do that, I'd have very little need to C-x 0 stuff. I switch between buffers easily otherwise. |
| 05:52:25 | <sebell> | Korollary: Ah. Yes, I agree -- Emacs still behaves as though a user had a single frame on an 80x24 terminal |
| 05:53:05 | <bos> | ACTION digs the xmonad screenshot with hmp3 playing sonic youth. it all fits nicely :-) |
| 05:54:45 | <dons> | hah |
| 06:04:58 | <arcatan> | xmonad isn't easy to recognize in screenshots |
| 06:05:32 | <kfish> | perhaps it needs an anime mascot? |
| 06:05:46 | <ddarius> | Sure it is. It's a computer screen without any non-essential clutter. Just content. |
| 06:06:30 | <Korollary> | It's like a good referee. |
| 06:06:38 | <bos> | this is a great essay: http://www.lambdassociates.org/Blog/bipolar.htm |
| 06:06:39 | <lambdabot> | Title: The BiPolar Lisp Programmer |
| 06:07:42 | <edwardk> | bos was good, though i'd s/Lisp/Haskell/ig |
| 06:08:42 | <Korollary> | I don't necessarily agree with a lot of that essay |
| 06:09:28 | <Korollary> | There are a lot of lazy bums who'd like to think that they're actually brilliant and it's the 'system', etc. |
| 06:09:37 | <edwardk> | hahhahaha |
| 06:09:40 | <edwardk> | there is that factor too |
| 06:10:03 | <JohnMeacham> | @seen dons |
| 06:10:03 | <lambdabot> | dons is in #xmonad, #haskell-soc, #haskell-overflow, #haskell and #ghc. I last heard dons speak 45s ago. |
| 06:10:13 | <edwardk> | ACTION is a lazy bum. I only work when forced by a suitable demand signature. |
| 06:10:33 | <dons> | JohnMeacham: ? |
| 06:11:09 | <JohnMeacham> | Ah, I made a bunch of changes to jhc recently, I was wondering if you could update the nobench page with the latest tag. |
| 06:11:20 | <dons> | ah yes, i plan to this week sometime. |
| 06:11:28 | <JohnMeacham> | cool. |
| 06:13:11 | <JohnMeacham> | it will probably be slower, but should actually compile more of them. |
| 06:14:29 | <ddarius> | Valuing correctness over speed? What kind of programmer are you? |
| 06:17:34 | <monochrom> | That is a type, not a kind. (duck!) |
| 06:20:52 | <JohnMeacham> | don't worry, I'll get back to breaking things soon enough. |
| 06:23:22 | <dons> | ddarius: hah |
| 06:50:11 | <dblhelix> | dons: do you know anything about phrac? |
| 06:51:28 | <dons> | yeah, a little |
| 06:52:29 | <dblhelix> | dons: all my attempts to use it seem to result in "phrac: <stdin>: hGetLine: end of file" :-( |
| 06:52:32 | <stmartin> | I should be able to use fromIntegral to convert from Word8 to Char, right? |
| 06:53:15 | <dons> | stmartin: no :-) |
| 06:53:25 | <dblhelix> | dons: that is, if I try input from stdin... passing it a file works fine |
| 06:53:29 | <stmartin> | awww, why not? |
| 06:53:42 | <dons> | stmartin: well, sort of, w2c = chr . fromIntegral |
| 06:54:11 | <dons> | dblhelix: ok. no idea. i'd suggest looking at the src |
| 06:54:21 | <dblhelix> | stmartin: because Char is not an instance of Num |
| 06:54:37 | <dblhelix> | dons: yeah, I'll have a look---thanks |
| 06:54:51 | <dblhelix> | dons: btw, how's xmonad going? |
| 06:54:53 | <stmartin> | But it is an Enum right? |
| 06:55:02 | <dblhelix> | stmartin: it is |
| 06:55:17 | <dons> | dblhelix: flying along. lots of stuff happening. |
| 06:55:51 | <dons> | xrandr support (rotate monitors), 3rd party contribs keep landing, entire core rewritten to be a Zipper. the code makes me happy. all good |
| 06:56:10 | <dons> | > fromEnum 'a' |
| 06:56:18 | <dons> | > toEnum 'a' |
| 06:56:18 | <lambdabot> | 97 |
| 06:56:19 | <lambdabot> | Couldn't match expected type `Int' against inferred type `Char' |
| 06:58:40 | <kosmikus> | dons: do you still try to impose a line limit? |
| 06:59:21 | <dons> | its sort of a guide about as to how smelly some code is. we don't require 500 loc, but notionaly sticking to the 500 limit has helped keep the code cleaner |
| 07:00:07 | <twb> | I'm bored, and trying to compile and run Yi 0.2.0 with GHC 6.6. I did ./Setup.hs config && ./Setup.sh build, but subsequently dist/build/yi/yi immediately panics. |
| 07:00:10 | <dons> | rewriting to a zipper knocked 55 lines off: good sign. some other things have been rejected for being too big. so it acts as a bit of a heuristic, and helps guide contributors |
| 07:00:36 | <dons> | its one of the few forces that oppose never ending feature bloat |
| 07:00:41 | <kosmikus> | twb: have you installed the -gtk or -vty frontends? |
| 07:00:44 | <quicksilver> | stmartin: you can use its enum instance by using 'toEnum' |
| 07:00:52 | <quicksilver> | stmartin: or you can just use 'chr' |
| 07:00:56 | <sebell`> | twb: You're in #haskell now? I guess it was only a matter of time... |
| 07:00:59 | <twb> | kosmikus: AFAIK, no. |
| 07:01:05 | <kosmikus> | twb: you need one of them |
| 07:01:06 | <twb> | sebell`: I used to come by here occasionally |
| 07:01:11 | <twb> | kosmikus: I see. |
| 07:01:18 | <twb> | kosmikus: maybe I'll RTFM before I ask stupid questions |
| 07:01:23 | <twb> | *more stupid questions |
| 07:01:46 | <kosmikus> | twb: it's not a stupid question. there could be a README, or even a meaningful error message ... |
| 07:01:48 | <stmartin> | That's all very well, but it doesn't seem to convert to Word8 |
| 07:02:10 | <quicksilver> | stmartin: you said you wanted 'from' Word8 |
| 07:02:19 | <quicksilver> | :t toEnum |
| 07:02:22 | <lambdabot> | forall a. (Enum a) => Int -> a |
| 07:02:26 | <kosmikus> | dons: I always hear this "Zipper" talk. What exactly is a zipper now? |
| 07:02:26 | <stmartin> | ACTION tries to sort what it is he wants |
| 07:02:48 | <quicksilver> | :t fromIntegral . toEnum |
| 07:02:51 | <lambdabot> | forall b. (Num b) => Int -> b |
| 07:03:04 | <quicksilver> | :t fromEnum . fromIntegral |
| 07:03:07 | <lambdabot> | forall a. (Integral a) => a -> Int |
| 07:03:20 | <stmartin> | I want to output a UTF8 encoded bytestream, so my encoder function is returing [Word8]. |
| 07:03:40 | <quicksilver> | stmartin: then you need to write a UTF8 encoding function :) |
| 07:03:51 | <dons> | kosmikus: in this case, we represent a workspace (a [Window]), as a zipper on lists, i.e. a one-hole cursor into a [Window], --> ([Window],Window,[Window]) |
| 07:04:06 | <stmartin> | But that kicks up a fuss with writeFile, so I'm making a wrapper around my encoder function which converts it to a [Char] |
| 07:04:12 | <dons> | this is the zipper for lists, a list with a hole punched in it, where the hole marks where window manager focus is. |
| 07:04:14 | <quicksilver> | stmartin: but if you only care about the low 7 bits, then fromIntegral . fromEnum should do |
| 07:04:23 | <quicksilver> | :t fromIntegral . fromEnum |
| 07:04:26 | <lambdabot> | forall b a. (Num b, Enum a) => a -> b |
| 07:04:30 | <dons> | kosmikus: the code for manipulating focus then becomes obvious, happily. |
| 07:04:32 | <kosmikus> | dons: yes, ok. |
| 07:04:32 | <stmartin> | No, I definately _do_ care about all the bits. |
| 07:04:46 | <quicksilver> | stmartin: then you have to write, or use, a UTF8 encoder |
| 07:04:55 | <quicksilver> | stmartin: there is no UTF8 encoder built in to haskell |
| 07:04:56 | <stmartin> | That's what I'm doing. |
| 07:04:57 | <kosmikus> | dons: handwritten zipper, or do you use some obscure generic programming library? |
| 07:05:18 | <dons> | no, its hand written, but is the same as you'd derive by hand on [a]. |
| 07:05:23 | <dons> | no obscure generics :-) |
| 07:05:23 | <twb> | kosmikus: http://twb.ath.cx/tmp/tmp.log |
| 07:05:30 | <kosmikus> | dons: good :) |
| 07:05:48 | <scodil> | is there a version of hoogle that indexes the opengl bindings? or any of the other non-standard stuff that ships with ghc? |
| 07:05:50 | <quicksilver> | dons: there was UTF8 library layered on ByteString, wasn' there? |
| 07:06:05 | <dons> | though the actual data structure, i found after the fact, is given as an example of type calculus in an intro to Conor's paper on one-hole context types. |
| 07:06:09 | <stmartin> | I'm making the UTF-8 encoder as a learning experience. |
| 07:06:34 | <quicksilver> | stmartin: the clearest thing probably is jsut to use 'ord' then |
| 07:06:35 | <dons> | quicksilver: hmm, yesh, a utrecht lib. better check the archives of the news page on haskell.org |
| 07:06:47 | <quicksilver> | stmartin: use 'ord' to convert Char to Int |
| 07:06:53 | <quicksilver> | stmartin: then split the cases |
| 07:07:01 | <kosmikus> | twb: this is completely normal. you have to *install* yi, then also download, build and install yi-gtk (or yi-vty, but I've not yet tried that), and only then the binary should work. |
| 07:07:11 | <quicksilver> | stmartin: (if its less than 127, just use that, if it's over 127 then...) |
| 07:07:24 | <twb> | kosmikus: confusing! I will try. |
| 07:07:34 | <stmartin> | ACTION checks if hpaste is back up yet. |
| 07:07:42 | <kosmikus> | twb: the yi binary tries to dynamically load modules that are provided only by the other package. |
| 07:08:21 | <twb> | kosmikus: where is yi-vty? |
| 07:08:22 | <dons> | kosmikus: oh, the other thing that keeps code clean, is requiring QC properties. patches aren't accepted on the core unless they have nice QC properties for their semantics. (idea is that ease of semi-formal statements about the code, hints at how good the code is) |
| 07:08:30 | <kosmikus> | twb: they should all be on hackage |
| 07:08:35 | <stmartin> | Is writeFile 8-bit clean? |
| 07:08:53 | <kosmikus> | dons: interesting idea. |
| 07:08:54 | <twb> | kosmikus: I don't know how to make hackage work on my Debian/GHC6.6 system. AFAICT I need to use hackage to install hackage |
| 07:09:05 | <kosmikus> | twb: now, you can just use the web. |
| 07:09:17 | <dons> | and, more interrestingly, that simplicity of QC statements about the code, indicates how usable the interface is. |
| 07:09:18 | <quicksilver> | :t writeFile |
| 07:09:21 | <lambdabot> | FilePath -> String -> IO () |
| 07:09:25 | <quicksilver> | stmartin: yes |
| 07:09:26 | <dons> | that's more controversial, I think, but seems to hold up. |
| 07:09:36 | <quicksilver> | stmartin: under some OSes you have to open the file in binary mode |
| 07:09:44 | <kosmikus> | twb: http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Editor |
| 07:09:48 | <lambdabot> | http://tinyurl.com/yqov7f |
| 07:09:54 | <dons> | window manager behaviour that is easy to state with QC, tends to be lead to more intuitive interfaces. |
| 07:10:27 | <kosmikus> | dons: do you have optional floating windows yet? ;) |
| 07:10:47 | <dons> | jcreigh: mentioned he'd got a simple version working this morning. |
| 07:10:58 | <stmartin> | Or would I be better to output a ByteString, do you think? |
| 07:11:05 | <dons> | so whether that makes it into 0.2, or 0.3, i'm not sure, but we'll have it soon enough. |
| 07:11:28 | <kosmikus> | great, I should make the switch then. |
| 07:11:40 | <dons> | you need floating layer support? |
| 07:11:43 | <dons> | for gimp or some such? |
| 07:11:50 | <kosmikus> | yes, sometimes. |
| 07:12:07 | <dons> | yeah. there must be other users in a similar state. hopefully we get that sorted soon |
| 07:12:40 | <quicksilver> | stmartin: depends what your objectives are |
| 07:13:06 | <twb> | kosmikus: so what am I supposed to do -- download the .tar.gz's for yi-vty and yi, and then build them as normal with Setup.hs? |
| 07:13:09 | <quicksilver> | stmartin: bytestring is probably better, but if you're only doing this as an exercise it's up to you how you limit the complexity :) |
| 07:13:11 | <stmartin> | Well I'd want to write it stdout or a file ideally. |
| 07:13:32 | <kosmikus> | twb: yes. you already have downloaded yi though. |
| 07:13:35 | <twb> | OK. |
| 07:13:51 | <twb> | I thought hackage also had a download feature, like apt |
| 07:13:51 | <kosmikus> | twb: so you only need the other one, I guess. |
| 07:13:58 | <twb> | I guess I misunderstood. |
| 07:14:17 | <quicksilver> | stmartin: you can do that equally well with either |
| 07:14:32 | <kosmikus> | twb: there's a program (cabal-install, I think) that can interface automatically with hackage, but you don't have to use it. |
| 07:15:18 | <kosmikus> | twb: I'm not sure in what state it currently is. But if it works it should track dependencies automatically. |
| 07:15:47 | <fuzan> | are odd drawing issues common with VTY? |
| 07:15:55 | <twb> | Oh, I evidently confused cabal-install with hackage. |
| 07:16:38 | <twb> | kosmikus: FYI, both yi-gtk and yi-vty appear to be in packages/ in the yi darcs repo |
| 07:17:29 | <kosmikus> | twb: sorry, I didn't realize you were using the darcs repo before. |
| 07:17:36 | <twb> | kosmikus: no problem. |
| 07:17:48 | <kosmikus> | twb: but you're right, of course. |
| 07:20:22 | <fuzan> | http://www.fuzan.org/before.PNG |
| 07:20:26 | <fuzan> | http://www.fuzan.org/after.PNG |
| 07:20:39 | <fuzan> | examples of the drawing issue i'm having with VTY |
| 07:20:43 | <fuzan> | on resize, it dissapears |
| 07:20:54 | <fuzan> | and it only occurs when it the text reaches the info bar |
| 07:23:10 | <quicksilver> | fuzan: never used it but it looks like a bug to me |
| 07:24:23 | <fuzan> | i'm thinking if not, my fill code is incorrect; but then again, it the width of images need to be identical, so i think i'm doing that correctly :\ |
| 07:25:03 | <quicksilver> | fuzan: other possibility of course is a but in that terminal |
| 07:25:10 | <quicksilver> | fuzan: FWIW, check it in a plain xterm too |
| 07:25:14 | <fuzan> | kk |
| 07:25:19 | <fuzan> | good call. |
| 07:27:43 | <fuzan> | happens in console too :\ |
| 07:28:06 | <sebell> | dons: ``code smell'' Eww! |
| 07:28:16 | <twb> | kosmikus: how do I do a user install of vty? |
| 07:28:19 | <fuzan> | it's odd, the last character before spaces propogate down |
| 07:28:30 | <twb> | kosmikus: ./Setup.lhs install --user? |
| 07:30:52 | <kosmikus> | twb: yes. |
| 07:34:53 | <jmg> | hi |
| 07:35:19 | <Lemmih> | Hey |
| 07:36:44 | <jmg> | i'am trying to find out where an exception is thrown during execution of an quickcheck property |
| 07:36:58 | <jmg> | any ideas? |
| 07:37:35 | <Lemmih> | Finding where exceptions are thrown from is a bit hard in Haskell. |
| 07:37:45 | <jmg> | yes |
| 07:37:47 | <Lemmih> | jmg: What kind of exception? |
| 07:37:57 | <jmg> | *** Exception: Prelude.(!!): negative index |
| 07:38:16 | <twb> | kosmikus: that doesn't seem to work... I mean that I have no root priviledges on this host, and I want to install somewhere in $HOME. |
| 07:38:18 | <jmg> | i am using fql, quicheck, Data.Set, and Data.Map in that code |
| 07:38:32 | <jmg> | s/fql/fgl/ |
| 07:39:24 | <jmg> | i don't use (!!), so the culprit must be in those libraries |
| 07:39:44 | <Lemmih> | Oh, hm. |
| 07:40:23 | <jmg> | and I didn't use any of the "unsafe" functions of Data.Set either |
| 07:40:38 | <kosmikus> | twb: and you can't install with --user? |
| 07:40:47 | <fuzan> | jmg: look for subtractions |
| 07:41:05 | <twb> | kosmikus: --user tries to use /usr/local |
| 07:41:15 | <kosmikus> | oh, you can provide a different prefix |
| 07:41:28 | <jmg> | you mean (\\) i suppose? |
| 07:41:53 | <fuzan> | jmg: something's gotta make a subtraction for !! to occur :) |
| 07:41:57 | <fuzan> | err, negative index |
| 07:42:05 | <fuzan> | ? [] \\ [5] |
| 07:42:14 | <fuzan> | > [] \\ [5] |
| 07:42:16 | <lambdabot> | [] |
| 07:42:18 | <kosmikus> | twb: Setup configure --prefix=/my/home/yi |
| 07:42:25 | <stmartin> | Well, that worked well. I love how you write an entire file in a single line. |
| 07:42:33 | <opqdonut> | > [1,2,3] \\ [1,3] |
| 07:42:34 | <lambdabot> | [2] |
| 07:42:38 | <osfameron> | ACTION invents an operator (let _ & x = x) in order to be able to write map (&1) and then realises that there is a handy function 'const' in the prelude that does just that... |
| 07:42:40 | <twb> | kosmikus: OK |
| 07:43:04 | <opqdonut> | osfameron: :P |
| 07:43:27 | <jmg> | fuzan: the strange thing is i don't use any indices for list elements myself |
| 07:43:37 | <fuzan> | a prelude's probably calling it |
| 07:43:46 | <opqdonut> | ?src (\\) |
| 07:43:47 | <lambdabot> | (\\) = foldl (flip delete) |
| 07:43:55 | <Lemmih> | jmg: The problem must be in fgl, then. |
| 07:43:59 | <opqdonut> | ?src delete |
| 07:43:59 | <lambdabot> | delete = deleteBy (==) |
| 07:44:21 | <Syzygy-> | ?src deleteBy |
| 07:44:21 | <lambdabot> | Source not found. It can only be attributed to human error. |
| 07:44:22 | <fuzan> | ?src liftM |
| 07:44:23 | <lambdabot> | liftM f m1 = do { x1 <- m1; return (f x1) } |
| 07:45:39 | <jmg> | thanks, i will try to avoid the usage of fgl and see what happens |
| 07:48:11 | <twb> | Well, I have no clue what this rats nest of makefiles did, but I got yi to boot. |
| 07:48:30 | <twb> | ...oh, except it's now saying error: YiConfig not loaded |
| 07:48:53 | <fuzan> | i'm not using yi until either binary builds or the build process is made sane :) |
| 07:48:53 | <kosmikus> | twb: yes, that's the next problem. |
| 07:51:17 | <kosmikus> | twb: see http://www.haskell.org/haskellwiki/Yi#How_to_Configure_Yi |
| 07:51:17 | <lambdabot> | Title: Yi - HaskellWiki |
| 07:51:18 | <jmob> | ?hoogle sleep |
| 07:51:18 | <lambdabot> | System.Win32.Process.sleep :: DWORD -> IO () |
| 07:51:18 | <twb> | ACTION 's head hurts |
| 07:51:18 | <ejt__> | dons: I just read you latest xmonad blog (v. good). I was wondering why you wrote 'go' as a fold across a list rather than just composing with (.) ? |
| 07:51:18 | <fuzan> | ?hoogle threadDelay |
| 07:51:18 | <lambdabot> | Control.Concurrent.threadDelay :: Int -> IO () |
| 07:51:45 | <jmob> | fuzan: yeah, that's what I wanted |
| 07:51:54 | <osfameron> | twb: yeah, I got that far. During the build it popped up a yi window. But when I closed it, I couldn't find the binary, and the one I did eventually find (in the "build" tree) moaned there was no YiConfig |
| 07:52:17 | <twb> | osfameron: make runtime-config |
| 07:53:34 | <osfameron> | twb: how odd! thanks. I wonder why that isn't done as part of build |
| 07:53:35 | <kosmikus> | fuzan: actually, the build process of yi is pretty easy compared to what it used to be. |
| 07:53:52 | <fuzan> | is it a viable alternative to emacs? |
| 07:54:07 | <kosmikus> | fuzan: not yet, but you can help make it into one ;) |
| 07:54:10 | <twb> | fuzan: no, since it has no web browser or newsreader |
| 07:54:24 | <fuzan> | you don't want me hacking on code yet :) |
| 07:54:36 | <twb> | It probably doesn't even have a directory editor or irc client! |
| 07:54:51 | <fuzan> | i really only care about multiple buffers/tabs and sytntax highlighting/indention |
| 07:54:53 | <quicksilver> | I believe it doesn't even have a tetris game, or an AI psychoanalyst |
| 07:54:55 | <kosmikus> | twb: there's a dired patch in darcs, but I haven't tested it. |
| 07:54:57 | <quicksilver> | it's really a very poor editor |
| 07:54:59 | <kosmikus> | twb: no irc client afaik. |
| 07:55:06 | <osfameron> | what! no pyscoanalyst? |
| 07:55:07 | <quicksilver> | ;) |
| 07:55:33 | <twb> | osfameron: it's not a psychoanalyst, it's a psychoTHERAPIST. |
| 07:55:39 | <osfameron> | the vim clone doesn't yet understand visual mode and other niceties. but it looks like a good start |
| 07:55:50 | <kosmikus> | I guess it'll soon (if it hasn't already) have a "built-in" lambdabot. |
| 07:56:19 | <osfameron> | twb: no wonder my editing has been inefficient while I was labouring under that delusion! thanks ;-) |
| 07:57:52 | <fuzan> | the vim mode should be put on hiatus |
| 07:57:58 | <fuzan> | who here even uses vim for coding? |
| 07:58:01 | <kosmikus> | me |
| 07:58:09 | <fuzan> | that's one :) |
| 07:58:19 | <jmob> | fuzan: I use emacs with viper |
| 07:58:21 | <earthy> | ACTION does |
| 07:58:27 | <fuzan> | jmob: for reals? |
| 07:58:30 | <earthy> | and what vim mode? there's dozens. :) |
| 07:58:35 | <jmob> | fuzan: for reals |
| 07:58:44 | <kosmikus> | earthy: he's referring to yi's vim-mode, I think |
| 07:58:45 | <earthy> | (well, maybe not dozens, but at least 3) |
| 07:58:47 | <earthy> | ah. ;) |
| 07:59:11 | <osfameron> | ACTION uses vim |
| 07:59:25 | <earthy> | which reminds me to look into shim some more |
| 07:59:31 | <twb> | No horizontal splitting, either. |
| 07:59:34 | <osfameron> | I wish it had a proper programming language as the backend, like emacs, but I love the keyboard bindings |
| 07:59:55 | <osfameron> | which is why I think yi is an interesting project - it's a proper extensible editor with a sane (roughly) scripting language |
| 08:00:07 | <earthy> | hum, yeah, well, you can compile vim against python. ;) |
| 08:00:10 | <twb> | Since when is Haskell a scripting language? |
| 08:00:15 | <opqdonut> | osfameron: do you know lua (the scripting language)? |
| 08:00:21 | <earthy> | since we want it to be. ;) |
| 08:00:25 | <twb> | "scripting" is a denigration |
| 08:00:36 | <earthy> | twb: explain that to John Ousterhout |
| 08:00:38 | <osfameron> | unlike vim which is lovely and powerful but has a pissy little hacked together thing that has grown organically and only got arrays and hashes in the latest release |
| 08:00:41 | <osfameron> | twb: my arse |
| 08:00:50 | <osfameron> | I'm a perl programmer. "Scripting" is a term of the utmost respect |
| 08:00:51 | <twb> | elisp is a scripting language because it has broken scoping and only byte compiles |
| 08:00:59 | <osfameron> | and in any case I meant it in a very specific way |
| 08:01:07 | <osfameron> | Haskell is the scripting language of yi |
| 08:01:12 | <osfameron> | because yi is scripted in it |
| 08:01:16 | <MarcWeber> | fuzan: Me too |
| 08:01:23 | <opqdonut> | osfameron: extension language might be more politically correct :) |
| 08:01:24 | <osfameron> | if you write a (dynamically plugged in) extension to yi, it will be in haskell |
| 08:01:27 | <twb> | yi is implemented and extended in Haskell; thus it is the implementation and extension language. |
| 08:01:36 | <dons> | heh. |
| 08:01:41 | <osfameron> | opqdonut: only if you think "scripting language" is denigratory, which I don't |
| 08:01:43 | <earthy> | ooh, flamewar. ;) |
| 08:01:48 | <dons> | this is funny |
| 08:01:57 | <dons> | what do we call haskell in the yi paper? |
| 08:01:59 | <earthy> | ACTION dons his asbestos suit |
| 08:02:08 | <osfameron> | opqdonut: I've heard good things about Lua, not used it |
| 08:02:08 | <opqdonut> | osfameron: i don't, but some people seem to :) |
| 08:02:09 | <twb> | ACTION ducks and covers |
| 08:02:12 | <dons> | ACTION earthys his dons suit |
| 08:02:12 | <dons> | what |
| 08:02:17 | <earthy> | ACTION laughs |
| 08:02:19 | <osfameron> | dons++ |
| 08:02:21 | <opqdonut> | osfameron: i'm working on an editor extensible in lua |
| 08:02:32 | <osfameron> | opqdonut: nice! got a blog/url/repo ? |
| 08:02:36 | <earthy> | anyway, yi is a laudable effort |
| 08:02:38 | <dons> | i think we call haskell an extension language, officially, in yi. |
| 08:02:40 | <rhythm> | why not just write the editor in it? its not like editing is CPU intensive |
| 08:02:45 | <twb> | lua is icky |
| 08:02:52 | <osfameron> | opqdonut: I have a half-baked project to write an editor in Perl |
| 08:02:53 | <dons> | rhythm: hmm, it can be. |
| 08:02:56 | <earthy> | I just probably will never use it |
| 08:02:58 | <opqdonut> | osfameron: http://opqdonut.users.paivola.fi/repos/editor |
| 08:03:00 | <twb> | Or at least all the projects that use lua seem to suck and be badly broken |
| 08:03:01 | <lambdabot> | Title: Index of /repos/editor |
| 08:03:05 | <dons> | big buffers. (think of some slow javascript editor in the browser) |
| 08:03:06 | <opqdonut> | osfameron: i considered perl but lua has a nicer api |
| 08:03:29 | <opqdonut> | twb: you've seen the wrong projects :) |
| 08:03:29 | <osfameron> | opqdonut: fair enough. I'm a perl dev, so I know it, and it has CPAN ;-) |
| 08:03:34 | <twb> | osfameron: ion? |
| 08:03:37 | <opqdonut> | ion3 is very nice |
| 08:03:42 | <twb> | Ion is a horrible mistake |
| 08:03:47 | <dons> | hah |
| 08:04:04 | <twb> | It only looks good compared to wmi |
| 08:04:05 | <dons> | twb, you're funny :-) its like watching flames shoot out left and right ;-) |
| 08:04:07 | <opqdonut> | if you want more examples, try adobe lightroom, grim fandango and wow on the commercialside |
| 08:04:30 | <opqdonut> | and lighttpd lua cgi-scripting from open source |
| 08:04:36 | <twb> | Well, I've only seen grime crash twice in two days ;-) |
| 08:04:37 | <fuzan> | too bad wow is for stupid people. |
| 08:05:01 | <dons> | ejt: hey. |
| 08:05:07 | <osfameron> | Lua sounded interesting as a proof that scripting languages are "better" than C++ etc. for games programming and other low level tasks (as long as the core engine is implemented efficiently) |
| 08:05:08 | <dons> | i wrote go as a fold to fake a state monad :-) |
| 08:05:54 | <twb> | lua only makes sense if you've already decided to use a stupid language like C or C++ for the core. If you use something sensible for the core like Common Lisp or Forth, you get the extension language for free. |
| 08:06:19 | <twb> | ACTION has spoken |
| 08:06:20 | <opqdonut> | twb: forth might be sensible but it's a pain to code |
| 08:06:24 | <dons> | yeah, if you want a high level language to extend a low level one in, an out of the box extension system is a reasonable choice. |
| 08:06:25 | <ejt> | dons: have to think about that for a bit ... |
| 08:06:33 | <dons> | to recode twb's statement in a less inflammatory way ;-) |
| 08:06:35 | <osfameron> | twb: yes, but if your staff know C and scripting language, then it's a good fit. Lisp would be lovely, I guess, but not everyone has the mindset or experience |
| 08:06:47 | <dons> | ejt, I wanted to write: do a ; b ; c ; d |
| 08:06:49 | <fuzan> | dons: this look like a vty bug or no? : http://fuzan.org/before.PNG http://fuzan.org/after.PNG |
| 08:06:56 | <dons> | ejt, with each applied to a threaded stackSet |
| 08:07:07 | <dons> | hence, foldl [a, b , c, d] s |
| 08:07:08 | <dons> | :-) |
| 08:07:13 | <twb> | ACTION is a sysadmin, and can afford to be principled (sack c/java/php coders!) about programming |
| 08:07:15 | <fuzan> | it's odd, the last character before spaces propogate down, and only if the text reaches the info bar |
| 08:07:24 | <dons> | fuzan: hmm, talk to sorear or jyp. |
| 08:07:29 | <dons> | my involvement in yi now is minimal. |
| 08:07:32 | <fuzan> | kk |
| 08:07:34 | <dons> | sorear is the vty author |
| 08:08:10 | <twb> | As a user for the last three minutes, I think the next feature Yi should get is a stinking big texinfo manual |
| 08:08:18 | <dons> | hah |
| 08:08:34 | <dons> | good idea. but it is supposed to be either vim or emacs like. so you should be able to guess ;-) |
| 08:08:36 | <ejt> | dons: thx |
| 08:09:35 | <quicksilver> | lua is great, as a 'dynamic extension to C++' |
| 08:09:38 | <twb> | It certainly seems more emacs-like than it was when I tried it a few years ago |
| 08:09:44 | <opqdonut> | quicksilver: or c |
| 08:09:45 | <quicksilver> | or indeed, C programs with an object model |
| 08:09:55 | <twb> | quicksilver: I'm prepared to concede that point. |
| 08:10:12 | <twb> | It just seems ludicrous to me that anyone with proper training would use C++ in the first place. |
| 08:10:23 | <opqdonut> | c++ is a nice language |
| 08:10:26 | <twb> | ACTION pokes johnw |
| 08:10:27 | <quicksilver> | it is also really simple to embed, which is nice for the programmer |
| 08:10:40 | <quicksilver> | (not that I'm saying there aren't lisps which are simple to embed) |
| 08:11:36 | <ejt> | dons: have you thought about using a golden spiral to tile the windows in xmonad ? |
| 08:11:45 | <opqdonut> | simplicity is lua's greatest asset |
| 08:11:55 | <shiva> | hi babies |
| 08:11:56 | <opqdonut> | ejt: ugh, sound pretty unusable |
| 08:12:09 | <kolmodin> | opqdonut: why lua? |
| 08:12:13 | <shiva> | i am shiva |
| 08:12:15 | <quicksilver> | actually ejt's idea is pretty cool |
| 08:12:23 | <quicksilver> | ejt: but use GL scaling |
| 08:12:24 | <opqdonut> | cool != usable |
| 08:12:31 | <quicksilver> | ejt: so the outer ones are just compressed |
| 08:12:44 | <quicksilver> | then, I think, you can get an unbounded number of windows in finite space? |
| 08:12:45 | <ejt> | I didn't mean anything that fancy |
| 08:13:06 | <opqdonut> | kolmodin: why not? |
| 08:13:09 | <quicksilver> | but all of fixed size |
| 08:13:20 | <quicksilver> | so you add more windows and never decrease the size of your 'main' ones |
| 08:13:23 | <quicksilver> | could be a cool hack :) |
| 08:13:47 | <ejt> | ACTION goes to get the darcs version of xmonad |
| 08:13:54 | <kolmodin> | opqdonut: good question :) |
| 08:14:01 | <twb> | Can you :select - in xmonad, or are all windows always displayed? |
| 08:14:18 | <dons> | ejt: hmm.... sound interesting. |
| 08:14:27 | <kolmodin> | opqdonut: what I meant is that you must have picked between many languages |
| 08:14:51 | <dons> | ejt: yeah, you can write your own layout algos in Config.hs |
| 08:14:57 | <opqdonut> | kolmodin: basically between perl, python and lua |
| 08:15:05 | <dons> | and then if its fun , darcs send it as a patch against the contribs repo |
| 08:15:08 | <opqdonut> | and lua is just so pretty and simple i decided to use it |
| 08:15:21 | <dons> | i'd like xmonad to be a bit of a platform for tiling algos. they're rather trivial to write. |
| 08:15:29 | <kolmodin> | opqdonut: ah, ok. I know some python and would probably have picked that just because I know it |
| 08:15:33 | <dons> | twb: do you mean, are all windows always displayed? |
| 08:15:40 | <osfameron> | gah! don't talk to me about lua. I might have to learn it, and I still have haskell, erlang, C to get through... |
| 08:15:50 | <opqdonut> | kolmodin: python is overly bloated for this purpose and a pain to embed |
| 08:15:59 | <dons> | i'm not sure lua offers a lot to be learnt, though, does it? |
| 08:16:07 | <kolmodin> | opqdonut: ah. bummer. I've always thought that it'd be easy |
| 08:16:13 | <dons> | other than for how to write a C extension language system. |
| 08:16:14 | <opqdonut> | and i wanted good text-handling features, like perl has |
| 08:16:18 | <twb> | dons: yes, that's my question |
| 08:16:21 | <osfameron> | well, there is that. I also intend to learn Ruby, but I guess that will take a day or two ;-) |
| 08:16:24 | <kolmodin> | opqdonut: guess lua more or less is built to build in |
| 08:16:40 | <dons> | twb, no, since there are virtual workspaces, so windows you don't want are tossed. (secondly) it depends on the layout algorithm in play |
| 08:16:42 | <opqdonut> | so i decided to go with pcre+lua+c engine |
| 08:16:53 | <osfameron> | why not pure lua ? |
| 08:16:55 | <kolmodin> | opqdonut: oh, I've always thought python has excellent text-handling |
| 08:16:58 | <twb> | ACTION doesn't understand the point of workspaces |
| 08:17:06 | <opqdonut> | dons: well, yeah the learning part was quite short |
| 08:17:17 | <opqdonut> | now i'm trying to make it usable and good |
| 08:17:28 | <opqdonut> | osfameron: because i like C :) |
| 08:17:42 | <fuzan> | what is everyone's opinion of objC/ |
| 08:17:43 | <opqdonut> | and curses and memory management are nicer in c than in lua |
| 08:17:45 | <twb> | Generally I have one window -- emacs. Sometimes I have another one, such as evince or display(1), which I want to take up either the whole screen, or horizontally split -- usually 1:1 or 2:1 |
| 08:17:47 | <dons> | twb, it depends on the tiling algorithm in use, and no, you don't need to have all windows displayed. |
| 08:17:51 | <boegel> | anyone from Scandinavia in here? |
| 08:17:55 | <opqdonut> | boegel: me |
| 08:17:56 | <dons> | twb, right. sound good. |
| 08:18:02 | <kolmodin> | boegel: aye |
| 08:18:03 | <opqdonut> | boegel: or actually finland :P |
| 08:18:06 | <dons> | twb, you'd switch between fullscreen and vertical tiling mode. |
| 08:18:14 | <twb> | dons: ah, I see. |
| 08:18:34 | <boegel> | opqdonut, kolmodin: can you guys joing #haskell-blah, I don't want to spam #haskell with my pointless questions |
| 08:18:37 | <twb> | In ratpoison, I do :only (fullscreen) or :hsplit [1/3 ] |
| 08:18:45 | <boegel> | or join even |
| 08:18:52 | <dons> | yeah, so that's much the same as xmonad. |
| 08:18:55 | <osfameron> | opqdonut: er.... "memory management" is easier in C than Lua? (* osfameron faints) |
| 08:19:08 | <dons> | it has fullscreen, vsplit and hsplit, with custom ratios. (2%3 I like), or (1%2) |
| 08:19:14 | <twb> | dons: what does xmonad offer that ratpoison doesn't? |
| 08:19:17 | <dons> | but you can write your own layouts in Config.hs |
| 08:19:26 | <dons> | its 10x smaller? |
| 08:19:35 | <twb> | Smaller? It depends on Haskell! |
| 08:19:37 | <dons> | you can write pure functions in Config.hs to extend it? |
| 08:19:50 | <dons> | the code base is much smaller. |
| 08:19:58 | <twb> | True |
| 08:19:58 | <dons> | so you can hope to understand every line. |
| 08:20:09 | <dons> | there's quite a few points of differentiation. |
| 08:20:14 | <dons> | i think xmonad looks nicer. |
| 08:20:15 | <twb> | That's probably only because it's younger, tho :-) |
| 08:20:27 | <dons> | hmm, not so sure. |
| 08:20:44 | <kolmodin> | opqdonut: ok. I've noticed that we're all different :D |
| 08:21:17 | <quicksilver> | osfameron: presumably only in the sense 'if you need to do manual memory management for some reason' |
| 08:21:17 | <dons> | twb, try it out. then you can make a detailed comparison |
| 08:21:43 | <dons> | i'm a ion/wmii/dwm refugee, not ratpoision, so can't offer much more on ratpoison |
| 08:21:56 | <fuzan> | i likes the wmii. |
| 08:22:01 | <twb> | I looked at those last week, and they just seemed plain insane |
| 08:22:39 | <twb> | Using environment variables and string pipes for customization? Eek. |
| 08:22:39 | <dons> | they're not. |
| 08:22:49 | <dons> | oh, that's cute. but probably uneeded. |
| 08:22:59 | <dons> | means you can script it in any language. good idea |
| 08:23:31 | <twb> | You can do the same with ratpoison, all it does is look for properties on the root window |
| 08:23:55 | <stmartin> | Ahh procrastination. The best way to learn Haskell. |
| 08:24:45 | <profmakx> | stmartin: It`s the laziness that counts. |
| 08:25:26 | <stmartin> | ACTION is reminded of a paper my Lecture in Functional told us about today: "Listlessness is better than Laziness". |
| 08:28:16 | <aleator> | I'm blind. Is there a ready made way of formatting floats for printing in ghc? |
| 08:28:32 | <stmartin> | Text.Printf |
| 08:28:56 | <fuzan> | dinounix: sourcemage? i went to school with sandalle :) |
| 08:29:18 | <quicksilver> | aleator: showEFloat, showFFloat |
| 08:29:43 | <quicksilver> | :t showEFloat |
| 08:29:46 | <lambdabot> | forall a. (RealFloat a) => Maybe Int -> a -> String -> String |
| 08:29:57 | <quicksilver> | showEFloat (Just 4) 1.2345467 |
| 08:29:59 | <dinounix> | fuzan: really? nice :) |
| 08:30:10 | <aleator> | quicksilver: Thanks. |
| 08:30:23 | <quicksilver> | > showEFloat (Just 4) 1.2345467 "blah" |
| 08:30:25 | <lambdabot> | "1.2345e0blah" |
| 08:30:30 | <quicksilver> | > showEFloat (Just 4) 1.2345467 "" |
| 08:30:32 | <lambdabot> | "1.2345e0" |
| 08:30:36 | <quicksilver> | > showFFloat (Just 4) 1.2345467 "" |
| 08:30:37 | <lambdabot> | "1.2345" |
| 08:30:52 | <profmakx> | me likey |
| 08:33:22 | <Cheery> | @ho Word8 -> Char |
| 08:33:22 | <lambdabot> | Maybe you meant: hoogle hoogle+ . bf echo ft ghc id pl rc show v wn yow |
| 08:33:28 | <Cheery> | @hoogle Word8 -> Char |
| 08:33:29 | <lambdabot> | No matches, try a more general search |
| 08:33:37 | <Cheery> | @hoogle+ Word8 -> Char |
| 08:33:49 | <kosmikus> | dons: is there a channel for yi? |
| 08:34:04 | <quicksilver> | Cheery: chr . fromIntegral |
| 08:34:16 | <quicksilver> | Cheery: or toEnum . fromIntegral if you prefer |
| 08:34:40 | <quicksilver> | kosmikus: personally I think 'yi' is ontopic here until it causes problems |
| 08:34:54 | <quicksilver> | kosmikus: don't split channels until you have proved there is enough traffice to deserve it IMO |
| 08:34:55 | <Cheery> | @hoogle chr |
| 08:34:55 | <lambdabot> | Char.chr :: Int -> Char |
| 08:34:55 | <lambdabot> | Text.PrettyPrint.HughesPJ.Chr :: Char -> TextDetails |
| 08:34:55 | <lambdabot> | Text.Regex.matchRegex :: Regex -> String -> Maybe [String] |
| 08:35:26 | <kosmikus> | quicksilver: I didn't ask because I wanted to take traffic away, but because I was curious if I'm missing discussions by not being there. |
| 08:35:55 | <quicksilver> | kosmikus: in that case, I would also like to know the answer :) |
| 08:36:40 | <earthy> | ACTION grins |
| 08:38:57 | <earthy> | okay, that's about the point where I start taking up the gauntlet thrown down by dcoutts... |
| 08:39:23 | <earthy> | ACTION murmurs a bit to himself 'wxHaskell isn't all bad' |
| 08:39:47 | <kosmikus> | did he imply something else? |
| 08:39:58 | <osfameron> | isn't the main complaint that wxHaskell is more of a building block than a really haskellish solution ? |
| 08:40:46 | <dons> | i thought it had quite a high level layer? |
| 08:40:52 | <dons> | kosmikus: no yi channel |
| 08:41:38 | <osfameron> | I was thinking of wxFruit being built on top of it |
| 08:42:02 | <earthy> | wxHaskell actually has a higher level of interfacing than gtk2hs does, afaiui |
| 08:42:14 | <earthy> | it's just woefully undermaintained |
| 08:49:53 | <stmartin> | What's the way to exit cleanly out of a Haskell program? I notice there doesn't seem to be exit() defined. |
| 08:50:07 | <Cheery> | what would be the nicest way to make cyclic redundancy check in haskell? |
| 08:50:46 | <stmartin> | nm. /me just found System.Exit |
| 09:18:37 | <ivanm> | with lists, what's the difference between concatMap and =<< (in terms of implementation, efficiency, etc) ? |
| 09:19:06 | <Saizan> | ?src ([]) >>= |
| 09:19:06 | <lambdabot> | Source not found. Maybe if you used more than just two fingers... |
| 09:19:21 | <fuzan> | ?src (>>=) |
| 09:19:21 | <lambdabot> | Source not found. This mission is too important for me to allow you to jeopardize it. |
| 09:19:57 | <Saizan> | ivanm: with >>= you need a typeclass method resolution, so a method dictionary and a lookup in ghc |
| 09:20:44 | <ivanm> | so concatMap would be slightly faster as it doesn't need to bother checking if its a list? |
| 09:20:47 | <Cheery> | is there a shorthand notation for something like: a . a . a . a . a ? |
| 09:20:49 | <ivanm> | it _has_ to be a list? |
| 09:20:54 | <ivanm> | Cheery: iterate? |
| 09:21:00 | <Cheery> | thanks |
| 09:21:10 | <ivanm> | > take 10 . iterate succ $ 1 |
| 09:21:21 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10] |
| 09:21:29 | <Cheery> | or wait, that's not what I'm looking for |
| 09:21:38 | <ivanm> | > last . take 10 . iterate succ $ 1 |
| 09:21:39 | <lambdabot> | 10 |
| 09:21:43 | <ivanm> | ^^ |
| 09:21:57 | <Jaak> | > (iterate succ 1) !! 100 |
| 09:21:58 | <lambdabot> | 101 |
| 09:22:01 | <ivanm> | that's what you're after, isn't it? |
| 09:22:07 | <ivanm> | or you could just do that :s |
| 09:22:13 | <ivanm> | ACTION forgot about list indexing |
| 09:22:58 | <Cheery> | @type iterate |
| 09:23:00 | <lambdabot> | forall a. (a -> a) -> a -> [a] |
| 09:23:16 | <ivanm> | @hoogle (a -> a) -> a -> [a] |
| 09:23:17 | <lambdabot> | Prelude.iterate :: (a -> a) -> a -> [a] |
| 09:23:17 | <lambdabot> | List.deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a] |
| 09:23:17 | <lambdabot> | List.insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a] |
| 09:23:32 | <ivanm> | looks like iterate is it... just do what Jaak did |
| 09:23:40 | <Cheery> | @type (.) |
| 09:23:42 | <lambdabot> | forall b c a. (b -> c) -> (a -> b) -> a -> c |
| 09:24:10 | <Saizan> | ?type \a arg -> replicate 5 a `sequence` arg |
| 09:24:12 | <lambdabot> | Ambiguous occurrence `sequence' |
| 09:24:12 | <lambdabot> | It could refer to either `sequence', imported from Control.Monad.Writer |
| 09:24:18 | <dons> | sorry |
| 09:24:19 | <Saizan> | ?type \a arg -> replicate 5 a `Prelude.sequence` arg |
| 09:24:21 | <lambdabot> | forall t a. (Monad ((->) t)) => (t -> a) -> t -> [a] |
| 09:24:22 | <Cheery> | @type replicate |
| 09:24:24 | <lambdabot> | forall a. Int -> a -> [a] |
| 09:24:28 | <dons> | ?pl \a arg -> replicate 5 a `Prelude.sequence` arg |
| 09:24:29 | <lambdabot> | (line 1, column 25): |
| 09:24:29 | <lambdabot> | unexpected "`" |
| 09:24:29 | <lambdabot> | expecting variable, "(", operator or end of input |
| 09:24:35 | <dons> | ?pl \a arg -> replicate 5 a `sequence` arg |
| 09:24:35 | <lambdabot> | sequence . replicate 5 |
| 09:24:56 | <dons> | ?hoogle replicateM |
| 09:24:57 | <lambdabot> | Control.Monad.replicateM :: Monad m => Int -> m a -> m [a] |
| 09:24:57 | <lambdabot> | Control.Monad.replicateM_ :: Monad m => Int -> m a -> m () |
| 09:25:08 | <matthew-_> | @seen sjanssen |
| 09:25:09 | <lambdabot> | sjanssen is in #haskell-overflow, #ghc, #gentoo-haskell, #xmonad and #haskell. I don't know when sjanssen last spoke. |
| 09:26:02 | <ivanm> | back to what I asked above: in general, for lists, is concatMap better than bind? |
| 09:30:20 | <osfameron> | seen Apocalisp? |
| 09:30:26 | <osfameron> | @seen Apocalisp? |
| 09:30:26 | <lambdabot> | I haven't seen Apocalisp?. |
| 09:30:30 | <osfameron> | stupid bot |
| 09:31:06 | <int-e> | ivanm: it's a matter of taste I think - >>= is shorter but harder to understand (until you've got used to it) |
| 09:31:44 | <ivanm> | *nod* |
| 09:31:49 | <matthew-_> | oh, whoops, int-e, it was you I was looking for! /me must remember mapping between irc and email better... |
| 09:32:26 | <kaol> | @src (=<<) |
| 09:32:26 | <lambdabot> | f =<< x = x >>= f |
| 09:32:38 | <int-e> | matthew-_: oh. my nick doesn't make that particularily easy though. |
| 09:32:48 | <kaol> | wow. it's a palindrome |
| 09:33:12 | <matthew-_> | int-e: I think you're right, but I also think it should work with synonynms |
| 09:33:50 | <matthew-_> | int-e: because you should be able to determine the current type, apply any synonynms to it and work out which instance it came from. I think |
| 09:34:50 | <int-e> | matthew-_: for type synonyms, you can assign the same type multiple times though. |
| 09:34:55 | <matthew-_> | oh! |
| 09:35:06 | <int-e> | matthew-_: which in an open type system means you can't do a reverse mapping. |
| 09:35:13 | <matthew-_> | absolutely |
| 09:35:50 | <matthew-_> | that rather ruins the idea that associated types replace fundeps though? Or is this just the same problem as with open classes |
| 09:35:51 | <matthew-_> | ? |
| 09:36:54 | <matthew-_> | so in fact, the reverse mapping is guaranteed by the fact that you must have unique constructors on the data type. |
| 09:37:15 | <int-e> | matthew-_: well, they do replace one-way fundeps. Foo a b | a -> b can be expressed with Foo a where type B a :: * |
| 09:37:34 | <ivanm> | so where is List defined as a monad? /me can't find it in the docs |
| 09:38:45 | <int-e> | matthew-_: if I understand the meaning of data B a :: * correctly, yes. |
| 09:39:40 | <stmartin> | Is it my imagination, or does the Haskell report make no mention of how to catch errors? |
| 09:40:12 | <matthew-_> | stmartin: I don't know, but errors are covered in "tackling the awkward squad" |
| 09:41:20 | <matthew-_> | int-e: the reverse mapping's an interesting properly - one that you can't do with normal functional dependencies? |
| 09:41:45 | <Cheery> | @hoogle Int -> (a -> a) -> (a -> a) |
| 09:41:45 | <lambdabot> | No matches, try a more general search |
| 09:41:51 | <Cheery> | @hoogle (a -> a) -> (a -> a) |
| 09:41:51 | <lambdabot> | No matches, try a more general search |
| 09:41:55 | <int-e> | @type catch |
| 09:41:57 | <lambdabot> | forall a. IO a -> (IOError -> IO a) -> IO a |
| 09:42:15 | <matthew-_> | not without class F a b | a -> b, b -> a; but the indexed type doesn't demand the b -> a |
| 09:42:43 | <ivanm> | @hoogle (a -> b) -> (b -> c) |
| 09:42:44 | <lambdabot> | No matches, try a more general search |
| 09:42:51 | <ivanm> | @hoogle (a -> b) -> (c -> d) |
| 09:42:51 | <lambdabot> | No matches, try a more general search |
| 09:42:59 | <ivanm> | well, that's as general as I can think of... |
| 09:43:24 | <int-e> | matthew-_: well, Foo a b | a -> b, b -> a is supposed to express that, but as we've seen a few days ago it doesn't really work. |
| 09:43:44 | <qwr> | @hoogle a - |
| 09:43:44 | <lambdabot> | Hoogle Error: Parse Error: Unexpected character '-' |
| 09:43:52 | <qwr> | @hoogle a -> (b -> c) -> d |
| 09:43:52 | <lambdabot> | Prelude.(.) :: (b -> c) -> (a -> b) -> a -> c |
| 09:43:53 | <lambdabot> | Control.Parallel.Strategies.(-|) :: (a -> b) -> Strategy b -> (b -> c) -> a -> c |
| 09:43:53 | <lambdabot> | Control.Parallel.Strategies.(-||) :: (a -> b) -> Strategy b -> (b -> c) -> a -> c |
| 09:44:00 | <int-e> | matthew-_: as you just wrote. yep. |
| 09:47:43 | <int-e> | stmartin: section 7.3 of the haskell report specifies catch - but that only works for IO errors. The Control.Exception stuff isn't specified by Haskell 98. |
| 09:48:20 | <stmartin> | Thanks. I've just looked at that. Seems to do the trick. Easy to forget how long ago '98 was. |
| 09:49:13 | <stmartin> | Actually, its not catching the error thrown by read() when I pass in a non-number. Any ideas? |
| 09:49:53 | <stmartin> | catch (dec_to_roman s) (\e -> hPutStr stderr $ show e) -- read is called within doc_to_roman |
| 09:50:22 | <stmartin> | Oh. I think perhaps I might need evaluate |
| 09:52:38 | <int-e> | > (reads :: ReadS Int) "1421" |
| 09:52:38 | <lambdabot> | [(1421,"")] |
| 09:52:39 | <int-e> | or you can do it with pure code and reads. |
| 09:52:54 | <stmartin> | The version in Control.Exception does work better (just had to hide the Prelude version) |
| 09:53:03 | <haskellnew> | is there any api for calculating sha hash |
| 09:54:00 | <Lemmih> | haskellnew: Not in the standard libraries. |
| 09:54:12 | <dons> | system $ "sha1 file.txt" -- ? |
| 09:54:49 | <Lemmih> | haskellnew: There are several implementations available. Some written in Haskell, some using a C implementation. |
| 09:55:05 | <dons> | in the crypto lib? |
| 09:55:24 | <haskellnew> | Lemmih: ok , where do i find these crypto lib |
| 09:55:38 | <dons> | on hackage, iirc. |
| 09:55:43 | <dons> | ?hackage crypto |
| 09:55:44 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/crypto |
| 09:55:55 | <dons> | nope. |
| 09:56:03 | <dons> | let me see.. |
| 09:56:14 | <dons> | Crypto. |
| 09:56:19 | <dons> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Crypto-3.0.3 |
| 09:56:22 | <lambdabot> | http://tinyurl.com/2z4ujp |
| 09:56:29 | <dons> | Data.Digest.SHA1 module |
| 09:58:11 | <quicksilver> | Saizan: I don't believe ghc generates dictionary lookups when the type is statically known |
| 09:58:45 | <Lemmih> | ACTION prefers the minimal C implementations with a nice 'ByteString -> ByteString' interface. |
| 09:58:51 | <gleb> | quicksilver: why are monad transformers slow then? |
| 10:00:06 | <quicksilver> | gleb: I didn't think they were :P |
| 10:00:16 | <haskellnew> | dons : Lemmih , thanks i will download it , bye |
| 10:00:32 | <quicksilver> | gleb: but I can hypothesise that monad transformers make it easy to write code which is polymorphic, so dictionaries are required |
| 10:01:05 | <dons> | they don't have to be slow |
| 10:01:22 | <dons> | we use monad transformers in Data.Binary, which are massively inlined and optimised |
| 10:01:33 | <dons> | (i think mtl could do with some INLINE aggression, in fact) |
| 10:01:41 | <quicksilver> | dons: have you experienced code which turns out to be slow, with the bottleneck being dictionary lookup? |
| 10:02:23 | <dons> | yeah, which then required inline pragmas to encourage the compiler a bit. |
| 10:02:26 | <quicksilver> | ACTION nods |
| 10:02:35 | <dons> | not terribly common, one or two cases over serveral years |
| 10:02:40 | <quicksilver> | ghc can't do cross-module specialisation, can it? |
| 10:02:47 | <quicksilver> | specialisation over type class, not over constructor, I mean |
| 10:02:50 | <dons> | it does, but not as agressively as within a module |
| 10:02:54 | <quicksilver> | ah, interesting |
| 10:02:57 | <dons> | and generally not without INLINE pragmas to push it |
| 10:03:04 | <quicksilver> | can it specialise functions (as distinct from methods) ? |
| 10:03:14 | <dons> | hmm, yes, pretty sure it can. |
| 10:03:19 | <dons> | (i'd have to double check) |
| 10:03:22 | <quicksilver> | ACTION ndos |
| 10:03:53 | <dons> | the monad stuff in Data.Binary is entirely inlined and specialised, fwiw |
| 10:04:02 | <dons> | (leading to slow compile times for users of Data.Binary and -O2 !) |
| 10:04:09 | <dons> | but in the end you end up with straight line Addr# code |
| 10:04:21 | <dons> | although you start with get/put monoid/monad code. |
| 10:04:59 | <quicksilver> | ACTION nods |
| 10:05:00 | <quicksilver> | nice |
| 10:05:41 | <dons> | we use this guy, |
| 10:05:41 | <dons> | instance Monad Get where |
| 10:05:42 | <dons> | return a = Get (\s -> (a, s)) |
| 10:05:42 | <dons> | m >>= k = Get (\s -> let (a, s') = unGet m s |
| 10:05:42 | <dons> | in unGet (k a) s') |
| 10:05:44 | <dons> | fail = failDesc |
| 10:05:46 | <dons> | specialised on |
| 10:05:50 | <dons> | data S = S {-# UNPACK #-} !B.ByteString -- current chunk |
| 10:05:50 | <dons> | L.ByteString -- the rest of the input |
| 10:05:50 | <dons> | {-# UNPACK #-} !Int64 |
| 10:06:04 | <dons> | and ghc happily inlines away all dictionaries, and all monads , and just about everything. |
| 10:06:14 | <dons> | but it did require careful placement of INLINE pragmas |
| 10:06:50 | <dons> | (all primitive read/write ops are inlined, for example: |
| 10:06:51 | <dons> | getWord16be :: Get Word16 |
| 10:06:51 | <dons> | getWord16be = do |
| 10:06:51 | <dons> | s <- readN 2 id |
| 10:06:51 | <dons> | return $! (fromIntegral (s `B.index` 0) `shiftl_w16` 8) .|. |
| 10:06:54 | <dons> | (fromIntegral (s `B.index` 1)) |
| 10:06:56 | <dons> | {-# INLINE getWord16be #-} |
| 10:07:13 | <osfameron> | optimizing haskell must be interesting (for the appropriate values of interesting) |
| 10:07:23 | <quicksilver> | dons: so, in a sense, INLINE also means 'specialise'? |
| 10:07:28 | <quicksilver> | dons: the one triggers the other? |
| 10:07:32 | <quicksilver> | inline-and-specialise |
| 10:07:35 | <dons> | yeah |
| 10:07:49 | <dons> | osfameron: it is fun, you get to do some really high level thinking, to get low level performance |
| 10:08:01 | <dons> | things like Data.Binary's new rewrite rules on applicative functors (!) |
| 10:08:10 | <dons> | which lift and combine bounds checks |
| 10:08:23 | <dons> | so that inner loops are entirely unchecked memory writes |
| 10:08:47 | <dons> | that kind of fun you don't get with C, because you just don't know the things about the code we have in haskell: purity, and precise type information |
| 10:09:02 | <dons> | purity enables all sorts of cool agressive optimisations |
| 10:09:09 | <stmartin> | I'm trying to make a wrapper for read that catches any possible exception and rethrows it (with a nicer error message). |
| 10:09:12 | <stmartin> | read' s = catch (read s) (error "Not a number") |
| 10:09:21 | <stmartin> | But the type checker is complaining... |
| 10:09:25 | <osfameron> | that's kind of what I was wondering (though I don't have the CS background to get all of that), but it kind of seems like there's lots of scope for cleverness and fun |
| 10:09:44 | <gleb> | dons: i'm stupid. It seems to me that Get monad identical to State monad. Why duplicate? Is it necessary for inlining? |
| 10:09:55 | <dons> | gleb: yes, in this case. |
| 10:10:10 | <dons> | the missing INLINE pragmas in mtl meant that ghc wouldn't specialise/optimise across the package boundar |
| 10:10:26 | <dons> | we could go back into mtl, and add the necessary tweaks we did in binary, but it was easier to just modify that code |
| 10:11:01 | <dons> | also means we don't have to worry about preserving unspecified laziness behaviour in State. |
| 10:12:02 | <quicksilver> | I still have this nagging suspicion that haskell is just begging for whole-program compilation |
| 10:12:20 | <dons> | that's what jhc sez too :-) |
| 10:12:25 | <dons> | and i'd agree, actually |
| 10:12:27 | <earthy> | ACTION nods |
| 10:12:33 | <quicksilver> | I remember convincing myself 10 years ago that for a language to have powerful abstractions and be really fast, it essentially needs whole-program compilation |
| 10:12:36 | <dons> | heavy inlining is turning into whole-program optimisation by stealth |
| 10:12:44 | <quicksilver> | but in principle there is a 'middle way' |
| 10:12:55 | <quicksilver> | separate compilation to some kind of 'intermediate form' |
| 10:12:57 | <earthy> | if one looks at e.g. Clean, and the results the Clean team get |
| 10:12:58 | <dons> | inline pragmas in Data.Binary basically inline the entire library into a user's code, which then gets optimise as if it was just one module. |
| 10:13:01 | <quicksilver> | and then whole-program optimisation |
| 10:13:21 | <earthy> | they don't really do whole-program optimisation, but they *do* assume a closed world, which makes a lot of optimizations a whole lot easier |
| 10:13:23 | <dons> | yeah, the improved native code gen should tell us how much the clean advantage is just in the code gen. |
| 10:13:27 | <osfameron> | is whole-program compliation in constrast with incremental compilation ? |
| 10:13:44 | <quicksilver> | of course ghc's .hi files, in the presence of INLINE pragmas, are in fact a simple version of the 'intermediate form' I'm talking about |
| 10:13:51 | <quicksilver> | osfameron: as opposed to one-file at a time |
| 10:14:04 | <quicksilver> | osfameron: if you just change Foo.hs, you don't need to recompile Lib/Bar.hs, currently |
| 10:14:09 | <dons> | yeah, inline pushes .hi files more towards the whole program end of the scale |
| 10:14:09 | <osfameron> | ah, right, rather than linking them together as separate units |
| 10:14:30 | <dons> | ACTION wonders what ghc would do with INLINE on everything in base/mtl, and a users's program... |
| 10:14:38 | <dons> | churn for a few days, i'd imagine |
| 10:14:49 | <osfameron> | presumably as a last step before release rather than a compilation option you'd use every time ? |
| 10:14:59 | <dons> | certainly. |
| 10:15:20 | <dons> | Data.Binary as is, is a bit scary to use with -O2, due to compile times |
| 10:24:22 | <quicksilver> | I really can't believe that people in this editor thread are suggesting the mouse is always faster than the keyboard |
| 10:24:26 | <quicksilver> | quite boggling |
| 10:24:46 | <dons> | hey andygill |
| 10:24:47 | <quicksilver> | you can point me to any number of pieces of bogus research done on computer users who are in every way unlike me, but it won't help |
| 10:24:56 | <quicksilver> | I *know* it's faster for me to use keys |
| 10:25:04 | <andygill> | Hi Dons |
| 10:25:19 | <dons> | i don't have a mouse, so hard to tell, quicksilver ;-) |
| 10:25:47 | <dons> | but it seems to me that key bindings are O(1) lookup, while moving the mouse isn't. |
| 10:26:10 | <quicksilver> | dons: key bindings are O(something hard to calculate about the human memory) |
| 10:26:16 | <dons> | yeah |
| 10:26:21 | <dons> | which looks like O(1) to me :) |
| 10:26:27 | <quicksilver> | dons: but I believe it tends to O(1) for experienced users with keybindings they are familiar with |
| 10:26:54 | <dons> | ah right. yes, non-experienced users don't have O(1). |
| 10:26:55 | <osfameron> | which editor thread is this? |
| 10:27:16 | <gleb> | quicksilver: I will bet money that C-x C-f foo TAB bar is faster than File->Open - click * n -> OK |
| 10:27:28 | <profmakx> | non-experienced users often have a high learning-resistance too |
| 10:27:35 | <quicksilver> | osfameron: haskell-cafe |
| 10:27:42 | <osfameron> | moving a mouse is easier to learn but deleting 4 lines and pasting them at the end of the next function definition is much much faster in vim than with a mouse |
| 10:28:05 | <quicksilver> | gleb: yes although I believe that's not really the comparison they are discussing, per se |
| 10:28:32 | <quicksilver> | gleb: more analagous would be to compare File->Open - click* - OK with Alt-F, O, <first part of name>, ENTER |
| 10:30:22 | <DRMacIver> | Arguably that's still faster. :) |
| 10:30:48 | <DRMacIver> | A lot of things which aren't designed for it are still faster with the keyboard. e.g. web browsing (or at least a core subset thereof) |
| 10:31:59 | <quicksilver> | DRMacIver: I wasn't saying it wasn't faster. It is for me |
| 10:32:06 | <quicksilver> | DRMacIver: I was just saying that was a 'fairer' comparison |
| 10:34:41 | <ndm> | having keyboard AND gui means you can learn GUI (fast to learn) then for the small "5% of things you spend 95% of the time doing" you can learn keyboard shortcuts as well |
| 10:34:41 | <DRMacIver> | True |
| 10:34:59 | <quicksilver> | ndm: absolutely |
| 10:35:03 | <DRMacIver> | ndm: Sure. |
| 10:35:10 | <quicksilver> | ndm: and all the editors I use have both, certainly |
| 10:35:34 | <ndm> | indeed, mine too - i wouldn't consider one that didn't support both like they were meant to be |
| 10:35:44 | <quicksilver> | I'm interested that all the HCI advances the OP seems to be interested in are the input ones |
| 10:35:48 | <quicksilver> | I don't find them very interesting |
| 10:35:53 | <quicksilver> | I find my input devices work well |
| 10:36:04 | <quicksilver> | the HCI advances I find exciting are the output ones: interactive feedback |
| 10:36:14 | <quicksilver> | hints/clues/suggestions |
| 10:36:23 | <quicksilver> | (stuff like 'the type expected at the cursor location is:') |
| 10:36:52 | <quicksilver> | or intruiging ways to shade ares of the code to indicate dependencies |
| 10:36:55 | <quicksilver> | or nesting |
| 10:36:56 | <quicksilver> | etc etc |
| 10:39:25 | <ejt> | anyone here going to the London HUG meeting tomorrow night ? |
| 10:39:53 | <ToRA> | ejt: yup |
| 10:40:36 | <kaol> | @seen shapr |
| 10:40:36 | <lambdabot> | shapr is in #haskell-blah, #scannedinavian and #haskell. I last heard shapr speak 12h 5m 16s ago. |
| 10:41:48 | <kaol> | shapr: http://haskelldb.sourceforge.net/getting-started.html links to your site, but the URL is 404. Do you know anything about that? |
| 10:41:49 | <lambdabot> | Title: HaskellDB - Getting Started |
| 10:43:24 | <Lemmih> | @oldwiki HaskellDbTutorial |
| 10:43:24 | <lambdabot> | http://www.haskell.org/hawiki/HaskellDbTutorial |
| 10:44:26 | <kaol> | oh, it's just that page? |
| 10:45:08 | <Lemmih> | I believe so. |
| 10:46:37 | <Lemmih> | The "New Tutorial" was written by yours truly. |
| 10:50:06 | <dblhelix> | igloo |
| 10:50:12 | <dblhelix> | @seen igloo |
| 10:50:12 | <lambdabot> | igloo is in #haskell, #ghc, #gentoo-haskell and #darcs. I last heard igloo speak 9h 15m 7s ago. |
| 10:51:57 | <Cheery> | @hoogle even |
| 10:51:57 | <lambdabot> | Prelude.even :: Integral a => a -> Bool |
| 10:51:57 | <lambdabot> | GHC.ConsoleHandler.ConsoleEvent :: data ConsoleEvent |
| 10:51:57 | <lambdabot> | System.Console.Readline.setEventHook :: Maybe (IO ()) -> IO () |
| 10:52:25 | <kaol> | I must say that I'm a bit suspicious of hdbc. I'm just too used to writing SQL queries myself. Can everything be expressed the hdbc way too? Does it pass the queries to the DB and let their query optimizer do their work? |
| 10:53:21 | <Lemmih> | kaol: hdbc is not HaskellDB. |
| 10:53:31 | <kaol> | oh. um. |
| 10:53:46 | <kaol> | ACTION sighs |
| 10:53:50 | <osfameron> | the thing with database wrappers is that if you don't use one you end up rewriting one 100 times anyway |
| 10:54:05 | <osfameron> | so it kind of makes sense to use one, as long as you have access to the raw SQL when you really need it |
| 10:54:23 | <Lemmih> | kaol: I agree that HaskellDB has issues. I don't recommend using it unless you're completely familiar with all its limitations. |
| 10:54:54 | <kaol> | well, my question still applies if you s/hsql/haskellDB/. even if I feel a bit embarassed now. |
| 10:55:22 | <kaol> | argh. hsql != hdbc, either. |
| 10:58:22 | <quicksilver> | osfameron: if you like SQL then what you *REALLY* want is somethign which allows you to write SQL, but actually parses the SQL at compile time and generates the correct types |
| 10:58:41 | <quicksilver> | osfameron: most of the mini-languages around it are to circumvent the fact that that is quite hard |
| 10:58:52 | <quicksilver> | osfameron: i.e. to provide some kind of 'type' information to the host language |
| 10:59:15 | <osfameron> | quicksilver: oh, I'm not so much bothered about it being hard. It's the "I want this clause, that clause and the other clause, now stick them together" bit that gets me writing a wrapper every time |
| 11:00:06 | <quicksilver> | osfameron: I didn't mean SQL is hard |
| 11:00:16 | <quicksilver> | osfameron: I meant, inferring a type discipline on SQL is hard |
| 11:00:28 | <quicksilver> | osfameron: hence all the metadata all the various SQL interfaces require you to enter |
| 11:00:37 | <osfameron> | oh, that. I guess, er... as a Perl programmer I never really worried about type discipline all that much ;-) |
| 11:00:59 | <osfameron> | and there's no metadata to enter there either |
| 11:01:02 | <quicksilver> | osfameron: that's funny; as a perl programmer I use DBIx::Class precisely because it gives me some kind of type discipline |
| 11:01:23 | <quicksilver> | osfameron: in the sense that, it know which columns a relation has, and it knows which relations can be sensibly joined to which others |
| 11:01:38 | <osfameron> | right |
| 11:02:19 | <quicksilver> | as a haskell programmer, though, I'd love to be able to write "SELECT foo,bar FROM x JOIN y" and have it know at compile time that the type of that was [(Foo,Bar)] |
| 11:02:33 | <quicksilver> | (but this implies it needs schema access at compile time) |
| 11:02:57 | <osfameron> | well, you could have a scaffolding module that knows the schema |
| 11:03:51 | <Cheery> | how would I turn Word8 to Word32? |
| 11:04:36 | <Lemmih> | Cheery: fromIntegral. |
| 11:04:59 | <quicksilver> | osfameron: yup; that counts as 'schema access at compile time' |
| 11:05:12 | <osfameron> | quicksilver: yep |
| 11:05:14 | <Cheery> | > fromIntegral (2::Word8) :: Word32 |
| 11:05:16 | <lambdabot> | 2 |
| 11:05:19 | <quicksilver> | osfameron: there's still the whole "compile time SQL parsing' part, too |
| 11:05:21 | <Cheery> | Lemmih: thanks |
| 11:06:03 | <osfameron> | quicksilver: meh. Sometimes dynamic is just easier :D |
| 11:06:06 | <osfameron> | anyway, lunch |
| 11:06:10 | <quicksilver> | osfameron: certainly |
| 11:06:15 | <quicksilver> | osfameron: easier != better though :) |
| 11:10:52 | <ndm> | what are the limitations of DrIFT? |
| 11:10:56 | <ndm> | i.e. what can't it do? |
| 11:11:01 | <ndm> | can it work with literate haskell? |
| 11:11:06 | <ndm> | does it burn on certain extensions? |
| 11:13:35 | <Svrog> | why am i getting "undefined reference to `__stginit_ZCMain`'" if im compiling a program with -no-hs-main and a custom main function written in c? |
| 11:14:44 | <ndm> | Svrog: which GHC? |
| 11:14:47 | <ndm> | ghc --version |
| 11:14:53 | <Svrog> | 6.6.1 under windows xp |
| 11:15:00 | <ndm> | no need for -no-hs-main |
| 11:15:05 | <ndm> | and in fact that may be breaking it |
| 11:15:09 | <Svrog> | under os x the same program compiles correctly |
| 11:15:10 | <ndm> | ghc file.c works fine for me |
| 11:15:18 | <ndm> | thats 6.6.1 on XP |
| 11:15:19 | <Svrog> | hmm |
| 11:15:21 | <Svrog> | ok ill try that |
| 11:15:48 | <Cheery> | does Data.Binary recognize somehow between big and little endian? |
| 11:15:57 | <Cheery> | if not, which one does it use for default? |
| 11:16:08 | <Svrog> | nope - even without -no-hs-main i get the same error |
| 11:16:09 | <quicksilver> | Cheery: if you use the high-level stuff, it writes in network byte-order by default |
| 11:16:25 | <quicksilver> | Cheery: to produce stuff which can safely be sent across the wire and/or exchanged as disk files |
| 11:16:26 | <ndm> | Svrog: works fine for me |
| 11:16:48 | <Svrog> | hmm |
| 11:16:59 | <kolmodin> | (big endan) |
| 11:17:08 | <ndm> | Svrog: can you hpaste your code? |
| 11:17:10 | <ndm> | @hpaste |
| 11:17:10 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 11:17:39 | <Svrog> | yup - i was just thinking that |
| 11:18:36 | <Cheery> | quicksilver: it seems PNG is using the same, ok, I think this will be enjoyable |
| 11:20:11 | <ndm> | is the hpaste website down? |
| 11:20:33 | <kolmodin> | ndm: seems that way |
| 11:20:36 | <quicksilver> | ndm: yes, has been all day |
| 11:20:43 | <ndm> | :( |
| 11:26:12 | <Svrog> | hmm.. ok problem doesn't happen when i use main, only when i use WinMain and passing -optl -mwindows doesn't help |
| 11:34:16 | <ndm> | yeah, you'll need to link some libraries |
| 11:34:18 | <ndm> | win32 |
| 11:34:29 | <ndm> | and a few others, can't remember which |
| 11:36:02 | <dcoutts> | dons: optimising mtl code would be an interesting project, take a stack of n monad transformers and optimise the data representation and >>= functions |
| 11:36:16 | <ndm> | dcoutts, my optimiser will do that automatically |
| 11:37:35 | <dcoutts> | ndm: I'm looking forward to seeing it |
| 11:40:04 | <quicksilver> | ndm: whole-program compilation? |
| 11:40:23 | <Cheery> | how should I handle the error handling when I'm decoding/encoding with Data.Binary? |
| 11:40:42 | <Cheery> | say, the signature of file is wrong or cyclic redundancy test fails |
| 11:41:25 | <Cheery> | or that my decoder can't simply decode the file |
| 11:42:21 | <Cheery> | so, how should I do that? |
| 11:45:43 | <Svrog> | hmm.. it seems i dont need a WinMain - main + -mwindows appears to work |
| 11:46:08 | <Svrog> | i dont think that used to work |
| 11:46:40 | <Svrog> | i dont even get a command prompt window and the app appears to run correctly |
| 11:51:17 | <dcoutts> | Cheery: currently it'll just throw an error |
| 11:53:57 | <Cheery> | I don't know whether that's appropriate, I mean somebody may want to know whether there's errors in the file, others may want to do some sort of data recovery |
| 11:54:02 | <njbartlett> | Any London HUGgers online? I need to ask a favour |
| 11:55:06 | <quicksilver> | Cheery: then you can catch the error :) |
| 11:55:13 | <njbartlett> | I was planning to record Simon PJ's talk tomorrow but my camcorder has died. Wondering if anybody can help out |
| 11:59:10 | <dcoutts> | toxic: you're the guy looking at ByteStrings for HTTP right? |
| 11:59:49 | <Cheery> | dcoutts: is there ByteStrings for just IP? |
| 12:00:07 | <Cheery> | and TCP+UDP |
| 12:00:09 | <dcoutts> | Cheery: huh? for IP? Not sure what you mean. |
| 12:00:39 | <Cheery> | well, for socket stuff |
| 12:00:48 | <dcoutts> | the ByteString lib provides a low level way of building ByteStrings from memory chunks so you can connect it to any API like that |
| 12:01:23 | <Cheery> | ok |
| 12:02:33 | <dcoutts> | Cheery: the existing ByteString IO api is for Handles, and you can do networking in terms of Handles |
| 12:03:38 | <Baughn> | Is it possible to block signals from other threads until after I've finished a critical section? (So I don't leak memory) |
| 12:04:06 | <dcoutts> | Baughn: yes, though I don't recall how |
| 12:04:08 | <Baughn> | I'm thinking of throwTo in particular |
| 12:04:08 | <opqdonut> | well you can't block all signals :) |
| 12:04:41 | <Baughn> | dcoutts: Oh. I found it - Control.Exception.block |
| 12:08:55 | <quicksilver> | opqdonut: I imagine he means dynamic exceptions, rather than posix signals |
| 12:09:21 | <opqdonut> | yeah, figured |
| 12:10:21 | <Baughn> | If someone starts kill()ing my program, they /deserve/ a memory leak. |
| 12:10:42 | <Cheery> | um.. maybe only in windows |
| 12:10:58 | <opqdonut> | ^_^ |
| 12:11:09 | <opqdonut> | yeah in *nix memoryis freed |
| 12:11:16 | <quicksilver> | opqdonut: not necessarily :P |
| 12:11:19 | <opqdonut> | but for example sockets take some time to get cleaned |
| 12:11:37 | <opqdonut> | quicksilver: well yeah, tmpfs, shm and other exceptions |
| 12:11:39 | <toxic> | dcoutts: yes |
| 12:11:45 | <quicksilver> | opqdonut: *nod* |
| 12:11:53 | <Baughn> | Actually, I'd like to know how posix signals would affect it. Do they get converted into dynamic exceptions? Abort FFI code? Do anything other than just resuming execution where it was? |
| 12:11:58 | <dcoutts> | toxic: I don't quite understand the lazy bytestring handle closing problem |
| 12:12:05 | <Baughn> | opqdonut: Very good reasons for that |
| 12:12:21 | <toxic> | well |
| 12:12:24 | <opqdonut> | Baughn: of course |
| 12:12:31 | <dcoutts> | toxic: presumably we only get EOF on the Handle if the other end closes the socket, no? |
| 12:12:48 | <toxic> | when using lazy bytestrings we represent the http body as a lazy bytestring that isn't completely downloaded when the control leaves the http lib |
| 12:13:06 | <toxic> | like our UA.getContent, it returns the lazy bytestring of the not yet downloaded http body |
| 12:13:40 | <toxic> | in the getContent case the socket never closes |
| 12:13:44 | <dcoutts> | toxic: ah, so when it gets closed depends on when the user consumes the input |
| 12:13:50 | <quicksilver> | Baughn: they have their default effect |
| 12:13:51 | <dcoutts> | toxic: right, but that was just a bug |
| 12:13:56 | <quicksilver> | Baughn: so most of them kill the process |
| 12:14:01 | <quicksilver> | Baughn: unless explicitly caught |
| 12:14:04 | <toxic> | dcoutts: i dont think a lazy bytestring closes the handle when it reaches eof yet |
| 12:14:07 | <quicksilver> | Baughn: (well, FSOV 'most') |
| 12:14:19 | <dcoutts> | toxic: yes, but it should, I've already patched that |
| 12:14:21 | <toxic> | but i'm not sure, haven't read the implementation that carefully yet |
| 12:14:25 | <toxic> | ah, nice |
| 12:15:14 | <dcoutts> | toxic: so how does a socket get re-used for multiple http transfers? |
| 12:15:25 | <dcoutts> | toxic: presumably you ask the server to keep the other end open |
| 12:15:55 | <Baughn> | Assuming I take care to avoid inlining, does using unsafePerformIO ever cause code to be executed more times than it would if I stuck it in IO? |
| 12:16:04 | <fasta> | I have a derived state monad. I also have some ST actions. How can I combine the two actions in one do block? I tried do lift(derivedaction);lift(newSTRef "A);return (), but that isn't the way to do it apparently. |
| 12:16:08 | <toxic> | haven't implemented any reusing yet with lazy bytestrings |
| 12:16:13 | <Baughn> | dcoutts: Yep. Connection: Keep-Alive |
| 12:16:22 | <dcoutts> | toxic: which btw, would mean that hGetContents would not stop when it got to the end of the file |
| 12:16:31 | <toxic> | somehow the rspBody of the respons should stop giving away data when it reaches its end, and then not close |
| 12:16:46 | <dcoutts> | toxic: you'd have to detect the end of the input yourself |
| 12:16:51 | <toxic> | yes |
| 12:16:54 | <fasta> | In fact the monad is a newtype of State. |
| 12:17:40 | <quicksilver> | Baughn: haskell thunks are not reduced more than once |
| 12:17:44 | <dcoutts> | toxic: btw, if you really do not want to use Handles, you can do a lazy get contents on a socket, you just have to implement it yourself |
| 12:17:54 | <quicksilver> | Baughn: but, haskell functions with parameters are re-reduced each time they get a fresh parameter |
| 12:18:05 | <toxic> | exactly, that shouldn't be a part of a http library to implement lowlevel bytestring socket handeling |
| 12:18:09 | <toxic> | -e |
| 12:18:12 | <quicksilver> | Baughn: those two rules should tell you how many times your unsafe will get performed |
| 12:18:43 | <dcoutts> | toxic: aye, I suppose so, but we were not planning on adding that to the bytestring lib |
| 12:19:07 | <toxic> | hmm, btw, the body is not taken directly from the handle, its downloaded as chunks and merged, hmm |
| 12:19:36 | <toxic> | so maybe there is no need to "notice" when a new respons is there when reusing |
| 12:19:43 | <Baughn> | quicksilver: Does this mean that "foo x y = ..." is not actually equivalent to "foo x = \y -> ..." (for less trivial function bodies)? |
| 12:19:58 | <quicksilver> | Baughn: no |
| 12:19:59 | <toxic> | dcoutts: maybe some other level then, because it's not a http specific issue |
| 12:20:07 | <dcoutts> | sure |
| 12:20:19 | <Baughn> | quicksilver: I mean, if the second foo does something with x that is then used inside the \y ? |
| 12:20:20 | <dcoutts> | toxic: and you really have to use sockets because you need that level of control? |
| 12:20:23 | <quicksilver> | Baughn: in the terminology I was using, a lambda form is still a 'function with parameters' |
| 12:20:36 | <toxic> | no |
| 12:20:47 | <quicksilver> | Baughn: oh, yes |
| 12:20:48 | <toxic> | you can set the flags before doing socketToHandle |
| 12:20:54 | <quicksilver> | Baughn: if the second form does something with the x |
| 12:20:59 | <quicksilver> | Baughn: (e.g. a let expression) |
| 12:21:21 | <quicksilver> | Baughn: then that let expression is shared between successive invovations of the '\y->' part returned |
| 12:21:25 | <quicksilver> | Baughn: if you see what I mean |
| 12:21:49 | <Baughn> | quicksilver: I do. Good to know, even if it means my code will have to be de-elgantified. |
| 12:23:38 | <dcoutts> | toxic: well, good luck with your project, I think having a Haskell HTTP lib is rather better than a curl binding. |
| 12:23:40 | <fasta> | http://pastebin.ca/502216 |
| 12:23:43 | <osfameron> | quicksilver: easier `can_be` better, under some circumstances :-) |
| 12:23:48 | <quicksilver> | osfameron: hell yes |
| 12:23:57 | <dcoutts> | toxic: you know where to find me if you have ByteString Qs |
| 12:24:02 | <fasta> | I slightly oversimplified in my original question. This is the correct one. |
| 12:24:16 | <toxic> | dcoutts: thanks, i guess we will have more time after the exams ;) |
| 12:24:25 | <toxic> | and there even is nominolo |
| 12:24:33 | <nominolo> | heya toxic |
| 12:24:51 | <dcoutts> | ACTION sends good luck to the chalmers students about to do exams |
| 12:24:52 | <nominolo> | ?where logs |
| 12:24:52 | <lambdabot> | http://tunes.org/~nef/logs/haskell/ http://ircbrowse.com/cdates.html?channel=haskell |
| 12:25:19 | <nominolo> | thanks a lot. |
| 12:25:30 | <Baughn> | toxic: Assuming the target site works correctly, would it be safe for me to unsafePerformIO a http get? |
| 12:25:35 | <ToRA> | fasta: can you paste a bit more context? - types of new_ref and what you think combine_ST_and_M should be? |
| 12:26:03 | <fasta> | ToRA: ok, one minute |
| 12:26:05 | <Saizan> | also, M is an instance of MonadTrans? |
| 12:26:16 | <dcoutts> | Baughn: I would really really recommend against doing that. :-) |
| 12:26:39 | <Baughn> | dcoutts: GET is supposed to be idempotent, though. :'( |
| 12:27:11 | <dcoutts> | Baughn: at a very high level, that's true |
| 12:27:39 | <mux> | pigs will fly the day where every web developer knows to use POST when the request ends up doing non-idempotent things |
| 12:27:45 | <mux> | it's faaar beyond their grasp |
| 12:28:02 | <mux> | consider most of these guys use php :-) |
| 12:28:09 | <Baughn> | dcoutts: So a sufficiently high-level haskell library should be able to have a non-IO GET function |
| 12:28:27 | <quicksilver> | GET isn't idempotent; it serves adverts and makes log entries and stores cookies on your computer |
| 12:28:33 | <fasta> | ToRA: http://pastebin.ca/502222 |
| 12:28:48 | <mux> | quicksilver: it should be wrt to the web site, not wrt to your own computer |
| 12:28:57 | <toxic> | Baughn: if the target site works incorrectly you get a parse error thrown |
| 12:28:58 | <mux> | the point is to avoid spurious page reloads for dangerous things |
| 12:29:03 | <mux> | like database inserts and so on. |
| 12:29:16 | <quicksilver> | mux: yes, I understand this :) |
| 12:29:28 | <nominolo> | Baughn: that requires a veery reliable server on the other end |
| 12:29:35 | <quicksilver> | mux: however it does insert new log entries (presumably) on the server at the other end |
| 12:29:40 | <ski_> | fasta :t new_ref ? |
| 12:29:43 | <quicksilver> | mux: and in principle cost money (bandwidth isn't free) :) |
| 12:29:53 | <Baughn> | nominolo: The getter could.. retry until it works? Or return an error instead of throwing on? |
| 12:29:56 | <Baughn> | *one |
| 12:30:28 | <Baughn> | I'm taking the latter approach with libpng, but at least that one's /reliable/. |
| 12:30:31 | <quicksilver> | I *quite* like the notion of an ideal HTTP library with a non-IO interface to GET |
| 12:30:31 | <fasta> | http://pastebin.ca/502224 |
| 12:30:37 | <quicksilver> | but I don't think it would be reliable :) |
| 12:30:39 | <fasta> | ski_: that's just newSTRef |
| 12:30:55 | <mux> | quicksilver: yeah, bt there isn't much sense in interpreting the idempotency as anything but with respect to the served website/web application :-) |
| 12:31:07 | <Saizan> | ?type lift |
| 12:31:13 | <lambdabot> | forall (m :: * -> *) a (t :: (* -> *) -> * -> *). (MonadTrans t, Monad m) => m a -> t m a |
| 12:31:22 | <Baughn> | quicksilver: It could have an IO interface for those who want that, and convert exceptions into error codes (or not!) for those who just want convenience |
| 12:31:25 | <fasta> | Ok, so it needs to be an instance of MonadTrans. |
| 12:31:49 | <Saizan> | fasta: also, you need different level of lifting for different inner monads |
| 12:32:02 | <fasta> | Since it's an instance of MonadState it should also be an instance of MonadTrans? |
| 12:32:11 | <ski_> | fasta : then 'new_ref "A"' is an action in the 'ST s' monad, while 'fooM undefined' is an action in the 'M a s' monad |
| 12:32:30 | <Saizan> | fasta: no, State for example is not an instance of MonadTrans |
| 12:32:39 | <osfameron> | Saizan: LPhas was looking for you earlier |
| 12:32:54 | <ski_> | fasta : also 'instance (Monad (State (M a s))) => Monad (M a s)' looks strange |
| 12:33:33 | <ToRA> | (using GeneralizedNewtypeDeriving) newtype Splat = Splat StateT (ST s) a (deriving Monad, MonadState), and then a custom new_ref fn needs writing? |
| 12:33:52 | <ToRA> | mmm, that's very wrong |
| 12:33:54 | <ToRA> | 1 sec |
| 12:34:58 | <quicksilver> | cale's article on how to use monad transformers sanely is worth a read |
| 12:35:20 | <quicksilver> | his point of view if I remember right is it's worth taking a moment to set up the correct (pre-lifted) primitives for your custom stack |
| 12:35:29 | <quicksilver> | then once you've done it once, the rest of your code looks cleaner |
| 12:35:38 | <fasta> | ski_: that's because I derive Monad. |
| 12:35:49 | <fasta> | ski_: but I admit, that's odd. |
| 12:36:40 | <fasta> | I wrote lots of code already in Monad M. It would be nice if I wouldn't need to change that. |
| 12:38:45 | <ski_> | ACTION found it useful to write a <http://www.mdstud.chalmers.se/~md9slj/code/Ref.hs> module for monads supporting 'STRef s' or 'IORef' references .. |
| 12:39:02 | <quicksilver> | fasta: you won't |
| 12:39:05 | <fasta> | ski_: I know the module, I don't need it. |
| 12:39:10 | <quicksilver> | fasta: that's what the lifting stuff is for |
| 12:39:23 | <nominolo> | Baughn: I don't think this is a workable solution in the general case. If you're really sure you could cache the first result and reuse that in the future. |
| 12:39:41 | <quicksilver> | fasta: but you need to make sure it's lifting the right bit |
| 12:39:54 | <quicksilver> | (in principle can't it lift the right thing using a type class match?) |
| 12:40:06 | <fasta> | quicksilver: but do I need to write a new monad transformer type? |
| 12:40:12 | <fasta> | quicksilver: e.g. MT? |
| 12:41:19 | <quicksilver> | fasta: you need a transformer for every monad except the one at the bottom of the stack, I think? |
| 12:41:33 | <quicksilver> | fasta: I haven't written code in anger using this stuff so I'm the wrong person to ask |
| 12:42:43 | <fasta> | Is there a STT? |
| 12:43:05 | <ski_> | fasta : no |
| 12:43:07 | <quicksilver> | ah, perhaps there can't be |
| 12:43:43 | <ski_> | there can't be unless you can control uses of thing (like maybe Clean could do it, had it 'ST' to begin with) |
| 12:44:31 | <fasta> | ski_: so, ST needs to be at the bottom |
| 12:44:40 | <ski_> | ACTION nods |
| 12:45:25 | <ToRA> | fasta: is your M monad a newtype M = blah... monad or a totally custom one? |
| 12:45:32 | <fasta> | ToRA: newtype |
| 12:45:39 | <ToRA> | fasta: what's the newtype decl? |
| 12:46:37 | <fasta> | ToRA: newtype M a b c = M { state:: State (MState a b) c} deriving (Monad,Monoid,MonadCont) |
| 12:47:25 | <fasta> | (MState holds bits of state I use everywhere almost everywhere) |
| 12:47:28 | <ToRA> | yeah |
| 12:47:36 | <ToRA> | not deriving MonadState (MState a b) ? |
| 12:47:41 | <fasta> | strip one everywhere |
| 12:47:56 | <fasta> | ToRA: no, I am not doing that currently. |
| 12:48:21 | <ToRA> | so can't you change that to newtype M a b c = M { state :: StateT (MState a b) (ST <? guys what goes here>) c } |
| 12:48:36 | <fasta> | ToRA: Functional dependencies conflict between instance declarations: |
| 12:48:42 | <fasta> | ToRA: When I add that instance |
| 12:48:43 | <ToRA> | and then write a custom new_ref method that strips off your M, and then uses lift to get into ST |
| 12:49:01 | <ski_> | ToRA : 's' |
| 12:49:12 | <ToRA> | ski_: it needs a forall from somewhere |
| 12:49:17 | <fasta> | ToRA: Never mind that last remark: I wrote my own instance for MonadState (MState a b) |
| 12:49:29 | <ski_> | ToRA : yes, in the 'runXXX' function |
| 12:49:48 | <fasta> | ToRA: no, I cannot change that type. |
| 12:49:50 | <ToRA> | ski_: so you have to param M with s now too? |
| 12:49:55 | <ski_> | indeed |
| 12:50:07 | <ski_> | it's contagious |
| 12:50:25 | <ToRA> | fasta: which type can you not change? |
| 12:50:42 | <fasta> | ToRA: of M which is the monad in which I have written lots of code already |
| 12:51:03 | <fasta> | ToRA: I only care about getting the example as pasted to work as easily as possible. |
| 12:51:18 | <ski_> | (well .. i think one can also make the whole thing parametric over the inner monad, and then instantiate that to 'IO' or 'ST s' as you wish .. e.g in the 'run' function(s)) |
| 12:51:45 | <fasta> | ski_: what whole thing? |
| 12:52:06 | <ski_> | sorry ? |
| 12:52:16 | <ToRA> | fasta: if all your code only uses the MonadState methods, and nothing (apart from a couple of helpers) directly touch State then it should be a /really/ minimal change |
| 12:53:10 | <ski_> | fasta : oh .. your whole monad type i mean, 'M' i surmise |
| 12:53:52 | <fasta> | ToRA: that is the case. Question is: what mininal change? ;) I am reading the Cale tutorial again. |
| 12:53:53 | <ToRA> | fasta: the alternative is just do the example only in the ST monad, and use let res = runMyMMonadCode (myMonadCode), let res' = runMyMonadCode2 res all through? |
| 12:54:40 | <ToRA> | minimal change = change any type signatures that were M a b to M s a b (regex find & replace) |
| 12:54:50 | <ToRA> | plus any helper methods that unpack your M will need to be updated |
| 12:55:22 | <ski_> | ACTION wonders how much parameterized modules could help with such .. |
| 12:56:44 | <fasta> | I don't think ST is contagious in up direction of the stack |
| 12:57:33 | <ski_> | how do you mean ? |
| 13:00:07 | <fasta> | ski_: I mean that I don't need to add the s parameter to the M type. |
| 13:00:49 | <ski_> | in what case ? |
| 13:00:58 | <ski_> | (what is "up direction") |
| 13:02:09 | <fasta> | ski_: never mind |
| 13:03:34 | <fasta> | Again the question: do you know how the original paste would work, without modifying M? |
| 13:04:08 | <ski_> | the one case i can imagine in which you want to plug 'ST s' into a bigger monadic type, and you don't have to add 's' as parameter to that type, is when you instead add an 'm' as argument to that type (and later instantiate that 'm' to 'ST s', or somthing containing that) |
| 13:04:47 | <ToRA> | fasta you could just run the example in the ST monad and use let res = runMMonad mmonadcode ? |
| 13:05:05 | <ToRA> | ACTION realises he already said that and didn't just think it |
| 13:05:44 | <beelsebob> | ACTION pokes malcolmw |
| 13:05:49 | <beelsebob> | if he's about |
| 13:05:52 | <ToRA> | ACTION thinks doing a phd is making him go mad |
| 13:05:52 | <chessguy_> | 'morning haskellers |
| 13:06:01 | <kaol> | I'm starting to feel that I'd like to improve HSQL a bit. I'm guessing that patches would be welcome. |
| 13:06:03 | <david48> | morning ! |
| 13:06:07 | <beelsebob> | ToRA: sounds entirely plausable |
| 13:06:10 | <ski_> | fasta : have i understood correctly in that you want to use 'MState a b' as an ordinary state as in 'State' (or 'StateT') monad, and still use some 'ST s'-state things ? |
| 13:06:24 | <david48> | .... afternoon here though :) |
| 13:06:34 | <malcolmw> | ACTION slaps beelsebob with a coffee mug |
| 13:06:39 | <beelsebob> | ow! |
| 13:06:49 | <chessguy_> | ouch, that's gonna leave a mark |
| 13:06:53 | <malcolmw> | ..filled with hot coffee |
| 13:06:58 | <beelsebob> | OW! |
| 13:07:08 | <beelsebob> | malcolmw: I was trying to respond to your haskell cafe email in the great editor flamer war |
| 13:07:13 | <david48> | I wish I was able to patch HSQL... There's some MySQL features I miss |
| 13:07:16 | <malcolmw> | hello beelsebob. :-) |
| 13:07:20 | <beelsebob> | but my emails to the list seem to disapear into the ether |
| 13:07:23 | <beelsebob> | hello :P |
| 13:07:25 | <fasta> | ski_: I want M to be unchanged, use MState a b as an ordinary state as in State and use 'ST s'- state things. |
| 13:07:51 | <chessguy_> | beelsebob: they're probably getting sucked into the hole that leads into space. have you been following xkcd? |
| 13:07:58 | <beelsebob> | I believe the reason that Apple had come up with for it being faster with a mouse while seeming faster with the keybeard was roughly this: |
| 13:07:58 | <fasta> | ski_: but other than that for the example function you may invent as many types as you want. |
| 13:08:07 | <malcolmw> | beelsebob: feel free to respond to my email here in IRC then, but you'll have a much smaller audience |
| 13:08:32 | <beelsebob> | with the mouse, your brain needs to put very little effort in, because it's a very natural gesture |
| 13:08:41 | <beelsebob> | thus you have a lot of brain time left to spend thinking about how long it's taking |
| 13:08:52 | <beelsebob> | on the other hand, thinking up the relevant keyboard combo is hard |
| 13:09:13 | <beelsebob> | your brain has fun doing a difficult task |
| 13:09:24 | <beelsebob> | and as we know, time flies when you're having fun |
| 13:09:28 | <ski_> | fasta : if you want to use them in a single combined monad, then you need to change 'M' (no monad sums unfortunately ..) .. an alternate way which maybe could be used in your case is to have an 'M'-monad action which returns an 'ST s'-monad action (or vice versa), so that you get things in two stages .. but it depends on your problem if you can use that or not |
| 13:09:40 | <quicksilver> | beelsebob: I strongly suspect the study was done on people-not-like-me |
| 13:09:43 | <malcolmw> | beelsebob: hmm, so we have conflicting hypotheses |
| 13:09:48 | <quicksilver> | beelsebob: people like my father, perhaps |
| 13:09:52 | <beelsebob> | malcolmw: indeed, almost exactly so |
| 13:10:12 | <beelsebob> | quicksilver: I believe it was done on people who had already worked on computers where the only option was keyboard shortcuts |
| 13:10:12 | <malcolmw> | beelsebob: I wonder how we could test them by experiment |
| 13:10:28 | <beelsebob> | the first task would be to try and duplicate apple's results |
| 13:10:34 | <beelsebob> | and see whether mousing really is faster |
| 13:10:43 | <beelsebob> | and if so, for which keyboard combos |
| 13:11:05 | <beelsebob> | because their reasoning was that there were three keyboard combos for which it was slower -- copy, paste, and cut |
| 13:11:17 | <araujo> | morning |
| 13:11:29 | <beelsebob> | and that those combos were used so commonly that they became muscle memorised |
| 13:11:30 | <chessguy_> | have you guys read this article/paper/manifesto on GUI design? http://worrydream.com/MagicInk/ |
| 13:11:32 | <lambdabot> | Title: Magic Ink: Information Software and the Graphical Interface |
| 13:11:37 | <chessguy_> | araujo! |
| 13:11:50 | <araujo> | chessguy_, ya!!! |
| 13:11:53 | <earthy> | chessguy: that's an interesting text yeah |
| 13:12:09 | <chessguy_> | i love his point that interaction is a BAD thing |
| 13:12:15 | <malcolmw> | beelsebob: funny, I only learnt that there are key shortcuts for cut/copy/paste recently, and had always used the mouse for those, ever since early X11 days |
| 13:12:22 | <beelsebob> | hehe |
| 13:12:29 | <earthy> | looks like a nice application to use tangible values for |
| 13:12:45 | <beelsebob> | yeh, it's interesting, it suggests that X11 does it exactly the wrong way |
| 13:12:46 | <malcolmw> | beelsebob: recently = when i got a mac |
| 13:12:49 | <beelsebob> | lol |
| 13:13:15 | <beelsebob> | malcolmw: I wouldn't have been surprised if you'd hung on a lot longer than that |
| 13:13:39 | <beelsebob> | most of the accademics I know who have bought a mac still launch X11, xemacs, and all the tools they've used for the past 30 years |
| 13:13:48 | <earthy> | hm |
| 13:14:00 | <earthy> | maybe I never got very attached to X |
| 13:14:02 | <malcolmw> | beelsebob: I do that too |
| 13:14:03 | <earthy> | but I don't |
| 13:14:03 | <earthy> | ;) |
| 13:14:16 | <earthy> | ofcourse, I do run gVim |
| 13:14:20 | <earthy> | and Terminal.app a *lot* |
| 13:14:20 | <beelsebob> | hehe |
| 13:14:28 | <beelsebob> | I use terminal.app quite a lot |
| 13:14:34 | <beelsebob> | but not as much as most people I know |
| 13:14:47 | <beelsebob> | I'm consistantly cutting out uses for it too |
| 13:15:00 | <earthy> | but I definitely like combos such as TeXShop/gVim |
| 13:15:12 | <earthy> | especially given my Make TeXShop target |
| 13:15:17 | <malcolmw> | I avoid Terminal.app in favour of xterm - give be crisp fonts instead of fuzzy ones any day |
| 13:15:31 | <earthy> | malcolmw: that's a matter of font choice. :) |
| 13:15:34 | <beelsebob> | malcolmw: you know you can set Terminal.app not to anti-alias? |
| 13:15:51 | <earthy> | ACTION uses 10 point Monaco without anti aliasing in Terminal.app |
| 13:15:51 | <beelsebob> | plus... I actually use Terminal.app for exactly the opposite reason... |
| 13:16:05 | <malcolmw> | earthy: beelsebob: yeah, yeah, but xterm doesn't require any configuration, and I'm lazy |
| 13:16:05 | <beelsebob> | give me nice smooth fonts I can read, not some odd bitmap |
| 13:16:11 | <beelsebob> | malcolmw: lol |
| 13:16:28 | <opqdonut> | grr terminal.app |
| 13:16:30 | <earthy> | so am I. that's why I use a mac. no mucho setting up. ;) |
| 13:16:30 | <opqdonut> | grr antialias |
| 13:16:45 | <beelsebob> | incidentally -- Terminal.app in leopard *wins* |
| 13:16:49 | <earthy> | 'it just works'. :) |
| 13:16:56 | <beelsebob> | tabs, and presetup terminals ftw |
| 13:17:09 | <malcolmw> | the mac's anti-aliased fonts are an order of magnitude better than windows or linux fonts though |
| 13:17:14 | <beelsebob> | indeed |
| 13:17:23 | <ski_> | screen ftw |
| 13:17:26 | <beelsebob> | although vista seems to have got a little closer on that respect |
| 13:18:12 | <beelsebob> | ski_: this is one of the benefits -- you can make it so you do cmnd-n, and it opens a terminal, sshes into another machine, and then connects to screen |
| 13:18:20 | <beelsebob> | (complete win!) |
| 13:18:26 | <malcolmw> | ACTION just started up terminal.app for the first time in a couple of years, and was surprised to see it uses nice crisp bitmap fonts by default |
| 13:18:26 | <quicksilver> | I've just switched to iTerm |
| 13:18:43 | <beelsebob> | quicksilver: yeh, the new terminal.app is basically iTerm without the annoying bugs |
| 13:18:45 | <earthy> | oh, and the mousing/keyboarding thing: I often keep one hand on the mouse and one on the keyboard |
| 13:18:50 | <quicksilver> | nice programmable default configs and clickable links |
| 13:18:53 | <earthy> | to point and hit shortcuts |
| 13:19:03 | <opqdonut> | earthy: but do you type one-handed? |
| 13:19:13 | <earthy> | not normally |
| 13:19:14 | <osfameron> | insane delete/backspace behaviour though |
| 13:19:22 | <beelsebob> | this is actually one of the reasons I prefer to use a track pad over a mouse |
| 13:19:30 | <osfameron> | it always catches me out when I'm forced to use gf's ibook |
| 13:19:33 | <beelsebob> | I can use it just as fast, and it's under my thumb while I'm typing |
| 13:19:37 | <opqdonut> | i prefer keyboard-only usage |
| 13:19:42 | <earthy> | nah |
| 13:19:57 | <malcolmw> | hmm, so the reason I don't use terminal.app would appear to be scrolling. on xterm, I can scrollback with shift-pageup, but in terminal.app you have to use the mouse |
| 13:20:20 | <chessguy> | grrrr |
| 13:20:28 | <osfameron> | malcolmw: you can configure scrolling too |
| 13:20:34 | <osfameron> | it's just hidden in the menus somewhere |
| 13:20:46 | <malcolmw> | unless some mac user knows different and wants to enlighten me? |
| 13:21:28 | <psnl> | I hit shift-fn-up to scroll up |
| 13:21:31 | <beelsebob> | I don't think so |
| 13:21:37 | <malcolmw> | osfameron: found it - apple-pageup, not shift-pageup |
| 13:21:38 | <nominolo> | dcoutts: do you have an idea how to force the handle behind a lazy bytestring? i.e. if you want to do: "read 1000 bytes and then close, even if there's no eof". |
| 13:21:39 | <beelsebob> | I think that's the principal complaint that most people have |
| 13:22:28 | <beelsebob> | it's somewhat irritating though, that discussion *could* have been really interesting |
| 13:22:33 | <beelsebob> | and not a giant editor flame war |
| 13:22:39 | <nominolo> | dcoutts: but abstracting it in the library. since most other issues have been resolved this is the only thing that's stopping us from making this the new Network.HTTP release |
| 13:22:46 | <beelsebob> | if the first response had not been "oh grow up and use vim or emacs" |
| 13:22:49 | <malcolmw> | heh, editor flame wars are inevitable |
| 13:22:53 | <beelsebob> | indeed |
| 13:22:59 | <toxic> | nominolo: (except finishing UserAGent) |
| 13:23:03 | <quicksilver> | beelsebob: I was that first responder |
| 13:23:04 | <toxic> | -G+g |
| 13:23:08 | <quicksilver> | beelsebob: and that wasn't what I intended |
| 13:23:09 | <beelsebob> | quicksilver: o.O |
| 13:23:14 | <beelsebob> | hmm |
| 13:23:25 | <quicksilver> | beelsebob: My intention was 'can you explain more carefully what about vim and emacs you don't like, to make this debate more interesting' |
| 13:23:33 | <beelsebob> | hmmm |
| 13:23:37 | <malcolmw> | dismissing both emacs in vim in the OP was the mistake I think :-) |
| 13:23:49 | <earthy> | actually, given the way editor flamewars generally run this one was rather civil and interesting. :) |
| 13:23:49 | <quicksilver> | beelsebob: the OP then replied with somethign I believe to be a combination of prejudice and ignorance ;) |
| 13:24:10 | <beelsebob> | I'm not sure that dismissing them was -- I think that the way he dismissed them had a lot to do with it though |
| 13:24:20 | <beelsebob> | quicksilver: well, ignorance I think is a fair reason |
| 13:24:27 | <malcolmw> | beelsebob: so, what interesting avenues do you think we should have been exploring instead? |
| 13:24:29 | <ndm> | he seemed much more flamey and uninformed when he started discussing Windows |
| 13:24:32 | <beelsebob> | I know enough vim to open it, edit something and quit |
| 13:24:50 | <beelsebob> | I don't want to spend 2 years learning it, but that's somewhat irrelevant |
| 13:25:00 | <fasta> | ski_: There's quite a bit of interaction between ST and M (I store references in the state type of M). |
| 13:25:10 | <fasta> | ski_: that would rule out option 2? |
| 13:25:14 | <ski_> | fasta : two-way interaction ? |
| 13:25:27 | <beelsebob> | malcolmw: personally, I thought the interesting question was "what are the alternative editors out there... Does someone prefers a GUI actually have a choice" |
| 13:25:50 | <fasta> | ski_: I am not sure what you mean by two-way. |
| 13:25:56 | <malcolmw> | beelsebob: and that was probably the question he intended to ask |
| 13:26:01 | <opqdonut> | beelsebob: and gui here means menus and whatnot? |
| 13:26:22 | <quicksilver> | beelsebob: even that question i find hard to answer properly |
| 13:26:23 | <malcolmw> | opqdonut: I don't think GUI needs to mean menus and mice |
| 13:26:27 | <quicksilver> | beelsebob: emacs has a GUI |
| 13:26:32 | <beelsebob> | opqdonut: I don't know what it means to a linux user, because I've never seen a "standard" gui on linux |
| 13:26:42 | <opqdonut> | what is a standard gui? |
| 13:26:46 | <opqdonut> | ala office? |
| 13:26:49 | <beelsebob> | one that is standardised |
| 13:26:52 | <quicksilver> | beelsebob: so to give a helpful answer, I need 'I don't like the GUIs of emacs and vim because *XYZ*, is there anything more like *ABC* ? |
| 13:26:57 | <beelsebob> | one that is nice and consistant across the whole platform |
| 13:27:08 | <fasta> | beelsebob: what platform? |
| 13:27:09 | <quicksilver> | beelsebob: such things only exist in fairy tales |
| 13:27:10 | <beelsebob> | I don't care what it looks like -- as long as 99% of linux apps use it |
| 13:27:11 | <opqdonut> | beelsebob: well, take kde for example |
| 13:27:16 | <opqdonut> | that is a consistent platform |
| 13:27:22 | <beelsebob> | quicksilver: rubbish -- such things exist on a Mac |
| 13:27:22 | <beelsebob> | :P |
| 13:27:28 | <opqdonut> | but linux will never be fully consistent |
| 13:27:30 | <quicksilver> | beelsebob: neither microsoft nor apple has ever achieved a remotely consistent UI |
| 13:27:31 | <beelsebob> | I know |
| 13:27:32 | <opqdonut> | there will always be choices |
| 13:27:36 | <quicksilver> | beelsebob: and they have tried quite hard |
| 13:27:46 | <quicksilver> | beelsebob: apple is *terrible* at consistency |
| 13:27:52 | <malcolmw> | like the guy in Magic Ink says, most interaction design would be better targetted at information layout design, reducing interaction to a minimum |
| 13:27:55 | <quicksilver> | beelsebob: every new app has brand new user interface widgets |
| 13:27:55 | <beelsebob> | quicksilver: Apple's GUI is *way* more consistant than Linux's |
| 13:28:03 | <quicksilver> | beelsebob: that's because linux isn't a 'thing' |
| 13:28:07 | <ski_> | fasta : if 'M0' and 'M1' are two monads, and say you then define 'foobarbaz :: Foo -> M0 (Bar -> M1 Baz)', then you must be able to decide which value of type 'Bar -> M1 Baz' you want to return solely on the basis of the 'Foo' input, and on interaction with effects in the 'M0' monad .. in particular you can't depend on value of 'Bar' or interactions with the 'M1' monad |
| 13:28:17 | <ToRA> | fasta: |
| 13:28:18 | <ToRA> | http://pastebin.ca/502290 |
| 13:28:23 | <ToRA> | does that help? |
| 13:28:24 | <beelsebob> | quicksilver: ah, but that's my point -- new apps may have new widgets, but they don't have different widgets that do the same thing |
| 13:28:29 | <quicksilver> | beelsebob: yes, they do |
| 13:28:34 | <quicksilver> | beelsebob: almost always :) |
| 13:28:36 | <beelsebob> | in linux you have thousands of things that look different but behave the same |
| 13:28:42 | <beelsebob> | name one |
| 13:28:46 | <opqdonut> | beelsebob: what's unconsistent about the cli?-) |
| 13:28:51 | <quicksilver> | beelsebob: iTunes was totally unlike all the MacOS apps that came before it |
| 13:28:56 | <beelsebob> | opqdonut: we're talking about guis |
| 13:28:59 | <ToRA> | it typechecks, i assume it works and i think it does what you want? |
| 13:29:05 | <opqdonut> | beelsebob: yeah i know :) |
| 13:29:21 | <opqdonut> | beelsebob: but you should consider ui consisntency on linux on a per-toolkit basis |
| 13:29:26 | <quicksilver> | beelsebob: to be remotely fair, you'd have to compare apple to, say, KDE |
| 13:29:31 | <opqdonut> | for example the kde/qt apps are quite consistent |
| 13:29:36 | <quicksilver> | beelsebob: and, I grant you, apple probably is more consistent than KDE |
| 13:29:39 | <beelsebob> | opqdonut: no I shouldn't -- I use lots of different apps -- they all use different toolkits |
| 13:29:39 | <opqdonut> | or gnome/gtk |
| 13:29:42 | <quicksilver> | beelsebob: but I maintain they do a fairly bad job at it |
| 13:29:47 | <fasta> | ski_: hmm, it's too complicated to predict whether that will be the case. |
| 13:29:51 | <beelsebob> | quicksilver: sure |
| 13:29:54 | <opqdonut> | beelsebob: well that is the price of choice |
| 13:29:56 | <beelsebob> | but a much better job than most |
| 13:29:56 | <quicksilver> | meanwhile, adobe mostly ignore the windows and max guidelines |
| 13:30:04 | <quicksilver> | and build apps exactly how they want to |
| 13:30:05 | <opqdonut> | i would hate to be locked into one toolkit |
| 13:30:05 | <beelsebob> | opqdonut: yes, I believe the point was that for some people the price is too high |
| 13:30:13 | <quicksilver> | microsoft and apple ignore their own guidelines |
| 13:30:23 | <quicksilver> | and make each new app look 'new and cool' (and different) |
| 13:30:24 | <opqdonut> | and there almost always is an alternative that uses another toolkit |
| 13:30:32 | <beelsebob> | quicksilver: apple don't ignore them -- they rewrite them to suit the new app :P |
| 13:30:33 | <opqdonut> | quicksilver: yes, like the new offices |
| 13:30:40 | <quicksilver> | beelsebob: that's newspeak :) |
| 13:30:45 | <beelsebob> | yep :P |
| 13:31:01 | <malcolmw> | apple mostly seem to go for different skins on different apps, rather than fundamentally different widgets |
| 13:31:05 | <quicksilver> | the closest thing there is a a 'standard' is actually 'try to look like MS Word' |
| 13:31:15 | <beelsebob> | malcolmw: that all appears to be changing in Leopard |
| 13:31:20 | <quicksilver> | malcolmw: that's true, there is some underlying consistency |
| 13:31:24 | <beelsebob> | *all* the apps use the same skin |
| 13:31:40 | <malcolmw> | and there is a good argument that per-app skins allow you to identify which app ant particular window belongs to quickly |
| 13:31:41 | <beelsebob> | looks roughly like the combined toolbar one, but a bit darker |
| 13:32:14 | <ToRA> | fasta: the M a is your existing monad, the N is a variant of your M that can nest ST, and call is how you get M a code into N a code? |
| 13:32:30 | <ToRA> | fasta: so you don't need to change /any/ of your existing code |
| 13:32:39 | <fasta> | ToRA: oh, right, I wasn't paying attention. |
| 13:32:44 | <fasta> | ToRA: thank you very much. |
| 13:33:26 | <ToRA> | fasta: np if it works |
| 13:34:12 | <malcolmw> | one thing I like about apple's gui design is that they usually try to avoid needing the menus. Menus are for experts. Simple stuff is available directly using buttons within the window pane |
| 13:34:24 | <beelsebob> | indeed |
| 13:34:32 | <ski_> | ToRA : hm, interesting take on it |
| 13:35:06 | <dcoutts> | nominolo: hGet :: Handle -> Int -> IO ByteString |
| 13:35:29 | <nominolo> | dcoutts: that doesn't work with lazy bytestrings |
| 13:35:29 | <ToRA> | ski_: it's a pattern i use a bit, is there anything wrong with it? |
| 13:35:37 | <nominolo> | does it? |
| 13:35:39 | <dcoutts> | nominolo: yes |
| 13:35:49 | <ski_> | ACTION wants 'MonadFunctor' and some class for relating monads to corresponding monad transformers |
| 13:35:57 | <ski_> | ToRA : not that i can see |
| 13:36:00 | <ToRA> | ski_: i just make this stuff up as i go, and as long as the type system passes it i usually assume it works ;) |
| 13:36:00 | <beelsebob> | malcolmw: of note -- I think SubEthaEdit meets all his criteria, except function folding, and unfortunately, it doesn't run on Linux |
| 13:36:11 | <dcoutts> | nominolo: it does the read strictly of course |
| 13:36:13 | <Spark> | anyone know how much type safety algol'58 had? |
| 13:36:16 | <quicksilver> | nominolo: are you confusing 'lazy' as in unsafeInterleave and 'lazy' as in lazy bytestring? |
| 13:36:22 | <Spark> | and how much the original cobol design had |
| 13:36:24 | <nominolo> | quicksilver: no |
| 13:36:42 | <nominolo> | dcoutts: well, that's exactly what we don't want |
| 13:36:45 | <dcoutts> | quicksilver: see the ByteString.Lazy.hGet docs |
| 13:36:48 | <malcolmw> | beelsebob: from what I've seen of Kate/KDevelop, it is rather nice, (apart from Haskell support probably) |
| 13:36:50 | <quicksilver> | beelsebob: I think emacs meets all his criteria and he's just too blinkered to try it |
| 13:36:57 | <dcoutts> | nominolo: I don't think you can have both. |
| 13:37:08 | <beelsebob> | quicksilver: except that you need to know to press ctrl-x ctrl-s to save |
| 13:37:11 | <ski_> | (ToRA : i was just mumbling about how one possibly could structure your pattern up to a more general thing ..) |
| 13:37:12 | <beelsebob> | I have no idea how you would exit |
| 13:37:18 | <quicksilver> | dcoutts: yes, I know :) I was wondering if nominolo didn't |
| 13:37:21 | <beelsebob> | I usually get lost in a sea of buffers in emacs |
| 13:37:27 | <quicksilver> | beelsebob: no you don't. You save just like you do in SubEthaEdit |
| 13:37:30 | <dcoutts> | nominolo: you can either read a certain amount strictly or read the whole thing, but then you give up control over when the Handle gets closed |
| 13:37:33 | <quicksilver> | beelsebob: you go File > Save |
| 13:37:37 | <quicksilver> | beelsebob: then File > Quit |
| 13:37:38 | <beelsebob> | quicksilver: I doubt cmnd-s will work |
| 13:37:43 | <beelsebob> | but yes, it has menus |
| 13:37:51 | <quicksilver> | beelsebob: well he *seems* to want menus |
| 13:37:57 | <quicksilver> | beelsebob: what with his stories about the mosue being faster |
| 13:38:01 | <nominolo> | dcoutts: please see the last comment here: http://nominolo.blogspot.com/2007/05/networkhttp-bytestrings.html |
| 13:38:05 | <lambdabot> | Title: nominolo's Blog: Network.HTTP + ByteStrings |
| 13:38:09 | <beelsebob> | I *think* he wants one where the keyboard shortcuts are not banal |
| 13:38:16 | <quicksilver> | beelsebob: if he finds emac's shortcut commands offensive, he doesn't have to use them |
| 13:38:16 | <beelsebob> | plus probably one with menus |
| 13:38:20 | <ToRA> | ski_ yeah - well i do that pattern a lot so an abstraction on it would be useful :) |
| 13:38:27 | <opqdonut> | i thinks he's just lazy and afraid of new things :) |
| 13:38:35 | <quicksilver> | beelsebob: and there is a set of emacs keybindings which are more 'windows like' than the defaults |
| 13:38:42 | <beelsebob> | actually, I think most emacs/vim users are afraid of new things |
| 13:38:47 | <dcoutts> | nominolo: sounds right |
| 13:38:58 | <dcoutts> | nominolo: hGetContents will only close if it gets EOF |
| 13:38:59 | <quicksilver> | beelsebob: most people with an investment in something which was hard to learn are |
| 13:39:00 | <gleb> | beelsebob: You can tweak all keybindings. But it's better to learn default if you don't want to redefine everything in every mode. C-x C-s is not that bad |
| 13:39:08 | <quicksilver> | beelsebob: hence java programmers being afraid of haskell |
| 13:39:20 | <quicksilver> | beelsebob: however, I'm neither afraid of new editors nor new languages :) |
| 13:39:26 | <beelsebob> | quicksilver: it being hard to learn does not make it good -- just because you have investment in something doesn't mean you shouldn't give it up |
| 13:39:35 | <opqdonut> | i use emacs, vi and ed fluently :) |
| 13:39:36 | <quicksilver> | beelsebob: yes, I wasn't defending it :) just stating it :) |
| 13:39:43 | <beelsebob> | okay |
| 13:39:43 | <gleb> | After working with Emacs I tend to press C-x C-s in Visual Studio |
| 13:39:49 | <beelsebob> | I think we can probably agree to disagree now |
| 13:39:56 | <quicksilver> | beelsebob: I don't even think we disagree :) |
| 13:40:08 | <dcoutts> | nominolo: can you explain again, exactly what behaviour you're looking for? |
| 13:40:23 | <beelsebob> | well, I think the only disagreement is "I like SEE" "you like emacs" "other people like vim" |
| 13:40:34 | <beelsebob> | which really is just opinion, so lets not flame |
| 13:40:38 | <beelsebob> | :) |
| 13:40:44 | <nominolo> | dcoutts: yes. one sec |
| 13:41:20 | <dons> | are we still talking about editors?? |
| 13:41:41 | <beelsebob> | dons: I hope not, I'm hoping that killed it |
| 13:41:44 | <dons> | here's something cute, xmonad lines of code versus comment growth: |
| 13:41:47 | <dons> | loc, http://www.cse.unsw.edu.au/~dons/tmp/xmonad-loc.png |
| 13:41:54 | <dons> | comments, http://www.cse.unsw.edu.au/~dons/tmp/xmonad-comments.png |
| 13:41:59 | <malcolmw> | ACTION has just discovered that KDevelop is available on MacOS |
| 13:42:03 | <dons> | and dwm, our competitor, loc: http://na.srck.net/dwm/dwmsloccountrevs.png |
| 13:42:14 | <beelsebob> | malcolmw: heh, cool |
| 13:42:28 | <beelsebob> | malcolmw: personally -- I like XCode, but it has crappy Haskell support |
| 13:42:30 | <beelsebob> | so SEE it is |
| 13:43:43 | <malcolmw> | ACTION has never tried XCode |
| 13:43:48 | <beelsebob> | I think that final comment that Ketil made is somewhat flawed |
| 13:44:03 | <beelsebob> | the article stated that most of the time was spent thinking about which keyboard shortcut to use |
| 13:44:11 | <beelsebob> | and he's said he's faster if he pre-caches it |
| 13:44:25 | <beelsebob> | he thought about how to do a search and replace, started the timer, and then did it |
| 13:44:56 | <ndm> | he's also missing how i do search and replace |
| 13:45:04 | <quicksilver> | beelsebob: if I ever flame feel free to pick me up on it |
| 13:45:10 | <quicksilver> | beelsebob: I don't believe I do :) |
| 13:45:31 | <beelsebob> | quicksilver: I think it was quite hard not to |
| 13:45:31 | <malcolmw> | beelsebob: any experiment is going to have to have a human giving out tasks to people using editors, and the stopwatch is started immediately the task description is complete |
| 13:45:31 | <ndm> | I press F5 which brings up the search and replace GUI dialog box, with the selected text hilighted in the find box, then i tab around and press enter to do it |
| 13:45:39 | <ndm> | i.e. 100% keyboard, but using a GUI |
| 13:45:51 | <beelsebob> | quicksilver: it was after all a discussion about editors |
| 13:45:58 | <quicksilver> | beelsebob: the only reason I haven't tried subethaedit is I have an innate resistance to non-free software when good free alternatives exist |
| 13:46:09 | <quicksilver> | beelsebob: I will believe you when you say it's good, though |
| 13:46:21 | <chrismbrown_> | quicksilver: I can vouch for how good SEE is |
| 13:46:30 | <quicksilver> | two testimonials :) |
| 13:46:33 | <beelsebob> | malcolmw: yes, but you don't need to tell the person what you're measuring, nor do you have to show them the stop watch |
| 13:46:35 | <chrismbrown_> | :) |
| 13:46:37 | <osfameron> | SEE ? |
| 13:46:42 | <chrismbrown_> | Sub Etha Edit |
| 13:46:45 | <beelsebob> | malcolmw: they need not even know that you're timing them |
| 13:46:47 | <osfameron> | oh, yeah |
| 13:47:01 | <osfameron> | is that good as an editor? I like the multi-user gimmick, but how does the core functionality stack up ? |
| 13:47:07 | <osfameron> | (not that I have or want a Mac so it's academic) |
| 13:47:13 | <manu3000> | talking about non free software, Textmate is nice too, but the Haskell bundle is somewhat restricted |
| 13:47:15 | <chrismbrown_> | osfameron: I like it, it works nicely for me. It's nice and simple. |
| 13:47:15 | <beelsebob> | osfameron: as far as I'm concerned, it's perfect |
| 13:47:16 | <nominolo> | dcoutts: if we use lazy bytestrings then we read a lazy bytestring once and then just take parts of it using the regular list operations. if the server closes the connection we just get an EOF on the handle the string is termited and we're fine. However, if the server doesn't close the connection: |
| 13:47:27 | <beelsebob> | osfameron: it has every feature I need, and none I don't need |
| 13:47:39 | <fasta> | M-% some letters M-/ RET some letters M-/ RET ! is also possible |
| 13:47:40 | <osfameron> | ah, I'll try one time I'm on a mac |
| 13:47:45 | <chrismbrown_> | it has search and replace, open and save, all a growing Haskeller needs :) |
| 13:47:53 | <beelsebob> | heh |
| 13:48:00 | <nominolo> | dcoutts: we want to have a way to close the connection _once we're done reading_. I.e. we want a lazy takeAndClose n lbs |
| 13:48:10 | <dcoutts> | nominolo: then you need some way of identifying the end of the transfer from the server |
| 13:48:34 | <nominolo> | dcoutts: yes, after reading 'n' characters i want to force the EOF |
| 13:48:35 | <quicksilver> | manu3000: the reason I prefer a free editor is that if the haskell bundle is restricted, I can improve it |
| 13:48:37 | <cdsmith> | Whoa! I know complaining about Java is one of our hobbies; but I just an email griping that it limits you to 65536 local variables per function. Makes you wonder what some people's code looks like! |
| 13:48:38 | <dcoutts> | nominolo: that doesn't sounds like a pure operation |
| 13:48:46 | <quicksilver> | manu3000: of course, I'm aware that the community contribute lots of work to textmate too |
| 13:48:52 | <beelsebob> | quicksilver: the reason I don't go for vim or emacs is that I'm a firm believer that it shouldn't take longer to learn how to use a text editor than, how to use the OS it's residing in |
| 13:48:53 | <dcoutts> | nominolo: you can do take of course |
| 13:49:10 | <manu3000> | @ quicksilver : well you can improve it with textmate too |
| 13:49:13 | <dcoutts> | nominolo: but I thought you didn't want to hClose the handle, if there might be another transfer following |
| 13:49:17 | <quicksilver> | manu3000: but to my mind, it's strange to constribute your free time to non-free code :) |
| 13:49:31 | <beelsebob> | or actually in the case of emacs, I'm a firm believer that it shouldn't take longer to learn how to use an OS, than the text editor it's residing in |
| 13:49:34 | <nominolo> | dcoutts: no there are case where I want to close it deliberately |
| 13:49:38 | <nominolo> | *cases |
| 13:49:43 | <manu3000> | well if it is a tool you spend hours on evry day, why not |
| 13:49:49 | <quicksilver> | beelsebob: I take your point. But, I use my OS (in any meaningful sense) less than I use my text editor |
| 13:49:51 | <sris> | if i have a recursive method. is there an easy way to make it print some output in between every call? |
| 13:49:56 | <dcoutts> | nominolo: it sounds to me like you want to have more control over the IO, so use strict IO. |
| 13:50:02 | <quicksilver> | beelsebob: and I demand more features from my editor than my OS (at the user level) |
| 13:50:10 | <beelsebob> | which is odd |
| 13:50:11 | <quicksilver> | beelsebob: so therefore I reasonably expect it will be complex |
| 13:50:12 | <opqdonut> | sris: well you could just use trace |
| 13:50:13 | <fasta> | I used to think ConText was a great editor on Windows. |
| 13:50:21 | <beelsebob> | because the point of the OS is to distribute tasks between different programs |
| 13:50:24 | <nominolo> | dcoutts: then i'd have to do the chunking myself. fair enough |
| 13:50:30 | <beelsebob> | so why are you sticking all the tasks in the editor? |
| 13:50:38 | <sris> | opqdonut: whats that? |
| 13:50:47 | <beelsebob> | my current king of the hill on Windows is Notepad++ |
| 13:50:53 | <fasta> | beelsebob: you don't need to use Emacs like an OS. |
| 13:50:55 | <opqdonut> | ?hoogle trace |
| 13:50:56 | <lambdabot> | Debug.Trace.trace :: String -> a -> a |
| 13:50:56 | <lambdabot> | Debug.Trace :: module |
| 13:50:56 | <lambdabot> | Debug.Trace.putTraceMsg :: String -> IO () |
| 13:51:15 | <beelsebob> | fasta: no, I was responding to quicksilver's "needing more features in a text editor than in an OS" |
| 13:51:17 | <malcolmw> | I read someone yesterday who said that emacs is a great OS, shame it doesn't have a useful text editor in it |
| 13:51:19 | <beelsebob> | I want my OS to manage processes |
| 13:51:28 | <beelsebob> | and I want my editor to edit text |
| 13:51:30 | <beelsebob> | and not much more |
| 13:51:44 | <SamB_XP> | malcolmw: yeah, its a pretty standard joke ;-) |
| 13:51:45 | <dcoutts> | nominolo: I don't think lazy IO is really compatible with re-using the same socket for multiple transfers |
| 13:51:46 | <fasta> | beelsebob: Yesterday I was interested in what command I did a few strokes back. M-x view-lossage |
| 13:51:47 | <beelsebob> | malcolmw: lol |
| 13:52:07 | <fasta> | beelsebob: I don't think software can have too many features, unless it's too slow. |
| 13:52:09 | <dcoutts> | nominolo: because you're relying on your caller to consume the input before you can get the next transfer |
| 13:52:33 | <beelsebob> | fasta: on the contrary, I'm a great believer in each program being excellent at one specific task |
| 13:52:34 | <SamB_XP> | fasta: well, you have to admit it can be harder to find the features |
| 13:52:35 | <fasta> | beelsebob: especially with the interface Emacs or VIM has |
| 13:52:40 | <beelsebob> | if I then want to combine the tasks, I can combine the programs |
| 13:52:54 | <SamB_XP> | emacs has a lot of programs |
| 13:52:56 | <nominolo> | dcoutts: true |
| 13:53:01 | <SamB_XP> | why do you suppose they call it an OS? |
| 13:53:17 | <fasta> | SamB_XP: it's a name space problem |
| 13:53:35 | <beelsebob> | SamB: that's exactly my problem with it |
| 13:53:48 | <toxic> | maybe if the reusing includes forcing to read all the old data |
| 13:54:46 | <quicksilver> | beelsebob: as an example of how the combined approach works well, consider a complex ghci session. |
| 13:55:07 | <quicksilver> | beelsebob: clearly I could run a putative GUI ghci (like winhugs) or I could just run ghci in a terminal |
| 13:55:11 | <quicksilver> | beelsebob: and sometimes, I do |
| 13:55:24 | <beelsebob> | quicksilver: of note, I don't... ever |
| 13:55:25 | <quicksilver> | beelsebob: but, if I'm testing complex things, and entering complex haskell expressions |
| 13:55:43 | <beelsebob> | if I'm exiditing complex haskell expressions I use an editor |
| 13:55:48 | <beelsebob> | I then paste them into ghci |
| 13:55:56 | <dcoutts> | toxic: you can do that if you're prepared to buffer the remaining input in memory or on disk, you might need threads to help with that, but this starts to sound too complex |
| 13:55:56 | <beelsebob> | because my editor, and ghci can work together nicely |
| 13:56:05 | <quicksilver> | ACTION nods |
| 13:56:10 | <quicksilver> | but what I'm doing is like what you're doing |
| 13:56:17 | <quicksilver> | (using the editor to edit the complex expressions) |
| 13:56:22 | <quicksilver> | except, I save the copy-paste step |
| 13:56:22 | <dcoutts> | toxic: you really need to know who is responsible for pulling/consuming the data |
| 13:56:24 | <beelsebob> | except that you're combining two arbitrary programs |
| 13:56:27 | <beelsebob> | for no reason |
| 13:56:27 | <zorg0f> | hey, i'm having some problems learning the foldr function. would someone mind explaining how foldr (+)1 [1,2,3] = 7 ? |
| 13:56:31 | <Speck> | Is there any page/wiki/blog/repository where I can learn about the Parsec -> ParsecT/ByteString SoC project? |
| 13:56:35 | <quicksilver> | beelsebob: not "for no reason" |
| 13:56:42 | <quicksilver> | beelsebob: "for the reason I just described" |
| 13:56:53 | <SamB_XP> | beelsebob: I suppose it would be gratuitous on plan 9... |
| 13:56:55 | <beelsebob> | quicksilver: yes, but you gained a step -- the "enter ghci mode" step |
| 13:57:03 | <quicksilver> | beelsebob: that's once per fortnight, though |
| 13:57:07 | <nominolo> | zorg0f: 7 = (1 + (2 + (3 + 1))) |
| 13:57:07 | <quicksilver> | beelsebob: once it's there, it's there |
| 13:57:31 | <SamB_XP> | quicksilver: it isn't much harder than finding an empty xterm and typing "ghci" |
| 13:57:33 | <beelsebob> | yes, but once there, you need to be you to actually know what it is and what it's doing |
| 13:57:46 | <beelsebob> | wheras I have ghci that's always ghci |
| 13:57:46 | <quicksilver> | beelsebob: eh? |
| 13:57:49 | <zorg0f> | so basically, foldr does *whatever* (in this case +1) to the last element of a list? |
| 13:57:53 | <beelsebob> | and an editor that's always an editor |
| 13:57:54 | <quicksilver> | beelsebob: ghci in emacs is still ghci... |
| 13:58:03 | <beelsebob> | yes... but emacs is no longer emacs |
| 13:58:04 | <SamB_XP> | beelsebob: buffers have names |
| 13:58:11 | <SamB_XP> | and emacs is still emacs |
| 13:58:13 | <beelsebob> | SamB: so do programs... use them |
| 13:58:14 | <quicksilver> | beelsebob: it doesn't behave differently, it just has a different line editor |
| 13:58:34 | <beelsebob> | so it does behave differently then? |
| 13:58:50 | <beelsebob> | but only subtly |
| 13:58:51 | <quicksilver> | beelsebob: I can use my editor to edit things |
| 13:59:00 | <quicksilver> | beelsebob: before I 'submit' my command to the ghci |
| 13:59:01 | <ski_> | zorg0f : foldr (+) 42 [1,2,3] = 1 + (2 + (3 + 42)) |
| 13:59:01 | <beelsebob> | good, so use it to |
| 13:59:06 | <beelsebob> | don't expect it to do other stuff too |
| 13:59:13 | <Saizan> | zorg0f: foldr f z [a,b,c] = f a (f b (f c z)) |
| 13:59:17 | <beelsebob> | it is after all, an editor |
| 13:59:18 | <quicksilver> | beelsebob: but using it in the same window is conveninet |
| 13:59:22 | <quicksilver> | beelsebob: rather than needing two |
| 13:59:30 | <quicksilver> | beelsebob: (and you get syntax hihglighting on ghci output) |
| 13:59:34 | <beelsebob> | that's just a symptom of a poor window manager |
| 13:59:47 | <quicksilver> | beelsebob: (which isn't desperately interesting for ghci but is for some other programs) |
| 13:59:51 | <beelsebob> | click -> drag, done |
| 14:00:07 | <SamB_XP> | I especially like the error clicking |
| 14:00:50 | <SamB_XP> | beelsebob: since when do WMs do that? |
| 14:01:00 | <beelsebob> | SamB: mine does |
| 14:01:11 | <beelsebob> | or do you mean error clicking? |
| 14:01:40 | <zorg0f_> | oops - was resting my feet on my case and they slipped and hit the power button! :$ |
| 14:01:47 | <SamB_XP> | hah |
| 14:01:56 | <zorg0f_> | could someone paste that foldr example with the characters |
| 14:01:59 | <beelsebob> | zorg0f: not quite as bad as a particular apple UI failing |
| 14:02:04 | <Saizan> | zorg0f: foldr f z [a,b,c] = f a (f b (f c z)) |
| 14:02:08 | <zorg0f_> | ta |
| 14:02:17 | <opqdonut> | ?src foldr |
| 14:02:17 | <lambdabot> | foldr k z xs = go xs |
| 14:02:17 | <lambdabot> | where go [] = z |
| 14:02:17 | <lambdabot> | go (y:ys) = y `k` go ys |
| 14:02:38 | <beelsebob> | on Mac IIs the cable coming out of the keyboard was the perfect size, shape and height to hit the reset button if you shoved the keyboard forwards |
| 14:03:29 | <opqdonut> | .) |
| 14:03:34 | <SamB_XP> | was it also the perfect horizontal location? |
| 14:03:42 | <beelsebob> | usually |
| 14:03:48 | <SamB_XP> | wow |
| 14:03:51 | <beelsebob> | if you sat the keyboard directly in front of the box it was |
| 14:04:01 | <opqdonut> | wtg apple :P |
| 14:04:04 | <beelsebob> | indeed |
| 14:04:05 | <SamB_XP> | yeah, 'swhat I meant ;-) |
| 14:04:48 | <bos> | @seen dons |
| 14:04:48 | <lambdabot> | dons is in #xmonad, #haskell-soc, #haskell-overflow, #haskell and #ghc. I last heard dons speak 19m 21s ago. |
| 14:07:52 | <zorg0f_> | why is this ( foldr (+) [4,4,4] ) not valid? does foldr need to have a value as well as a function? |
| 14:08:07 | <bos> | yes. |
| 14:08:08 | <opqdonut> | zorg0f_: yes |
| 14:08:12 | <zorg0f_> | cool. ta |
| 14:08:12 | <beelsebob> | you need to give it a zero value |
| 14:08:14 | <earthy> | zorg0f: it needs to know what to stop on |
| 14:08:15 | <beelsebob> | foldr needs two things |
| 14:08:15 | <opqdonut> | use foldr0 if you want 0 |
| 14:08:20 | <beelsebob> | something to replace [] with |
| 14:08:25 | <beelsebob> | and something to replace : with |
| 14:08:41 | <opqdonut> | sorry, foldr1 |
| 14:08:49 | <opqdonut> | > foldr1 (+) [4,4,4] |
| 14:08:51 | <lambdabot> | 12 |
| 14:09:01 | <earthy> | foldr1 takes the last element in the list to stop on |
| 14:09:01 | <SamB_XP> | > foldr1 (+) [] |
| 14:09:02 | <opqdonut> | that requires a non-empty list |
| 14:09:03 | <lambdabot> | Exception: Prelude.foldr1: empty list |
| 14:09:03 | <therp> | > foldr (+) 0 [4, 4, 4] |
| 14:09:04 | <lambdabot> | 12 |
| 14:10:34 | <ToRA> | do we know who was responsible for www.foldr.com ? |
| 14:10:43 | <beelsebob> | zorg0f: to think about foldr -- write out the list in it's un-sugared way (4 : 4 : 4 : []) -- then replace ':' with the function, and [] with the zero value, so for foldr (+) 0, you would end up with 4 + 4 + 4 + 0 |
| 14:11:44 | <dons> | ToRA: don't you mean www.foldl.com ? |
| 14:12:21 | <pitecus> | what is the best way to split a darcs repo into several independent projects? |
| 14:12:24 | <beelsebob> | dons: what are you trying to show, that foldl is more user friendly, because you can click it more easily? |
| 14:12:24 | <ski_> | > let plus x y = concat ["(",show x," + ",y,")"] in foldr plus "0" [1,2,4,7,12,20] |
| 14:12:25 | <lambdabot> | "(1 + (2 + (4 + (7 + (12 + (20 + 0))))))" |
| 14:12:40 | <osfameron> | foldr.com++ |
| 14:12:42 | <ToRA> | dons: well i wanted to know why they havn't registered concatMap.com |
| 14:12:42 | <beelsebob> | ski_: neat :) |
| 14:12:49 | <zorg0f_> | excellent, yeah, i got it now. |
| 14:12:50 | <ski_> | > let plus x y = concat ["(",x," + ",show y,")"] in foldl plus "0" [1,2,4,7,12,20] |
| 14:12:52 | <lambdabot> | "((((((0 + 1) + 2) + 4) + 7) + 12) + 20)" |
| 14:13:09 | <zorg0f_> | lol, when i was googling for foldr examples earlier i found foldr.com - sat there clicking it for ages :$ |
| 14:13:20 | <opqdonut> | :) |
| 14:13:27 | <osfameron> | it's beautiful! |
| 14:13:35 | <osfameron> | I think I like foldl.com even more |
| 14:15:35 | <nominolo> | dcoutts: reading at a later place in the bytestring automatically forces the part before that |
| 14:15:46 | <nominolo> | dcoutts: of course that will increase memory usage |
| 14:16:21 | <dcoutts> | nominolo: yes, using take/drop for example to look later in the bytestring forces it that far |
| 14:16:44 | <nominolo> | dcoutts: so we'd want the user to decide if she wants to reuse the old socket |
| 14:17:01 | <nominolo> | dcoutts: but that'd be fine, i guess |
| 14:17:45 | <quicksilver> | chessguy: that was a great article, thanks |
| 14:18:27 | <chessguy> | quicksilver: yeah, it's great stuff |
| 14:20:29 | <cdsmith> | chessguy: I'm enjoying the movie names in one of the examples. |
| 14:25:15 | <earthy> | ACTION thinks he ought to drop http://neugierig.org/content/unix/ into each following editor war :) |
| 14:25:17 | <lambdabot> | Title: Unix |
| 14:29:19 | <kfish> | why can't people argue about something tasty, like cheese? |
| 14:29:30 | <SamB_XP> | oooh |
| 14:29:34 | <SamB_XP> | I loves cheeses |
| 14:30:20 | <earthy> | not all cheese is tasty though. :) |
| 14:30:38 | <Speck> | who could argue about cheese? except like: "Do you have any cheese?" "No." "Screw you!" |
| 14:30:45 | <osfameron> | I like the "How Dumbledore would sell Haskell" thread |
| 14:33:34 | <shapr> | Griere(sp?) is the best cheese in the world. |
| 14:34:00 | <quicksilver> | gruyere, I believe |
| 14:34:12 | <quicksilver> | I can't bear cheese with a modal interface :P |
| 14:34:12 | <shapr> | Ah, thanks. I can't spell before I've had coffee. |
| 14:34:50 | <earthy> | Speck is not aware of the monty python cheese shop sketch then? :) |
| 14:35:22 | <Speck> | earthy: I am very aware, now shut up that bloody basooki |
| 14:35:36 | <Speck> | (or however you spell that) |
| 14:35:55 | <earthy> | 'shut that bloody mazourka up!' :) |
| 14:36:29 | <earthy> | oh, no, bouzouki |
| 14:36:32 | <earthy> | other type of dance |
| 14:36:34 | <Apocalisp> | No. 'Twas an act of sheer optimism to pose the question in the first place. |
| 14:36:34 | <Speck> | ACTION has a savant friend who can recite any sketch verbatim in accent |
| 14:37:07 | <earthy> | that is just plain scary. |
| 14:37:15 | <Apocalisp> | Can he do it in Hungarian? |
| 14:37:52 | <Speck> | he can do it in whatever language the sketch is in. english mostly |
| 14:38:19 | <earthy> | ACTION dislikes wensleydale though. ;) |
| 14:39:44 | <osfameron> | yeah, I'm not fussed on the crumbly, tart English cheeses |
| 14:40:17 | <osfameron> | cheddar otoh is vastly underrated intrenationally |
| 14:40:31 | <earthy> | there's cheddar and cheddar though |
| 14:40:37 | <osfameron> | oh, sure |
| 14:40:44 | <earthy> | much as there's gouda and gouda |
| 14:40:48 | <shapr> | I'm fond of Gorgonzola. |
| 14:41:00 | <savanni> | question (and this means a topic change back to Haskell for a moment) |
| 14:41:05 | <earthy> | ;) |
| 14:41:20 | <savanni> | In ghci, I'm using readFile to read a file from disk. How do I keep it from printing the entire file to screen? |
| 14:41:32 | <savanni> | Different function, maybe? |
| 14:41:36 | <earthy> | contents <- readFile |
| 14:41:45 | <earthy> | is what you do? |
| 14:41:49 | <fasta> | ToRA: Does your "call" not fit in some existing type class? |
| 14:41:50 | <savanni> | Yeah, it is. |
| 14:41:52 | <quicksilver> | earthy: some versions of ghci automatically show the return value, too |
| 14:42:08 | <earthy> | quicksilver: just determining what savanni's doing ;) |
| 14:42:09 | <quicksilver> | I forget the hack that was advised |
| 14:42:19 | <quicksilver> | you can turn off that behaviour, of course |
| 14:42:48 | <osfameron> | hmmm, I've been deliciousing articles about haskell since Feb 2005. Took me a while to get around to learning it... |
| 14:42:56 | <lispy> | mm...ttmrichter seems to be a troll |
| 14:43:05 | <earthy> | lispy: oh, but he is. :) |
| 14:43:17 | <ToRA> | fasta: no |
| 14:43:41 | <ToRA> | fasta: i think ski_ was lamenting that fact |
| 14:43:43 | <ndm> | mnislaih: i think your thread about debugging shows that debugging works best when its reliable, not when its fancy |
| 14:43:58 | <ToRA> | fasta: (and i agree) |
| 14:44:14 | <lispy> | ndm: i would agree with that statement purely on personal experience |
| 14:44:50 | <ndm> | lispy: i think it works absolutely best in a GUI though |
| 14:44:52 | <lispy> | ndm: BTW, what are the limitiations of catch? do you think it would work on darcs source? |
| 14:45:26 | <quicksilver> | lispy: main limitation is it has to be YHC-compilable |
| 14:45:35 | <quicksilver> | lispy: that means no pattern guards, e.g. |
| 14:45:35 | <ndm> | lispy: its not going to work on darcs yet for a couple of reasons: Yhc must be able to compile the program (thats because GHC.Core is broken, once they fix, it will work with GHC) |
| 14:46:01 | <lispy> | i see, yes darcs uses pattern guards |
| 14:46:04 | <fasta> | ToRA: Yes, I thought you did. Just wanted to be sure., |
| 14:46:06 | <ndm> | secondly, the first-order transformation isn't perfect, but i've got one in a different project that is, so that needs moving over |
| 14:46:38 | <ndm> | thirdly, darcs is somewhat larger than anything i've put through catch yet - but in theory that shouldn't be an issue, although may show up some places i'm using associative lists instead of maps etc |
| 14:47:09 | <ndm> | in principle, once GHC.Core gets finished, and i port Catch over, i'd say you've got a shot at getting it through with a beefy computer |
| 14:47:34 | <lispy> | ndm: that's great. Sounds like I need to keep waiting for now though. |
| 14:47:39 | <lispy> | thanks |
| 14:48:01 | <ndm> | lispy: yes, its not ready yet for darcs, but can happily cope with projects in the thousands of lines |
| 14:48:57 | <earthy> | savanni: run ghci with -fno-print-bind-result |
| 14:55:05 | <_case> | hello, i have a binary search tree. i wan't to add a node to it, but i get the following error: |
| 14:55:12 | <_case> | Main> insTree 17 aTree |
| 14:55:19 | <_case> | ERROR - Cannot find "show" function for: |
| 14:55:32 | <_case> | *** Expression : insTree 17 aTree |
| 14:55:32 | <_case> | *** Of type : Tree Integer |
| 14:55:50 | <_case> | instree has arguments insTree :: Ord a => a -> Tree a -> Tree a |
| 14:55:58 | <_case> | what's wrong here? |
| 14:56:20 | <_case> | aTree is a static defined BST for testing purposes |
| 14:56:21 | <Saizan> | that your interpret needs a way to print your Tree |
| 14:56:31 | <Saizan> | *interptreter |
| 14:56:37 | <savanni> | earthy: cool, thanks! |
| 14:56:42 | <Saizan> | so you nee to make it an instance of Show |
| 14:56:43 | <_case> | Saizan: i have a printBST function, can i use that? |
| 14:57:15 | <fasta> | _case: a printBST function has type IO () probably, so no |
| 14:57:29 | <fasta> | _case: you need something of type Tree a -> String |
| 14:57:29 | <ari> | @type show |
| 14:57:32 | <lambdabot> | forall a. (Show a) => a -> String |
| 14:57:51 | <fasta> | _case: (but somewhere in your printBST function you already do this) |
| 14:58:04 | <_case> | hmm, i don't quite understand |
| 14:58:14 | <Saizan> | _case an easy solution is to add deriving (Show) to your Tree definition |
| 14:58:36 | <thruspa> | And a dummy instance like : instance Show aTree where show x = "" ? |
| 14:58:42 | <Saizan> | i.e. data Tree a = .... deriving (Show) |
| 14:58:55 | <_case> | ok |
| 14:59:03 | <Saizan> | _case: but, what's the type of printBST? |
| 14:59:24 | <_case> | printBST :: Tree a -> [a] |
| 14:59:56 | <_case> | ah, the deriving part worked :) |
| 15:00:04 | <_case> | what does it do exactly? |
| 15:00:45 | <Saizan> | it defines Tree a as an instance of the class Show, so that you can use the function show on a tree |
| 15:00:48 | <Saizan> | ?type show |
| 15:00:50 | <lambdabot> | forall a. (Show a) => a -> String |
| 15:01:06 | <_case> | Saizan: aah ok, i see |
| 15:01:08 | <Saizan> | _case: do you know how typeclasses work? |
| 15:01:18 | <ari> | _case: It conceptually writes out a bunch of code for you according to the rules at http://haskell.org/onlinereport/derived.html#sect10.4 |
| 15:01:19 | <lambdabot> | Title: The Haskell 98 Report: Derived Instances |
| 15:01:40 | <_case> | Saizan: yeah in general |
| 15:02:43 | <Saizan> | _case: well some of them can be derived in this way, as you can find on ari's link |
| 15:03:23 | <_case> | ok, tnx guys |
| 15:04:53 | <shapr> | Gruyere supreme! |
| 15:05:46 | <shapr> | Cheddar is the Yugo of the cheese world. |
| 15:06:05 | <shapr> | ACTION tries to start a holey cheese war. (Should have talked about Swiss) |
| 15:06:10 | <Speck> | cream cheese! (or neufchatel) ++ |
| 15:06:38 | <osfameron> | parmesan versus grana padano! |
| 15:06:49 | <osfameron> | brie versus camembert! |
| 15:07:29 | <quicksilver> | anyone around know Yi? specifically its display model? |
| 15:07:40 | <ski_> | gammelost ! |
| 15:07:57 | <shapr> | America is the land of boring cheese. I went to the nearest specialty shop and they had Gruyere for one dollar an ounce (0.74 euro for 0.028 kilo of cheese) |
| 15:08:19 | <mux> | ACTION in .fr |
| 15:08:25 | <mux> | lots of good cheeses |
| 15:08:39 | <shapr> | Yeah, France is the land of fromage! |
| 15:08:44 | <osfameron> | Gjetost (sp?) - strange norwegian cheese that looks (and almost tastes) like fudge |
| 15:08:51 | <phoniq_> | ski queen! |
| 15:08:52 | <shapr> | I like Vasterbottom. |
| 15:08:57 | <mux> | shapr: and wine ;-) |
| 15:09:04 | <dcoutts_> | osfameron: in can taste like fudge, but often smells like poo |
| 15:09:15 | <elrodeo_> | elrodeo_: test |
| 15:09:16 | <phoniq> | great with gala apples |
| 15:09:16 | <osfameron> | eeek! |
| 15:09:19 | <dcoutts_> | ACTION knows to his cost |
| 15:09:35 | <osfameron> | there are swiss cheeses that smell rank |
| 15:09:36 | <shapr> | The Swedish cheese is actually called Vasterbotten but its fat content is so high it *should* be called vaster*bottom*. |
| 15:09:40 | <ski_> | mesost ! |
| 15:09:44 | <osfameron> | Muenster, maybe |
| 15:09:52 | <mux> | hmmm, münster |
| 15:10:17 | <osfameron> | beautiful taste, but you wrap it in layers of plastic and boxes etc., put it in your luggage, and while you travel people are constantly looking at you to check if you've a) farted or b) died |
| 15:10:26 | <ski_> | ACTION . o O ( muenster monster ) |
| 15:10:59 | <shapr> | osfameron: It means "goat cheese" and truly, goat cheese and sheep cheese is biological warfare. |
| 15:11:18 | <osfameron> | shapr: which means "goat cheese" ? |
| 15:11:34 | <zorg0f_> | im trying to write a recursive version of this: f xs y = [y * x| x<-xs ] i.e. doesn't use list comprehension, but i'm having problems using x:xs etc. I have: f :: [Int] -> Int -> [Int] f [] _ = [] f x:xs y = [ x*y ++ f xs y ] - i know this is wrong but can anyone see what i'm trying to do? :( |
| 15:11:39 | <osfameron> | there are wonderful sheep cheeses, the Spanish ones are great, and Italian Pecorino is occasionally marvellous |
| 15:11:41 | <shapr> | My ex had this one mutton cheese that polluted our apartment for weeks, and it was only in the fridge for hours. |
| 15:11:46 | <shapr> | osfameron: Sorry, I'm not awake yet :-) |
| 15:12:00 | <shapr> | osfameron: getost is "goat cheese" in Swedish |
| 15:12:14 | <osfameron> | ah, ok - I thought it was a norwegian cheese |
| 15:12:14 | <ski_> | zorg0f_ : 'f (x:xs) y = ...' |
| 15:12:39 | <ski_> | zorg0f_ : 'f x:xs y' gets parsed as '(f x):(xs y)' which is not what you want |
| 15:13:06 | <Baughn> | zorg0f_: Or, even shorter, f x y = map (* y) x |
| 15:13:10 | <shapr> | osfameron: Oh, I'm sure it is, but Swedish, Norwegian and Danish are very similar. So gjetost in Norwegian would be getost in Swedish and gedest in Danish. |
| 15:13:22 | <ski_> | ('gjetost' is norwegian spelling) |
| 15:13:32 | <shapr> | Er, gedeost in Danish |
| 15:13:32 | <osfameron> | ah, cool |
| 15:13:42 | <malcolmw> | goat's cheddar is delicious - totally much better than cow cheddar |
| 15:13:55 | <shapr> | malcolmw: Yeah, but nothing you want to keep in your backpack on a warm summer's day. |
| 15:14:13 | <zorg0f_> | baughn: yeah, i realize that map function would do it but i've got to do it this way for the sake of an exercise. ski_: ta, i'll try and have a fiddle with it |
| 15:14:13 | <shapr> | malcolmw: btw, did colourFragment become colour? |
| 15:14:29 | <shapr> | malcolmw: Er, colourFragment -> hscolour? |
| 15:14:30 | <malcolmw> | shapr: hmm, yes I think so |
| 15:14:36 | <shapr> | ok, thanks. |
| 15:15:08 | <malcolmw> | shapr: at any rate, someone introduced Fragment variations, and I decided to make them the default API |
| 15:15:33 | <zorg0f_> | woo! got it working. third line should've been: f (x:xs) y = [x*y] ++ f xs y |
| 15:15:33 | <malcolmw> | shapr: with a flag to choose partial/non-partial |
| 15:15:43 | <shapr> | Well, I broke hpaste yesterday trying to update it, so I ended up with some questions. |
| 15:16:16 | <malcolmw> | shapr: ah, so you are responsible for hpaste not working... |
| 15:16:31 | <ski_> | zorg0f_ : you can (if you want) simplify '[foo] ++ bar' to 'foo : bar' .. in some cases the former can read better, though |
| 15:16:35 | <shapr> | Not originally, no. but at this point, yes. |
| 15:16:39 | <lispy> | zorg0f_: hmm...so you multiply each element by y? |
| 15:17:13 | <zorg0f_> | lispy: lol, yeah - that's all. ski_: what's the difference between using a colon and double + ? |
| 15:17:44 | <lispy> | zorg0f_: look at map :) |
| 15:17:46 | <lispy> | :t map |
| 15:17:49 | <lambdabot> | forall a b. (a -> b) -> [a] -> [b] |
| 15:17:57 | <lispy> | > map (*4) [1..4] |
| 15:17:59 | <lambdabot> | [4,8,12,16] |
| 15:18:19 | <zorg0f_> | yeah, i'm aware of map. i just had to use recursion for the exercise. |
| 15:18:24 | <lispy> | zorg0f_: now that you see how to write it by hand, you can start looking at more advanced ways |
| 15:18:39 | <osfameron> | Apocalisp: ping? |
| 15:18:45 | <ski_> | zorg0f_ : '++' will walk through it's left argument (a list) and add each element in front of the right argument (a list) (using ':') .. ':' just puts the left argument (an element) in front of the right argument (a list) directly |
| 15:19:08 | <ski_> | (zorg0f_ : and in your case the left argument happened to be a one-element list) |
| 15:19:21 | <ski_> | @src (++) |
| 15:19:22 | <lambdabot> | (++) [] ys = ys |
| 15:19:22 | <lambdabot> | (++) (x:xs) ys = x : xs ++ ys |
| 15:20:16 | <mnislaih> | ndm: about debugging: as long as I have the assurance it works _always_ (99% of times), the fancier, the better, |
| 15:20:33 | <ndm> | mnislaih: oh yes, but realiable before features |
| 15:20:34 | <malcolmw> | shapr: see patch "*Add a -partial option, to produce output without header/footer." it says "Note that the library API has changed: hscolourFragment has been removed ..." |
| 15:20:44 | <shapr> | malcolmw: Thanks |
| 15:20:50 | <zorg0f_> | hrmmm. the way i think im understanding it, is that the x:whatever adds a single element to a list. wheras the ++ adds a list to a list. is that correct? |
| 15:21:00 | <ski_> | zorg0f_ : yes |
| 15:21:06 | <zorg0f_> | great, ta :) |
| 15:21:06 | <shapr> | glguy said he'd fix hpaste when he has time, but he's been distracted with major life changes. |
| 15:21:14 | <rho> | ACTION is away: (ice cream time) |
| 15:21:19 | <zorg0f_> | and they're just adding left/right-wise by the order they come in? |
| 15:21:24 | <ski_> | (zorg0f_ : and the "element in front of list" is the primitive view of lists) |
| 15:21:31 | <ski_> | @src [] |
| 15:21:32 | <lambdabot> | data [] a = [] | a : [a] |
| 15:22:01 | <malcolmw> | shapr: at about the same time, I changed the cmdline options so -anchorHTML and -anchorCSS disappeared to become -anchor + [ -html | -css ] |
| 15:22:04 | <ski_> | zorg0f_ : sorry, can you rephrase that question ? |
| 15:22:37 | <lispy> | zorg0f_: you could define lists backwards if that's what you're asking |
| 15:23:13 | <malcolmw> | shapr: but hpaste probably uses the library API rather than the cmdline, so maybe not a breaking issue |
| 15:23:17 | <lispy> | they could have been defined, data [] a = [] | [a] : a |
| 15:23:27 | <zorg0f_> | '1':"ab" would equal "1ab". is "ab":'1' valid? |
| 15:23:31 | <zorg0f_> | no it's not |
| 15:23:36 | <zorg0f_> | ok |
| 15:23:42 | <ski_> | (zorg0f_ : you always add elements to the "same side" of a list using ':' (and that side is usually thought of as "left"/"front"/"top")) |
| 15:23:54 | <lispy> | :t (:) |
| 15:23:56 | <lambdabot> | forall a. a -> [a] -> [a] |
| 15:24:00 | <lispy> | zorg0f_: does that help ^^ |
| 15:24:10 | <thruspa> | :-) |
| 15:24:24 | <zorg0f_> | cool, that's just what i was checking - that elements are always added to the front using : |
| 15:25:35 | <zorg0f_> | lipsy: ive got the kind of brain that works things out by looking at examples and explanations rather than looking at definitions =/ :( |
| 15:26:11 | <zorg0f_> | but i understand it now :) thanks guys |
| 15:26:39 | <ski_> | > let xs `snoc` x = xs ++ [x] in "foo" `snoc` 'f' |
| 15:26:41 | <lambdabot> | "foof" |
| 15:28:31 | <Baughn> | @src (++) |
| 15:28:32 | <lambdabot> | (++) [] ys = ys |
| 15:28:32 | <lambdabot> | (++) (x:xs) ys = x : xs ++ ys |
| 15:29:11 | <roconnor> | ahh, my arch repository is corrupted |
| 15:29:48 | <Apocalisp> | osfameron: Pong |
| 15:32:11 | <shapr> | roconnor: Try darcs? |
| 15:32:22 | <shapr> | Tom Lord is darcs archenemy. |
| 15:32:36 | <roconnor> | :) |
| 15:32:50 | <roconnor> | arch is an institutional choice |
| 15:33:23 | <Baughn> | Hum. Around here we're still on CVS. |
| 15:33:44 | <toxic> | cvs generates a lot of head ache |
| 15:34:07 | <Baughn> | Not to worry. There's a full-time position in dealing with it. |
| 15:34:15 | <shapr> | toxic: Was that a pun? HEAD ache? |
| 15:35:15 | <toxic> | it is now when you mention it :P |
| 15:35:15 | <osfameron> | Apocalisp: heya |
| 15:35:41 | <osfameron> | Apocalisp: I was about to post my version of SOE 2.2 to the blog. I wanted to quote your version too (as it's nicer), with credit. Would that be OK ? |
| 15:35:48 | <roconnor> | I solve my problem by deleting my corrupted pristine-tree |
| 15:36:08 | <zorg0f_> | can a haskell function take a variety of types? i want to write a function that takes *something* and returns a set thing if it's an integer |
| 15:36:49 | <ski_> | zorg0f_ : what should it return otherwise ? |
| 15:36:50 | <Apocalisp> | osfameron: Yes, except the version I pasted doesn't work! |
| 15:37:10 | <zorg0f_> | erm, an integer returns "1", say |
| 15:37:18 | <zorg0f_> | not the string "1", the integer :p |
| 15:37:20 | <osfameron> | Apocalisp: harr! that shows me up as not having tried it ;-) I just admired its concision |
| 15:37:35 | <osfameron> | Apocalisp: do you have a working version along those lines ? |
| 15:38:26 | <Apocalisp> | osfameron: I do. It was just a slight bug. |
| 15:38:39 | <Baughn> | zorg0f_: You could presumably use a typeclass for that, though I'm not sure how to get around its instances being overlapping |
| 15:38:55 | <Baughn> | zorg0f_: (One instance for Num a => a, one for.. everything else?) |
| 15:39:24 | <quicksilver> | zorg0f_: you could use typeclasses to do tricks like that |
| 15:39:42 | <quicksilver> | zorg0f_: but more idiomatic haskell to to make a new data type for the possibilities |
| 15:40:07 | <quicksilver> | zorg0f_: data PossibleArg = ZorgInteger Int | ZorgString String | ZorgSomethingCool |
| 15:40:10 | <Apocalisp> | osfameron: I did the convexity exercise last night. Fun stuff. |
| 15:40:38 | <zorg0f_> | hrmmm |
| 15:40:51 | <osfameron> | Apocalisp: yeah! I finished exercises for Chapter 7 this morning. I'm finding that the ones that don't involve maths are easier (for some funny reason) ;-) |
| 15:40:58 | <zorg0f_> | then just have a function f :: PossibleArg -> Int ? |
| 15:41:07 | <quicksilver> | zorg0f_: right |
| 15:41:08 | <osfameron> | Apocalisp: did you go with the "keep on turning left" approach? |
| 15:41:23 | <Baughn> | zorg0f_: Or did you want 'f :: a -> TypeID' ? |
| 15:41:53 | <zorg0f_> | basically, i want a function that can take anything and will return the number 1 if "anything" is an integer |
| 15:42:10 | <Apocalisp> | osfameron: The approach is basically rotate (0,r) by 360/n degrees, repeat n times. |
| 15:42:36 | <Baughn> | zorg0f_: Would 'f :: Typeable a => a -> TypeID' work? |
| 15:42:40 | <Baughn> | That one already exists |
| 15:42:43 | <Apocalisp> | osfameron: When I have some time, I will make a version that uses no trig. |
| 15:42:56 | <osfameron> | Apocalisp: er, for t isConvex question? |
| 15:42:59 | <quicksilver> | zorg0f_: 'a function which can take anything' is not idiomatic haskell |
| 15:42:59 | <ski_> | zorgOf :: Zorgable a => a -> Zorg |
| 15:43:07 | <Apocalisp> | oh! For convex... |
| 15:43:16 | <quicksilver> | zorg0f_: I don't say it's not possible; you can do things like that with typeclasses |
| 15:43:18 | <Baughn> | zorg0f_: f = Data.Typeable.typeOf, perhaps |
| 15:43:21 | <quicksilver> | zorg0f_: but it's not idiomatic |
| 15:43:29 | <quicksilver> | zorg0f_: you're fighting the type system instead of using it |
| 15:43:31 | <Apocalisp> | osfameron: here's my convex version... wait |
| 15:43:44 | <Baughn> | zorg0f_: Probably it would help if you explained why you want this |
| 15:44:01 | <zorg0f_> | my exercise is: "Give a definition, with type, for the Haskell function toone which given an |
| 15:44:03 | <zorg0f_> | integer, returns the number 1." |
| 15:44:23 | <quicksilver> | I believe you are misunderstanding your exercise |
| 15:44:35 | <quicksilver> | I believe they are just asking you to write a function of type Integer -> Integer |
| 15:44:38 | <quicksilver> | which returns 1 :) |
| 15:44:43 | <zorg0f_> | :| |
| 15:44:54 | <zorg0f_> | they can't be serious |
| 15:45:00 | <quicksilver> | they are not (in my opinion) asking you to consider the case you might be given something other than an integer |
| 15:45:21 | <mauke> | I interpret it as f :: (Integral a) => a -> a |
| 15:46:06 | <quicksilver> | I think they just want: toone :: Integer -> Integer ; toone x = 1 |
| 15:46:16 | <fasta> | ACTION goes with quicksilver |
| 15:46:19 | <quicksilver> | I suspect the point of the exercise is to make you notice that you need the type signature |
| 15:46:25 | <quicksilver> | because if you just type 'toone x = 1' |
| 15:46:30 | <quicksilver> | you get a more general type than you want |
| 15:46:42 | <quicksilver> | :t let toone x = 1 in toone |
| 15:46:44 | <lambdabot> | forall t t1. (Num t1) => t -> t1 |
| 15:46:45 | <fasta> | quicksilver: you don't need it |
| 15:46:55 | <Baughn> | I'd just go with toone = const 1 |
| 15:46:55 | <osfameron> | like (const 1) ? |
| 15:46:59 | <malsyned> | Is cabal-linstall stable enough to use on win32 with ghc 6.6.1? |
| 15:46:59 | <quicksilver> | fasta: you need the type signature, to get the function they ask for in the question :) |
| 15:46:59 | <fasta> | quicksilver: (but that's nitpicking) |
| 15:47:13 | <quicksilver> | well my argument is that const 1 is too general |
| 15:47:13 | <mauke> | toone x = 1 `asTypeOf` x |
| 15:47:22 | <osfameron> | const 1::Integer ? |
| 15:47:23 | <zorg0f> | lol sorry - keep kicking out the power cord - i need a footrest instead of my case |
| 15:47:26 | <quicksilver> | mauke: I seriously doubt they want that |
| 15:47:32 | <zorg0f> | but yeah, you think that's all that's required? |
| 15:47:32 | <fasta> | quicksilver: no, you can call some useless function that already requires an Integer as input |
| 15:47:40 | <quicksilver> | mauke: this is a beginners set of first exercises |
| 15:47:46 | <quicksilver> | fasta: oh, I see. Yes, of course. |
| 15:47:51 | <fasta> | quicksilver: e.g. in a where clause (yes, this is pedantic) |
| 15:47:55 | <quicksilver> | fasta: the type signature is the better answer :) |
| 15:47:57 | <Baughn> | zorg0f_: Given an integer, your function should return 1. Is there any indication that it might be given anything /but/ an integer? |
| 15:47:58 | <quicksilver> | fasta: but yes, I understand your point |
| 15:48:13 | <fasta> | quicksilver: it depends on how much you want to show your 1337'ness |
| 15:48:19 | <zorg0f> | 2 secs |
| 15:48:26 | <fasta> | "look no type signatures" |
| 15:48:41 | <fasta> | (as in "look no hands") |
| 15:49:18 | <Apocalisp> | osfameron: just testing to make sure it works! |
| 15:49:46 | <thruspa> | For integers, could it be possible to detect with a function isInt if some data object is integer? |
| 15:49:51 | <mauke> | toone x = head [1, x, fromInteger x] |
| 15:49:59 | <thruspa> | Without using classes, just a function. |
| 15:50:10 | <mauke> | thruspa: what would be the type of that function? |
| 15:50:27 | <osfameron> | Apocalisp: :-) Oh, but while you're there, if you have that version of regularPoly as well that would rock |
| 15:50:27 | <thruspa> | isInt :: x -> Int |
| 15:50:31 | <zorg0f> | the full question is "Give a definition, with type, for the Haskell function toone which given an integer, returns the number 1.". It's worth 4 marks out of 90 on a 75 minute past exam paper. |
| 15:50:56 | <quicksilver> | zorg0f_: the answer is toone :: Integer -> Integer ; toone x = 1 |
| 15:51:00 | <mauke> | thruspa: you know nothing about that x so there are no operations you can use with it |
| 15:51:04 | <quicksilver> | I am sure of this :) |
| 15:51:08 | <thruspa> | I think it is possible, using (\ x y -> case x of y) applied to [1..] , and the negative integers. |
| 15:51:10 | <ski_> | @free isInt :: x -> Int |
| 15:51:10 | <lambdabot> | isInt = isInt . f |
| 15:51:15 | <Baughn> | thruspa: It needs to at least be Typeable or similar |
| 15:51:19 | <quicksilver> | thruspa: no, you can't |
| 15:51:21 | <thruspa> | Pattern-match the whole integers, lazily :-) |
| 15:51:31 | <zorg0f> | it's a basic taster course is functional programming but im suprised they gave something that basic :| |
| 15:51:35 | <quicksilver> | thruspa: pattern-matching is typed |
| 15:51:45 | <quicksilver> | zorg0f_: you have to have some questions to check the basics |
| 15:51:54 | <fasta> | (Num a)=> Integer -> a would be the type I would write down. |
| 15:51:54 | <zorg0f> | yeah, fair enough |
| 15:52:08 | <zorg0f> | glasgow uni love to word questions ambiguously |
| 15:52:20 | <quicksilver> | it's bloody difficult to write questions like that precisely |
| 15:52:24 | <Apocalisp> | osfameron: I have this on another workstation actually. I'm just reconstructing from memory. |
| 15:52:25 | <thruspa> | > > (\x y -> case x of y) 1 [] |
| 15:52:26 | <lambdabot> | Parse error |
| 15:52:32 | <malsyned> | Anybody know why "runghc Setup.lhs configure" on cabal-install might crash with "Warning: Unknown field 'build-type'"? |
| 15:52:36 | <thruspa> | > > (\x y -> case x of y -> 1) 1 [] |
| 15:52:36 | <lambdabot> | Parse error |
| 15:52:37 | <zorg0f> | heh, i guess so |
| 15:52:42 | <ski_> | > (\x y -> case x of y) 1 [] |
| 15:52:42 | <lambdabot> | Parse error |
| 15:52:43 | <fasta> | zorg0f: you need to know what the literal 1 means in Haskell |
| 15:52:51 | <ski_> | > (\x y -> case x of y -> "foo !") 1 [] |
| 15:52:52 | <lambdabot> | "foo !" |
| 15:52:53 | <quicksilver> | thruspa: in a case statement, the 'y' part is a pattern binder |
| 15:52:56 | <fasta> | zorg0f: it's quite a tricky question for newbies |
| 15:53:00 | <quicksilver> | thruspa: you can't abstract over pattern binders |
| 15:53:08 | <osfameron> | Apocalisp: oh, heh. There's no massive hurry btw, just interested, and as I'd liked the regularPoly approach I wanted to cite it, it can wait till you're on another machine. |
| 15:53:15 | <zorg0f> | fasta: lol |
| 15:53:35 | <thruspa> | Anyway, for some reason I think it shouldn't work. |
| 15:53:35 | <fasta> | zorg0f: I am sure someone would write down Integer -> Integer |
| 15:54:14 | <quicksilver> | fasta: and I'm sure Integer -> Integer is the answer they want |
| 15:54:31 | <ski_> | :t let toone _ = 1 in (toone :: Integer -> Integer) |
| 15:54:34 | <lambdabot> | Integer -> Integer |
| 15:54:42 | <quicksilver> | s/want/expect, and would happily award full marks for/ |
| 15:54:45 | <ski_> | see, 'toone' does have type 'Integer -> Integer' ! :) |
| 15:55:10 | <ski_> | (it also has some other types as well, of coursE) |
| 15:55:23 | <fasta> | zorg0f: see? Even quicksilver gives the wrong answer |
| 15:55:25 | <fasta> | quicksilver: ;) |
| 15:56:01 | <fasta> | I think both answers will be OK, though. |
| 15:56:09 | <zorg0f> | stop trying to trick the noob ;) |
| 15:56:27 | <fasta> | ACTION doesn't like "guess-the-question-questions" |
| 15:56:27 | <zorg0f> | :D |
| 15:56:35 | <zorg0f> | yeah, agreed. |
| 15:57:37 | <zorg0f> | earlier this week i had an exam on databases and the sample database was on "hotels", "rooms", and "keys" - they started asking lots of ambiguous questions using "key" :| |
| 15:57:41 | <zorg0f> | i think they do it on purpose tbh |
| 15:58:09 | <fasta> | A better question would be: what is the type of tone in: tone b = 1 where a = <something to force the b into an Integer> |
| 15:58:14 | <Apocalisp> | osfameron: I will send you the correct versions when I have them. In the meantime, here's the convexity test from memory. |
| 15:58:14 | <ski_> | 'Map Key Room' ? |
| 15:58:32 | <quicksilver> | fasta: that would be a much much harder question |
| 15:58:39 | <quicksilver> | fasta: not one I would ask first-years |
| 15:59:18 | <Baughn> | "What is the type of f x = 1, where x is of type Integer"? |
| 15:59:33 | <Baughn> | ..no, the correct answer there is -> Num a |
| 16:00:02 | <Apocalisp> | http://paste.lisp.org/display/41594 |
| 16:00:23 | <ski_> | :t f x = 1 |
| 16:00:25 | <fasta> | hpaste still offline. |
| 16:00:26 | <lambdabot> | parse error on input `=' |
| 16:00:29 | <quicksilver> | Baughn: again, too hard :) |
| 16:00:56 | <sjanssen> | @keal |
| 16:00:56 | <lambdabot> | what are epsilons? |
| 16:00:57 | <Baughn> | quicksilver: Exactly, but it seems hard to formulate it so both new students and those who've studied ahead get the right answer. |
| 16:00:59 | <opqdonut> | :t let f x = 1 in f |
| 16:01:01 | <lambdabot> | forall t t1. (Num t1) => t -> t1 |
| 16:01:04 | <opqdonut> | :) |
| 16:01:16 | <sjanssen> | aww, hpaste is still down :( |
| 16:01:25 | <quicksilver> | I don't know that I'd even expect 3rd year undergrads who'd done 3 programming courses to be able to replicate the principle type/typeclass algorithm on paper |
| 16:01:28 | <ToRA> | quicksilver: imperial college, first year haskell practice test, question 1 is "what is the type of...if correct questions": http://www.doc.ic.ac.uk/~ajf/Teaching/Haskell/practiceTest.pdf |
| 16:01:28 | <sjanssen> | ACTION pokes shapr |
| 16:01:52 | <Apocalisp> | osfam: http://paste.lisp.org/display/41594 <-- just to get the name highlight |
| 16:01:56 | <Apocalisp> | grr |
| 16:02:01 | <Apocalisp> | osfameron: ^^ |
| 16:02:02 | <chitin> | does this syntax to intersect elements in a in this fashion [x1 /\ x2, x2 /\ x3, x3 /\ x4, etc..] : map (\x x' -> x `intersect` x') xs |
| 16:02:03 | <osfameron> | ta, just saw it |
| 16:02:23 | <osfameron> | Apocalisp: I privmsg'd you my email if you don't catch me online later |
| 16:02:27 | <quicksilver> | ToRA: yup, but I bet they don't expect you to do the typeclass stuff? |
| 16:02:35 | <osfameron> | though I'm usually connected from screen so I can read backlog |
| 16:03:11 | <quicksilver> | ToRA: erm, hang on |
| 16:03:16 | <quicksilver> | ToRA: that question ask for values, not types :) |
| 16:04:03 | <ToRA> | quicksilver: i'll concede the type classes |
| 16:04:09 | <quicksilver> | chitin: no, map is not for binary functions |
| 16:04:19 | <_case> | if i have nodes of my own defined tupel, being a string and an int. How would i check if the string is already in the binary search tree? |
| 16:04:19 | <shapr> | arjanoosting: Hey, when will the debian/unstable libghc6-filepath-dev be working with ghc 6.6.1 ? |
| 16:04:20 | <ToRA> | quicksilver: does being able to type check ==> being able to assign types? |
| 16:04:24 | <quicksilver> | chitin: you possibly want zipWith or scanr |
| 16:04:30 | <quicksilver> | ToRA: no, not really |
| 16:04:31 | <ski_> | chitin : zipWith intersect xs (tail xs) -- assuming 'xs' is not empty |
| 16:04:34 | <ToRA> | quicksilver: but i'll agree without the typeclasses it gets a lot simpler |
| 16:04:36 | <quicksilver> | ToRA: you can type check intuitively |
| 16:04:42 | <shapr> | sjanssen: Sorry, if you want to update hpaste to work with the latest HAppS, I can restart it. |
| 16:04:46 | <quicksilver> | ToRA: (for the purpose of answering undergraduate questions) |
| 16:04:49 | <chitin> | thanks ski_ and quicksilver |
| 16:04:57 | <LoganCapaldo> | I think I'd pass that test ToRA, huzzah |
| 16:05:09 | <quicksilver> | ToRA: I imagine the only kind of thing the author of those questions is hoping for is 'you can't add a number to a string' |
| 16:05:33 | <quicksilver> | ToRA: so, the 'zip' example is 'X' because zip needs two lists |
| 16:05:35 | <quicksilver> | ToRA: and so on |
| 16:05:46 | <quicksilver> | ToRA: this is easier than full principal type inference, let alone typeclass inference :) |
| 16:05:54 | <fasta> | quicksilver: Type class type inference isn't documented correctly anywhere(outside of code), AFAIK, so I wouldn't too. |
| 16:06:11 | <LoganCapaldo> | quicksilver: isn't the zip example given two lists? |
| 16:06:20 | <quicksilver> | LoganCapaldo: oh, so it is. You win, I lose :) |
| 16:06:29 | <chessguy> | @pl \p -> if p then True else False |
| 16:06:30 | <lambdabot> | flip (flip if' True) False |
| 16:06:31 | <quicksilver> | LoganCapaldo: I bet that caught out lots of undergrads, too :) |
| 16:07:02 | <lispy> | ACTION wishes if' was in the prelude |
| 16:07:19 | <ndm> | ACTION agrees with lispy |
| 16:07:29 | <LoganCapaldo> | ACTION agrees with ndm |
| 16:07:43 | <ndm> | ACTION notes that agreement is transitive |
| 16:08:15 | <fasta> | ndm: it's symmetric |
| 16:08:32 | <lispy> | is it reflexive too? |
| 16:08:43 | <ari> | I disagree with myself :( |
| 16:08:44 | <quicksilver> | I never agree with myself |
| 16:08:44 | <fasta> | lispy: unless you are insane, yes |
| 16:08:48 | <quicksilver> | life would be so boring, then |
| 16:08:51 | <ndm> | depends if agreement is equivalence, or an ordering |
| 16:08:55 | <lispy> | we could consider all the equivalence classes created by agreements |
| 16:08:57 | <quicksilver> | quicksilver: you can shut up, too |
| 16:09:08 | <ndm> | i.e. you agree with me, but you might support a stronger viewpoint, of which mine is a subset |
| 16:09:20 | <ndm> | in which case its a partial order |
| 16:09:46 | <lispy> | ndm: well, if you have a relation that is transitive, reflexive and symmetric it's an equivalence |
| 16:10:04 | <fasta> | ndm: yes, it's an equivalence relation. |
| 16:10:08 | <ndm> | lispy: yes, i'm not sure agreement is reflexive |
| 16:10:36 | <chessguy> | in http://www.haskell.org/ghc/docs/latest/html/libraries/time/Data-Time-Calendar.html , i can't remember, what's the difference between Gregorian and Julian calendars? |
| 16:10:37 | <ndm> | you want to kill Fred, I want to kill Fred and Bob - i agree with you, but you don't agree with me |
| 16:10:37 | <fasta> | I am not sure applying logic to humans has any value. |
| 16:10:38 | <lambdabot> | http://tinyurl.com/2x95nr |
| 16:11:22 | <fasta> | ndm: you always agree on some subject. |
| 16:11:24 | <earthy> | chessguy: Gregorian has been fixed and includes leap years and stuff |
| 16:11:28 | <earthy> | julian doesn't |
| 16:11:39 | <earthy> | IIRC |
| 16:12:01 | <chessguy> | ah, ok |
| 16:12:31 | <_case> | if i have nodes containing my own defined tupel, being a string and an int. How would i check if the string is already in a binary search tree? |
| 16:12:54 | <_case> | how would i get the string from the node |
| 16:13:31 | <LoganCapaldo> | _case: use your name :) |
| 16:13:45 | <LoganCapaldo> | sorry I couldn |
| 16:13:48 | <LoganCapaldo> | resist |
| 16:13:48 | <_case> | LoganCapaldo: geh |
| 16:14:01 | <fasta> | It depends on how you model agreement. If you make it depend on the person who said it, it's not transitive. |
| 16:14:24 | <quicksilver> | _case: are you trying to write your own binary search tree as a learning exercise? or would it be helpful to direct you to Data.Map ? |
| 16:14:35 | <LoganCapaldo> | if its like data Tup = Tup String Int; do case tupVal of Tup s _ -> s |
| 16:14:54 | <_case> | quicksilver, exercise |
| 16:14:55 | <LoganCapaldo> | bwhahaa |
| 16:14:55 | <chessguy> | > showGregorian $ fromGregorian 2007 5 22 |
| 16:14:59 | <_case> | LoganCapaldo, hmm |
| 16:15:01 | <lambdabot> | Not in scope: `fromGregorian' |
| 16:15:18 | <quicksilver> | _case: then at each stage you check if you're lesser or greater and you recurse down the loeft or right branch as appropriate :) |
| 16:15:25 | <LoganCapaldo> | At least assuming that was your acutal question |
| 16:15:27 | <chessguy> | > showGregorian $ Data.Time.Calendar.fromGregorian 2007 5 22 |
| 16:15:27 | <lambdabot> | Not in scope: `Data.Time.Calendar.fromGregorian' |
| 16:15:32 | <_case> | tupVal is my own function right? |
| 16:15:38 | <quicksilver> | chessguy: s/Data/Date/ ? |
| 16:15:44 | <LoganCapaldo> | tupVal would be a value of type Tup |
| 16:16:03 | <chessguy> | quicksilver: no, Data is the correct package |
| 16:16:07 | <chessguy> | ?hoogle gregorian |
| 16:16:07 | <lambdabot> | No matches found |
| 16:16:17 | <chessguy> | apparently LB just doesn't know about it |
| 16:16:53 | <_case> | LoganCapaldo, when would the case tupVal be called? |
| 16:16:54 | <chessguy> | ?hoogle day |
| 16:16:54 | <lambdabot> | System.Time.Day :: data Day |
| 16:16:55 | <lambdabot> | System.Time.Friday :: Day |
| 16:16:55 | <lambdabot> | System.Time.Monday :: Day |
| 16:16:55 | <quicksilver> | chessguy: ah *nod* |
| 16:18:04 | <chessguy> | ?hoogle CalendarTime |
| 16:18:05 | <lambdabot> | System.Time.CalendarTime :: Int -> Month -> Int -> Int -> Int -> Int -> Integer -> Day -> Int -> String -> Int -> Bool -> CalendarTime |
| 16:18:05 | <lambdabot> | System.Time.CalendarTime :: data CalendarTime |
| 16:18:05 | <lambdabot> | Time.calendarTimeToString :: CalendarTime -> String |
| 16:18:18 | <LoganCapaldo> | _case: I thought you were asking how do I get the string out of the datastructure. You'd use a piece of code like that to get at the string so you could compare it etc. |
| 16:19:52 | <chessguy> | ?hoogle Month |
| 16:19:52 | <lambdabot> | System.Time.Month :: data Month |
| 16:19:53 | <lambdabot> | System.Locale.months :: TimeLocale -> [(String, String)] |
| 16:19:53 | <lambdabot> | System.Time.ctMonth :: CalendarTime -> Month |
| 16:19:56 | <_case> | LoganCapaldo, so if i would say Tup1 == Tup2, it would compare the two strings? |
| 16:20:04 | <quicksilver> | yup |
| 16:20:08 | <_case> | k |
| 16:20:10 | <quicksilver> | because strings are in the typeclass 'Eq' |
| 16:20:16 | <quicksilver> | and therefore can be compared with == |
| 16:20:19 | <_case> | let me try that one |
| 16:20:24 | <quicksilver> | but you don't want to compare the whole tuples |
| 16:20:27 | <quicksilver> | just the 'string bit' |
| 16:20:32 | <quicksilver> | > "foo" == "foo" |
| 16:20:35 | <lambdabot> | True |
| 16:21:05 | <sjanssen> | yay, somebody started an editor flamewar on haskell-cafe |
| 16:21:32 | <Saizan> | ghc-6.6.1 is still via-C by default right? |
| 16:21:36 | <gour> | sjanssen: war is over. vim won ;) |
| 16:22:02 | <sjanssen> | gour: good |
| 16:22:12 | <gour> | :-) |
| 16:22:36 | <sjanssen> | I thought I might have to stop using it, seeing as it's 'from the 1970s' |
| 16:22:49 | <gour> | lol |
| 16:23:00 | <chessguy> | > calendarTimeToString $ CalendarTime 2007 May 22 0 0 0 0 Tuesday 0 "EST" 0 True |
| 16:23:01 | <lambdabot> | Not in scope: data constructor `Tuesday' |
| 16:23:30 | <chessguy> | ACTION sighs |
| 16:24:06 | <quicksilver> | sjanssen: I regret feeding the flames, now |
| 16:24:16 | <quicksilver> | sjanssen: I was actually hoping to shift it into an interesting debate |
| 16:24:31 | <quicksilver> | (because good editors for effective coding are in my opinion an interesting topic) |
| 16:24:41 | <sjanssen> | sur |
| 16:24:42 | <sjanssen> | e |
| 16:24:53 | <chessguy> | what the heck is wrong with that? |
| 16:25:15 | <cjeris> | lots of good things are from the 1970s... like... uh... HP-35 calculators! |
| 16:25:15 | <chessguy> | > Tuesday |
| 16:25:16 | <lambdabot> | Not in scope: data constructor `Tuesday' |
| 16:25:35 | <chessguy> | > System.Time.Tuesday |
| 16:25:36 | <lambdabot> | Not in scope: data constructor `System.Time.Tuesday' |
| 16:25:57 | <quicksilver> | cjeris: and my wife! |
| 16:26:19 | <sjanssen> | quicksilver: I have a feeling the conversation would be significantly more productive if it didn't start with emacs/vim bashing |
| 16:26:44 | <quicksilver> | sjanssen: well my intention was to try to draw him out on what kind of editor he preferred. It didn't work. |
| 16:26:45 | <chessguy> | ?hoogle Tuesday |
| 16:26:46 | <lambdabot> | System.Time.Tuesday :: Day |
| 16:26:50 | <chessguy> | wtf |
| 16:26:57 | <quicksilver> | chessguy: hoogle != lambdabot |
| 16:27:06 | <quicksilver> | chessguy: they have different sets of packages available |
| 16:27:38 | <Baughn> | ?hoogle [IO a] -> IO () |
| 16:27:39 | <lambdabot> | No matches, try a more general search |
| 16:27:50 | <quicksilver> | :t sequence_ |
| 16:27:52 | <chessguy> | @type sequence_ |
| 16:27:53 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => [m a] -> m () |
| 16:27:54 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => [m a] -> m () |
| 16:27:57 | <quicksilver> | chessguy: win! |
| 16:28:15 | <sjanssen> | chessguy: only a certain set of modules are availabe for '> ' |
| 16:28:32 | <chessguy> | yeah |
| 16:28:36 | <chessguy> | that's annoying |
| 16:28:40 | <sjanssen> | chessguy: this is to avoid '> System.Unsafe.unsafePerformIO ...' |
| 16:28:48 | <Baughn> | ?hoogle Monad a => [ |
| 16:28:49 | <lambdabot> | No matches, try a more general search |
| 16:28:58 | <chessguy> | sure, but why not just lock out System.Unsafe then' |
| 16:28:58 | <Baughn> | ?hoogle Monad m => [m a] -> m () |
| 16:28:59 | <lambdabot> | Prelude.head :: [a] -> a |
| 16:29:00 | <lambdabot> | Prelude.last :: [a] -> a |
| 16:29:12 | <Baughn> | ..thanks, hoogle. |
| 16:29:14 | <quicksilver> | chessguy: periodically dons adds newer packagse and stuff to it |
| 16:29:24 | <sjanssen> | chessguy: there are too many holes. Whitelisting is safer than blacklisting |
| 16:29:34 | <opqdonut> | yep |
| 16:29:39 | <chessguy> | true |
| 16:29:42 | <quicksilver> | chessguy: if you want the calendar stuff in there, nudge him |
| 16:30:15 | <chessguy> | bah, i generally don't care, just when i want a list of what months for the next year are going to have 2 paychecks, and which are going to have 3 :) |
| 16:30:24 | <chessguy> | or the next n years |
| 16:30:43 | <sjanssen> | chessguy: don't you have ghci on your machine? |
| 16:30:47 | <chessguy> | not at work |
| 16:32:51 | <chessguy> | that's ok, i'll just work out the algorithm, and write the code later |
| 16:34:22 | <mnislaih> | why isn't there a liftM2 for functors, i.e. fmap2 ? |
| 16:34:41 | <sjanssen> | mnislaih: I don't think that's possible |
| 16:34:52 | <quicksilver> | mnislaih: functors don't generally have that structure |
| 16:35:10 | <quicksilver> | > liftM2 (+) [0,1] [10,20] |
| 16:35:12 | <lambdabot> | [10,20,11,21] |
| 16:35:22 | <quicksilver> | mnislaih: note that that answer tells me qutie a bit about the monad structure of [] |
| 16:35:30 | <quicksilver> | mnislaih: it uses much more than merely its functor structure |
| 16:35:31 | <mnislaih> | yes |
| 16:35:39 | <mnislaih> | neat |
| 16:36:01 | <quicksilver> | I'm tempted to suggest that a working definition of liftM2 is enough to make a monad out of a functor |
| 16:36:05 | <quicksilver> | but that's only a hunch :) |
| 16:36:07 | <Saizan> | applicative has liftA2 |
| 16:36:17 | <quicksilver> | ah, that would suggest I'm wrong |
| 16:36:22 | <quicksilver> | merely enough to make an 'applicative' |
| 16:36:46 | <mnislaih> | and from there to a monad there's still a bind to jump |
| 16:36:55 | <byorgey> | @src liftM2 |
| 16:36:55 | <lambdabot> | liftM2 f m1 m2 = do { x1 <- m1; x2 <- m2; return (f x1 x2) } |
| 16:41:29 | <chessguy> | @paste |
| 16:41:29 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 16:41:35 | <chessguy> | guess again, lb |
| 16:42:24 | <quicksilver> | mnislaih: sort of |
| 16:42:37 | <quicksilver> | mnislaih: but my claim is that liftA2 gives you 'something about bind' |
| 16:42:52 | <quicksilver> | mnislaih: certainly it restricts your choice of possible binds to those compatible with liftA2 |
| 16:42:59 | <quicksilver> | mnislaih: it might even constraint it uniquely |
| 16:43:11 | <Baughn> | @src liftIO |
| 16:43:12 | <lambdabot> | Source not found. And you call yourself a Rocket Scientist! |
| 16:43:25 | <chessguy> | does this look about right? http://paste.lisp.org/display/41599 |
| 16:43:42 | <quicksilver> | Baughn: LB can't do the src for methods unless you tell it the class name |
| 16:43:47 | <quicksilver> | Baughn: instance name, I mean |
| 16:43:54 | <quicksilver> | Baughn: and I normally cna't work out the syntax for that :) |
| 16:43:56 | <chessguy> | ?src head |
| 16:43:56 | <lambdabot> | head (x:_) = x |
| 16:43:56 | <lambdabot> | head [] = undefined |
| 16:44:06 | <Baughn> | ?src liftM |
| 16:44:07 | <lambdabot> | liftM f m1 = do { x1 <- m1; return (f x1) } |
| 16:44:25 | <quicksilver> | :t groupBy |
| 16:44:28 | <lambdabot> | forall a. (a -> a -> Bool) -> [a] -> [[a]] |
| 16:44:42 | <LoganCapaldo> | @src Maybe (>>=) |
| 16:44:42 | <lambdabot> | (Just x) >>= k = k x |
| 16:44:43 | <lambdabot> | Nothing >>= _ = Nothing |
| 16:45:17 | <quicksilver> | chessguy: looks sane to me |
| 16:45:24 | <quicksilver> | chessguy: gratuitious use of 'ap' :) |
| 16:45:37 | <chessguy> | quicksilver: thank @pl :) |
| 16:45:41 | <quicksilver> | chessguy: isn't there a 'map' missing though? |
| 16:46:02 | <chessguy> | hm, oh yes |
| 16:46:20 | <quicksilver> | chessguy: that's a rather good example, actualy |
| 16:46:35 | <quicksilver> | chessguy: of code which is really elegant in haskell, but would be slightly messy in classic imperative stylee |
| 16:46:36 | <chessguy> | i think i want: |
| 16:46:38 | <chessguy> | result :: [[Date]] -> [(Month, Int)] |
| 16:46:38 | <chessguy> | result = map $ ap ((,) . month . head) length |
| 16:46:46 | <quicksilver> | yes, I think you want that, too :) |
| 16:47:20 | <chessguy> | quicksilver: seems like there ought to be a more idiomatic way to do it, but i can't put my finger on it |
| 16:47:21 | <quicksilver> | chessguy: the little loop to figure that out and compare with the last iteration, with a special case for the first in the list, etc |
| 16:47:41 | <quicksilver> | chessguy: I think what you've written is goo. Although personally I wouldn't bother with the cute use of ap (,) |
| 16:47:50 | <chessguy> | yes, i tend to write gooey code |
| 16:48:02 | <ToRA> | map (month . head &&& length) ? |
| 16:48:15 | <quicksilver> | hmm yes, I prefer ToRA 's |
| 16:48:16 | <assl0r> | > [ w1, " ", w2 | w1 <- repeat "foo ", w2 <- repeat "bar ", w1 /= ' ', w2 /= ' ' ] |
| 16:48:16 | <lambdabot> | Parse error |
| 16:48:31 | <quicksilver> | although I was going to say map (\ds -> (month $ head ds, length ds)) |
| 16:48:38 | <chessguy> | oh good call |
| 16:48:47 | <quicksilver> | chessguy: good, not 'goo', if that isn't obvious :) |
| 16:48:51 | <ToRA> | someday i'll find a use for arrows that isn't (,) combinators |
| 16:49:05 | <chessguy> | quicksilver: it was obvious, but i was being gratuitously cute again |
| 16:50:17 | <chessguy> | it seems like there should be more of a pipeline approach somehow |
| 16:51:04 | <assl0r> | > [ w1 ++ " " ++ w2 | w1 <- repeat "foo ", w2 <- repeat "bar ", w1 /= ' ', w2 /= ' ' ] |
| 16:51:06 | <lambdabot> | Couldn't match expected type `[Char]' against inferred type `Char' |
| 16:51:13 | <chessguy> | i don't know, i guess it's ok |
| 16:51:29 | <quicksilver> | chessguy: sure, you could join it all together |
| 16:51:42 | <chessguy> | i guess that might get messy though |
| 16:51:44 | <quicksilver> | chessguy: but I like nice named, individually understandable chunks like you have |
| 16:51:50 | <mauke> | :t repeat |
| 16:51:50 | <chessguy> | yeah |
| 16:51:52 | <lambdabot> | forall a. a -> [a] |
| 16:51:55 | <ToRA> | assl0r: w1 /= " " |
| 16:51:57 | <mauke> | :t cycle |
| 16:51:59 | <lambdabot> | forall a. [a] -> [a] |
| 16:52:03 | <ToRA> | assl0r: (and w2) |
| 16:52:12 | <mauke> | > [ w1 ++ " " ++ w2 | w1 <- cycle "foo ", w2 <- cycle "bar ", w1 /= ' ', w2 /= ' ' ] |
| 16:52:12 | <lambdabot> | Couldn't match expected type `[a]' against inferred type `Char' |
| 16:52:36 | <mauke> | > [ [w1, ' ', w2] | w1 <- cycle "foo ", w2 <- cycle "bar ", w1 /= ' ', w2 /= ' ' ] |
| 16:52:38 | <lambdabot> | ["f b","f a","f r","f b","f a","f r","f b","f a","f r","f b","f a","f r","f ... |
| 16:52:40 | <assl0r> | ToRA, wat is cycle? |
| 16:52:44 | <assl0r> | what |
| 16:52:48 | <ToRA> | > cycle [1] |
| 16:52:50 | <lambdabot> | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... |
| 16:53:01 | <ToRA> | > repeat [1] |
| 16:53:02 | <lambdabot> | [[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]... |
| 16:53:07 | <Igloo> | Any French speakers about? |
| 16:53:11 | <assl0r> | ahh ;) |
| 16:53:23 | <ToRA> | asslor: in your example you wanted [ w1 ++ ........., w1 /= " ", w2 /= " " |
| 16:53:28 | <mauke> | ToRA: I doubt that |
| 16:53:37 | <ToRA> | well to make it type check |
| 16:53:39 | <arcatan> | my speakers have some contact problems |
| 16:53:44 | <jmelesky> | Igloo: i speak French well for an American, but that may not be useful for you |
| 16:53:45 | <arcatan> | the sounds goes all wobly |
| 16:53:47 | <mauke> | ToRA: it would make the /= checks useless |
| 16:53:48 | <mux> | Igloo: yes |
| 16:54:03 | <mux> | ACTION is a frog |
| 16:54:12 | <ToRA> | i don't know what he actually wanted to do, but it was the shortest route i could think of to make it type-check. And yes, with some thought you're right. |
| 16:54:19 | <Igloo> | disponibilité of epuise and indisponible are both bad, right? |
| 16:54:22 | <assl0r> | i want to switch the words in two maybe infinite input lists |
| 16:54:52 | <mux> | Igloo: err, I don't get your question |
| 16:54:53 | <assl0r> | because they are infinite i can't use the words function first on each input stream |
| 16:54:58 | <mux> | Igloo: "disponibilit of epuise" ? |
| 16:55:11 | <Igloo> | mux: If something says "Disponibilité : epuise" it's unavailable, right? |
| 16:55:19 | <mux> | yep |
| 16:55:21 | <mauke> | > words (cycle "foo ") |
| 16:55:22 | <assl0r> | > words cycle "foo bar" |
| 16:55:23 | <lambdabot> | ["foo","foo","foo","foo","foo","foo","foo","foo","foo","foo","foo","foo","fo... |
| 16:55:23 | <lambdabot> | Couldn't match expected type `String' |
| 16:55:31 | <Igloo> | mux: And likewise "Disponibilité : indisponible"? |
| 16:55:31 | <mauke> | > words (cycle "foo bar ") |
| 16:55:33 | <lambdabot> | ["foo","bar","foo","bar","foo","bar","foo","bar","foo","bar","foo","bar","fo... |
| 16:55:36 | <mux> | Igloo: yes |
| 16:55:40 | <Igloo> | OK, thanks! |
| 16:55:41 | <assl0r> | mhm |
| 16:55:42 | <mux> | Igloo: in that context they both mean the same thing |
| 16:55:44 | <mux> | Igloo: yw |
| 16:56:14 | <Igloo> | OK, thanks |
| 16:56:39 | <assl0r> | but switching the words in a stream wouldn't work like that.. |
| 16:56:45 | <chessguy> | @pl \(x,y,z) -> y |
| 16:56:45 | <lambdabot> | (line 1, column 6): |
| 16:56:45 | <lambdabot> | unexpected "," |
| 16:56:45 | <lambdabot> | expecting letter or digit, operator or ")" |
| 16:56:45 | <lambdabot> | ambiguous use of a non associative operator |
| 16:56:59 | <chessguy> | @pl f (x,y,z) = y |
| 16:57:00 | <lambdabot> | (line 1, column 11): |
| 16:57:00 | <lambdabot> | unexpected "=" |
| 16:57:00 | <lambdabot> | expecting variable, "(", operator or end of input |
| 16:57:31 | <chessguy> | ?hoogle (a,b,c) -> b |
| 16:57:32 | <lambdabot> | No matches, try a more general search |
| 16:57:49 | <chessguy> | ?hoogle (a,b,c) |
| 16:57:50 | <lambdabot> | No matches, try a more general search |
| 16:58:16 | <chessguy> | @type (,,) |
| 16:58:19 | <lambdabot> | forall a b c. a -> b -> c -> (a, b, c) |
| 16:58:40 | <chessguy> | @pl \(x, y, z) -> y |
| 16:58:44 | <chessguy> | @pl \(x, y, z) -> y |
| 16:58:44 | <lambdabot> | (line 1, column 7): |
| 16:58:44 | <lambdabot> | unexpected "," |
| 16:58:44 | <lambdabot> | expecting letter or digit, operator or ")" |
| 16:58:44 | <lambdabot> | ambiguous use of a non associative operator |
| 16:58:49 | <chessguy> | grrrrrrrrr |
| 16:59:36 | <LoganCapaldo> | chessguy: IIRC pl doesn't do triples |
| 17:00:19 | <chessguy> | are there not any standard functions on triples any more either? |
| 17:01:50 | <sioraiocht|sleep> | has anyone here read any version of "how to think like a computer scientist"? |
| 17:02:11 | <LoganCapaldo> | > let projectl (a, b, _) = (a, b) ; projectr (_, a, b) = (a, b) in snd . projectl $ (1,2,3) |
| 17:02:13 | <lambdabot> | 2 |
| 17:02:22 | <ToRA> | > fmap (+1) (1,2,3) |
| 17:02:23 | <lambdabot> | add an instance declaration for (Functor ((,,) t t1)) |
| 17:02:23 | <lambdabot> | In the expression... |
| 17:02:33 | <luqui> | what, knowing that you will never know if you will ever stop thinking? |
| 17:02:42 | <LoganCapaldo> | ToRA: can you even write that instance? |
| 17:02:56 | <LoganCapaldo> | (I mean for (a,a,a)) |
| 17:03:17 | <ToRA> | fmap (+1) ("hello",3) |
| 17:03:19 | <ToRA> | > fmap (+1) ("hello",3) |
| 17:03:20 | <lambdabot> | ("hello",4) |
| 17:03:26 | <LoganCapaldo> | I guess so |
| 17:03:29 | <ToRA> | it only applies on the last bit |
| 17:03:33 | <ToRA> | so no you can't ;) |
| 17:03:33 | <LoganCapaldo> | oh thats different |
| 17:03:58 | <ToRA> | i guess you could manually write the instance decl? |
| 17:04:12 | <ToRA> | but it doesn't seem to exist |
| 17:04:18 | <LoganCapaldo> | I'd think you'd need a newtype wouldn't you? |
| 17:04:23 | <ToRA> | i though there were curry/uncurry methods for triples etc, but i can't find them |
| 17:04:37 | <LoganCapaldo> | @type uncurry3 |
| 17:04:39 | <lambdabot> | Not in scope: `uncurry3' |
| 17:04:41 | <ToRA> | LoganCapaldo: could probably get away with type synonym instance |
| 17:04:59 | <cdsmith> | @pl \f x y z -> f (x, y, z) |
| 17:05:00 | <lambdabot> | (. (,,)) . (.) . (.) |
| 17:05:31 | <LoganCapaldo> | I don't *think* you can use synonyms for instance decls. I could be wrong |
| 17:05:37 | <chessguy> | @type \(x,y,z) -> y $ ?t ?d |
| 17:05:39 | <lambdabot> | forall t t1 a b t2. (?t::t2 -> a, ?d::t2) => (t, a -> b, t1) -> b |
| 17:05:55 | <sioraiocht|sleep> | LoganCapaldo: afaik you can't, there was a convo on haskell-cafe about that recently |
| 17:05:58 | <chessguy> | @type (\(x,y,z) -> y) ?t ?d |
| 17:06:00 | <cdsmith> | LoganCapaldo: I did so a few days ago (declared an instance for a synonym) |
| 17:06:00 | <lambdabot> | forall t t1 t2 t3. (?t::(t, t2 -> t3, t1), ?d::t2) => t3 |
| 17:06:33 | <LoganCapaldo> | sioraiocht and cdsmith, fight it out! :) |
| 17:06:37 | <sioraiocht> | lol |
| 17:06:46 | <luqui> | cdsmith: well, if it was a synonym for something that you could normally declare an instance on... |
| 17:07:18 | <cdsmith> | luqui: perhaps I missed some context. I'll reread past discussion now. |
| 17:08:26 | <ToRA> | ah, don't think you can - |
| 17:08:28 | <ToRA> | type Triple a = ( a , a , a ) |
| 17:08:28 | <ToRA> | instance Functor Triple where |
| 17:08:42 | <ToRA> | won't let me write the instance line, due to Triple not being fully parameterised |
| 17:09:02 | <ToRA> | (even with LANGUAGE TypeSynonymInstances #-}) |
| 17:09:17 | <Saizan> | shapr: i have 2 patches that applied to hpaste-devel make it work with current HAppS |
| 17:09:39 | <chessguy> | @pl f d = g !! (m d) |
| 17:09:39 | <lambdabot> | f = (g !!) . m |
| 17:11:47 | <osfameron> | how much does ICFP usually cost? |
| 17:12:02 | <osfameron> | I can't see a price on any of the related websites |
| 17:12:24 | <ndm> | osfameron: around £250 for registration, i think |
| 17:13:09 | <osfameron> | ndm: thanks |
| 17:13:21 | <assl0r> | how do i append a single Char to [Char] list? |
| 17:13:22 | <osfameron> | meh. that's not "community" level pricing. But I am tempted |
| 17:13:50 | <tapi> | char:charlist |
| 17:13:56 | <osfameron> | well, I guess it is compared to OSCON etc. |
| 17:14:04 | <tapi> | append... |
| 17:14:09 | <opqdonut> | assl0r: charlist++[char] |
| 17:14:37 | <assl0r> | doh... yeah |
| 17:15:00 | <Stinger> | @pl \(a,b,c)->a |
| 17:15:00 | <lambdabot> | (line 1, column 6): |
| 17:15:01 | <lambdabot> | unexpected "," |
| 17:15:01 | <lambdabot> | expecting letter or digit, operator or ")" |
| 17:15:01 | <lambdabot> | ambiguous use of a non associative operator |
| 17:15:15 | <tapi> | is there an easy way or reading binary data from a file ? my goal is to decode a bitmap (bmp) file |
| 17:15:23 | <malsyned> | anybody here have experience with cabal-install? esp. on win32? |
| 17:15:57 | <chessguy> | @pl \(a,b) -> a |
| 17:15:57 | <lambdabot> | fst |
| 17:16:01 | <tapi> | i tried to deal with the Word* datatypes, but wasn't able to produce something useable... |
| 17:16:13 | <Stinger> | is that the standard error when pl cant do something? |
| 17:16:17 | <assl0r> | let i1 = cycle "foo "; i2 = cycle "bar " in [(w1:[]) ++ " " ++ (w2:[]) | w1 <- i1, w2 <- i2, w1 /= ' ', w2 /= ' ' ] |
| 17:16:23 | <Stinger> | cause it seems like an odd message otherwise :) |
| 17:16:29 | <assl0r> | > let i1 = cycle "foo "; i2 = cycle "bar " in [(w1:[]) ++ " " ++ (w2:[]) | w1 <- i1, w2 <- i2, w1 /= ' ', w2 /= ' ' ] |
| 17:16:38 | <lambdabot> | ["f b","f a","f r","f b","f a","f r","f b","f a","f r","f b","f a","f r","f ... |
| 17:17:54 | <assl0r> | i want "bar foo bar foo..." ;( |
| 17:18:27 | <chessguy> | > iterate ("bar foo" :) [] |
| 17:18:29 | <lambdabot> | [[],["bar foo"],["bar foo","bar foo"],["bar foo","bar foo","bar foo"],["bar ... |
| 17:18:38 | <chessguy> | mff |
| 17:18:38 | <arjanoosting> | shapr: I will look after my Debian haskell packages after diner. It seems ghc 6.6.1 ships the filepath package already, so I need to look into that first |
| 17:18:48 | <chessguy> | >concat $ iterate ("bar foo" :) [] |
| 17:18:58 | <chessguy> | > concat $ iterate ("bar foo" :) [] |
| 17:18:58 | <lambdabot> | ["bar foo","bar foo","bar foo","bar foo","bar foo","bar foo","bar foo","bar ... |
| 17:19:05 | <chessguy> | bah |
| 17:19:06 | <assl0r> | noo |
| 17:19:29 | <shapr> | Saizan: Send me the patches!! |
| 17:19:32 | <Vulpyne> | Is there any way, when installing a package from HackageDB to add some compile flags to what gets passed to the compiler? |
| 17:19:45 | <assl0r> | i1 and i2 are infinite strings of words (streams) |
| 17:20:19 | <chessguy> | > foldr (\s1 s2 -> s1 ++ " " + s2) "" $ concat $ iterate ("bar foo" :) [] |
| 17:20:20 | <lambdabot> | add an instance declaration for (Num [Char]) |
| 17:20:27 | <ToRA> | > let odds = [1,3..] in let evens = [2,4..] in take 20 $ concat $ (zipWith (\a b -> [a,b])) odds evens |
| 17:20:29 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] |
| 17:20:33 | <tapi> | > cycle "bar foo " |
| 17:20:34 | <lambdabot> | "bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar... |
| 17:20:38 | <ToRA> | is that kinda what you want? |
| 17:21:18 | <ToRA> | > let odds = (words (cycle "foo ")) in let evens = (words (cycle "bar ")) in take 20 $ concat $ (zipWith (\a b -> [a,b])) odds evens |
| 17:21:20 | <lambdabot> | ["foo","bar","foo","bar","foo","bar","foo","bar","foo","bar","foo","bar","fo... |
| 17:21:29 | <ToRA> | > let odds = (words (cycle "foo ")) in let evens = (words (cycle "bar ")) in take 20 $ concat $ concat $ (zipWith (\a b -> [a,b])) odds evens |
| 17:21:31 | <lambdabot> | "foobarfoobarfoobarfo" |
| 17:21:40 | <ToRA> | > let odds = (words (cycle "foo ")) in let evens = (words (cycle "bar ")) in take 20 $ unwords $ concat $ (zipWith (\a b -> [a,b])) odds evens |
| 17:21:41 | <lambdabot> | "foo bar foo bar foo " |
| 17:21:45 | <ToRA> | (last try) |
| 17:21:47 | <tapi> | isn't 'cycle "bar foo "' what you want ? |
| 17:22:01 | <tapi> | ^^ |
| 17:22:02 | <assl0r> | no |
| 17:22:49 | <chessguy> | tapi: he doesn't seem to be able to elucidate what he wants |
| 17:23:31 | <assl0r> | > let i1 = "i hate this shit"; "man i really do" in cycle i2 . cycle i1 |
| 17:23:32 | <lambdabot> | Parse error |
| 17:23:52 | <assl0r> | > let i1 = "i hate this shit"; i2 = "man i really do" in (cycle i2) . (cycle i1) |
| 17:23:53 | <lambdabot> | Couldn't match expected type `b -> c' |
| 17:24:11 | <ToRA> | assl0r: what is it about my last example that doesn't do what you want? |
| 17:24:30 | <tapi> | does someone know how to cast a 16 bits (2 char) string into an unsigned int ? |
| 17:25:08 | <assl0r> | mhm |
| 17:25:22 | <ToRA> | sum . map $ ord as a really weak guess? |
| 17:25:35 | <kpreid> | tapi: a string of two Chars is *NOT* 16 bits |
| 17:25:37 | <ToRA> | (eek brackets really wrong there) |
| 17:25:49 | <tapi> | kpreid: that's what i was afraid of... |
| 17:25:51 | <malsyned> | > concat (cycle "bar foo ") |
| 17:25:52 | <lambdabot> | Couldn't match expected type `[a]' against inferred type `Char' |
| 17:26:15 | <tapi> | i want to read 2 bytes from a file, and cast it into an unsigned int |
| 17:26:31 | <tapi> | could that be easily done ? |
| 17:26:41 | <malsyned> | > concat (cycle ["bar foo "]) |
| 17:26:42 | <lambdabot> | "bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar... |
| 17:28:34 | <ToRA> | read two Word8's (or just a Word16) and use fromIntegral or something? |
| 17:29:00 | <ToRA> | (or toInteger since they are in Num...) |
| 17:29:07 | <assl0r> | thx ToRA ;) |
| 17:30:03 | <ToRA> | assl0r: np |
| 17:31:10 | <tapi> | ToRA: i tried to go this way, but i don't know how to read a Word16 from a file (or a string)... |
| 17:31:30 | <rho> | ACTION is back |
| 17:32:10 | <ToRA> | tapi: http://www.haskell.org/haskellwiki/UTF-8 |
| 17:32:10 | <lambdabot> | Title: UTF-8 - HaskellWiki |
| 17:32:12 | <ToRA> | have a look at the bottom of that |
| 17:32:20 | <tapi> | ToRA: thx |
| 17:32:24 | <ToRA> | it shows how to read Word8's from a handle |
| 17:32:52 | <ToRA> | then since Word8 is an instance of Num, you can treat it like an 8bit int |
| 17:35:31 | <shapr> | Bah, I want everything from Hackage to be in @index and @src |
| 17:35:37 | <shapr> | There must be an automatic way to do it. |
| 17:35:53 | <shapr> | Saizan: send me the patches: shae@Scanned In Avian dah com |
| 17:40:49 | <shapr> | Is there something like wget for Browser.browse? I just want to get the page contents as an IO String |
| 17:40:51 | <zorg0f> | Given this function: f x (y:ys) z = z:(map x ys) would this be a correct type: f::(y->z)->[y]->[z] ? |
| 17:41:22 | <nominolo> | shapr: there's the get.hs example on Network.HTTP |
| 17:41:22 | <zorg0f> | sorry: f::(y->z)->[y]->z->[z] |
| 17:41:38 | <tapi> | ToRA: thanks, that's exactly what i was looking for ;) |
| 17:42:12 | <shapr> | nominolo: ooh, handy! |
| 17:42:33 | <nominolo> | shapr: i used it for my http+bytestrings benchmarks |
| 17:43:57 | <nominolo> | @seen bringert |
| 17:43:57 | <lambdabot> | bringert is in #ghc and #haskell. I don't know when bringert last spoke. |
| 17:44:16 | <bringert> | hi nominolo |
| 17:45:01 | <nominolo> | hi |
| 17:45:28 | <nominolo> | seems where in fact aren't that far away from a releasable version for the http package |
| 17:45:54 | <nominolo> | bringert: simonM noted that socketToHandle does indeed work for threaded setup |
| 17:46:14 | <nominolo> | bringert: and the handle closing bug has been fixed recently |
| 17:46:37 | <nominolo> | bringert: so we still don't have a nice high-level interface, but at least we have lazy bytestrings |
| 17:47:12 | <nominolo> | and if someone treats them as eager bytestrings they just behave as if they had been eager bytestrings in the first place |
| 17:47:30 | <assl0r> | @src words |
| 17:47:30 | <lambdabot> | words s = case dropWhile isSpace s of |
| 17:47:30 | <lambdabot> | "" -> [] |
| 17:47:30 | <lambdabot> | s' -> w : words s'' where (w, s'') = break isSpace s' |
| 17:48:39 | <shapr> | nominolo: Oh, I liked that blog post! The dramatic improvement that came with lazy bytestrings was impressive! |
| 17:48:45 | <nominolo> | bringert: the only thing that's missing is to be able to automatically close a socket once we're done reading its contents lazily. though we can always call close explicitly if we're sure |
| 17:49:13 | <nominolo> | shapr: heh, thanks. yes, we were suprised ourselves |
| 17:49:47 | <assl0r> | how do i import Prelude excluding words? |
| 17:50:13 | <Saizan> | import Prelude hiding (words) |
| 17:50:15 | <nominolo> | import Prelude hiding (words) |
| 17:52:24 | <bringert> | nominolo: doesn't hGetContents do that? |
| 17:52:41 | <nominolo> | bringert: only if it gets an EOF |
| 17:52:56 | <bringert> | nominolo: ah |
| 17:52:58 | <nominolo> | which again only happens if the server closes the socket |
| 17:53:33 | <nominolo> | bringert: it doesn't prevent us from re-using the socket though. |
| 17:54:21 | <nominolo> | bringert: that only means that, before we can handle the next request the previous request will be forced completly. which is ovious, i assume |
| 17:54:24 | <bringert> | doesn't hGetContents slurp up everything that will every appear on the socket? |
| 17:54:38 | <bringert> | s/every/ever/ |
| 17:54:45 | <nominolo> | bringert: yes, exactly |
| 17:55:15 | <cinimod> | @pl \x y z -> (x,(y,z)) |
| 17:55:16 | <lambdabot> | (. (,)) . (.) . (,) |
| 17:55:34 | <bringert> | nominolo: ah, so you don't really reuse the socket, just the tail of the bytestring |
| 17:55:38 | <cinimod> | @pl \w x y z -> (w,(x,(y,z))) |
| 17:55:39 | <lambdabot> | (. ((. (,)) . (.) . (,))) . (.) . (.) . (,) |
| 17:55:40 | <nominolo> | bringert: so if we want to reuse that socket and the server sends some garbage in between we'll read that. though that would happen in any case, right? |
| 17:55:52 | <nominolo> | bringert: yup |
| 17:55:53 | <bringert> | sure |
| 17:56:17 | <cinimod> | @pl \x y z -> ((x,y),z) |
| 17:56:17 | <lambdabot> | ((,) .) . (,) |
| 17:56:42 | <bos> | nominolo: did you see my comment about being able to use ByteString directly with Socket? |
| 17:57:02 | <nominolo> | bos, no, where? on reddit? |
| 17:57:17 | <bos> | on your blog. |
| 17:57:20 | <nominolo> | bos: ahh no |
| 17:57:28 | <nominolo> | bos: yes, i did |
| 17:57:56 | <bos> | basically what you do is read a fixed-size chunk via the non-blocking interface, then use createAndTrim' to shrink the ByteString |
| 17:57:56 | <nominolo> | bos: but according to simonM's comment i actually don't need to implement this |
| 17:57:59 | <bos> | it's kind of fiddly. |
| 17:58:00 | <bos> | ok. |
| 17:58:52 | <nominolo> | bos, oh, now that i didn't understand. what's the non-blocking part? |
| 17:59:20 | <nominolo> | bos: you mean the function parameter to createAndTrim' ? |
| 17:59:30 | <bos> | you can do a non-blocking read on the socket. |
| 17:59:36 | <bos> | yeah. |
| 18:00:03 | <nominolo> | bos, but that would re-alloc, wouldn't it? |
| 18:00:21 | <bos> | hmm, hpaste is dead. |
| 18:00:24 | <bos> | nominolo: no. |
| 18:00:26 | <nominolo> | and AFAIU re-alloc means memcpy? |
| 18:00:44 | <bos> | it reads directly into the buffer allocated, then trims the size down without moving the data. |
| 18:01:09 | <bos> | the potential downside is that if you ask to read 65536 bytes and get 1 byte, you have a lot of extra memory allocated |
| 18:01:17 | <nominolo> | ah, ok |
| 18:03:26 | <nominolo> | thanks. if we run into problems with the handle-based solution i'll try that |
| 18:10:10 | <shapr> | Isn't there a test or check target for cabal? |
| 18:12:58 | <shapr> | ACTION reads http://www.haskell.org/ghc/docs/latest/html/Cabal/builders.html#setup-test |
| 18:12:59 | <lambdabot> | Title: 3. Building and installing a package, http://tinyurl.com/ox63q |
| 18:18:22 | <nominolo> | bringert: ok, toxic just volunteered to make a releasable version from our code |
| 18:18:27 | <nominolo> | :) |
| 18:20:06 | <elrodeo> | lambdabot > [1..3] |
| 18:21:44 | <bringert> | nominolo: great |
| 18:23:06 | <bringert> | nominolo: hGetContents uses blocking reads, iirc. wouldn't this cause problems if the server doesn't close the socket? |
| 18:23:30 | <bringert> | nominolo: hGetContents would block waiting to fill the buffer, even after the ned of the response |
| 18:23:36 | <bringert> | s/ned/end/ |
| 18:23:57 | <nominolo> | hm, i think we did tests and didn't find that problem |
| 18:24:05 | <nominolo> | not sure though |
| 18:24:36 | <araujo> | mm.. |
| 18:24:44 | <araujo> | ACTION needs to study something very boring |
| 18:24:55 | <shapr> | araujo: Tax law |
| 18:25:24 | <araujo> | shapr, business systems theory |
| 18:25:32 | <shapr> | Hm, I find that interesting actually. |
| 18:25:49 | <araujo> | shapr, the subject sounds interesting |
| 18:25:53 | <araujo> | but it isn't |
| 18:25:56 | <shapr> | Tax law is painfully boring, mostly because it'd be so easy to fix :-( |
| 18:26:04 | <vegai> | shapr: flat? |
| 18:26:17 | <shapr> | vegai: flat what? flat rate VAT? |
| 18:26:29 | <vegai> | would your solution be flat tax as well? :) |
| 18:26:31 | <nominolo> | bringert: hm, yes it hangs |
| 18:26:57 | <nominolo> | bringert: so what should we do in that case? i guess we need a timeout or sth. |
| 18:27:12 | <bringert> | nominolo: use non-blocking reads |
| 18:28:07 | <nominolo> | i.e., return an empty string? |
| 18:28:13 | <nominolo> | or truncated string |
| 18:28:35 | <bringert> | hGetNonBlocking |
| 18:29:05 | <bringert> | write your own hGetContents using hGetNonBlocking |
| 18:29:14 | <motus> | hi folks, can someone help me with ffi in ghc? I have an opaque structure I have to pass by pointer to a bunch of functions; the problem is that I have to allocate it - is there a way to do it Haskell without extra functions in C? |
| 18:29:15 | <bringert> | ByteString ought to have one really |
| 18:29:32 | <nominolo> | ok |
| 18:29:33 | <sjanssen> | I thought Data.ByteString.Lazy had non-blocking IO? |
| 18:29:35 | <helmut> | any recommended reading on row polymorphism? |
| 18:29:42 | <sjanssen> | maybe it didn't make it into base . . . |
| 18:30:17 | <Xgc> | It was blocked. |
| 18:31:09 | <motus> | i.e. C code looks like this: YPI_MSGINFO info; ypi_sendproxymsg(..., &info, ...); ... ypi_recvproxymsg(..., &info,...); |
| 18:32:16 | <sjanssen> | bringert, nominolo: see Data.ByteString.hGetNonBlocking |
| 18:32:35 | <nominolo> | bringert: i'm not quite sure if this will work. since i'm calling hGetContents when i open the socket it might very well be the case that the server will have nothing to send yet |
| 18:32:44 | <sjanssen> | an hGetContentsNonBlocking would be really handy too |
| 18:33:29 | <sjanssen> | nominolo: you can do a hybrid approach |
| 18:33:33 | <motus> | i.e. passing ptr into a foreign funtion is not a problem, but can I allocate the structure without defining it fully in Haskell or writing an extra C function? maybe I can do "foreign import ..." on a struct in .h file or something? |
| 18:33:42 | <nominolo> | bringert: maybe we should extend this to the stream interface, too. so that we can use it only for the actual contents, not the headers |
| 18:33:58 | <nominolo> | sjanssen: no, hGetContents and hGet doesn't mix well |
| 18:34:00 | <sjanssen> | do hWaitForInput handle 1; s <- hGetNonBlocking handle |
| 18:34:13 | <nominolo> | sjanssen: oh |
| 18:34:14 | <sjanssen> | nominolo: yes, you'll need to rewrite hGetContents |
| 18:35:57 | <nominolo> | i'm still not sure this is the right approach. since we read on demand, how should hGetContentsNonBlocking behave? whenever we have a demand we insist on something being available or otherwise end the string and close the handle? |
| 18:36:19 | <bringert> | sjanssen, nominolo: I think is what we want Data.ByteString.Lazy.hGetNonBlocking |
| 18:36:37 | <bringert> | modolo correct english syntax |
| 18:36:44 | <sjanssen> | :) |
| 18:37:12 | <sjanssen> | nominolo: no, hGetContentsNonBlocking should only terminate on EOF |
| 18:37:29 | <nominolo> | sjanssen: and otherwise? |
| 18:37:38 | <nominolo> | loop? |
| 18:37:45 | <sjanssen> | nominolo: it should return input whenever input is available |
| 18:38:16 | <sjanssen> | you're writing HTTP stuff, right? |
| 18:38:22 | <nominolo> | but the code that uses the lazy bytestring still gets blocked since it wants to read the next byte |
| 18:38:28 | <nominolo> | sjanssen: right |
| 18:38:46 | <nominolo> | bringert: no, hGet* reads all data at once |
| 18:39:05 | <nominolo> | bringert: ie., they're not lazy |
| 18:39:41 | <bringert> | nominolo: not Data.ByteString.Lazy.hGetNonBlocking |
| 18:40:04 | <sjanssen> | are you sure Lazy.hGetNonBlocking is lazy? |
| 18:40:13 | <bringert> | look at the code |
| 18:40:17 | <toxic> | BSLazy.hGetContentsUntilNBytesThenClose h would rock |
| 18:40:30 | <toxic> | + n |
| 18:40:32 | <bringert> | see http://darcs.haskell.org/packages/base/Data/ByteString/Lazy.hs |
| 18:40:40 | <bringert> | hGetNonBlocking :: Handle -> Int -> IO ByteString |
| 18:40:41 | <bringert> | hGetNonBlocking = hGetNonBlockingN defaultChunkSize |
| 18:40:45 | <sjanssen> | bringert: oops, it's even in the haddocks :) |
| 18:41:13 | <nominolo> | oh |
| 18:41:41 | <sjanssen> | so the server doesn't close the socket because you might make another request, and it will need to send more data? |
| 18:41:44 | <nominolo> | then maybe it was different in dons' online-accessible source? hm. ok then. problem solved |
| 18:42:14 | <nominolo> | ah no |
| 18:42:18 | <nominolo> | it doesn't work |
| 18:42:45 | <nominolo> | no, wait, i'm confused |
| 18:42:48 | <nominolo> | ACTION has to think |
| 18:43:50 | <sjanssen> | by the way, Data.ByteString.Lazy.hGetContents uses non-blocking reads |
| 18:44:16 | <toxic> | it reads whenever you really access it |
| 18:44:47 | <sjanssen> | and only blocks when there is actually no data to be read |
| 18:45:14 | <sjanssen> | as opposed to System.IO.hGetContents, which will use the blocking policy stored in the Handle |
| 18:48:17 | <jmob> | How would I fold max over a lift of numbers? |
| 18:48:36 | <jmob> | Is there a initial value that would always be less than any other number? |
| 18:48:48 | <jmob> | ?h list.max |
| 18:48:48 | <lambdabot> | Maybe you meant: hackage help hitchcock hoogle hoogle+ . v |
| 18:48:52 | <sjanssen> | jmob: depends on the numeric type |
| 18:48:56 | <koeien> | depends on your type, if you use Int there is |
| 18:49:05 | <jmob> | ?hoogle List.max |
| 18:49:05 | <lambdabot> | No matches, try a more general search |
| 18:49:12 | <jmob> | ?hoogle max |
| 18:49:12 | <lambdabot> | Prelude.max :: Ord a => a -> a -> a |
| 18:49:12 | <lambdabot> | List.maximumBy :: (a -> a -> a) -> [a] -> a |
| 18:49:12 | <lambdabot> | Prelude.maxBound :: Bounded a => a |
| 18:49:16 | <shapr> | Didn't someone figure out how to integrate HUnit and QuickCheck? Was that one of don's blog posts? |
| 18:49:43 | <sjanssen> | jmob: the library maximum function makes 'maximum []' an error |
| 18:49:47 | <sjanssen> | > maximum [] |
| 18:49:48 | <lambdabot> | Exception: Prelude.maximum: empty list |
| 18:49:56 | <sjanssen> | @src maximum |
| 18:49:56 | <lambdabot> | maximum [] = undefined |
| 18:49:57 | <lambdabot> | maximum xs = foldl1 max xs |
| 18:49:59 | <opqdonut> | jmob: if the lists are empty you can use foldl1 |
| 18:50:02 | <opqdonut> | yes exactly |
| 18:50:09 | <motus> | Hey ADEpt you are here! do you know ffi? |
| 18:50:34 | <encryptio> | > True > False |
| 18:50:36 | <lambdabot> | True |
| 18:50:39 | <encryptio> | cool. |
| 18:50:58 | <jmob> | ah, cool |
| 18:51:02 | <opqdonut> | > [False..] |
| 18:51:03 | <lambdabot> | Parse error |
| 18:51:07 | <opqdonut> | > [False,..] |
| 18:51:07 | <lambdabot> | Parse error |
| 18:51:10 | <opqdonut> | gah |
| 18:51:13 | <sjanssen> | > [False ..] |
| 18:51:14 | <koeien> | i think that is evil |
| 18:51:15 | <lambdabot> | [False,True] |
| 18:51:18 | <opqdonut> | yeah |
| 18:51:23 | <ADEpt> | motus: hi. no, not really. I've always been scared shitless by FFI, for no apparent reason :) |
| 18:51:27 | <nominolo> | bringert, sjanssen: ah i remember, BS.Lazy does not have hGetLine |
| 18:51:30 | <sjanssen> | opqdonut: False.. parses as the . operator from the False module |
| 18:51:38 | <opqdonut> | ah okay |
| 18:52:12 | <sjanssen> | nominolo: that is an odd oversight |
| 18:52:38 | <motus> | ADEpt: mee too, until recently, but it turned out not that bad. still have to figure out some corner cases, though |
| 18:52:41 | <stepcut> | I found the FFI stuff confusing until I stopped trying to use things like c2hs, and just used plain ffi plus a little help from hsc2hs |
| 18:53:00 | <stepcut> | but, now I need to learning a higher level tool, because hsc2hs is slow going for big projects |
| 18:53:07 | <elrodeo> | ÄÁ, Ñ ÔÁË ÐÒÏÂÏ×ÁÌ -- 0 ÒÅÁËÃÉÉ. ÈÍ, ÎÁÅÒÎÏÅ ÜÔÏ ÉÚ-ÚÁ ÔÏÇÏ ÞÔÏ Ñ ÎÅ ÎÁÐÒÑÍÕÀ ÔÁÍ, Á ÞÅÒÅÈ ÖÁÂÂÅÒ |
| 18:53:21 | <opqdonut> | nice, elrodeo |
| 18:53:24 | <nominolo> | sjanssen: yup, but mixing strict and lazy didn't turn out so nicely. |
| 18:53:26 | <elrodeo> | sorry |
| 18:53:59 | <sjanssen> | nominolo: why not? |
| 18:54:14 | <nominolo> | we had some problems with inverted order |
| 18:54:33 | <elrodeo> | elrodeo test |
| 18:54:42 | <sjanssen> | inverted order? |
| 18:55:14 | <nominolo> | since hGetLine reads what's there immediately, but lzay hGet doesn't |
| 18:55:19 | <motus> | stepcut: cool. so maybe you can help me with my question? can you please take a quick look at the log - http://tunes.org/~nef/logs/haskell/07.05.22 so I don't post it here again? |
| 18:55:55 | <nominolo> | so whenever you call strict hGetLine you get what's in the socket, although, logically it belonged to some lazy stuff returned earlier |
| 18:57:17 | <bringert> | shapr: andy gill sent me some HUnit - QuickCheck integration code a a while ago |
| 18:57:20 | <nominolo> | meh, hGetLine is really long |
| 18:57:42 | <bringert> | nominolo: why do you want hGetLine? |
| 18:57:56 | <nominolo> | bringert: the stream interface needs it |
| 18:58:04 | <bringert> | oh |
| 18:58:12 | <nominolo> | i could re-add custom buffering though |
| 18:58:13 | <bringert> | nominolo: you can change the Stream interface |
| 18:58:15 | <stepcut> | motus: if I understand correctly, you just want to malloc memory to hold a data structure, and then you will pass a pointer to that memory to a foreign function ? |
| 18:58:31 | <nominolo> | bringert: that would involve changing all the protocol parsing stuff too ;) |
| 18:58:38 | <motus> | yes, except I don't know the size of the structure :-) |
| 18:58:47 | <nominolo> | so, basically everything! ;P |
| 18:59:18 | <motus> | stepcut: I mean, I don't know the size of the structure in Haskell. |
| 18:59:41 | <Vulpyne> | How can I add flags to the compiler commandline when installing a package from HackageDB? |
| 19:00:02 | <stepcut> | motus: right, is where hsc2hs comes into play |
| 19:00:09 | <Vulpyne> | I have been looking through the documentation, and I don't see how it's possible. |
| 19:00:41 | <shapr> | bringert: ohh, I want to see it! |
| 19:00:42 | <assl0r> | is there a way to check if a list has further elements __without__ evaluating it completly? |
| 19:00:42 | <nominolo> | bringert: it's ok to have it, i think. i'll just add simple custom buffering. |
| 19:00:46 | <stepcut> | motus: you use the (#size struct_name) to get the number of bytes in the structure |
| 19:01:26 | <assl0r> | foo (x:xs) = if length xs /= 0 ... -- evaluates the complete list |
| 19:01:31 | <stepcut> | motus: so, something like, allocaBytes (#size YPI_MSGINFO) $\ infoPtr -> ... |
| 19:01:33 | <motus> | stepcut: I see. OK, thanks a lot! I will look at it. so that (#size struct_name) is it a hsc2hs construct? |
| 19:01:34 | <sjanssen> | assl0r: null |
| 19:01:38 | <sjanssen> | > null [] |
| 19:01:39 | <lambdabot> | True |
| 19:01:41 | <sjanssen> | > null [1] |
| 19:01:42 | <lambdabot> | False |
| 19:01:45 | <Vulpyne> | assl0r: Pass it to something that pattern matches on [] and returns False or returns true otherwise? |
| 19:01:56 | <assl0r> | ah okay |
| 19:01:57 | <assl0r> | thx |
| 19:01:58 | <Vulpyne> | Does anyone have any idea about my question? |
| 19:02:10 | <motus> | stepcut: that's exactly what I need! cool, lemme try it. thanks for help! |
| 19:02:13 | <stepcut> | motus: yes. Typically you name your source file .hsc instead of .hs, and then use hsc2hs to generate the .hs file |
| 19:02:19 | <sjanssen> | Vulpyne: are you using cabal-install? |
| 19:02:26 | <stepcut> | motus: or perhaps, ghc does that part automatically if you name the file .hsc |
| 19:02:31 | <stepcut> | ACTION forgets |
| 19:02:35 | <Vulpyne> | sjanssen: I'm using the Setup.hs that came with the package. |
| 19:02:49 | <shapr> | ooh |
| 19:02:50 | <sjanssen> | Vulpyne: edit the ghc-options field in the .cabal file |
| 19:03:10 | <shapr> | hpaste: @quit |
| 19:03:14 | <shapr> | hmm |
| 19:03:19 | <Vulpyne> | Ah, thanks. |
| 19:03:24 | <sjanssen> | !quit |
| 19:03:32 | <shapr> | ACTION beats hpaste with the C-c stick |
| 19:03:36 | <Vulpyne> | Guess that was kind of dumb. I looked at it, but missed that. |
| 19:03:44 | <jmob> | hrmm... I'm getting better with monads, kind of scary |
| 19:03:45 | <sjanssen> | shapr: maybe I don't have permissions. I believe the commands start with ! |
| 19:03:46 | <shapr> | Saizan: You fixed hpaste! w00! |
| 19:03:49 | <shapr> | Saizan++ |
| 19:03:58 | <shapr> | sjanssen: Nah, I think access isn't in the repo by default. |
| 19:04:47 | <motus> | stepcut: nope, at least ghc 6.4 (this is what I have at work) does not recognize .hsc |
| 19:05:00 | <Vulpyne> | sjanssen: It didn't call ghc with the options in that field. |
| 19:05:05 | <stepcut> | motus: ok, I think I must have rules in my Makefile that do it for me |
| 19:05:14 | <Vulpyne> | sjanssen: Perhaps because it's trying to build a C file? |
| 19:05:17 | <sjanssen> | Vulpyne: you probably need to rerun configure |
| 19:05:18 | <Vulpyne> | Using ghc. |
| 19:05:22 | <Vulpyne> | Yep, I did. |
| 19:05:25 | <jmob> | shapr: doesn't look fixed to me |
| 19:05:36 | <sjanssen> | Vulpyne: yeah, a C file might be a different story |
| 19:05:54 | <Vulpyne> | I really need to pass -I/usr/local/include or it dies horribly. |
| 19:06:06 | <Vulpyne> | Is there a different field I could add which would control that? |
| 19:07:04 | <shapr> | jmob: It works locally, now installing it on the server. |
| 19:07:24 | <nominolo> | bringert: hm, mixing strict and lazy BS seems to work. maybe i used hGetContents instead of hGet last time |
| 19:08:26 | <stepcut> | Vulpyne: 'include-dirs: directory list' perhaps ? |
| 19:08:37 | <Vulpyne> | stepcut: Just about to try that actually, thank you. :) |
| 19:09:09 | <Vulpyne> | Woot! That fixed it. Thanks again. |
| 19:09:41 | <stepcut> | yay! |
| 19:11:34 | <shapr> | ACTION rebuilds HAppS for the Nth time. |
| 19:11:59 | <stepcut> | ACTION rebuild shapr for the Nth+1 time |
| 19:12:20 | <Saizan> | ah, so it's really a bot! |
| 19:12:41 | <shapr> | But I'm not named Anna. |
| 19:13:37 | <psnl> | I've met shapr, and he didn't look like a bot. |
| 19:13:42 | <bringert> | nominolo: why do you need to have an IORef ByteString? can't you just read a line/block at a time? |
| 19:13:46 | <psnl> | nor a Anna, for that matter. |
| 19:13:48 | <emu> | what would a bot look like |
| 19:13:56 | <bringert> | nominolo: looking at http://www.dtek.chalmers.se/~tox/darcs/http/Network/TCP.hs |
| 19:13:56 | <nominolo> | bringert: yes i changed it |
| 19:14:00 | <psnl> | emu: arnie, clearly. |
| 19:14:14 | <nominolo> | bringert: it's now almost like the strict version |
| 19:14:47 | <nominolo> | bringert: i only change the strict bytestring returned by hGetLine into a lazy bytestring |
| 19:16:00 | <nominolo> | bringert: i think the first time it didn't work because i used hGetContents in readBlock since it didn't look like hGet was actually lazy |
| 19:16:14 | <nominolo> | time to repeat the benchmark |
| 19:20:00 | <chitin> | is there a more idiomatic way of doing this: jj n xs | all (n==) (take n xs) = take n xs | otherwise = jj n (drop 1 xs) --I want it to return the first instance when n consequtive elements are equal |
| 19:20:03 | <shapr> | psnl: So, what did I look like? |
| 19:21:10 | <psnl> | shapr: younger than I expected... |
| 19:22:33 | <swiert> | Has anyone here bought the latest edition of "Compilers: Principles, Techniques and Tools"? |
| 19:22:33 | <lambdabot> | swiert: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 19:22:56 | <shapr> | psnl: Well, I am young and inexperienced. |
| 19:23:03 | <cdsmith> | swiert: I've got it, I think. Why? |
| 19:23:25 | <swiert> | Do you have any idea how it compares to previous versions? |
| 19:23:36 | <bringert> | swiert: I have it |
| 19:23:57 | <bringert> | swiert: haven't read it yet |
| 19:24:08 | <cdsmith> | swiert: Hmm. No, because it's been years since I've even seen older versions. |
| 19:24:08 | <psnl> | shapr: the photo of you trying to teach simonpj to unicycle has stuck in my mind. |
| 19:24:21 | <bringert> | swiert: I think it has visitors now, iirc |
| 19:24:21 | <shapr> | psnl: Um, where is that photo? |
| 19:24:25 | <malsyned> | Is there a good tutorial out there for understanding comonads? |
| 19:27:03 | <psnl> | shapr: it might have been edwinb, actually. |
| 19:27:04 | <Botje> | chitin: jj n xs = head $ filter (\l -> length l == n) $ group xs -- something like this? |
| 19:29:12 | <Saizan> | @google cellular automata comonadic |
| 19:29:15 | <lambdabot> | http://sigfpe.blogspot.com/2006/12/evaluating-cellular-automata-is.html |
| 19:29:15 | <lambdabot> | Title: A Neighborhood of Infinity: Evaluating cellular automata is comonadic |
| 19:29:26 | <Saizan> | @oldwiki comonad |
| 19:29:26 | <lambdabot> | http://www.haskell.org/hawiki/comonad |
| 19:29:38 | <cdsmith> | swiert: by comparing tables of contents, the intro is reworked. The new edition drops operator precedence parsing and talks a lot more about LR parser... should I go on? |
| 19:29:39 | <ray> | ooh |
| 19:29:46 | <ray> | comonads, my favorite |
| 19:30:07 | <chitin> | thanks Botje |
| 19:30:39 | <Saizan> | ?src group |
| 19:30:39 | <lambdabot> | group = groupBy (==) |
| 19:30:43 | <Saizan> | ?src groupBy |
| 19:30:43 | <lambdabot> | groupBy _ [] = [] |
| 19:30:44 | <lambdabot> | groupBy eq (x:xs) = (x:ys) : groupBy eq zs |
| 19:30:44 | <lambdabot> | where (ys,zs) = span (eq x) xs |
| 19:30:49 | <Botje> | chitin: your code searches for a group of n times n though |
| 19:31:00 | <Botje> | i'm assuming that wasn't what you meant, going by your description |
| 19:31:31 | <chitin> | Botje: well my code worked, just very slowly |
| 19:31:40 | <pjd> | http://haskell.org/haskellwiki/Research_papers/Monads_and_arrows#Comonads |
| 19:31:41 | <pjd> | http://haskell.org/haskellwiki/Blog_articles#Comonads |
| 19:31:44 | <lambdabot> | Title: Blog articles - HaskellWiki |
| 19:31:46 | <lambdabot> | Title: Research papers/Monads and arrows - HaskellWiki, http://tinyurl.com/fgd83 |
| 19:31:58 | <shapr> | segfaulted?? |
| 19:32:00 | <dcoutts_> | nominolo: you don't really want to use hGetLine, it's much slower than getting blocks and finding line breaks afterwards |
| 19:32:14 | <dcoutts_> | it involves an extra copy via the Handle buffer |
| 19:32:27 | <shapr> | ACTION kicks hpaste |
| 19:33:01 | <nominolo> | dcoutts_: ok. it works for now, though. |
| 19:33:09 | <cdsmith> | swiert: I guess you're gone? |
| 19:33:28 | <swiert> | cdsmith: Sorry. Afk for a bit. |
| 19:33:35 | <Saizan> | segfaults? |
| 19:33:43 | <swiert> | cdsmith: Is it still mostly parsing? |
| 19:34:09 | <swiert> | It's been on my amazon wish list for a while, but I'm in two minds whether or not to buy it. |
| 19:34:25 | <cdsmith> | swiert: There's a little bit more non-parsing stuff. I'd say about the first 1/2, slightly less, is parsing. |
| 19:35:11 | <psnl> | shapr: damn, can't find it - must have been edwinb |
| 19:35:16 | <cdsmith> | swiert: okay, I guess more like less than a third is parsing in terms of number of pages. |
| 19:35:30 | <nominolo> | bringert: hGetContentsNonBlocking doesn't work |
| 19:35:45 | <swiert> | cdsmith: Thanks for the info. |
| 19:35:48 | <nominolo> | bringert: it just aborts whenever the server has a hickup |
| 19:36:12 | <cdsmith> | swiert: ooh; looks like someone gutted the type checking chapter, and turned it into a subsection. :( |
| 19:36:45 | <Saizan> | !paste -- stable? |
| 19:36:45 | <hpaste> | Haskell paste bin: http://hpaste.org/ |
| 19:37:43 | <nominolo> | bringert: oh, and my program using LazyBytestrings now uses the full 175MB again |
| 19:37:54 | <nominolo> | so it's obviously not lazy anymore |
| 19:38:29 | <stepcut> | nominolo: to could be lazy, but holding on to data is does not need to be |
| 19:38:56 | <nominolo> | stepcut: ? |
| 19:38:58 | <nominolo> | ;) |
| 19:39:18 | <nominolo> | stepcut: it worked before with 3mb overhead |
| 19:40:03 | <nominolo> | i don't quite understand though. maybe i have the wrong version of bytestrings |
| 19:41:28 | <shapr> | ACTION has a hissy fit |
| 19:41:56 | <stepcut> | nominolo: for example, drop 100 [1..], is lazy, and in normally does not hold on to the first 100 elements, so the garabage collector can collect those |
| 19:42:15 | <Igloo> | shapr? |
| 19:42:45 | <stepcut> | nominolo: but, what if you managed to make a version of drop that accidently held onto the first 100 elements. It would still be lazy, but it would also have space leak... |
| 19:43:27 | <stepcut> | nominolo: so, maybe your code is lazy and is using the correct bytestring, but has a space leak ? |
| 19:44:04 | <shapr> | Igloo: I can't start screen for whatever reason. I tried "nohup ./hpaste 1>/dev/null 2>/dev/null" but then C-z and bg killed the process. What am I doing wrong? |
| 19:44:52 | <dcoutts_> | nominolo: what do you mean about hGetContentsNonBlocking? do you think there is some bug in the impl? |
| 19:44:56 | <stepcut> | shapr: ugh. That does not always work |
| 19:45:08 | <Heffalump> | can you just start it with & in the first place? |
| 19:45:26 | <stepcut> | shapr: disown maybe ? |
| 19:45:30 | <Igloo> | Does it read from stdin? |
| 19:45:42 | <nominolo> | dcoutts_: hGetNonBlocking. if i read from the socket non-blockingly then it doesn't download the complete file |
| 19:46:01 | <dcoutts_> | nominolo: can you be more specific? |
| 19:46:09 | <nominolo> | dcoutts_: bringert didn't like that the client get's blocked if the server doesn't respond |
| 19:46:19 | <shapr> | stepcut: Never heard of disown. |
| 19:46:21 | <shapr> | Igloo: No, it doesn't |
| 19:46:23 | <dcoutts_> | nominolo: right |
| 19:46:28 | <stepcut> | shapr: it might be bash specific |
| 19:46:56 | <nominolo> | dcoutts_: but i think this should be handled at a different level. e.g., using timeouts in network.browser |
| 19:47:09 | <dcoutts_> | nominolo: perhaps yes. |
| 19:47:11 | <stepcut> | shapr: I think I have also seen people use a sub-shell, like, ( ./hpaste 1> /dev/null 2>/dev/null & ), or something to that effect |
| 19:47:18 | <stepcut> | the parens are important in that line, btw |
| 19:47:25 | <shapr> | stepcut: I'll try that. |
| 19:48:26 | <pjd> | shapr: *just* C-z and bg? |
| 19:48:29 | <stepcut> | shapr: http://www.redhat.com/archives/fedora-list/2004-April/msg05387.html |
| 19:48:31 | <lambdabot> | Title: Re: kill xterm kills app!, http://tinyurl.com/23n5yw |
| 19:48:42 | <pjd> | it must be mis-catching SIGCONT, or something |
| 19:49:02 | <nominolo> | bringert, sjanssen: Data.ByteString.Lazy.hGet *is* strict. it does read in chunks but it reads them all! note the STRICT1(readChunks) |
| 19:49:17 | <dcoutts_> | nominolo: yes. |
| 19:49:32 | <dcoutts_> | nominolo: only hGetContents is lazy |
| 19:50:11 | <nominolo> | yes, so the implemention described in my post is correct |
| 19:50:36 | <dcoutts_> | I've not seen that yet |
| 19:50:55 | <nominolo> | it's on planet lisp |
| 19:51:10 | <TomMD> | xmonad is now invite only? |
| 19:51:59 | <sjanssen> | TomMD: hmm? |
| 19:52:12 | <sjanssen> | TomMD: you seem to have joined successfully |
| 19:52:21 | <TomMD> | That was a weird IRC message I just got. I am in xmonad now, but the first two tries resulted in "#xmonad is invite only" |
| 19:52:22 | <dcoutts_> | nominolo: is your blog syndicated on planet Haskell yet? |
| 19:53:19 | <nominolo> | yes |
| 19:53:28 | <TomMD> | Err - my bad "requires an invitation" and it was for "#monad" bahh |
| 19:53:41 | <nominolo> | funny, though, i mixed some numbers. it should be 175 MB instead of 375 MB |
| 19:54:13 | <bringert> | nominolo: my complaint wasn't about the server not responding. it was that if the server doesn't close the socket, hGetContent can block waiting to fill the last block of the response, even though the full response has been sent |
| 19:54:24 | <nominolo> | dcoutts_: http://nominolo.blogspot.com/2007/05/networkhttp-bytestrings.html |
| 19:54:25 | <lambdabot> | Title: nominolo's Blog: Network.HTTP + ByteStrings |
| 19:54:41 | <nominolo> | bringert: oh. well that's exaclty the problem i described then |
| 19:55:03 | <nominolo> | bringert: that's why i wanted a function readN and close or something |
| 19:55:26 | <nominolo> | or i'd have to implement a custom version of hGetContents |
| 19:59:40 | <shapr> | stepcut: I can't figure it out. ( /bin/sh -c ./hpaste 1> /dev/null 2>/dev/null & ) doesn't work. |
| 19:59:53 | <stepcut> | shapr: :( |
| 20:00:14 | <stepcut> | shapr: that is the extent of my ideas :( |
| 20:01:06 | <stepcut> | did you try, ( /bin/sh -c "./hpaste 1> /dev/null 2>/dev/null" & ) |
| 20:02:46 | <nominolo> | bringert: any other ideas? |
| 20:04:56 | <shapr> | CosmicRay: Hey, did you get the patch? |
| 20:05:02 | <CosmicRay> | yes |
| 20:05:12 | <CosmicRay> | haven't had time to test yet |
| 20:05:16 | <CosmicRay> | hopefully I will by tomorrow |
| 20:05:20 | <bringert> | nominolo: just to make sure we're on the same page: you want to implement the Stream class for Sockets, right? |
| 20:05:37 | <nominolo> | yes |
| 20:05:38 | <bringert> | nominolo: so you need readLine :: x -> IO (Result ByteString) |
| 20:05:38 | <bringert> | readBlock :: x -> Int -> IO (Result ByteString) |
| 20:05:53 | <nominolo> | writeBlock and close |
| 20:06:07 | <bringert> | readLine could just be Lazy.hGetLine |
| 20:06:16 | <bringert> | it doesn't have to be lazy |
| 20:06:45 | <nominolo> | no |
| 20:06:50 | <bringert> | readBlock could be a lazy hGet |
| 20:07:05 | <nominolo> | lazy hGet is not possible |
| 20:07:24 | <nominolo> | because a subsequent hGet would have to make sure that all previous ones were forced |
| 20:07:49 | <bringert> | sure |
| 20:07:54 | <bringert> | that could be done |
| 20:07:59 | <nominolo> | how? |
| 20:09:35 | <bringert> | hmm, maybe using the method that splitAtST in http://darcs.haskell.org/binary/src/Data/Binary/Get.hs uses |
| 20:10:01 | <bringert> | well, that wouldn't be hGet, but rather a way to get hGetNonBlocking to work |
| 20:10:40 | <bringert> | but yeah, it is a messy problem |
| 20:11:53 | <bringert> | nominolo: you could change the type of readBlock to make using a single lazy BS nicer, since it's onyl used in a few places |
| 20:13:11 | <nominolo> | yes, it's only used for the the message body |
| 20:14:28 | <shapr> | !paste |
| 20:14:29 | <hpaste> | Haskell paste bin: http://hpaste.org/ |
| 20:14:50 | <shapr> | ACTION swears |
| 20:16:22 | <assl0r> | ACTION swears too |
| 20:16:24 | <byorgey> | shapr: what's the problem? (or is that the question?) |
| 20:16:34 | <assl0r> | hpaste.org is down |
| 20:17:12 | <byorgey> | assl0r: I know, I meant, why does hpaste keep dying? |
| 20:17:52 | <shapr> | byorgey: Mostly user error. |
| 20:19:23 | <shapr> | I could either startup a new blank hpaste, or I could try to fix the existing state. |
| 20:20:33 | <shapr> | ACTION gives up and starts a blank hpaste |
| 20:22:42 | <olsner> | I've got a problem with retained structures... what should be basically a linear traversion of a file seems to retain the entire file before doing anything |
| 20:23:12 | <olsner> | @paste |
| 20:23:12 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 20:23:24 | <hpaste> | assl0r pasted "wrong idention...?!??" at http://hpaste.org/0 |
| 20:23:48 | <assl0r> | hpaste, u are ugly! |
| 20:24:11 | <hpaste> | shapr pasted "test paste" at http://hpaste.org/1 |
| 20:24:32 | <Heffalump> | can you get the number to start from where the old number was? |
| 20:25:02 | <shapr> | assl0r: I just fixed that! |
| 20:25:14 | <shapr> | I had forgotten to copy the static files over from eric's account. |
| 20:25:33 | <hpaste> | (anonymous) annotated "wrong idention...?!??" with "(no title)" at http://hpaste.org/0#a1 |
| 20:25:58 | <Igloo> | assl0r: Your parens don't match |
| 20:26:49 | <assl0r> | what? |
| 20:26:51 | <Igloo> | assl0r: Having () in your datatype is also a bit odd |
| 20:27:00 | <hpaste> | olsner pasted "Retained structures" at http://hpaste.org/2 |
| 20:27:41 | <nominolo> | shapr: could you maybe let the new pastes start at 2000, so that you could optionally add the old pastes later on? |
| 20:27:58 | <assl0r> | Igloo, how would i do that more elegantly? |
| 20:28:08 | <Igloo> | Do what? |
| 20:28:23 | <assl0r> | an imbalanced bintree |
| 20:28:35 | <Igloo> | Just don't put anything there |
| 20:28:47 | <assl0r> | mhm |
| 20:28:48 | <Igloo> | ... | KnotenL a (BinBaumFlexibel a) | ... |
| 20:29:38 | <Igloo> | (it's not really a question of balance, as the tree could be unbalanced even with only the first and last constructor) |
| 20:30:59 | <assl0r> | but a question whether it may have more than 2 children per node?! |
| 20:31:49 | <Igloo> | ACTION can't parse that |
| 20:35:37 | <_case> | what's wrong with this Eq? instance Eq Resultaat where |
| 20:35:37 | <_case> | Resultaat naam1 cijfer1 == Resultaat naam2 cijfer2 = naam1 == naam2 |
| 20:35:44 | <assl0r> | Igloo, expect that what you noted, why does the interpreter complains about incorrect idention? |
| 20:35:47 | <_case> | data Resultaat = Resultaat String Int |
| 20:36:05 | <Igloo> | assl0r: Because your parentheses aren't matched |
| 20:36:18 | <_case> | i wan't Resultaat to be equal when the first argument matches |
| 20:36:34 | <assl0r> | Igloo, i've checked them double... :( |
| 20:36:38 | <assl0r> | twice |
| 20:36:39 | <assl0r> | argh |
| 20:37:46 | <Igloo> | assl0r: Only two of the three in "(KnotenR 18 ( KnotenLR 34 (" are closed |
| 20:37:58 | <assl0r> | i should always use vi |
| 20:38:09 | <assl0r> | :) |
| 20:38:10 | <Igloo> | vim, yes :-) |
| 20:38:50 | <hpaste> | (anonymous) annotated "wrong idention...?!??" with "(no title)" at http://hpaste.org/0#a2 |
| 20:39:12 | <hpaste> | (anonymous) annotated "wrong idention...?!??" with "(no title)" at http://hpaste.org/0#a3 |
| 20:39:21 | <pjd> | silly question: |
| 20:40:08 | <pjd> | you know how fmap in the Reader monad/functor is like function composition? |
| 20:40:42 | <pjd> | what's the intuitive interpretation of join and bind in this context? |
| 20:42:08 | <sjanssen> | join applies an argument twice |
| 20:43:12 | <sjanssen> | f >>= g -- applies an argument, 'x', to both f and g, then applies the result of (f x) to g |
| 20:43:29 | <sjanssen> | > join (++) "hello" |
| 20:43:31 | <lambdabot> | "hellohello" |
| 20:44:28 | <sjanssen> | erm, applies (f x) to (g x) -- g x (f x) |
| 20:48:41 | <hpaste> | assl0r pasted "???" at http://hpaste.org/3 |
| 20:50:58 | <kpreid> | assl0r: your usage of KnotenB is incorrect |
| 20:53:17 | <assl0r> | precisely? |
| 20:54:14 | <kpreid> | the parentheses following it are inappropriate |
| 20:54:54 | <byorgey> | _case: what error are you getting? |
| 20:55:09 | <kpreid> | you're specifying an application of BlattF 45 to BlattF 68, which won't work as BlattF 45 is a type, not a type specifier; you're also giving KnotenS 2 parameters instead of 3 |
| 20:55:55 | <olsner> | @src mapMaybe |
| 20:55:55 | <lambdabot> | Source not found. I've seen penguins that can type better than that. |
| 20:56:13 | <kpreid> | olsner: fmap |
| 20:56:28 | <kpreid> | @src Maybe fmap |
| 20:56:28 | <lambdabot> | fmap _ Nothing = Nothing |
| 20:56:28 | <lambdabot> | fmap f (Just a) = Just (f a) |
| 20:56:43 | <olsner> | :t mapMaybe |
| 20:56:45 | <lambdabot> | forall a b. (a -> Maybe b) -> [a] -> [b] |
| 20:57:02 | <olsner> | for filtering out all Nothings from a list of Maybes |
| 20:57:17 | <kpreid> | oh |
| 20:57:20 | <fasta> | olsner: catMaybe |
| 20:57:35 | <fasta> | olsner: trivial to see when you do :browse Data.Maybe |
| 20:57:48 | <nominolo> | > do r <- newSTRef 4; readSTRef r |
| 20:57:49 | <lambdabot> | Not in scope: `readSTRef' |
| 20:59:34 | <olsner> | I just wanted to see how mapMaybe was implemented... something in my program is causing everything to be retained, when I know that it should be able to process one item then forget it |
| 21:00:03 | <olsner> | (and what I wanted was mapMaybe) |
| 21:00:35 | <nominolo> | > runST $ do r <- newSTRef 4; readSTRef r |
| 21:00:36 | <lambdabot> | Not in scope: `readSTRef' |
| 21:00:46 | <nominolo> | ?hoogle readSTRef |
| 21:00:46 | <lambdabot> | Data.STRef.readSTRef :: STRef s a -> ST s a |
| 21:07:11 | <pjd> | sjanssen: and return discards an argument |
| 21:07:57 | <pjd> | ok, i think i see how it fits together |
| 21:11:32 | <ndm> | Hi #haskell |
| 21:11:42 | <ndm> | i'm going to add pragma |
| 21:11:45 | <ndm> | 's to Catch |
| 21:12:14 | <ndm> | i was thinking of {-# PARTIAL funcname1 funcname2 #-} |
| 21:12:18 | <ndm> | was my thought |
| 21:12:33 | <assl0r> | kpreid: thx |
| 21:13:24 | <ndm> | anyone got any thoughts? |
| 21:13:38 | <ndm> | or any things i should bare in mind to keep them more useful? |
| 21:15:17 | <monochrom> | What does PARTIAL funcname1 funcname2 do? |
| 21:15:51 | <sieni> | I have always wondered why some people have problems with correct spelling of homonphones... |
| 21:15:55 | <ndm> | declares that the listed functions may return _|_ |
| 21:15:56 | <sieni> | homophones |
| 21:16:13 | <ndm> | i.e. {-# PARTIAL head, tail #-} |
| 21:16:34 | <ndm> | in order to make Catch give a warning that the function is partial, rather than an error |
| 21:16:36 | <Heffalump> | bah, what is it about Valentines Day. Why do people actually pay attention to this commercialised crap? |
| 21:16:42 | <ndm> | Heffalump, women! |
| 21:16:53 | <Botje> | Heffalump: because lots of other people are :] |
| 21:17:09 | <Heffalump> | mine doesn't! |
| 21:17:14 | <ndm> | Heffalump, i have no problem with a randomly chosen date relating to a random saint - but its hard convincing a g/f of that |
| 21:17:15 | <Botje> | and not doing so inevitably would result in "why didn't you buy anything for me? don't you love me? waa waa!" |
| 21:17:34 | <ndm> | Heffalump, then you chose well... |
| 21:18:02 | <Heffalump> | she does get flowers at some random point after Valentines Day. And she did remind me I'd failed to produce them yet this year the other day. |
| 21:19:04 | <encryptio> | :t fmap Just |
| 21:19:06 | <lambdabot> | forall a (f :: * -> *). (Functor f) => f a -> f (Maybe a) |
| 21:19:37 | <ndm> | Heffalump, so she merely has a displaced valentines day |
| 21:19:59 | <kilimanjaro> | Heffalump, just tell her that tomorrow is still after Valentines Day :) |
| 21:20:14 | <Heffalump> | so far I've had three reminders about Valentines Day, one issue with the Chinese New Year and one mention of school half-terms (in trying to find a date for Fun in the Afternooon for Feb 08) |
| 21:20:23 | <Heffalump> | ndm: yes, but without the commercialised crap. |
| 21:20:34 | <Heffalump> | or indeed any duty to be available on a certain date |
| 21:20:45 | <ndm> | you are doing it way in advance though |
| 21:21:11 | <Heffalump> | yeah, I guess only general things like that will be booked up |
| 21:21:27 | <Heffalump> | I need to book the room asap, is the reason. |
| 21:23:51 | <ndm> | Colin prebooked the room for 6 afternoons |
| 21:23:56 | <byorgey> | @src quot |
| 21:23:56 | <lambdabot> | Source not found. Just what do you think you're doing Dave? |
| 21:24:02 | <ndm> | then now just cancels 5 of them |
| 21:24:18 | <byorgey> | is there a difference between quot and div? |
| 21:24:22 | <Heffalump> | I doubt I could get away with that. |
| 21:25:15 | <ndm> | yeah, i was impressed that Colin thought of that |
| 21:25:29 | <ndm> | > -12 `quot` 5 |
| 21:25:30 | <lambdabot> | -2 |
| 21:25:34 | <ndm> | > -12 `div` 5 |
| 21:25:35 | <lambdabot> | -2 |
| 21:25:45 | <ndm> | oh, yes, they are entirely different |
| 21:25:53 | <ndm> | apart from on that particular example :) |
| 21:26:01 | <byorgey> | I see. =) |
| 21:26:02 | <ndm> | > 17 `div` 5 |
| 21:26:04 | <lambdabot> | 3 |
| 21:26:05 | <ndm> | > 17 `quot` 5 |
| 21:26:06 | <lambdabot> | 3 |
| 21:26:17 | <sieni> | -5 `div` 5 |
| 21:26:19 | <emu> | @src quot |
| 21:26:19 | <sieni> | eiku |
| 21:26:20 | <lambdabot> | Source not found. That's something I cannot allow to happen. |
| 21:26:21 | <ndm> | > 12 `quot` -5 |
| 21:26:22 | <lambdabot> | precedence parsing error |
| 21:26:22 | <lambdabot> | cannot mix `quot' [infixl 7] and prefix... |
| 21:26:23 | <sieni> | > -5 `div` 5 |
| 21:26:25 | <lambdabot> | -1 |
| 21:26:27 | <sieni> | > -5 `div` 3 |
| 21:26:28 | <lambdabot> | -1 |
| 21:26:29 | <ndm> | > 12 `quot` (-5) |
| 21:26:31 | <lambdabot> | -2 |
| 21:26:31 | <fasta> | > tail [] |
| 21:26:32 | <sieni> | > -5 `quot` 3 |
| 21:26:32 | <lambdabot> | Exception: Prelude.tail: empty list |
| 21:26:34 | <lambdabot> | -1 |
| 21:26:35 | <ndm> | > 12 `div` (-5) |
| 21:26:36 | <lambdabot> | -3 |
| 21:26:49 | <sieni> | > -5 `mod` 3 |
| 21:26:49 | <ndm> | ah, the difference is when the divisor is negative |
| 21:26:50 | <lambdabot> | -2 |
| 21:26:51 | <byorgey> | aha |
| 21:26:55 | <byorgey> | indeed |
| 21:27:00 | <ndm> | one rounds towards zero, one rounds downwards |
| 21:27:01 | <emu> | > 12 `mod` (-5) |
| 21:27:03 | <lambdabot> | -3 |
| 21:27:10 | <sieni> | > -5 `rem` 3 |
| 21:27:11 | <lambdabot> | -2 |
| 21:27:33 | <byorgey> | oh, I see... div goes with mod, and quot goes with rem |
| 21:28:20 | <sieni> | wtf? why is -5 `mod` 3 wrong? |
| 21:28:35 | <sieni> | It should be 1 or somebody has been a complete idiot |
| 21:29:54 | <Saizan> | i just wish to point out that -5 `quot` 2 is parsed as -(5 `quot` 2) |
| 21:30:07 | <ndm> | ah! |
| 21:30:11 | <ndm> | those silly negative literals |
| 21:30:20 | <sieni> | (-5) `quot` 2 |
| 21:30:27 | <sieni> | > (-5) `quot` 2 |
| 21:30:28 | <lambdabot> | -2 |
| 21:30:34 | <Saizan> | > (-5) `div` 2 |
| 21:30:35 | <lambdabot> | -3 |
| 21:30:41 | <sieni> | (-5) `mod` 2 |
| 21:30:46 | <sieni> | > (-5) `mod` 2 |
| 21:30:47 | <lambdabot> | 1 |
| 21:30:50 | <sieni> | huh |
| 21:31:21 | <sieni> | Saizan: thanks for restoring my trust to saneness of the designers of Haskell |
| 21:31:40 | <Saizan> | aside from the unary minus thing :) |
| 21:32:14 | <Heffalump> | I blame the designers of Maths. |
| 21:32:15 | <sieni> | Saizan: it is interesting that this is not noted on the following page: http://www.zvon.org/other/haskell/Outputprelude/mod_f.html |
| 21:32:17 | <lambdabot> | Title: Haskell : mod |
| 21:33:11 | <Saizan> | > -33 `mod` -12 |
| 21:33:11 | <lambdabot> | precedence parsing error |
| 21:33:11 | <lambdabot> | cannot mix `mod' [infixl 7] and prefix ... |
| 21:33:37 | <Saizan> | > show (-33) |
| 21:33:38 | <assl0r> | how do breakline long strings? |
| 21:33:38 | <lambdabot> | "-33" |
| 21:33:43 | <sieni> | > (-33) `mod` (-12) |
| 21:33:45 | <lambdabot> | -9 |
| 21:33:52 | <assl0r> | "....... \\n"..." doesn't work |
| 21:34:21 | <Saizan> | assl0r: you want to write long string literals across multiple lines? |
| 21:34:31 | <assl0r> | yeah |
| 21:34:49 | <assl0r> | foo = "long baaaaaaaaaar" |
| 21:35:23 | <kpreid> | assl0r: "........\ \......" |
| 21:35:28 | <Saizan> | foo = "long \ <actual newline here> \baaaar" |
| 21:35:41 | <assl0r> | ah thx |
| 21:35:45 | <kpreid> | note: last time I tried, it didn't work right in >-style lhs |
| 21:36:02 | <kpreid> | I might have been doing something else odd, though |
| 21:36:52 | <nominolo> | hm, who do i have to ask to get access to darcs.haskell.org? (for SoC purposes) |
| 21:37:12 | <nominolo> | (or "whom"?) |
| 21:37:51 | <dcoutts> | nominolo: ask SyntaxNinja |
| 21:37:55 | <dcoutts> | heh |
| 21:37:59 | <dcoutts> | hia SyntaxNinja |
| 21:38:00 | <nominolo> | rofl |
| 21:38:09 | <nominolo> | hej SyntaxNinja |
| 21:38:12 | <Daveman> | ACTION pets lambdabot |
| 21:38:53 | <ndm> | nominolo, it should be JaffaCake, I think |
| 21:39:08 | <SyntaxNinja> | y0y0 |
| 21:39:14 | <SyntaxNinja> | how's everyone today? |
| 21:39:14 | <ndm> | i need to sort out access for my SoC student |
| 21:39:26 | <nominolo> | SyntaxNinja: can you give me access to darcs.haskell.org? (for SoC) |
| 21:39:42 | <nominolo> | SyntaxNinja: or should i ask simonM as ndm says |
| 21:39:49 | <SyntaxNinja> | nominolo, ndm, who don't we try something new actually :) |
| 21:40:14 | <ndm> | community.haskell.org? |
| 21:40:25 | <SyntaxNinja> | yeah, but it doesn't have a name yet; it's just an IP address |
| 21:40:26 | <nominolo> | SyntaxNinja: ah, the guinnia pig part? |
| 21:40:30 | <SyntaxNinja> | yeah |
| 21:40:38 | <SyntaxNinja> | dcoutts: want to give him/them an account? |
| 21:40:55 | <nominolo> | btw, SyntaxNinja, you got mail (not from aol) |
| 21:41:08 | <ndm> | SyntaxNinja, if i email you my students public key, can you set it up and email us back instructions? |
| 21:41:30 | <dcoutts> | SyntaxNinja: I can give nominolo an account on "community.haskell.org" yes. |
| 21:41:45 | <ndm> | or should i be emailing dcoutts? |
| 21:41:52 | <SyntaxNinja> | ndm: try dcoutts :) |
| 21:41:56 | <dcoutts> | @yarr! |
| 21:41:56 | <lambdabot> | Smartly me lass |
| 21:42:11 | <SyntaxNinja> | I can do it too, but it's good as a test to let duncan do it :) |
| 21:42:18 | <robertfunfun> | i'm trying to make a function that takes in a list and outputs it with a gap in the middle of it and i'm using |
| 21:42:20 | <robertfunfun> | --splitlist -- splits list in the middle |
| 21:42:20 | <robertfunfun> | splitlist :: [a] -> String |
| 21:42:20 | <robertfunfun> | splitlist [a] = take (length [a]/2) [a] ++ " " ++ drop (length [a]/2) [a] |
| 21:42:47 | <robertfunfun> | but when i load the file, i get Hugs> :l hugsfiles/intinset.hs |
| 21:42:47 | <robertfunfun> | ERROR "hugsfiles/intinset.hs":32 - Inferred type is not general enough |
| 21:42:47 | <robertfunfun> | *** Expression : splitlist |
| 21:42:47 | <robertfunfun> | *** Expected type : [a] -> String |
| 21:42:48 | <robertfunfun> | *** Inferred type : [Char] -> String |
| 21:42:51 | <sjanssen> | hey SyntaxNinja, the xmonad team is interested in hosting on the new community server. Is this possible? |
| 21:43:07 | <robertfunfun> | anyone got any ideas? |
| 21:43:22 | <mauke> | robertfunfun: " " is a [Char], not an [a] |
| 21:43:37 | <mauke> | wait |
| 21:43:50 | <mauke> | robertfunfun: how can you convert a to Char in your function? |
| 21:43:50 | <ndm> | dcoutts, you too have mail |
| 21:43:57 | <dcoutts> | SyntaxNinja: can we get a dns names sorted out for the new server, did we decide on "community" vs "hackage" ? (I prefer the latter I think) |
| 21:44:08 | <ndm> | i prefer community |
| 21:44:13 | <nominolo> | dcoutts: so i should send you my sshkey.pub? |
| 21:44:21 | <ndm> | hackage should be reserved for the releaed side of things, i would have thought |
| 21:44:29 | <Botje> | robertfunfun: your use of ++ " " forces the input to be of type [Char] |
| 21:44:31 | <ndm> | hackage is distributing all haskell code |
| 21:44:42 | <Botje> | since ++ only works on lists of equal type |
| 21:44:48 | <ndm> | community is for writing some |
| 21:44:51 | <SyntaxNinja> | dcoutts: I'd prefer hackage, but that would require moving other stuff or changing links or something, which is something that someone would have to organize :) |
| 21:44:58 | <dcoutts> | SyntaxNinja: hmm, I can't seem to ssh in at the moment, not sure what's wrong. |
| 21:45:07 | <SyntaxNinja> | ndm: but I think hackage will probably want to move to that server |
| 21:45:15 | <robertfunfun> | so how do i do what i'm trying to do |
| 21:45:17 | <Botje> | robertfunfun: perhaps you can use show to convert the two halves into strings, then join with ++ ? |
| 21:45:34 | <robertfunfun> | show? |
| 21:45:36 | <dcoutts> | SyntaxNinja: well, not a whole lot, since most things that are acessible via hackage.h.o are more commonly known by the darcs.h.o name |
| 21:45:42 | <nominolo> | robertfunfun: either change the type or add a parameter for what to fill into the gap |
| 21:45:48 | <dcoutts> | SyntaxNinja: it's just the hackagedb and the trac instances iirc |
| 21:45:57 | <Botje> | > let splitlist [a] = (show $ take (length [a]/2) [a]) ++ " " ++ (show drop (length [a]/2) [a]) in splitlist [1..10] |
| 21:45:58 | <lambdabot> | Couldn't match expected type `Int -> [t] -> [Char]' |
| 21:46:04 | <dcoutts> | SyntaxNinja: I really can't seem to ssh in, and no ping |
| 21:46:09 | <Botje> | > let splitlist [a] = (show $ take (length [a]/2) [a]) ++ " " ++ (show $ drop (length [a]/2) [a]) in splitlist [1..10] |
| 21:46:10 | <lambdabot> | add an instance declaration for (Fractional Int) |
| 21:46:14 | <Botje> | argh |
| 21:46:31 | <Botje> | > let splitlist l = (show $ take (length l`div`2) [a]) ++ " " ++ (show $ drop (length l`div`2) [a]) in splitlist [1..10] |
| 21:46:32 | <lambdabot> | Not in scope: `a' |
| 21:46:43 | <Botje> | > let splitlist l = (show $ take (length l`div`2) l) ++ " " ++ (show $ drop (length l`div`2) l) in splitlist [1..10] |
| 21:46:45 | <lambdabot> | "[1,2,3,4,5] [6,7,8,9,10]" |
| 21:46:52 | <Botje> | like that. *sigh* |
| 21:47:07 | <robertfunfun> | ace thanks |
| 21:47:30 | <Botje> | robertfunfun: although you might want to take a look at the standard splitAt function |
| 21:47:52 | <Botje> | > let l = [1..10] in splitAt (length l`div`2) |
| 21:47:53 | <lambdabot> | Add a type signature |
| 21:47:55 | <robertfunfun> | does that do what i;m doing? |
| 21:48:02 | <Botje> | > let l = [1..10] in splitAt (length l`div`2) l |
| 21:48:04 | <lambdabot> | ([1,2,3,4,5],[6,7,8,9,10]) |
| 21:52:17 | <zorg0f> | is there somewhere where i can look at the definitions for all the haskell functions? foldr, map, etc. |
| 21:52:49 | <Botje> | zorg0f: hoogle is nice |
| 21:53:02 | <Botje> | haskell.org/hoogle |
| 21:53:22 | <Botje> | all standard functions are described in http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html |
| 21:53:24 | <lambdabot> | http://tinyurl.com/ovjef |
| 21:53:34 | <luqui> | hoogle doesn't give implementations, though, does it? |
| 21:54:03 | <zorg0f> | nah, it doesnt :( |
| 21:54:32 | <zorg0f> | im looking for the function definitions i.e. implimentations. |
| 21:54:50 | <DRMacIver> | @src foldr |
| 21:54:50 | <lambdabot> | foldr k z xs = go xs |
| 21:54:51 | <lambdabot> | where go [] = z |
| 21:54:51 | <lambdabot> | go (y:ys) = y `k` go ys |
| 21:55:03 | <DRMacIver> | Where does lambdabot get its sources from? |
| 21:55:13 | <zorg0f> | god :) |
| 21:55:30 | <DRMacIver> | zorg0f: ghc is open source, so presumably you can find the library sources in there. |
| 21:55:40 | <zorg0f> | ta |
| 21:55:49 | <Saizan> | http://www.haskell.org/onlinereport/standard-prelude.html <-- prelude! |
| 21:55:50 | <lambdabot> | Title: The Haskell 98 Report: Standard Prelude |
| 21:55:51 | <zorg0f> | @src map |
| 21:55:51 | <lambdabot> | map _ [] = [] |
| 21:55:52 | <lambdabot> | map f (x:xs) = f x : map f xs |
| 21:56:41 | <Binkley> | you can get to all the library sources at http://darcs.haskell.org/libraries/ |
| 21:56:43 | <lambdabot> | Title: Index of /libraries |
| 21:56:44 | <zorg0f> | saizan: excellent - cheers |
| 21:56:54 | <zorg0f> | exactly what i was looking for |
| 21:58:24 | <DRMacIver> | Hm. London hug is actually somewhere convenient for me to get to. I didn't expect that. :) |
| 21:59:32 | <Saizan> | zorg0f: some of the definitions there are quite naive, splitAt for example |
| 22:09:21 | <fasta> | Ok, this is pretty bad: I need to call two functions(lift and a specific function depending on the type of monad I want to get functionality from) to just to select that I want to have stuff computed at the ContT level. |
| 22:10:47 | <fasta> | Claiming that you just need a "small interface" of already lifted names also doesn't make sense, since it's not a "small module". |
| 22:12:05 | <fasta> | I also don't really get why there's MonadIO, but no MonadST |
| 22:16:17 | <davidL> | @seen mux |
| 22:16:18 | <lambdabot> | mux is in #haskell-overflow and #haskell. I last heard mux speak 5h 20m 34s ago. |
| 22:18:59 | <hpaste> | thoughtpolice pasted "character frequency counter" at http://hpaste.org/4 |
| 22:22:26 | <Saizan> | ?type M.insertWith |
| 22:22:28 | <lambdabot> | Couldn't find qualified module. |
| 22:22:35 | <Saizan> | ?type Data.Map..insertWith |
| 22:22:38 | <lambdabot> | parse error on input `Data.Map..' |
| 22:22:40 | <Saizan> | ?type Data.Map.insertWith |
| 22:22:42 | <lambdabot> | forall a k. (Ord k) => (a -> a -> a) -> k -> a -> Data.Map.Map k a -> Data.Map.Map k a |
| 22:28:03 | <nominolo> | dcoutts, SyntaxNinja: could you resolve that "no ping" issue? |
| 22:29:13 | <SyntaxNinja> | nominolo: yeah just now |
| 22:29:24 | <SyntaxNinja> | turns out they deleted everything on that machine because of a billing bug. |
| 22:29:48 | <SyntaxNinja> | not exactly stellar customer service. |
| 22:29:55 | <SamB_XP> | no |
| 22:29:57 | <SamB_XP> | that is not |
| 22:29:59 | <nominolo> | yikes |
| 22:30:54 | <SyntaxNinja> | so stay tuned. |
| 22:32:07 | <SyntaxNinja> | I paid for a year of service in advance, the 2nd month they decided I was delinquent and so deleted my account. |
| 22:32:42 | <monochrom> | That is very sad. |
| 22:33:33 | <SyntaxNinja> | at least we hadn't done too much, just a few hours of work getting everyones keys on there. |
| 22:34:02 | <Igloo> | SyntaxNinja: Are they giving any compensation or free extra months? |
| 22:34:19 | <therp> | ls |
| 22:34:27 | <emu> | . .. |
| 22:34:28 | <therp> | I love ion focus bugs.. sorry.. |
| 22:34:54 | <SyntaxNinja> | yeah, they offered 3 extra months. |
| 22:35:21 | <SyntaxNinja> | I'm pushing a bit, just checking if htey have backups. |
| 22:35:47 | <Igloo> | When does SoC start, BTW? |
| 22:37:29 | <encryptio> | @hoogle (a -> b -> c -> d) -> (a,b,c) -> d |
| 22:37:30 | <lambdabot> | No matches, try a more general search |
| 22:37:45 | <encryptio> | @djinn (a -> b -> c -> d) -> (a,b,c) -> d |
| 22:37:46 | <lambdabot> | f a (b, c, d) = a b c d |
| 22:39:34 | <Jedai> | @djinn |
| 22:39:34 | <lambdabot> | Cannot parse command |
| 22:42:30 | <pjd> | @djinn problem -> solution |
| 22:42:30 | <lambdabot> | -- f cannot be realized. |
| 22:42:40 | <pjd> | dang |
| 22:43:42 | <Jedai> | Too bad... |
| 22:56:26 | <nominolo> | Igloo: next monday |
| 22:57:05 | <dibblego> | why isn't class Enum a as class (Ord a) => Enum a ? |
| 22:57:16 | <Igloo> | Oh, cool |
| 23:04:36 | <lispy> | dibblego: sometimes it's just enumerated but not ordered? |
| 23:04:50 | <dibblego> | that doesn't make sense to me |
| 23:06:36 | <lispy> | dibblego: how would you order snow white's seven dwarves? |
| 23:07:07 | <dibblego> | by height of course! |
| 23:07:20 | <assl0r> | @src length |
| 23:07:20 | <lispy> | i'd by go beard length, myself |
| 23:07:21 | <lambdabot> | Source not found. I've seen penguins that can type better than that. |
| 23:07:28 | <dibblego> | how would you "order them" (since you do by implementing Enum) |
| 23:07:37 | <dibblego> | Enum implies an ordering |
| 23:07:56 | <lispy> | ?src Enum |
| 23:07:56 | <lambdabot> | class Enum a where |
| 23:07:57 | <lambdabot> | succ :: a -> a |
| 23:07:57 | <lambdabot> | pred :: a -> a |
| 23:07:57 | <lambdabot> | toEnum :: Int -> a |
| 23:07:57 | <lambdabot> | fromEnum :: a -> Int |
| 23:07:58 | <lambdabot> | [3 @more lines] |
| 23:08:11 | <lispy> | i see, succ and pred |
| 23:08:13 | <dibblego> | forall a. succ a > a -- ordering |
| 23:08:21 | <lispy> | i didn't realize succ and pred were in Enum |
| 23:08:48 | <malsyned> | is there a function already that is defined to something like myfunc f l = (filter f l, filter (not.f) l) ? |
| 23:09:02 | <lispy> | dibblego: does Ord require equality? |
| 23:09:02 | <Igloo> | partition |
| 23:09:06 | <lispy> | ?src Ord |
| 23:09:06 | <lambdabot> | class (Eq a) => Ord a where |
| 23:09:06 | <lambdabot> | compare :: a -> a -> Ordering |
| 23:09:06 | <lambdabot> | (<), (<=), (>), (>=) :: a -> a -> Bool |
| 23:09:06 | <lambdabot> | max, min :: a -> a -> a |
| 23:09:07 | <dibblego> | lispy, yes |
| 23:09:18 | <malsyned> | @hoogle (x -> Bool) - |
| 23:09:21 | <malsyned> | oops |
| 23:09:22 | <lambdabot> | Hoogle Error: Parse Error: Unexpected character '-' |
| 23:09:35 | <lispy> | dibblego: well, maybe that's the why? they didn't want to require enum to have eq? |
| 23:09:45 | <malsyned> | @hoogle (x -> Bool) -> [x] -> ([x], [x]) |
| 23:09:46 | <lambdabot> | List.partition :: (a -> Bool) -> [a] -> ([a], [a]) |
| 23:09:46 | <lambdabot> | Prelude.break :: (a -> Bool) -> [a] -> ([a], [a]) |
| 23:09:46 | <lambdabot> | Prelude.span :: (a -> Bool) -> [a] -> ([a], [a]) |
| 23:10:09 | <dibblego> | lispy, why not? forall a. succ a /= a |
| 23:10:50 | <Igloo> | That's not enough to give you an equality function |
| 23:11:08 | <nominolo> | dibblego: you can define orderings for infinite or tree-like structures |
| 23:11:12 | <Igloo> | I think the answer to your original question is that there's no need for it to |
| 23:11:15 | <dibblego> | forall a. succ $ pred a == a |
| 23:12:02 | <nominolo> | > succ $ pred (maxBound :: Int) == (maxBound :: Int) |
| 23:12:07 | <lambdabot> | True |
| 23:12:21 | <dibblego> | I think you mean minBound |
| 23:12:33 | <monochrom> | There is a requirement on monads that (return a >>= f) = (f a). This is not a requirement that monads must be Eq. |
| 23:12:41 | <nominolo> | > succ $ pred (minBound :: Int) == (minBound :: Int) |
| 23:12:42 | <lambdabot> | Exception: Prelude.Enum.pred{Int}: tried to take `pred' of minBound |
| 23:12:47 | <nominolo> | hehe |
| 23:12:54 | <dibblego> | ok |
| 23:13:17 | <lispy> | ?check \x -> succ (pred x) == (x :: Int) |
| 23:13:18 | <lambdabot> | OK, passed 500 tests. |
| 23:13:22 | <lispy> | ah, must be true |
| 23:13:25 | <lispy> | ?scheck \x -> succ (pred x) == (x :: Int) |
| 23:13:26 | <lambdabot> | Completed 13 test(s) without failure. |
| 23:13:59 | <nominolo> | ?check \x -> succ (pred x) == (x :: Bool) |
| 23:14:01 | <lambdabot> | Exception: Prelude.Enum.Bool.pred: bad argument |
| 23:14:12 | <nominolo> | ?check \x -> succ (pred x) == (x :: Int8) |
| 23:14:13 | <lambdabot> | add an instance declaration for (Arbitrary Int8) In the expression: let... |
| 23:14:32 | <nominolo> | @instances Arbitrary |
| 23:14:33 | <lambdabot> | Couldn't find class `Arbitrary'. Try @instances-importing |
| 23:14:53 | <nominolo> | @instances-importing Arbitrary |
| 23:14:54 | <lambdabot> | Couldn't find class `Arbitrary'. Try @instances-importing |
| 23:15:01 | <nominolo> | whatever |
| 23:15:38 | <nominolo> | @instances Ord |
| 23:15:39 | <lambdabot> | (), All, Any, Bool, Char, Double, Either a b, Float, Int, Integer, Maybe a, Ordering, Product a, Sum a, [a] |
| 23:16:15 | <nominolo> | @instances Enum |
| 23:16:16 | <lambdabot> | (), Bool, Char, Double, Float, Int, Integer, Ordering |
| 23:17:38 | <lispy> | data Foo = Foo Int Int -- pred (Foo x y) = Foo (x+1) y; succ (Foo x y) = Foo x (y+1) |
| 23:29:54 | <dibblego> | I agree, thanks |
| 23:34:23 | <dibblego> | to implement the Eq type-class I need to only define /= or ==, but the source to Eq clearly defines these two functions without implementations - where are the implementations that refer to each other? |
| 23:37:07 | <TSC> | My source has implementations |
| 23:37:14 | <TSC> | Which source are you looking at? |
| 23:37:14 | <lispy> | dibblego: well...you could check the report, it should give the mutually recursive definitions |
| 23:37:17 | <dibblego> | ?src Eq |
| 23:37:17 | <lambdabot> | class Eq a where |
| 23:37:17 | <lambdabot> | (==), (/=) :: a -> a -> Bool |
| 23:37:22 | <dibblego> | that source |
| 23:37:27 | <TSC> | Oh, that |
| 23:37:32 | <TSC> | That's not the real source |
| 23:37:36 | <dibblego> | where are you looking? |
| 23:37:46 | <dibblego> | why isn't it real? |
| 23:37:52 | <TSC> | /usr/share/doc/ghc6-libsrc/base/GHC/Base.lhs.gz |
| 23:38:10 | <TSC> | GHC's source |
| 23:38:28 | <TSC> | I don't know where lambdabot gets its source code from |
| 23:38:33 | <lispy> | x /= y = not (x == y) |
| 23:38:34 | <lispy> | x == y = not (x /= y) |
| 23:38:38 | <dibblego> | ok I see it, thanks |
| 23:38:43 | <lispy> | according to: http://www.cs.chalmers.se/~patrikj/haskell/haskell98-report/basic.html |
| 23:38:46 | <lambdabot> | Title: The Haskell 98 Report: Basic Types and Classes, http://tinyurl.com/2ggr5w |
| 23:39:19 | <dibblego> | lambdabot, you misled me! |
| 23:39:31 | <dibblego> | ACTION divorces lambdabot |
| 23:42:38 | <ozo_> | ?src (==) |
| 23:42:39 | <lambdabot> | x == y = not (x /= y) |
| 23:46:07 | <dibblego> | I am still divorcing! |
| 23:46:59 | <chessguy> | is Data.Time a new module? |
| 23:48:56 | <TSC> | Is that the new one that replaces System.Time? |
| 23:50:09 | <chessguy> | i don't know, its documentation is at http://haskell.org/ghc/docs/latest/html/libraries/time/Data-Time.html |
| 23:50:12 | <lambdabot> | http://tinyurl.com/2hdu4w |
| 23:50:38 | <TSC> | I think it's new |
| 23:53:25 | <jmob> | shapr: I wrote a simple paste CGI in haskell: http://reason.homeunix.org:52180/~jam/cgi-bin/paste |
| 23:55:36 | <Botje> | is there a way to get infinite-precision floats, as with Integer? |
| 23:56:29 | <monochrom> | No. |
| 23:56:32 | <augustss> | haskell doesn't come with any |
| 23:56:57 | <Botje> | bah :( |
| 23:58:33 | <Apocalisp> | Botje: try Rational |
| 23:58:44 | <augustss> | nor is it clear to me what infinite precision floats would mean |
| 23:58:49 | <jmob> | chessguy: it's part of the time package |
| 23:58:53 | <augustss> | maybe you want real numbers? |
| 23:58:55 | <petekaz> | Does hGetChar eventually call fgetc? or does it call read(2)? |
| 23:59:15 | <augustss> | or maybe fixed (but arbitrary) precision |
| 23:59:23 | <shapr> | jmob: cute! You should add hscolour support next! |
| 23:59:29 | <petekaz> | I.e., if I call hGetChar repeatedly, is it going to cause a system call to fire off upon each invocation? |
Back to channel and daily index: content-negotiated html turtle