Experimental IRC log haskell-2009-06-07

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:00:37<CSWookie>Yay! I've solved problem 1 in Project Euler!
00:00:58<CSWookie>Well, technically, I supposed you guys solved it.
00:00:59<hackagebot>Added by JohnMillikin, Sun Jun 7 00:00:02 UTC 2009.: Parser/Serializer for IEEE-754 floating-point values http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-binary-ieee754-0.2
00:01:09<mauke>> sum $ filter (\n -> n `mod` 3 == 0 || n `mod` 5 == 0) [1 .. 999]
00:01:10<lambdabot> 233168
00:01:42<BMeph>BOO-yah! ;p
00:02:22<jmillikin>Once I upload a package with a new name, which obsoletes an old package, who do I contact to have the old one removed?
00:03:04<jmillikin>I can't find any information on package renaming online, aside from that I have to ask somebody to do so.
00:04:47<Saizan>jmillikin: ross paterson is the hackagedb maintainer, cabal-devel@ is also appropriate
00:06:52<jmillikin>This cabal-devel <http://www.haskell.org/pipermail/cabal-devel/>? It appears to be concerned mainly with the development of cabal itself, not administrative tasks in hackage.
00:07:44<dever>another stupid question here, i have a list of ActionEntry, and I want to set its field actionEntryCallback action, after I initialize it, to a function that takes in the action, how do i apply that to the list?
00:08:26<jmillikin>Will just wait for Mr. Paterson to show up in IRC, I guess.
00:08:28<pumpkin>SET!??!?!
00:08:51<Saizan>jmillikin: he doesn't, you've to mail him :)
00:08:57<dmwit>pumpkin: SPIKE!!!1!
00:09:39<Saizan>dever: map (\a -> a { actionEntryCallBack = foo }) actionentrylist
00:11:52<skorpan>hm, is there any pointless version of that function?
00:11:59<skorpan>@pl \a -> a { lol = loller }
00:11:59<lambdabot>(line 1, column 9):
00:11:59<lambdabot>unexpected "{"
00:11:59<lambdabot>expecting variable, "(", operator or end of input
00:12:09<Saizan>skorpan: no
00:12:13<pumpkin>nope, unless you write a function that does it
00:12:36<Saizan>which is kind of a tautology :)
00:12:42<pumpkin>:P
00:12:52<pumpkin>ACTION hrrmpf
00:12:53<skorpan>there is no function unless there is a function
00:12:56<inimino>actually the function exists even before you write it
00:13:04<lament>ommmm
00:13:13<thoughtpolice>hi pumpkin
00:13:16<pumpkin>ACTION mumbles something about trees and forests
00:13:31<pumpkin>...that doesn't involve graph theory
00:13:33<pumpkin>thoughtpolice: ohai
00:15:58<mozzyb>\x -> x ’a’
00:16:07<mozzyb>sorry.. wrong terminal :P
00:16:20<malouin>I'm trying to make an exception type that will allow me to suggest an HTTP status code, but I'm running into problems with 'Typeable', which I don't understand...
00:16:24<malouin>http://hpaste.org/view?id=5619#a5619
00:16:45<thoughtpolice>pumpkin: 01:02 < pumpkin> omg thoughtpolice
00:16:50<Saizan>what's the error?
00:17:06<pumpkin>thoughtpolice: that was me being surprised at seeing you!
00:17:08<pumpkin>and happy!
00:17:13<thoughtpolice>:>
00:17:25<malouin>Saizan: well, the code in the pastebin gives 'Not in scope: type constructor or class `Typeable''
00:17:36<malouin>But if I import Data.Typeable, more errors.
00:18:01<Saizan>malouin: you do have to import Data.Typeable, annotate the paste with the other errors
00:18:20<Saizan>malouin: you probably need {-# LANGUAGE DeriveDataTypeable #-} at the top of the file
00:18:58<malouin>Saizan: errors pasted.
00:19:41<malouin>Saizan: ok, that fixed it! although... magic...
00:19:47<Saizan>malouin: yeah, the ability to derive instances for the Typeable class is an extension to the Haskell 98 standard
00:20:04<Saizan>malouin: so you've to tell GHC that you do want to use such an extension
00:20:17<malouin>Ok, that makes sense.
00:20:37<malouin>If I did not want to use the extension, presumably I would have to figure out how to make my exception a Typeable instance by hand?
00:21:06<Saizan>malouin: yes, but that's strongly discouraged
00:21:27<malouin>sounds good, I didn't want to anyway :)
00:21:28<Saizan>malouin: a bad Typeable instance can subvert the type system
00:21:32<malouin>eew
00:21:56<Saizan>because of cast, essentially
00:21:56<malouin>Incidentally, the docs at http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#1 seemed to me to suggest that what I attempted to do would work.
00:21:58<Saizan>?type cast
00:22:00<lambdabot>forall a b. (Typeable a, Typeable b) => a -> Maybe b
00:23:01<malouin>A note there about {-# LANGUAGE DeriveDataTypeable #-} might be helpful, since apparently it is impossible to make exceptions otherwise?
00:24:21<Saizan>malouin: it might, yeah, the place to report such things is on the libraries@ list, or you might directly send a darcs patch
00:25:39<malouin>ok, awesome.
00:25:49<malouin>I'll see if I can put something together.
00:40:31<dever>i cant remember who responded to my last question abut setting the field of a type, but it was with map, here's what I have map (\action -> action ActionEntry {actionEntryCallback = activateAction action}) actions
00:40:48<dever>but that doesn't work either :§
00:41:54<Saizan>you've to leave out the ActionEntry constructor
00:42:06<dever>ah yes, just got it there
00:42:20<xoclipse>what's the best way to get the current UTC time in microseconds?
00:42:24<xoclipse>Data.Time or System.Time?
00:42:29<dever>im too tired for this :D
00:42:55<dever>I get warnings about the attribute not being set when I initialise the list, is that alright?
00:43:58<aavogt>dever: ok if you are /sure/ that you won't want to acces those unset attributes
00:44:37<dever>well, I set them just after I initialise the list, the unset attribute needs to reference itself
00:44:57<dever>sorry, it needs to reference the element it belongs to
00:45:02<dmwit>It can do that, you know.
00:45:14<yav>dever: you should avoid having uninitialized fields
00:45:16<dmwit>foo = ActionEntry { field = someFunction foo }
00:45:19<Bacta>@fag Can I use Haskell to write Crysis 2?
00:45:19<lambdabot>The answer is: Yes! Haskell can do that.
00:45:48<aavogt>@f is this short enough?
00:45:48<lambdabot>Maybe you meant: fact fact-cons fact-delete fact-set fact-snoc fact-update faq farber flush foldoc forget fortune fptools free freshname ft . ? @ bf v
00:46:02<dmwit>?fa q
00:46:02<lambdabot>Maybe you meant: fact fact-cons fact-delete fact-set fact-snoc fact-update faq farber ft
00:46:10<dever>yav: yup, but it's an element in a list, i.e. un named
00:46:18<dmwit>Oh, come on, ?faq is the closest one.
00:46:22<dmwit>dever: No problem!
00:46:24<dmwit>:t fix
00:46:25<lambdabot>forall a. (a -> a) -> a
00:46:28<aavogt>@fap ?
00:46:28<lambdabot>Maybe you meant: faq map
00:46:57<dmwit>fix (\foo -> ActionEntry { field = someFunction foo, otherFields = initializedHereToo })
00:47:52<dever>:i fix
00:47:56<dmwit>But yes, this is why it is a warning and not an error: so that you can ignore it if you are confident nothing will go wrong.
00:48:01<dmwit>\bot doesn't have :i
00:48:10<dmwit>And ?info doesn't do what you might hope. =)
00:48:12<yav>dever: sorry if i am repeating what has been said. elements of lists can be named too.
00:48:15<aavogt>@index fix
00:48:15<lambdabot>Control.Monad.Fix, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Error
00:48:17<dmwit>?index fix
00:48:17<lambdabot>Control.Monad.Fix, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Error
00:48:36<dmwit>Data.Function isn't in that list, but it should be.
00:48:59<dmwit>(for GHC >= 6.10)
00:49:56<dever>grr, anyone know how to scroll up on a mac in irssi?
00:51:15<yav>btw, has anyone that has managed to successfully build/use the network package on windows appeared on the channel?
00:52:42<EvilTerran>yav, doesn't that come with ghc?
00:53:10<kniu>In type theory literature,
00:53:23<yav>EvilTerran: the one that comes with GHC has a bug where it crashes with a pattern match failure when you try to do host lookup
00:53:27<kniu>what's the difference between the |- character and the _____ dividing line?
00:53:38<dmwit>dever: Uh, page up doesn't work?
00:53:40<dmwit>ACTION shrugs
00:53:50<kniu>Aren't they both "assuming this, then that"?
00:54:21<EvilTerran>kniu, i've seen them used interchangably in some contexts
00:54:21<dmwit>kniu: Usually one is used in defining a relation, and the other is used in defining an inference rule.
00:54:38<yav>kniu: |- separates assumptions from conclusions, ____ separates steps in a proof
00:54:57<dmwit>For values of "usually" that should be very carefully examined.
00:55:43<kniu>I'm still kind of confused, but ok.
00:56:27<yav>kniu: i've been there :-) one way to see the difference would be to try to write a proof of something just using |-
01:02:42<theunixgeek>It's been an hour since I started building GHC. How long should it take?
01:03:32<yav>theunixgeek: it depends on your machine and how you are building it but it usually takes a while
01:03:42<theunixgeek>yav: I'm installing it via macports on OS X
01:03:57<theunixgeek>I'll just wait
01:04:00<theunixgeek>thanks for the tip
01:06:55<gwern>@quote CReal
01:06:55<lambdabot><pumpkin> says: we should throw it [CReal] in with Foreign.C.Types to confuse people
01:07:04<gwern>@quote tell.*dons
01:07:04<lambdabot>MyCatVerbs says: The *real* best way to optimize a program is to tell dons that it's been added to the Shootout.
01:07:12<roconnor>@quote narrow
01:07:12<lambdabot><roconnor> says: I have a proof that Ultrafinitism is inconsistent, but the universe is too narrow to contain it.
01:07:15<gwern>@quote quantitative
01:07:16<lambdabot>No quotes match.
01:07:24<gwern>@quote quantitative
01:07:24<lambdabot>No quotes match. Wrong! You cheating scum!
01:07:28<pumpkin>someone needs to stop quoting people with <> around their nicks :P
01:07:37<gwern>roconnor: what is ultrafinitism?
01:07:44<gwern>@quote Frankau
01:07:44<lambdabot>No quotes match. I've seen penguins that can type better than that.
01:07:51<gwern>@remember SimonFrankau The points-free approach, while elegant, can make code unreadable, especially if it is written by quantitative analysts moonlighting as functional programmers.
01:07:52<lambdabot>Done.
01:08:03<gwern>@quote bacon
01:08:04<lambdabot>gwern says: drat. what *do* all you people talk about? only one bacon and one zombie quote
01:08:14<roconnor>gwern: the belief that very large numbers don't really exist.
01:08:17<pumpkin>@quote zombie
01:08:18<lambdabot>Tac-Tics says: oerjan: I tried, but his zombie lectures were hard to follow
01:09:15<roconnor>@forget <roconnor> I have a proof that Ultrafinitism is inconsistent, but the universe is too narrow to contain it.
01:09:15<lambdabot>Done.
01:09:24<roconnor>@remember roconnor I have a proof that Ultrafinitism is inconsistent, but the universe is too narrow to contain it.
01:09:24<lambdabot>Done.
01:09:28<roconnor>@quote narrow
01:09:28<lambdabot>roconnor says: I have a proof that Ultrafinitism is inconsistent, but the universe is too narrow to contain it.
01:13:47<gwern>roconnor: exist... in what sense?
01:14:17<gwern>@quote port.*GHC
01:14:17<lambdabot>mwc says: I'm thinking we should file a bug report and require ghc to produce executables that sound like famous classical pieces
01:14:22<gwern>@quote port.*GHC
01:14:22<lambdabot>mwc says: I'm thinking we should file a bug report and require ghc to produce executables that sound like famous classical pieces
01:14:39<gwern>@remember ValarQ l33t_h4x0r: could you help me port GHC to the AVR architecture? <-- l33t_h4x0r has left #haskell
01:14:39<lambdabot>Done.
01:14:51<gwern>@quote proggit
01:14:52<lambdabot>quicksilver says: well if you can get proggit to help with your interview, then perhaps you can get proggit to help with the job when you get it. So it's not cheating, it's just an indication of one
01:14:52<lambdabot>of your skill sets.
01:14:59<gwern>@quote SharePoint
01:15:00<lambdabot>shapr says: I haven't tried F#, everytime I get the urge to do something fun with .NET I have SharePoint flashbacks and buy more hardware instead.
01:15:01<idnar>@flush
01:15:02<lambdabot>Not enough privileges
01:15:15<gwern>@quote emoticon
01:15:15<lambdabot>No quotes match. :(
01:15:26<gwern>@remember gwern bleh. haskell is messing me up. I wondered what operator =) is, before I realized it was a syntax error, before I realized it was an emoticon
01:15:27<lambdabot>Good to know.
01:15:32<gwern>@flush
01:17:29<Badger>@quote
01:17:29<lambdabot>Peaker says: It depends how much of the door you want to model. In a ray tracer, it would be quite different than in an alarm system
01:19:42<roconnor>gwern: in any sense I guess
01:19:46<roconnor>er
01:20:18<gwern>it's always hard when people say things like 'infinities don't exist', since they're probably using a different definition of exist than you are
01:20:26<roconnor>gwern: you know how you and I believe that (10^10^10^10^10) is a number
01:20:31<roconnor>they don't
01:20:41<gwern>what do they believe that is?
01:20:47<roconnor>nonsense I guess
01:20:49<dmwit>abstract nonsense
01:20:53<pumpkin>whoa, ^ is infixr
01:21:06<roconnor>gwern: well, maybe more like what we think of as bottom
01:21:13<dmwit>pumpkin: infixl would be silly
01:21:22<dmwit>pumpkin: You can get (a^b)^c by a ^ b * c
01:21:32<pumpkin>true dat
01:21:50<MyCatVerbs>:i (^)
01:21:52<gwern>roconnor: hm. so any manipulation of 10^... is bottom? 10^.. divided by 10^10^10 is bottom?
01:21:56<pumpkin>:i does nothing
01:22:02<MyCatVerbs>Of course.
01:22:09<Badger>:t (^)
01:22:10<pumpkin>@info does nothing either
01:22:10<lambdabot>does nothing either
01:22:11<lambdabot>forall a b. (Num a, Integral b) => a -> b -> a
01:22:19<dmwit>?info do { x <- foo; return y }
01:22:20<lambdabot>foo >>= \ x -> return y
01:22:20<MyCatVerbs>Oh. (^) binds tighter than (*).
01:22:23<dmwit>pumpkin: You liar!
01:22:23<roconnor>gwen, well I'm not sure about that. possibly
01:22:25<dmwit>It does something.
01:22:38<pumpkin>@info does something
01:22:39<lambdabot>does something
01:22:40<roconnor>dmwit: isn't that like saying (->) being infixr is silly?
01:22:59<dmwit>Nah.
01:23:14<dmwit>;-)
01:23:23<roconnor>dmwit: you are so unfair
01:23:33<roconnor>your a curry bigot
01:23:36<dmwit>hehehe
01:23:38<roconnor>you're
01:23:48<gwern>roconnor: oh hey, there's a wp article on ultrafinitism
01:24:15<roconnor>I try to be an ultrafinitist, but it is hard.
01:24:34<roconnor>especially without a formal theory to go with it.
01:24:37<dolio>And silly.
01:24:38<dmwit>Oh man, I just realized: that heckler in Math 53h was an ultrafinitist!
01:24:55<dmwit>Boy did the lecturer get flustered.
01:25:00<roconnor>dolio: i'm not sure it is silly.
01:25:27<roconnor>dolio: it's like programming in constructive logic, only your programs never run out of memory.
01:25:29<gwern>roconnor: hm. it seems to suggest that the criteria is physically realizable; but deciding whether a physical arrangement 'means' a number is as hard, philosophically, as deciding what characterizes conscious physical arrangements imo
01:25:55<roconnor>gwern: I think it depends also depends on the representation
01:26:12<dmwit>So, this is Kolmogorov complexity applied to philosophy?
01:26:26<gwern>that's the issue. even 10^10^10^10^10^10^10 has a hysical representation - I just gave it
01:26:29<roconnor>for example, there are exponentially fewer peano natural numbers than binary natural numbers.
01:26:33<dmwit>There is no number bigger than what can actually be represented (in any chosen representation) using the resources available in the universe?
01:27:04<pumpkin>so you can't count all the chess games?
01:27:07<pumpkin>or all the go games?
01:27:08<idnar>dmwit: how could you conceive of a specific number that cannot be represented?
01:27:09<roconnor>I say, if I cannot normalize the value in Coq, then it doesn't exist :P
01:27:09<dmwit>ACTION writes down, "This is the smallest number not representable in any other way."
01:27:11<bremner>I've heard Doron Zeilberger say things like that
01:27:16<gwern>dmwit: well, isn't there a trivial notation where '1 = <whatever number you just thought was too big for me to represent>'?
01:27:21<idnar>dmwit: as soon as you describe it, you have represented it
01:27:45<dmwit>idnar: Correct. So if you can describe it, it's not the upper bound.
01:28:09<dmwit>gwern: Yes, but you have to define your notation. ;-)
01:28:14<idnar>dmwit: well, it seems pointless to hypothesize whether numbers that you cannot describe exist or not
01:28:17<roconnor>The problem is that if I'm not an ultrafinitist, then I think I have a formal proof of the Riemann Hypothesis in Coq.
01:28:34<gwern>roconnor: ?
01:28:35<inhahe>i'm some kind of ultraconstructivist in math, but as far as big numbers goes, it seems to depend on what one means by a numebr. for example in the wiki article it says that they don't bleieve in the floor of e^e^e^79. well, if you define it as floor(e^e^e^79), then the number exists by definition. if oyu define it as a decimal sequence, then it depends on whether an algorithm for that suffices
01:28:58<gwern>dmwit: *my* notation? why don't you translate your natural number-based notation into my new notation? seems just as fair to me
01:29:10<dmwit>gwern: Totally.
01:29:12<inhahe>i think it's irrelevant how big the universe is -- only wether a number has actually been represented or not
01:29:16<dmwit>gwern: Either notation has to be described.
01:29:26<roconnor>gwern: I "wrote" a Coq tactic to search all proofs in PA whose code is less than 10^10^10^10^10^10^10 for a proof of RH.
01:29:27<dmwit>gwern: It just turns out that mathematicians have already described *my* notation for me.
01:29:43<pumpkin>roconnor is the master of Coq
01:29:45<gwern>roconnor: did it ever terminate?
01:29:51<roconnor>gwern: not yet
01:29:55<roconnor>it's still going
01:29:58<gwern>pumpkin: your bad jokes will cock this discussion up
01:30:06<pumpkin>onoes :(
01:30:06<roconnor>but none the less, I think I'm the first.
01:30:28<roconnor>pumpkin: the jokes don't phase me anymore.
01:30:36<roconnor>It's been 7 years
01:30:36<pumpkin>:)
01:30:39<pumpkin>I bet
01:30:39<dmwit>ACTION high-fives roconnor
01:30:43<pumpkin>imagine working at inria
01:30:45<gwern>roconnor: 'faze'
01:30:49<Adamant>I'll avoid the obvious chicken choking jokes.
01:30:54<dmwit>Level Up! +1 to maturity
01:30:58<MyCatVerbs>roconnor: faze, faze! FAAAZE!
01:31:15<pumpkin>ACTION resisted the temptation to correct faze, knowing well that one of the 587 other people would've done it
01:31:16<roconnor>oh
01:31:20<roconnor>pumpkin: the jokes don't faze me anymore.
01:31:23<roconnor>ya
01:31:23<dolio>They get pretty old after looking at about 3 articles on Coq on reddit.
01:31:24<dmwit>?wn faze
01:31:26<roconnor>that looks way better
01:31:34<pumpkin>faze is like taze
01:31:40<pumpkin>or laze
01:31:40<lambdabot>Error: thread killed
01:31:42<Berengal>phase is like star trek
01:31:51<dolio>Since those are the only comments that ever get posted there, since no one knows enough to comment on the actual content of the articles, typically. :)
01:31:52<dmwit>roconnor: Unless you wanted to say that the jokes don't cause you to spontaneously shift throw walls and stuff, which I guess is also true.
01:32:00<dmwit>s/throw/through/
01:32:04<roconnor>:)
01:32:07<pumpkin>I was unfazed as I tazed Berengal while I lazed on the hammock
01:32:09<inhahe>i thnik a hand-held fazer would be awesome
01:32:36<gwern>dolio: no kidding. I wince when I see coq articles - I have to resist the temptation since I don't know coq at all
01:32:38<dmwit>I'll take a tasp over a fazer any day.
01:32:39<Berengal>phasers are also fazers, when set to stun
01:32:43<roconnor>gwern: or does my proof not count until Coq finishes type checking?
01:33:08<gwern>roconnor: was there a proof of fermat's last theorem before wile finished his proof?
01:33:09<idnar>dmwit: muphry's law strikes again!
01:33:19<dmwit>=)
01:33:24<idnar>roconnor: how do you know it'll succeed?
01:33:29<roconnor>gwern: depends on if you are an ultrafinisist or not. :)
01:33:35<Berengal>Bah, I'm being smug on the internet again :(
01:33:46<pumpkin>ACTION desmugs Berengal
01:33:46<Berengal>Haskell makes it hard not to be...
01:34:13<Badger>ACTION phases pumpkin
01:34:15<gwern>roconnor: mm. I'd identify that as a platonic/construcitvist argument, but I suppose ultrafinitists are a subset of constructivists...
01:34:37<malouin>Is there some way to clean up catch (catch f (\onetypeofe -> ...)) (\anothertypeofe -> ...)?
01:34:51<dever>can anyone tell me why this is returning [[ActionEntry]] opposed to [ActionEntry], I can't for the life of me figure it out :) http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5621#a5621
01:34:53<roconnor>idnar: let me try a different tact
01:34:55<roconnor>tack
01:35:11<roconnor>idnar gwern: I did run it to completion, and it worked.
01:35:35<roconnor>I ran it on a super fast secret computer and started it going in the 1980s
01:35:45<pumpkin>is it a cray? :o
01:35:47<roconnor>here you go
01:35:51<gwern>roconnor: remember me when you're rich!
01:35:53<roconnor>you can try it yourself too
01:36:09<dmwit>dever: I figured it out.
01:36:17<aavogt>dever: you're using the list monad and return is (:[])
01:36:19<dmwit>dever: GHC is balking at the 1024-line columns.
01:36:26<idnar>roconnor:
01:36:26<roconnor>hmm
01:36:29<idnar>er
01:36:30<dmwit>err... 1024-column lines
01:36:31<roconnor>maybe that argument doesn't work
01:36:36<idnar>roconnor: so you found the proof, but you don't know what it is? or you just can't communicate it to someone else?
01:36:49<dolio>Don't tactics find proofs?
01:36:55<Berengal>dever: 'do' does not do what you think it does
01:36:58<dolio>Are they proofs themselves?
01:37:13<roconnor>idnar: ah good point. I suppose if did a search I could have written down what the result was.
01:37:23<dmwit>dever: But yeah, you probably don't want a do-block at all; just "let actions = [...] in map (\action -> ...) actions"
01:37:26<dolio>An algorithm to check all proofs less than 10^10... isn't a proof. The thing it finds (if it does) is.
01:37:36<dever>that could be it
01:37:55<gwern>roconnor: I was thinking 'well, what was the haskell output?' :)
01:38:03<dmwit>dever: In particular, even if you take the return out (which will then cause it to type-check), you won't have initialized the callback fields.
01:38:22<idnar>that suggests the question: "does a non-constructive proof of the existence of a proof of X count as a proof of X?"
01:38:27<roconnor>dolio: it's a bit strange. It seems proof checking should be polynomial in the size of the proof, but that certainly isn't how Coq and the like work.
01:38:38<gwern>dever: of course, if we have a proof that the search will find the desired proof of x, then I guess by transivity we then have a proof of x
01:38:46<roconnor>Freek thinks that proof checking should be linear in the size of the proof.
01:38:53<dmwit>...and you'd have a big ol' list of copies of the action entries.
01:39:02<pumpkin>roconnor: seems like it should depend on how expressive your proof language is shouldn't it?
01:39:12<roconnor>Coq is very expressive.
01:39:13<pumpkin>roconnor: as said by someone who knows nothing about the topic (me)
01:39:17<idnar>I feel like Goedel is about to jump out from behind the wall and scream at me
01:39:28<dolio>roconnor: I don't really know coq at all, so I may be wrong.
01:39:34<roconnor>but not expressive enough to evaluate itself :P
01:39:38<gwern>idnar: godel doesn't scream. he stares at you mournfully and refuses to eat
01:39:43<gwern>idnar: because you are trying to poison him
01:40:05<roconnor>dolio: I think your comments are on the mark
01:40:23<idnar>gwern: well, I suppose it's more like going around a corner and tripping over Goedel's dead body
01:40:29<roconnor>I guess the result is that Coq "proofs" are not really proofs.
01:40:35<roconnor>or not always proofs
01:40:50<dolio>Agda has some kind of "ring solver" thing in the standard library, apparently, which you can use in lieu of writing down your arithmetic proofs manually, which seems similar to coq's machinery.
01:40:51<roconnor>which is odd for a proofs system...
01:41:09<roconnor>dolio: this problem goes beyond the tactic language.
01:41:23<roconnor>dolio: I can easily write ackermann in Agda, etc
01:41:54<roconnor>and program a proof term to search up to Ackerman(some number) without using the tactic language at all.
01:42:15<roconnor>thus making a compressed proof.
01:42:32<dolio>Sure. Agda doesn't hae a tactic language.
01:42:48<roconnor>dolio: oh the ring solver is in Agda?
01:42:51<roconnor>that's cool
01:42:52<dolio>Right.
01:42:55<dolio>Yeah. :)
01:43:30<roconnor>anyhow, there is something about proofs and proof objects and size and type checking and maybe ultrafinitism that I don't really fulling get yet.
01:43:38<roconnor>fully
01:47:26<dolio>Man, I can't remember where I saw an example of its use.
01:49:00<dolio>Oh, I remember. In Data.Nat.DivMod
01:49:32<wli>What representation is used by Data.Nat?
01:50:30<dolio>"solve 1 (λ x → x := x :+ con 0) refl _" presumably computes a proof of x == x + 0 for use in their proof of something else.
01:50:37<dolio>It uses Peano numbers.
01:51:07<wli>Suckage.
01:52:27<dolio>There's Data.Digit, though.
01:53:06<dolio>Also, you can use some pragmas to optimize Nat in agda to be internally represented as, I suspect, Haskell's Integer.
01:53:24<wli>I'd use [Word32] or something.
01:53:27<dolio>While still allowing you to do proofs using the Peano representation.
01:53:36<wli>(wrapped somehow)
01:53:42<dolio>There is no Word32. :)
01:53:58<pumpkin>http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord32
01:54:14<pumpkin>ACTION stares at his spoon
01:54:20<dolio>That's not an Agda library.
01:54:31<pumpkin>oh :)
01:54:42<pumpkin>that'll teach me to jump in without context again, /me zips his mouth
01:54:48<dmwit>pumpkin: I think you mistook this #agda channel for #haskell again.
01:54:54<gwern>he needs a long spoon who would sup with the Devil.
01:54:55<idnar>heh
01:54:56<pumpkin>oh no!
01:55:13<dolio>Data.Digit has "Digit : Nat -> Set", where "Digit b" is the type of base-b numbers.
01:55:43<pumpkin>how far does it go? 62?
01:55:59<pumpkin>or does it not care about actually showing it?
01:56:32<dolio>It's represented as lists (maybe a custom type) of 'Fin b's.
01:56:44<dolio>Fin b being the finite set of size b.
01:57:21<dolio>Is there fancy showing of Fins? I can't remember.
01:58:23<dolio>Looks like no.
01:58:47<dolio>I may be wrong, too. It looks like "Digit" is just an alias for "Fin".
01:59:24<dolio>And some fanciness for going between digits and chars.
01:59:40<dolio>And digit lists and Nats.
02:01:48<dolio>One could probably flesh it out to do digit-list-based arithmetic if he wanted.
02:02:49<dolio>But then, why bother when it'd probably be slower than special-cased Nat? :)
02:04:56<dmwit>ACTION asks for succ 0 in base 0
02:05:35<roconnor>dmwit: concat (repeat [])
02:05:39<dolio>Fin 0 is the empty set, so I'm not sure you can even represent 0.
02:06:03<dolio>Assuming 0 is represented by "fzero :: []".
02:06:24<dmwit>roconnor: Coq has those pesky termination guarantees that get in the way of having infinite inductive lists.
02:07:00<roconnor>dmwit: right, you cannot define concat as such
02:07:10<roconnor>but in Agda you can :P
02:07:16<dmwit>I would think repeat would be the one giving you trouble.
02:07:20<dolio>repeat is the problem.
02:07:26<roconnor>repeat is productive
02:07:32<dmwit>Also: oh yeah, we're talking about Agda, not Coq.
02:07:40<idnar>coqda
02:07:45<roconnor>Agda 2 might have codata
02:07:48<dolio>Well, concat is bad for codata, repeat is bad for data.
02:07:59<roconnor>oh right
02:08:04<roconnor>concat works fine on data
02:09:28<roconnor>@seen luqui
02:09:28<lambdabot>I saw luqui leaving #haskell-blah and #haskell 16h 6m 16s ago, and .
02:16:07<smorg>If i have something like: [ y | x <- [1..10], let y = 2*x, y >= 10 ] which == [10,12,14,16,18,20] what is the function of y? Replacing the first predicate with let y = x yields [10]. If y is acting as a variable of type list, it doesn't make sense that you would be able to both test y (as a list) against an integer with y >= 10, and multiply the whole list x by 2 and assign it to y.
02:17:23<smorg>is haskell taking every element of an input list and checking its properties against a set of constraints?
02:17:27<dolio>y has type Integer (or whatever).
02:17:56<dmwit>smorg: Neither x nor y are lists there.
02:18:27<dmwit>smorg: For any given (x,y) pair, x is an element of [1..10].
02:18:51<dolio>x is the element you're selecting from [1..10], and y is a name for 2*x.
02:19:24<dmwit>> [ x | x <- [1..10] ]
02:19:26<lambdabot> [1,2,3,4,5,6,7,8,9,10]
02:19:39<dolio>You're removing the cases for which y < 10, and the resulting list contains the ys such that the guard is satisfied.
02:19:45<dmwit>> [ 3 | x <- [1..10] ]
02:19:47<lambdabot> [3,3,3,3,3,3,3,3,3,3]
02:20:32<smorg>ooh i see. This seems like it would take some serious artificial intelligence to solve complicated constraint problems like that
02:20:53<dmwit>Yep, we don't do constraint solving in list comprehensions.
02:21:02<dmwit>However, we have a constraint-solver monad, if you want that. =)
02:21:05<lament>@faq Can haskell solve complicated constraint problems using some serious artificial intelligence?
02:21:06<lambdabot>The answer is: Yes! Haskell can do that.
02:21:30<lament>this one comes up all the time
02:21:47<smorg>wow :D
02:23:41<MyCatVerbs>@faq Can Haskell design arcane neurosurgical procedures to rewire a burnt-out hacker's nervous system so that it can manipulate him into taking part in a grand human-consciousness processing experiment? While aforementioned hacker is spaced out on lysergic, mescaline, psychobilin, valium, vaseline...
02:23:41<lambdabot>The answer is: Yes! Haskell can do that.
02:23:44<Fragsworth>what are the best online references for haskell?
02:23:55<pumpkin>vaseline?
02:23:55<Fragsworth>references and tutorials
02:24:07<gwern>MyCatVerbs: vaseline?
02:24:17<Axman6>Fragsworth: learn you a haskell for great good, real world haskell,... um
02:24:22<dmwit>?where hhl
02:24:22<lambdabot>I know nothing about hhl.
02:24:29<dmwit>http://www.haskell.org/ghc/docs/latest/html/libraries/
02:24:32<dmwit>?where hoogle
02:24:32<lambdabot>http://haskell.org/hoogle
02:24:34<Axman6>@where lyah
02:24:34<MyCatVerbs>http://www.haskell.org/ghc/docs/latest/html/libraries/
02:24:35<lambdabot>www.learnyouahaskell.com
02:24:39<lament>learn you a real world haskell for great good!!!
02:24:50<MyCatVerbs>^-- HHL.
02:24:53<dmwit>?where report
02:24:54<lambdabot>http://www.haskell.org/onlinereport/
02:25:06<Tarrant>Learn you a haskell is really awesome. Thats the tutorial I've been using.
02:25:08<dmwit>The ones I listed are references; the ones other people listed are mostly tutorials.
02:25:10<lament>hhl is the ultimate page of awesome
02:25:17<aavogt>MyCatVerbs: psilocybin?
02:25:22<smorg>> [ (3, 4) | x <- [0..5], y <- [0..5] ]
02:25:23<lambdabot> [(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3,4),(3...
02:25:24<dmwit>?where gentle (The Gentle Intro is my favorite tutorial)
02:25:25<lambdabot>http://www.haskell.org/tutorial/
02:25:54<MyCatVerbs>aavogt: yeah, I fail. Still not as hardcore as mainlining petroleum jelly, though.
02:25:57<dmwit>?where+ hhl http://www.haskell.org/ghc/docs/latest/html/libraries/
02:25:58<lambdabot>Done.
02:26:23<MyCatVerbs>Oh, should we link to the 6.10.3 HHL instead of latest?
02:26:34<MyCatVerbs>Latest gets a bit unstable around release times.
02:26:36<dmwit>I think latest is fine.
02:26:48<dmwit>It never needs to be updated in lambdabot.
02:27:01<dmwit>And given \bot's capability for remembering updates, I'd say that's a darn good thing.
02:27:12<dolio>Mainlining pretrolium jelly?
02:27:12<MyCatVerbs>I suppose.
02:27:17<dolio>That sounds like it'd just kill you.
02:27:18<dmwit>(I personally have added hhl to the where database at least three times now.)
02:27:36<MyCatVerbs>dolio: Probably. Hardcore, isn't it? :)
02:27:43<dolio>Totally.
02:28:39<Axman6>Fragsworth: oh and #haskell is probably one of the best haskell learning resources there is around
02:28:45<gwern>@flush
02:29:41<Eiler>> [ y | x <- [1..10], let y = 2*x, y >= 10 ]
02:29:42<lambdabot> [10,12,14,16,18,20]
02:29:52<dmwit>gwern: thanks =)
02:29:55<lament>#haskell is full of these ridiculously smart people whose main entertainment in life is explaining complicated stuff to people hundreds times less intelligent than them
02:30:15<dmwit>s/less intelligent than them//
02:30:23<dmwit>We just explain it hundreds of times. ;-)
02:30:26<Axman6>like Cale and his woncderful fold explanations
02:30:34<smorg>Fragsworth: I'm working through a few different books which all seem quite good: http://book.realworldhaskell.org/read/ http://learnyouahaskell.com/ http://en.wikibooks.org/wiki/Haskell and http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf
02:30:37<MyCatVerbs>lament: I'm not so sure about the "hundreds of times less intelligent than them" bit. Considering the quantity of people who migrate from the latter set to the former, it seems unlikely.
02:30:42<smorg>I'll probably solidify which I like best as I go along
02:31:08<lament>MyCatVerbs: being around smart people makes one smarter
02:32:13<MyCatVerbs>lament: that warrants two responses. 1) Being around intelligent people certainly doesn't make one any more intelligent.
02:32:26<lament>MyCatVerbs: i disagree!
02:32:55<Jedai>lament: I think that depends on what you do around these people
02:33:02<lament>MyCatVerbs: do you think intelligence is hereditary or random?
02:33:11<Jedai>lament: and what you call intelligence of course...
02:33:15<MyCatVerbs>lament: 2) yes, but only if one tries real hard to catch up. "Smart" is a function of how people use their brains' capacity for reasoning, not just the capacity itself.
02:33:18<lament>MyCatVerbs: evidence seems to be against both those theories
02:33:22<Berengal>I believe intelligence is very much based on knowledge, myself...
02:33:59<smorg>I have craptons of knowledge... it doesn't make up for the ADHD, trust me :b
02:34:04<MyCatVerbs>lament: I suspect that it's hereditary and dietary, and varies with general health.
02:34:09<Berengal>I don't see myself as very smart, but I've always had a good memory, which has lead others to believe I am
02:34:13<lament>you may believe it's based on knowledge, but i KNOW it's based on belief!
02:34:20<idnar>hahaha
02:34:27<BMeph>lament: My personal definition of genius is making complicated subjects understood easily. You could likely guess my opinion of bureaucracies from that. ;)
02:34:35<lament>BMeph: :)
02:34:39<Jedai>intelligence is probably a product of gene, environment and effort
02:34:57<gwern>if we absorb and emit intelligence osmotically, then we will be pulled down to the average. and as this is IRC, it *is* 'pulled down'
02:35:00<Axman6>effort pfft
02:35:11<lament>Jedai: and environment is basically being around smart people
02:35:35<Jedai>lament: sure it helps, if you make the effort of learning from these people
02:35:36<smorg>Jedai: I agree. If you aren't curious, you could be very smart but utterly useless. Like trying to teach a Dog how to do math. The dog just doesn't care, even if it had the capacity.
02:35:55<aavogt>@wn osmosis
02:35:55<lament>plenty of very smart people don't care about math
02:36:10<lambdabot>Error: thread killed
02:36:17<MyCatVerbs>gwern: Not necessarily! Electronic communication has the wonderful property that it's very very easy to pick who you're going to talk to.
02:36:27<smorg>or [insert any discipline which requires reasoning]
02:36:45<gwern>ACTION shnubs MyCatVerbs
02:36:52<Jedai>lament: it depends on what you call smarts
02:36:58<Berengal>lament: Presumably because they have no use for it, and recognize that. If that's not the case then I'd say it isn't very intelligence of them
02:37:31<aavogt>@wn diffusion
02:37:47<lambdabot>Error: thread killed
02:38:07<lament>speaking of math, does anyone know how would one describe the state of a lava lamp at a given moment?
02:38:12<lament>(not a haskell question)
02:38:28<gwern>lament: as a bunch of baryonic particles in 4D
02:38:42<roconnor>a bundle of vibrating strings
02:38:43<MyCatVerbs>gwern: easier than that, even. The people whom you are snubbing do not even have to know that they are being snubbed by you!
02:39:15<lament>by "describe" i meant "model mathematically without particles"
02:39:20<smorg>Is there some huge mathematical significance to fold that I just haven't run across yet? Everyones always talking about folds.
02:39:53<lament>smorg: mathematical, not really
02:40:03<BMeph>Groovy! ;p
02:40:14<lament>smorg: but do read bananas, lenses, envelopes, and barbed wire
02:41:03<travisbrady>smorg: might be worth checking this out www.cs.nott.ac.uk/~gmh/fold.pdf
02:41:28<lament>smorg: also, http://foldl.com/
02:41:53<pumpkin>don't forget foldr.com
02:42:19<lament>pumpkin: foldr is much harder to click
02:42:25<smorg>found http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.41.125&rep=rep1&type=pdf
02:42:40<lament>yeah, that one
02:42:42<aavogt>hmm, foldM.com taken
02:42:43<Berengal>If I ever write a paper, I'm going to try my best to name it something like "Bases, who do they really belong to? How over 9000 barrel rolls performed for great good did not go alone, but took this. Also, the real subject matter."
02:43:45<pumpkin>so if we could distinguish between data and codata in haskell, it would make sense to say that fold operates on data and scan operates on codata?
02:43:46<lament>Berengal: i'd love to be a professor of anatomy and write a paper "How is babby formed"?
02:43:51<pumpkin>(just reading sigfpe's post on that)
02:44:41<mauke>http://lambda-the-ultimate.org/node/1760
02:45:38<lament>mauke: hah
02:46:05<smorg>Reminds me of building natural numbers in peano arithmatic
02:49:01<roconnor>pumpkin: if we could distinguish between data and codata, where would poor data Domain = Domain (Domain -> Domain) go?
02:49:04<roconnor>;(
02:49:10<pumpkin>:o
02:49:24<pumpkin>beats me, all I know is what sigfpe's blog post told me :)
02:49:29<mauke>off to the lambda cave!
02:49:33<dmwit>lament: Just get vimperator; then clicking on either foldl.com's or foldr.com's link is as easy as hitting 'f' on your keyboard. =)
02:49:55<Badger>mauke: but lambdaman, what can we do?
02:50:37<smorg>Actually i was expecting some kind of javascript fork bomb when hitting '...'
02:50:42<edwardk>pumpkin: note in your tweet you computed for an U.S. butts. In international units the result should be somewhat smaller. Or will more fit because the units are smaller...
02:50:47<dmwit>Using this technique, and holding down 'f', I have managed to determine that \infty = 211+()
02:50:56<dmwit>not sure what an instance Num () would look like, though.
02:51:25<edwardk>er i guess that took a turn towards #haskell-blah.
02:51:34<pumpkin>edwardk: just a little ;)
02:51:46<pumpkin>edwardk: I'd respond to that, but people would think I'm an ***hole
02:51:52<mauke>instance Num () where fromInteger _ = (); _ + _ = (); _ - _ = (); _ * _ = ()
02:52:55<edwardk>Bah, you're just the one doing the measuring ;)
02:53:28<edwardk>mauke: heh i have instances for the monoid and multiplicative instances for () in that vein ;)
02:53:34<pumpkin>lol
02:53:42<edwardk>er instances for the ... classes
02:54:41<Axman6>@quote syntax error
02:54:42<lambdabot>No quotes for this person. My brain just exploded
02:54:48<Axman6>@quote syntax
02:54:48<lambdabot>ghc says: Illegal binding of built-in syntax
02:54:51<Axman6>@quote syntax
02:54:51<lambdabot>monochrom says: Time flies like an arrow. Fruit flies like a banana. Syntax rules like a macro.
02:55:03<Axman6>bleh
02:55:30<Axman6>i was looking for "gwern: bleh. haskell is messing me up. I wondered what operator =) is, before I realized it was a syntax error, before I realized it was an emoticon" which i think is classic
02:55:48<gwern>@quote emoticon
02:55:49<lambdabot>gwern says: bleh. haskell is messing me up. I wondered what operator =) is, before I realized it was a syntax error, before I realized it was an emoticon
02:56:10<gwern>ACTION helps
02:56:22<Axman6>heh
02:57:56<dmwit>?quote syntax.error
02:57:57<lambdabot>gwern says: bleh. haskell is messing me up. I wondered what operator =) is, before I realized it was a syntax error, before I realized it was an emoticon
02:57:58<dmwit>ACTION too
02:58:10<Axman6>i knew there was some syntax for spaces
02:58:31<dmwit>it's pcre
02:59:40<Axman6>ah right
02:59:59<Axman6>surely ' ' matches a space?
03:00:41<gwern>@quote syntax' 'error
03:00:42<lambdabot>No quotes for this person. Where did you learn to type?
03:00:52<gwern>guess not
03:01:01<mauke>@quote a((.+)+)+[bc](?!)
03:01:01<lambdabot>Plugin `quote' failed with: regex failed: (ReturnCode 13,"Invalid preceding regular expression")
03:01:04<pumpkin>ACTION has been coding haskell for almost 7 months!
03:01:12<pumpkin>time flies
03:01:48<roconnor>me has been coding haskell for almost 7 years
03:02:25<Berengal>I've been at it for about 11 months... although with some serious time off in the middle somewhere
03:02:41<performance>what is /lib/libtinfo.so.5 ?
03:03:03<dmwit>?quote gwern syntax error
03:03:03<lambdabot>gwern says: bleh. haskell is messing me up. I wondered what operator =) is, before I realized it was a syntax error, before I realized it was an emoticon
03:03:11<Berengal>Also, I just found a paper on L-Systems and music. Music was the reason I wrote an L-System implementation in the first place...
03:03:27<gwern>pumpkin: but do fruit flies like banana?
03:03:30<Berengal>ACTION goes off to read
03:03:31<dmwit>Axman6: ?quote has a slightly strange syntax; if it sees a space, it assumes everything before it is a nick, and everything after is a re.
03:03:46<performance>Berengal: so you can generate music like plants?
03:03:49<pumpkin>gwern: not sure :) it's funny, banana is my nick on another network :P
03:03:51<performance>like pictures of plants
03:03:56<pumpkin>gwern: I'd be inclined to say yes though
03:04:05<mauke>ACTION generates pictures of music
03:04:06<Berengal>performance: plant music
03:04:08<Berengal>Also, fractals
03:04:09<brian6>how to understand what is the first version of ghc to contain the fix for http://hackage.haskell.org/trac/ghc/ticket/2594 ?
03:04:25<gwern>ACTION wonders if pumpkin knows the allusion and is playing along, or is just playing it straight
03:04:26<Berengal>mauke: That was the overarching reason
03:04:39<pumpkin>gwern: I don't!
03:04:48<performance>Berengal: link please? i would like to read that paper too and if you want a scape goat to try your program , im here
03:04:50<gwern>but can I believe you?
03:05:10<pumpkin>gwern: nothing I can say will affect the situation
03:05:25<gwern>a suspiciously meta statement!
03:05:29<Berengal>performance: http://www.modularbrains.net/support/SteliosManousakis-Musical_L-systems.pdf
03:06:08<pumpkin>DmdAnal
03:06:21<pumpkin>that makes three Anals in ghc that I know of
03:06:33<performance>Berengal: i read a lot about LM systems and fractals, chaos theory turtle graphics :) but this was a while back.
03:06:41<dmwit>brian6: Since the bug is closed before the release of 6.10, it's probably at least safe there.
03:07:05<performance>but i never used any of that for anything, expect toplay with logo
03:07:13<dmwit>brian6: But that's just a guess. The bug is certainly sufficiently vague. =P
03:07:25<brian6>dmwit: yeah, ok. thanks. wish the tracker showed that a little more clearly.
03:08:04<Berengal>performance: The idea just struck me the other day. I'd been thinking about computer generated music a few weeks back, but all of a sudden I got this vision of fractals and music at the same time, so I decided to go check it out
03:08:23<performance>did you use Haskore?
03:08:53<Berengal>performance: Nah, I haven't gotten to the music part yet. I'm probably going to check it out once I've fine-tuned the graphics bit and added non-determinism
03:09:20<performance>you should probably join haskell-art if you havent already
03:10:10<Berengal>I was just about to say I'm no musician or artist in any other way yet. I barely even know what a chord is...
03:11:19<roconnor>anyone here a font geek?
03:11:35<pumpkin>ACTION , sort of
03:12:01<roconnor>pumpkin: do I need a san-serif font for the title on the cover of my book?
03:12:41<performance>if for a moment you keep the whole fractal/generator part aside, i am at a loss to find a relation between a fern and any music
03:12:44<performance>structure
03:13:38<pumpkin>roconnor: people usually use sans-serif for titles, but it depends on whether you want a distinctive style on it
03:14:31<Axman6>roconnor: use comic sans
03:14:35<pumpkin>lol
03:14:40<pumpkin>everyone's favorite :)
03:14:41<roconnor>:)
03:14:43<Axman6>or papyrus
03:14:44<performance>which parameter of the strucutre of music follows which pattern of the structure of a fern?
03:14:54<performance>but not wingdings
03:15:19<mauke>IMPACT
03:15:27<mauke>the image macro font
03:15:38<roconnor>pumpkin: you can see my existing font at http://r6.ca/thesis.pdf
03:15:51<roconnor>(I have a higher resolution background image elsewhere)
03:16:25<Axman6>i'd go with sans there
03:16:32<roconnor>ya
03:16:36<roconnor>I'm coming around to that
03:17:01<RyanT5000>what font is that? it has an interesting ampersand
03:17:53<Berengal>performance: Well, take the dragon curve for example. It starts simple at one end, grows bigger and more complex until the middle, then smaller and simpler again until you've reached the end. Music can also follow a similar pattern, starting with a simple structure, then using only that structure to build bigger more complex structures
03:18:09<Berengal>Then simplifying down again at the end
03:18:09<roconnor>DejaVuSeriv
03:18:11<roconnor>Serif
03:18:18<lament>the arch design
03:18:20<RyanT5000>ah, i see
03:28:47<performance>most popular music is like that already, and is also kind of built one simple structures which repeat often
03:32:47<roconnor>ugh, fonts are so ugly
03:32:56<roconnor>at least DejaVuSans isn't terrible.
03:34:14<roconnor>ACTION is tempted to use bold semi-condensed for the subtitle
03:35:12<pumpkin>roconnor: even the serif doesn't look bad, but I think a sans would look better
03:35:30<Axman6>me too
03:41:55<roconnor>pumpkin: http://img198.imageshack.us/img198/8722/coversans.png
04:04:12<hackagebot>Added by RohanDrape, Sun Jun 7 04:01:57 UTC 2009.: Haskell Open Sound Control http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hosc-0.7
04:04:33<pumpkin>roconnor: looks better, I think
04:04:46<mmorrow>, fft (fmap ((:+0) . fromIntegral) [0..2^14-1])
04:04:48<lunabot> [1.34209536e8 :+ 0.0,(-8192.000000011176) :+ 4.27228291999282e7,(-8192.0)...
04:05:37<pumpkin>, ft (map ((:+0) . romIntegral) [0..2^14-1])
04:05:38<lunabot> luna: Not in scope: `ft'
04:05:42<pumpkin>:(
04:05:48<pumpkin>CPE
04:06:42<wli>Discrete FFT's could be interesting, e.g. in GF(257).
04:07:03<pumpkin>http://www.apfloat.org/ntt.html !
04:08:21<mmorrow>, let x >< y = let f = fft . fmap (:+0); g = fmap (\(a:+_)->a) . ifft in g (zipWith (*) (f x) (f y)) in [1..4] >< [7..10]
04:08:23<lunabot> [86.0,80.0,86.0,88.0]
04:09:09<mmorrow>, let x >< y = let f = fft . fmap (:+0); g = fmap (\(a:+_)->a) . ifft in g (zipWith (*) (f x) (f y)) in let a = [0.20,0.30,0.30,0.20] in a >< a
04:09:10<lunabot> [0.25,0.26,0.25,0.24]
04:09:14<hackagebot>Added by RohanDrape, Sun Jun 7 04:08:34 UTC 2009.: Haskell SuperCollider http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-0.7
04:09:21<pumpkin>> product [7..10]
04:09:23<lambdabot> 5040
04:09:37<pumpkin>ah
04:10:11<pumpkin>that's meaningless
04:10:45<pumpkin>(my multiplication)
04:11:18<hackagebot>Added by RohanDrape, Sun Jun 7 04:10:34 UTC 2009.: Haskell Meapsoft Parser http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmeap-0.7
04:15:21<pumpkin>, fft ([1..4] :: [Complex Double])
04:15:22<lunabot> luna: No instance for (GHC.Enum.Enum
04:15:30<pumpkin>oh :(
04:15:54<pumpkin>if they're going to make a shitty instance of Enum for Double, they may as well make one for Complex too
04:16:01<mmorrow>heh
04:16:19<mmorrow>ACTION refuses to use the Double Enum out of principle :)
04:16:25<pumpkin>, fft (map fromIntegral [1..4])
04:16:27<lunabot> [10.0 :+ 0.0,(-2.0000000000000004) :+ 1.9999999999999996,(-2.0) :+ 0.0,(-...
04:17:03<pumpkin>, map (^2) . fft . map fromIntegral $ [1..4]
04:17:04<lunabot> [100.0 :+ 0.0,3.552713678800501e-15 :+ (-8.0),4.0 :+ (-0.0),(-4.440892098...
04:17:11<pumpkin>, ifft . map (^2) . fft . map fromIntegral $ [1..4]
04:17:12<lunabot> [26.0 :+ (-2.220446049250313e-16),20.0 :+ (-2.6107046212364704e-15),26.0 ...
04:17:25<mmorrow>here's a frequency spectrum of a .wav computed with lunabot's fft http://moonpatio.com/images/swinglow.png
04:17:28<wli>ACTION is completely falling down on trying to implement CPO-STV.
04:17:40<pumpkin>swing low, sweet chariot
04:18:01<mmorrow>http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=1902
04:18:29<pumpkin>, map realPart . ifft . map (^2) . fft . map fromIntegral $ [1, 2, 1, 1]
04:18:30<lunabot> [6.0,6.0,7.0,6.0]
04:18:44<mmorrow>ahhh, realPart... i was trying to remember that..
04:20:20<hackagebot>Added by RohanDrape, Sun Jun 7 04:19:49 UTC 2009.: Haskell data flow library for audio processing http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hdf-0.7
04:24:04<Axman6>how nice, hackagebot gives useful info now
04:24:26<Axman6>, typ fft
04:24:27<lunabot> luna: Couldn't match expected type `GHC.Base.String'
04:24:35<Axman6>, typ "fft"
04:24:38<lunabot> "[Data.Complex.Complex GHC.Types.Double]\n-> [Data.Complex.Complex GHC.Ty...
04:24:59<Axman6>, text . typ "fft"
04:25:01<lunabot> luna: Couldn't match expected type `a -> GHC.Base.String'
04:25:05<pumpkin>, typ "typ"
04:25:08<lunabot> "GHC.Base.String -> GHC.Base.String"
04:25:11<Axman6>, text . typ $ "fft"
04:25:14<lunabot> [Data.Complex.Complex GHC.Types.Double]
04:25:14<lunabot> -> [Data.Complex.Complex GHC.Types.Double]
04:26:21<hackagebot>Added by RohanDrape, Sun Jun 7 04:25:25 UTC 2009.: haskell supercollider graph drawing http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-dot-0.7
04:27:35<pumpkin>wow, this is really annoying, I can't ctrl+c out of the ghc testsuite
04:28:02<pumpkin>a kill did it :)
04:29:22<hackagebot>Added by RohanDrape, Sun Jun 7 04:28:55 UTC 2009.: Unsafe Haskell SuperCollider http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-unsafe-0.7
04:30:53<mmorrow>Axman6: http://hackage.haskell.org/packages/archive/pure-fft/0.2.0/doc/html/src/Numeric-FFT.html#fft
04:31:56<pumpkin>I love how elegant the dft function is
04:32:12<pumpkin>minus the !! :P
04:38:02<malouin>0607043428:~/src$ ls
04:38:02<malouin>darcs targz
04:38:22<malouin>luckily the the alphabet and UNIX are consonant-voice sensitive, otherwise these would be the same directory.
04:43:25<hackagebot>Added by RohanDrape, Sun Jun 7 04:42:19 UTC 2009.: Haskell SuperCollider SoundFile http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-sf-0.7
04:45:15<BMeph>malouin: Which alphabet - English? 'Cause there's no "T" in Hawaiian (I remember that from a TV special hosted by...Mr. T). :)
04:46:04<wli>ACTION could probably use someone turkey walking me through CPO-STV implementation.
04:50:26<hackagebot>Added by RohanDrape, Sun Jun 7 04:49:49 UTC 2009.: Haskell Music Theory http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmt-0.1
04:54:53<mmorrow>pumpkin: ah yeah, i forgot about that (!!) hiding in there... it could be eliminated surely (although the motivation is low since it's slow anyways :)
04:56:20<mmorrow>hmm, actually i'm not sure if you could eliminate (in the sense that any way you cut it you'll be doing the same thing.. now that i look more closely)
04:56:37<mmorrow>oh wait
04:57:26<mmorrow>yeah, it can go, that used to be in the fft too, but got replaced with the `go' in that one
04:57:59<mmorrow>good thing fft only calls dft with lists of length 2 :)
04:59:56<dmwit>You know what's a little bit frustrating? Bits of development where you spend a really long time doing something that are totally invisible in the front-end.
05:02:12<pumpkin>instead of feeling like your work won't be appreciated, feel smug that you know something they don't ;)
05:02:42<pumpkin>(that's BS, I know the feeling)
05:07:07<malouin>BMeph: ASCII / latin
05:08:06<malouin>;)
05:13:34<licksjp>Hello
05:15:15<BMeph>Hello, licksjp. Just soaking in the hask-tosphere, or do you have a specific concern? ;)
05:18:02<licksjp>I have installed haskell in my fedora10
05:18:23<licksjp>I don't find the hugs
05:18:31<licksjp>where is it?
05:19:23<licksjp>I installed yum
05:22:11<Tarrant>licksjp: Take a look for ghc
05:24:54<licksjp>Does talk type command lose?
05:26:08<Tarrant>licksjp: ?
05:26:55<licksjp>Does talk type command lose in huskell?
05:27:24<licksjp>Tarrant,ghc is only compiller
05:28:26<inimino>licksjp: try ghci
05:29:02<licksjp>oh
05:29:33<licksjp>inimino, see the talk line screen
05:29:44<licksjp>inimino, ty
05:49:40<hackagebot>Added by BryanOSullivan, Sun Jun 7 05:48:55 UTC 2009.: An efficient packed Unicode text type http://hackage.haskell.org/cgi-bin/hackage-scripts/package/text-0.3
06:08:36<licksjp>See you,again
06:12:39<Twey>Hm... I could have sworn there used to be a #haskell-jp
06:12:56<inimino>"talk line screen" was clear enough ;-)
06:13:01<Twey>Hehe
06:13:47<Twey>That's actually a pretty good kenning
06:13:50<inimino>"does Haskell have an REPL?" "No, even better..."
06:13:55<Twey>We should use that name officially
06:13:56<Twey>Yeah :-D
06:13:59<Twey>We have a TLS!
06:14:26<inimino>^.^
06:15:16<Twey>Hm
06:15:28<Twey>Why are there no Hackage docs navigable from http://hackage.haskell.org/cgi-bin/hackage-scripts/package/text-0.3?
06:16:18<Ycros>usually it means the build failed... but usually there's also a log file. Maybe it didn't get built?
06:16:52<Ycros>Twey: see how when you go to 0.2 is says "built by: ghc-6.10"
06:17:55<Ycros>Twey: seeing as it was uploaded not too long ago, the docs probably haven't been built yet
06:18:03<Twey>Ah
06:18:13<bos>Better Unicode support in the text package: http://bit.ly/9E6sa
06:18:36<bos>I only uploaded it a few minutes ago
06:18:55<Ycros>Twey: you can generate your own docs, if you run "cabal haddock"
06:20:02<Ycros>or maybe cabal install with --enable-documentation
06:23:15<Twey>bos: *nods*
06:32:25<dmwit>> '\0xdf'
06:32:27<lambdabot> <no location info>:
06:32:27<lambdabot> lexical error in string/character literal at chara...
06:32:31<dmwit>> 0xdf
06:32:32<lambdabot> 223
06:32:34<dmwit>> '\223'
06:32:35<lambdabot> '\223'
06:32:54<dmwit>Oh, I get it.
06:34:12<idnar>> '\xdf'
06:34:14<lambdabot> '\223'
06:34:34<idnar>> '\0223'
06:34:35<lambdabot> '\223'
06:34:57<idnar>> ord '\223'
06:34:58<lambdabot> 223
06:35:00<idnar>wtf
06:35:21<idnar>isn't that an octal number everywhere else?
06:35:27<dmwit>> 0o223
06:35:29<lambdabot> 147
06:35:32<dmwit>> '\0o223'
06:35:33<lambdabot> <no location info>:
06:35:34<lambdabot> lexical error in string/character literal at chara...
06:35:38<dmwit>> '\o223'
06:35:39<lambdabot> '\147'
06:35:50<dmwit>idnar: ...no. =)
06:36:02<idnar>by "everywhere else" I mean "other programming languages"
06:36:10<dmwit>Oh, well, then yes.
06:36:11<idnar>oh well, I always use hex escapes anyway
06:36:20<idnar>(I mean, octal? wtf)
06:48:14<jimmyjazz14>question about monads, I am using a function that does returns (IO Bool) and I was going to use it in a if/else statement but if takes Bool
06:48:41<dmwit>do notation time!
06:48:57<dmwit>do { x <- thingWithAnIOBool; if x then trueThing else falseThing }
06:49:16<jimmyjazz14>ah yes
06:49:34<BMeph>do { x <- thingWithAnIOBool; return $ if x then trueThing else falseThing }
06:49:37<jimmyjazz14>its there a way around having to unpack to x like that?
06:49:41<jimmyjazz14>*is
06:49:46<dmwit>Nope! =)
06:50:27<jimmyjazz14>ah, just seems like a little more code then would normally seem needed, but not a big deal
06:54:14<jimmyjazz14>I get `The last statement in a 'do' construct must be an expression` when using if/else
06:54:32<Twey>fmap (trueThing ?? falseThing) thingWithAnIOBool
06:54:42<dmwit>jimmyjazz14: I'm guessing indentation.
06:54:44<dmwit>?hpaste
06:54:44<lambdabot>Haskell pastebin: http://hpaste.org/new
06:54:46<idnar>@type (??)
06:54:48<lambdabot>Not in scope: `??'
06:54:53<idnar>wut?
06:54:57<Twey>If you have ‘(y ?? n) p = if p then y else n’
06:55:01<Twey>idnar: Not built-in :(
06:55:06<idnar>ah
06:55:31<idnar>like C's ?: except backwards
06:55:49<idnar>I suppose you can't exactly do p (y ?? n) = ...
06:55:51<jimmyjazz14>dmwit: indentation was the problem, damn whitespace
06:56:14<Twey>idnar: The point is that it's backwards.
06:56:23<idnar>that too
06:56:25<Twey>p (y ?? n) would be if'
06:56:35<idnar>I was just getting sidetracked
06:56:42<Twey>You never want to curry on the no-branch; you want to curry on the predicate
06:57:39<jimmyjazz14>should I switch to Hugs while I am learning haskell? GHC error messages throw me off a lot and I had heard Hugs was better about that.
06:57:46<dmwit>nah
06:58:00<dmwit>Just take your time.
06:58:09<dmwit>They're readable enough with a little practice.
07:13:28<Axman6>> let p ? (y,n) = if p then y else n in even 4 ? ("Yep","Nope")
07:13:30<lambdabot> "Yep"
07:14:33<Axman6>that's defined in the LLVM package i think
07:17:38<Cale>jimmyjazz14: At first if you don't know what the error messages mean, make use of the fact that you're given a line number, so you can start by looking at the code around that point. Also, if all else fails, we can help :)
07:18:32<jimmyjazz14>Cale: Thanks, the channel has been extremly helpful in my learning experience
07:18:34<Cale>jimmyjazz14: Also, you might already know this, but whitespace is much easier to get right if you make sure that your editor converts all tabs to spaces. (Most editors have such a feature)
07:19:25<Axman6>jimmyjazz14: i never found hugs errors all that much more useful
07:19:43<Cale>After that, the rule is basically that things which are logically at the same level should start in the same column -- note that while we might call this indentation, the actual amount of whitespace on the left edge is not as important as which character starts the block.
07:20:16<Cale>Well, things at the same level start in the same column, and things which are part of something else start in a deeper column.
07:20:26<Fragsworth>Is there a nice shell for haskell similar to ipython for Python? (with tab completion, etc.)
07:20:40<Axman6>ghci?
07:20:47<Axman6>it has tab completion
07:20:58<Axman6>works a lot like this...
07:21:06<Cale>The actual rule is more forgiving than that, but if you follow this idea, you should always get something correct.
07:21:15<Axman6>> let fibs = 1 : 1 : zipWith (+) fibs (tail fibs) in fibs
07:21:17<lambdabot> [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,1...
07:21:24<Twey>@let (y ?? n) p = if p then y else n
07:21:25<lambdabot> Defined.
07:22:09<Twey>> fmap ("yes" ?? "no") $ Maybe True
07:22:10<lambdabot> Not in scope: data constructor `Maybe'
07:22:14<Twey>Er
07:22:17<Twey>> fmap ("yes" ?? "no") $ Just True
07:22:19<lambdabot> Just "yes"
07:22:28<Twey>ACTION dies.
07:22:47<Axman6>quite OT, but this is realy cool, and probably quite important for out future energy needs: http://www.youtube.com/watch?v=GbLRKN3srUs&feature=sdig&et=1244305777.78
07:22:51<Axman6>really*
07:22:54<Twey>I've been at this for a year and a half now and I still mix up data and type constructors
07:23:02<Cale>jimmyjazz14: For example, even though it's not strictly required to do so, applying this rule to if/then/else dictates that since the 'then' and 'else' are siblings, they should start in the same column, and since they're both part of the 'if', they should start in a column which is deeper than it.
07:23:11<Cale>jimmyjazz14: So you get things which look like:
07:23:13<Cale>if foo
07:23:15<Cale> then bar
07:23:19<Cale> else quux
07:23:21<Cale>Or:
07:23:25<Cale>if foo then bar
07:23:29<Cale> else quux
07:23:44<Cale>jimmyjazz14: Make sense? :)
07:27:54<jimmyjazz14>Cale: yeah
07:29:35<jimmyjazz14>I'm using haskell-mode in emacs which seems to sometimes get indentation a little wrong sometimes
07:30:19<jimmyjazz14>auto indenting a block of haskell code is not pretty in emacs
07:32:24<Tarrant>jimmyjazz14: Its nto that much better in vim.
07:37:54<juhp_>anyone working on bindings to webkit?
07:38:42<Axman6>ACTION isn't sure what haskell webkit bindings would do, but would like to know
07:39:51<Tarrant>Build the interface for a browser in haskell?
07:42:56<Axman6>seems you'd need more than webkit bindings for that though. i guess the webkit-gtk stuff is the best place to start
07:43:42<Cale>jimmyjazz14: Oh, yeah, it can be annoying. I ended up using the simple-indent mode.
07:43:57<Cale>(though I use vim a lot more myself)
07:44:24<Tarrant>How is Yi's indenting?
07:57:10<ksf>Tarrant, it's better.
07:58:07<ksf>juhp_, I quickly looked into it, and we should have a TK, first.
07:58:28<ksf>...or generally, rendering layer.
07:59:16<juhp_>Tarrant: yeah that would be the idea or at least allow embedding webkit into gtk apps say
07:59:24<ksf>I couldn't find any xml descriptions to use to generate bindings to webkit-gtk, either.
07:59:38<ksf>there's mozembed
07:59:43<juhp_>ksf: toolkit?
07:59:49<ksf>yes
07:59:49<juhp_>ksf: it segfaults for me
08:00:03<ksf>well, but we _do_ have it :)
08:00:18<juhp_>true
08:00:38<juhp_>also webkit is fast
08:21:34<kuribas>jimmyjazz14: Use my haskell indentation mode.
08:22:08<kuribas>http://kuribas.hcoop.net/haskell-indentation.el
08:26:15<ivanm>kuribas: is it possible to have all the fancy C-c C-= keybindings work with your indentation mode?
08:27:45<kuribas>ivanm: What does that do again?
08:28:17<ivanm>inserts and = sign, and lines up all the = signs above it in the same function (for pattern matching, etc.)
08:29:08<kuribas>It doesn't do it now, but I guess it should be possible.
08:30:14<ivanm>it seems to be in haskell-indent.el rather than haskell-mode.el :s
08:33:26<kuribas>yes
08:35:47<performance>has any one installed Leksah lately? [ with ghc 6.10.3 ? ]
08:37:07<Ycros>yep
08:37:16<kuribas>ivanm: I'll put it on my TODO list.
08:37:28<ivanm>thanks kuribas
08:38:02<ivanm>on another note, your documentation at the beginning of the .el file is wrong: it says to use 'turn-on-haskell-indenting or something, which doesn't exist :s
08:38:22<Ycros>performance: are you having issues installing it?
08:38:25<kuribas>oh
08:38:51<performance>yarcos, not yet, but thehome page has special instructions for 6.10.2
08:39:11<Ycros>yes, they work for 6.10.3
08:39:20<performance>ok. thanks
08:39:38<performance>so just have to get gtk2hs from source, and the rest of it is through cabal right?
08:39:59<Ycros>performance: yep
08:40:20<performance>thanks :)
08:41:01<performance>and if getting for the first time, shouldn't darcs get is to be used isntead of darcs get --partial
08:41:03<performance>?
08:42:37<dmwit>performance: Depends on whether you care about the history or about how long it takes.
08:42:48<dmwit>--partial is fast(er), but doesn't grab the whole history
08:43:30<Ycros>performance: dunno, I didn't grab anything out of darcs
08:43:37<ivanm>of course, for some repos, you _have_ to use --partial because there's some breakage somewhere if you try and get the whole thing... >_>
08:43:56<ivanm>so should we start talking about the performance of GHC just to confuse/annoy performance? :p
08:47:23<performance>ivanm, no
08:47:35<ivanm>awwwwww
08:47:51<performance>Ycros, what did you do? where did you get gtk2hs from then?
08:48:32<mike-burns>http://haskell.org/gtk2hs/download/
08:48:40<Ycros>performance: tarball
08:48:58<Peaker>Who's the main man behind Haskell prime?
08:49:27<performance>hmm any way it finished very fast, if run into issues, i'll get the tar ball too
08:49:57<ivanm>Peaker: there's someone behind it? :o
08:50:37<Peaker>ivanm: I donno
08:52:11<Ycros>Peaker: maybe it created itself
09:01:28<barbseven>can someone please help me i am new to java programming, and im using BuleJ to create a simple game, how would i go about adding some music to the game?
09:02:18<joga>this may not be the right channel to ask that..
09:02:23<barbseven>????\
09:04:13<dcoutts>barbseven: perhaps try asking in the #java channel
09:05:04<Botje>sigh, the downside of being a biggish channel
09:06:42<Twey>I don't get how people can join #haskell and think it's a Java channel
09:06:47<ivanm>well, there was the case of someone (last year?) who googled programming help and thus found his way here, whom we half-way converted to haskellianism
09:06:58<ivanm>he thought this was a general-purpose programming channel :/
09:07:12<dmwit>I think it would be funny for ##java to send people here for help as a prank.
09:07:25<Botje>"haskell? that can't be a real programming language!"
09:07:40<ivanm>@slap dmwit
09:07:42<lambdabot>ACTION beats up dmwit
09:07:45<ivanm>don't give them any ideas!
09:07:47<Twey>Heh
09:07:52<Twey>Don't give them ideas :-P
09:07:57<Twey>ACTION chuckles.
09:09:16<dibblego>does Data.Array have a constant time length function?
09:10:06<Beelsebob>interesting, we seem to have moved on - software engineers have stopped ignoring FP, and started ridiculing it
09:10:08<dmwit>It should, yes.
09:10:17<dmwit>dibblego: Are you asking what the function is, or whether it's constant-time?
09:10:19<Beelsebob>now we only need to go through fighting it and us winning :)
09:10:28<dibblego>dmwit, both
09:10:34<dmwit>:t bounds
09:10:36<lambdabot>forall i e. (Ix i) => Array i e -> (i, i)
09:10:40<dibblego>ah thanks
09:10:45<ivanm>Twey: well, yes, my statement can be taken two ways
09:10:52<ivanm>s/taken/interpreted/
09:11:03<Botje>Beelsebob++ for the gandhi reference
09:13:11<deeflex>I have a list [a] where a is an instance of a data type (String,String,Float) with getters "from","to" "dst". I would like to calculate for each distinct "from", the sum of all "dst".
09:13:36<dmwit>:t groupBy
09:13:38<lambdabot>forall a. (a -> a -> Bool) -> [a] -> [[a]]
09:13:41<dmwit>:t sort
09:13:42<lambdabot>forall a. (Ord a) => [a] -> [a]
09:13:45<Botje>sort by comparing from, group by from, count then up
09:13:45<dmwit>err...
09:13:47<dmwit>:t sortBy
09:13:48<lambdabot>forall a. (a -> a -> Ordering) -> [a] -> [a]
09:14:18<dmwit>deeflex: Play around with those a bit. =)
09:16:16<deeflex>This is my only (failed) attempt. groupBy (\x y -> from x == from y) [DistElement "a" "to1" 1.0, DistElement "b" "to2" 2.0, DistElement "a" "to3" 1.0]
09:17:14<deeflex>but that results in three elements, not two as I want it. :)
09:17:44<Botje>yeah
09:17:49<Botje>you need to sort by from first
09:18:18<Botje>groupBy ((==) `on` from) . sortBy (compare `on` from)
09:18:27<Botje>(on is in Data.Function)
09:18:39<deeflex>ye I had problems with that one last night
09:18:43<deeflex>'on' that is
09:19:11<deeflex>"can't find module Data.Function". So I need another way
09:19:18<Botje>@src on
09:19:18<lambdabot>(*) `on` f = \x y -> f x * f y
09:19:30<Botje>or just write the lambdas yourself as you did for groupBy
09:22:53<deeflex>Botje, ok, but how do I use the src for on. Do I create a new file and import it where I want to use it?
09:23:27<Botje>for example
09:23:33<Botje>or just include it when you need it
09:23:45<Botje>it's just a prettier way of writing \x y -> foo x `compare` foo y
09:24:17<mmorrow>import Data.Function (on)
09:24:22<deeflex>ok
09:24:34<mmorrow>import Data.Function -- or just this to get all of the module
09:24:48<Botje>11:19 < deeflex> "can't find module Data.Function". So I need another way
09:24:48<ivanm>mmorrow: he says ghc[i] can't find Data.Function
09:24:57<mmorrow>oh, what ghc version?
09:25:01<mmorrow>(before 6.8?)
09:25:03<deeflex>no Hugs
09:25:06<mmorrow>oh
09:25:10<ivanm>ahhhh
09:25:10<Botje>brrr
09:25:28<Twey>@src on
09:25:29<lambdabot>(*) `on` f = \x y -> f x * f y
09:25:31<mmorrow>you may have to define it then, i'm not sure where it is in hugs (if anywhere)
09:25:32<Twey>Define that
09:25:37<Twey>It's nowhere in Hugs
09:28:15<ziman>i've already asked once but i'm quite curious about this; http://codepad.org/lTxA58kh should split a SQL dump into one-file-per-table parts (it's already a stripped down version); but it does not work in O(1) space and gradually eats all available memory. Does anybody see why?
09:30:11<ziman>if I use Data.List.Split.split, the behavior is the same and if I use (const True) as the predicate (thus only one line per section), the program works in constant space
09:30:58<ziman>but the memory doesn't free up between sections/files when there's this hasPrefix predicate
09:32:43<performance>Ycros: did you get any error messages about gtksourview2 not beign found?
09:33:18<ivanm>performance: you have to have gtksourceview (C-lib, not haskell) installed
09:33:47<performance>hmm
09:33:48<ivanm>and build gtk2hs with --enable-gnome
09:34:24<deeflex>Botje, The ' . ' is the composition operator, right? What is the diff. in writing groupBy (..) . sortBy (...) [a] --- AND --- groupBy (...) (sortBy (...) [a]) . The latter works, while the first yields an error.
09:34:55<ivanm>deeflex: you need a $ somewhere to tell hugs that you've stopped forming a function and want to apply it
09:35:06<ivanm>e.g. groupBy (..) . sortBy (..) $ [a]
09:36:20<deeflex>Ok thanks ivanm.
09:36:42<deeflex>Well I prefer the latter anyway.. so
09:36:43<deeflex>:)
09:36:52<Botje>deeflex: yes, but it looks a bit silly
09:37:00<ivanm>and doesn't scale as well
09:37:08<Botje>if you have foo a = groupBy (....) (sortBy ... a)
09:37:23<ivanm>ACTION thinks groupSortBy should be defined in Data.List
09:38:06<ivanm>as in groupSortBy f = groupBy ((==) `on` f) . sortBy (compare `on` f)
09:38:40<performance>Ycros: i still get that error, i installed gtksoureview2 through my distro's package manager.
09:39:38<performance>did you install gtk2hs in its default location?
09:40:06<twb>Are the bytestring-mmap and mmap packages complementary, or competetive?
09:40:13<twb>That is, do they do different things, or the same thing?
09:40:14<ivanm>performance: where you install it doesn't really matter, as long as ghc knows where it is
09:41:00<Cale>deeflex: The nice thing about something like f . g . h $ x is that apart from not requiring so many parens that have to be matched, it also makes clear lots of various ways of breaking the computation down into smaller parts: f . g, g . h, h $ x, g . h $ x, and so on are all well-typed and meaningful here.
09:41:18<dmwit>twb: They do different things, I think.
09:41:25<dmwit>twb: bytestring-mmap does not allow updates
09:41:36<dmwit>(i.e. it's read-only)
09:41:53<twb>I see.
09:42:18<Cale>deeflex: (.) is a nice associative operator, so expressions using it effectively have more subexpressions than they otherwise would :)
09:42:21<performance>ivanm, in that case, how do i tell ghc where my --prefix for gtk2hs is when doing ghc --make Steup.lhs ?[ probably findable by hunting the man page..]
09:42:29<deeflex>Cale, ok :>
09:42:32<ivanm>hmmmm?
09:42:37<ivanm>why are you using ghc --make ?
09:42:46<mornfall>Well, bytestring-mmap is a subset of mmap.
09:43:31<twb>OK, so I need both for hashed-storage.
09:43:40<twb>I thought maybe cabal-debian was being a bit too inclusive
09:44:02<mornfall>twb: Hm. I'll rip bytestring-mmap out then.
09:44:04<Ycros>performance: did you rebuild gtk2hs after you installed gtksourceview2?
09:44:13<performance>nope
09:44:18<performance>thats what struck me just now
09:44:23<mornfall>twb: The thing is I used bytestring-mmap in hashed-storage until it turned out that I need the more powerful API from mmap.
09:44:32<mornfall>twb: But I didn't get around to converting all calls to mmap.
09:44:40<performance>ivanm, to speed up instead of runhaskell everytime
09:44:42<twb>mornfall: is it going to cause problems when Darcs uses bytestring-mmap?
09:44:51<ivanm>performance: >_>
09:44:54<mornfall>twb: Ah. Well, we should maybe switch darcs to mmap as well.
09:44:58<twb>i.e. will they "fight"?
09:44:59<twb>Nod.
09:45:03<mornfall>No fighting.
09:45:07<ivanm>I don't think that will make much of a difference...
09:45:18<twb>I suggest making a task for that in the Darcs BTS.
09:45:32<twb>Presumably even if they won't fight, using the same API for both will be less sucky.
09:45:37<performance>it was given on the cabal README, so i just adopted it :)
09:45:56<mornfall>twb: For darcs, the the advantage with mmap would be that it works on Win32, unlike bytestring-mmap.
09:45:56<twb>mornfall: shall we move this discussion to #darcs?
09:46:40<performance>ivanm: what is >_> ?
09:46:51<ivanm>an emoticon ;-)
09:46:59<performance>for...
09:47:44<smorg>you mean O_o isn't a monad?
09:48:09<performance>looks like a dont care got into a sequence operator :)
09:49:38<ivanm>"disbelief, looking around shiftily [when alternating (>_>) and (<_<)]"
09:49:43<ivanm>^^ according to wikipedia
09:49:56<kyevan>Compose is confusing...
09:50:02<kyevan>I don't know WHY, but it is
09:51:19<dmwit>You think composition is confusing... wait until you try to claw your way up the abstraction ladder through functors, natural transformations, adjoints, monads, universal elements, and the Yoneda lemma.
09:51:40<dmwit>ACTION made it to stage 3 of 6
09:51:57<performance>kyevan: what is confusing about it?
09:52:10<kyevan>I don't know.
09:52:13<dmwit>hehe
09:52:20<dmwit>kyevan: Composition glues together two functions.
09:52:22<kyevan>It seems like it shold be simple but I somehow /can't quite get it/
09:52:27<dmwit>The output of one becomes the input of the other.
09:52:28<performance>:) well then it will go away
09:53:36<performance>ugh.. i wanted to sleep early yesterday, to watch the FO finals today morning .. but im just installing and configuring my linux box now
09:53:41<aleator>Hi all. I've got algorithms and datastructures to lecture. What is your favourite exotic algorithm/datastructure?
09:54:00<performance>not exotic but redblack trees and tries :)
09:54:19<dmwit>Composition takes a transformer, and a function that produces values that can act as inputs to the transformer, and applies the transformer to all the outputs of the function.
09:54:27<dmwit>aleator: Skip lists are neat!
09:54:40<performance>if it suits the theme.. BDDs are cool too
09:55:27<kyevan>> map ((+) 1) [1, 2, 3, 4, 5]
09:55:29<lambdabot> [2,3,4,5,6]
09:55:43<dmwit>> map (+1) [1, 2, 3, 4, 5]
09:55:45<lambdabot> [2,3,4,5,6]
09:55:57<dmwit>Actually, a more literal translation is
09:55:57<performance>oh as for algos, hashing is always top:) that way you can talk about the birthday paradox also and get your class excited
09:56:03<dmwit>> map (1+) [1, 2, 3, 4, 5]
09:56:04<lambdabot> [2,3,4,5,6]
09:56:07<kyevan>Og. You can do that? o.O
09:56:20<kyevan>I didn't know you could partially apply operators as operators.
09:56:27<dmwit>kyevan: Yep, it's special syntax for partial application of operators.
09:56:32<aleator>Next lecturer already booked red-blacks, but skip lists and tries are neat.
09:56:38<kyevan>Awesome ^_^
09:56:51<dmwit>Oh, in the realm of hashing, cuckoo hashing is the tops!
09:57:21<RayNbow>@google cuckoo hashing
09:57:22<lambdabot>http://en.wikipedia.org/wiki/Cuckoo_hashing
09:57:22<lambdabot>Title: Cuckoo hashing - Wikipedia, the free encyclopedia
09:58:06<dmwit>If you get too many collisions... just start over with a new hash! O_o
09:58:29<dmwit>And yet you get some beautiful theoretical run-time guarantees, and good performance in practice.
09:58:35<aleator>RayNbow: I already have cuckoos. I love the condition "If you have infinite loop, reserve more space" :)
09:59:14<dmwit>Let's see... what else did I get excited about in algorithms class?
09:59:16<RayNbow>aleator: or kill more cuckoos :p
09:59:40<dmwit>O(n) median was neat, but doesn't take too long to explain.
10:00:17<dmwit>Are you doing sorts?
10:00:26<dmwit>Radix sort is neat for people who haven't seen it.
10:00:41<ivanm>bogosort! :p
10:00:50<dmwit>It's fun to show it to people and then ask why the famous O(n * log n) bound on all sort algorithms doesn't apply. =)
10:01:03<aleator>Sorts were in the previous course, incl. radix sort. People were getting drowsy after 5th sorting method :)
10:01:04<performance>i found that merge sort is a hit with the class :) easy to have the class do it while they learn
10:01:12<ivanm>dmwit: radix sort requires some other criteria to be valid though, doesn't it?
10:01:19<dmwit>ivanm: Yep.
10:01:28<aleator>performance: I was forbidden to sort people according to size :P
10:01:36<ivanm>aleator: heh
10:01:41<dmwit>ivanm: The O(n * log n) bound only allows comparisons; radix sort does more than compare, and that accounts for the discrepancy.
10:01:46<performance>no give them data, like name etc
10:01:48<aleator>Damn this era of political correctness
10:02:19<dmwit>Oh, there's always graph algorithms.
10:02:24<aleator>I gave them numbers.. (And I was not allowed to use either one or zero there!)
10:02:26<ivanm>aleator: why, is it discriminatory to say that one person is taller than another?
10:02:30<dmwit>Kruskal's, Prim's, Djisktra's, A*, etc.
10:02:32<RayNbow>@hoogle bogosort
10:02:32<lambdabot>No results found
10:02:43<RayNbow>wait, no one has made a bogosort yet? :p
10:03:20<aleator>ivanm: Apparently there has been issues of height in basic school leading to traumatized uni-students...
10:03:28<ivanm>aleator: :/
10:03:44<kyevan>> [1..]
10:03:45<ivanm>aleator: in _Finland_? or is your /whois info misleading me?
10:03:46<lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28...
10:04:21<aleator>Yeah. We actually have a lecturer that is forbidden by faculty council to talk about women, old people, or people of color during his lectures.
10:04:50<ivanm>aleator: due to sexism, etc.?
10:04:55<aleator>ivanm: There is just 1 hypersensitive student who raises a fuss, not general culture.
10:05:03<ivanm>ahhh
10:05:20<dmwit>What, he can't talk about old people? Like Alonzo Church or Alan Turing? ;-)
10:05:22<aleator>No, he said "this is easy for a white man" - an old saying and this resulted in the ban.
10:05:47<ivanm>aleator: is it? never heard of it before...
10:05:52<performance>Ycros: grrh, now it says: Configuring leksah-0.4.4.1...
10:05:54<performance>Setup.lhs: At least the following dependencies are missing:
10:05:55<performance>glib >=0.10, gtk >=0.10, gtksourceview2 >=0.10.0
10:06:16<dmwit>performance: Check whether those libraries are available with "ghc-pkg list".
10:06:28<aleator>ivanm: a finnish thing. Not really racist, but from more incorrect times.
10:06:29<dmwit>performance: I'll bet they're available, but only under user or so.
10:06:45<ivanm>aleator: *nod*
10:07:03<dmwit>performance: (There's global and user libraries. When configuring, it defaults to global, and hence won't use user libraries, but cabal install defaults to user...)
10:07:48<performance>ram:$ ghc-pkg list | grep glib
10:07:49<performance>vector:/~/pax/ghc/leksah/leksah-0.4.4.1
10:07:54<performance>no results
10:08:36<Botje>ziman: have you tried changing mySplit to use take and drop?
10:08:38<dmwit>Install it, then?
10:09:02<dmwit>oh, wait
10:09:14<dmwit>performance: Have you installed gtk2hs?
10:09:23<performance>umm, how do i? its not a cabal package. and my package manager says i already have gtk+ :D which obviously do
10:09:36<dmwit>performance: There should be instructions on the gtk2hs website.
10:11:20<ivanm>performance: this gtk+ is different from the gtk it's talking about
10:11:36<performance>umm i cant find any instructions , just a list of deps
10:11:52<dmwit>http://www.haskell.org/gtk2hs/download/
10:12:27<dmwit>Grab a package if you happen to be on one of the systems that has one; otherwise grab the sources and build it.
10:13:21<performance>hmm. yeah i will get the tar ball now. teh darcs get --partial did not work ; may be there is a change that i dont want.
10:13:32<dmwit>did not work?
10:13:38<dmwit>Didn't work how?
10:14:31<dmwit>Gah, I have to go to bed.
10:14:48<dmwit>But say what you did and exactly what errors you got as a result; people in here will help get you straightened out. =)
10:15:21<performance>gtk2hs builds and installs fine, but Leksah does not :(
10:15:45<dmwit>But you just said ghc-pkg list didn't show glib.
10:15:51<dmwit>So obviously gtk2hs didn't install.
10:15:55<dmwit>How did you install it?
10:16:20<performance>when i try to configure Leksah it says it has un met deps . yeah where does ghc-pkg look ?
10:16:34<dmwit>...how did you install gtk2hs?
10:16:48<dmwit>Did you "runhaskell Setup.hs install" at any point? =P
10:16:57<dmwit>Because that's the critical one.
10:17:51<dmwit>uh... huh
10:17:59<dmwit>Of course gtk2hs isn't cabalized.
10:18:04<dmwit>So consider that a lie.
10:18:08<performance>ughghggh.. shoot me :(. after installing gtksourceview2 i rebuilt gtk2hs but forgot to make install it
10:18:17<dmwit>Nice. =)
10:18:41<ivanm>heh
10:19:47<performance>now Leksah error during runhaskell ./Setup.lhs build src/IDE/Completion.hs:88:18:
10:19:48<performance> Not in scope: `sourceLanguageManagerGuessLanguage'
10:20:01<dmwit>ACTION really goes to bed this time
10:21:14<MyCatVerbs>Sleep well.
10:21:16<performance>hmm i should too, but i cant sleep well until i get closure on this thing.. [the english closure not the lambda one ]
10:21:18<Ycros>performance: how did you build the gtk2hs package?
10:21:23<Ycros>performance: oh, nvm
10:21:45<performance>nevermind? hmm ok
10:22:42<performance>ram:$ ./configure --with-hc=`which ghc` --with-user-pkgconf --prefix=/home/ram/pax/gtk2hs
10:22:45<performance>just in case
10:24:55<performance>any way , thanks for the help folks, i'll get back to this after the final tomorrow
10:30:25<performance>wonder how this compiled for others, grep for sourceLanguageManagerGuessLanguage shows all occurances are just uses, its not defined anywhere?
10:38:15<performance>hmm well these are supposed to be part of gtk2hs, so something did not go right there
10:52:44<Vq^>good day #Haskell
10:53:20<Vq^>i had this idea of a fairly naïve numerical approximation framework
10:53:33<ray>ieee floats?
10:53:47<Vq^>Floating was my first thought
10:53:56<Vq^>it's mostly a toy
10:54:12<Vq^>and it only needs to find a local minimum in the error
10:54:20<Vq^>runApprox (do {x <- scalar 0 100; y <- scalar (-50) 50; let z = constructValue x y; calcError z; return z})
10:54:49<Vq^>the question is if it fits a monad
10:55:08<Vq^>my idea was to determine x and y at calcError
10:56:04<deeflex>Botje, still there? back from breakfast. Anyway..the groupby . sortby yielded the correct result, so now I want function like [[a]] -> [a] . The elements in [[a]] are grouped by 'from' (remember: DistElement from to dst). So for each group I want to create a new Distelement with the new dst as a mean value of the dsts in the group. Clear enough? :)
10:56:46<opqdonut>you basically want "map mean"
10:56:59<Botje>deeflex: i don't see what's the problem then :)
10:57:21<Botje>you know how to extract the dst from a DistElement, you know how to compute a mean, and you know how to construct a DistElement
10:57:34<Vq^>ACTION does some experiments
10:59:24<deeflex>Botje, well I'm not quite getting it to work. Hold on...
11:04:47<deeflex>Botje, map (\x -> DistElement (from (head x)) "v1" (dist (head x) + dist (tail x))/2) [[DistElement {from = "a", to = "to1", dist = 1.0},DistElement {from = "a", to = "to3", dist = 1.0}],[DistElement {from = "b", to = "to2", dist = 2.0}]] . Each element in the group will only have two elements, that's why I use tail.
11:04:48<deeflex>brb
11:05:27<Saizan_>ACTION starts a petition to save our libraries from Henning Thielemann
11:06:24<Botje>deeflex: almost correct. If you know for certain all lists will only have two elements you can use pattern matching to grab the two elements separately: \[x,y]
11:06:34<Botje>it's almost correct because tail returns a list, you want head $ tail x
11:12:42<Vq^>ACTION learns that monads doesn't quite fit his problem
11:14:42<Botje>monads are like violence: if it's not working, use more
11:15:21<PeakerWork>Vq^: I don't think it fits -- for example, I think "sequencing" two inaccurate float computations accumulates their inaccuracy, does not keep the same inaccuracy, so it shouldn't probably use the same "container" type
11:15:25<Vq^>i'd say use Arrows :o)
11:15:40<Gracenotes>:o
11:15:47<Vq^>PeakerWork: yeah, i think you're right
11:16:20<PeakerWork>Vq^: If you find it hard to see if it fits monads or arrows, just write the combinators first, and see what type-classes it fits later
11:16:21<Vq^>it's just that it would have been a nice looking interface
11:16:46<EnglishGent>hi all :)
11:16:49<PeakerWork>Vq^: after you write it you can still see that it fits monads or arrows or whatever
11:16:54<Vq^>EnglishGent: hello mr Gent
11:17:18<EnglishGent>does someone know a tutorial for using Haskell to work with HTML?
11:17:28<EnglishGent>hi Vq^ :)
11:17:35<Vq^>EnglishGent: parsing or generating?
11:18:08<bnijk>have you guys heard of this "haxe" language
11:18:09<EnglishGent>Vq^ - ultimately I want to do both - I'd like to write a web proxy in Haskell
11:18:11<EnglishGent>:)
11:18:18<EnglishGent>but I'll start with either! :)
11:18:32<bnijk>build it on top of happs, make it a noodle proxy
11:19:00<EnglishGent>happs? noodle?
11:19:05<EnglishGent>hi bnijk
11:19:08<Vq^>does your proxy need to understand HTML?
11:19:10<bnijk>hello bnijk
11:19:36<EnglishGent>yes - I want to be able to do things like extract a list of all the pages some given page links to
11:19:42<bnijk>proxies generally don't need to understand HTML, EnglishGent, unless it's gonna be parsing it - even then, better to just use XML libraries
11:19:48<bnijk>to do what little editing you want to do
11:20:04<bnijk>what is it...haxr?
11:20:25<bnijk>no, haxml
11:20:29<Isajha>Hi. I got a question on determism (as CTMCP says "a declarative operation is [...] deterministic (always gives the same results when given the same arguments)"). I understand that monads allow me to order IO operations (or anything else that needs to performed "in order"), however I really do not understand how a function in Haskell performing on any data that does not originate from...
11:20:31<Isajha>...within the program could be called deterministic? Now considering that this initial "world" state is an argument to any Haskell program, could a Haskell program be called deterministic because actually this "world" state is an argument to a Haskell program? (main :: IO ())
11:20:35<Ycros>bnijk: I have heard of the haxe language, but never used it
11:21:29<EnglishGent>I want to be able to build up a directed graph of pages - so I can render the graph using something like dot (www.graphviz.org/doc/info/lang.html)
11:21:53<MyCatVerbs>Isajha: IO actions are indeed not always deterministic.
11:22:05<EnglishGent>basically I want the proxy to remember what pages where visited & when - and the relationships between them
11:22:15<MyCatVerbs>Isajha: but running pure functions on the data that they generate is perfectly deterministic.
11:22:28<astrolabe>Isajha: You can think of the haskell program as deterministically generating a program, which then runs non-deterministically.
11:24:20<MyCatVerbs>Isajha: e.g. take the IO action (do { c <- getChar; putChar (toUpper c); }. getChar may return a completely different value every time you run this IO action. The toUpper function, however, will always return the same output when given the same input, no matter when or where you run it.
11:24:33<deeflex>Botje, ok I see. Let me try.
11:25:40<Twey>getChar >>= putChar . toUpper
11:25:40<MyCatVerbs>Isajha: you can tell from the types of things whether or not they might be non-deterministic. The non-deterministic things are the ones marked with IO. ^_^
11:25:41<Twey>>.>
11:25:52<Vq^>EnglishGent: have you seen this? http://ubietylab.net/ubigraph/
11:26:35<MyCatVerbs>Twey: I wrote it that way first, but then wasn't sure whether or not the person I'm addressing would be familiar with pointless style. :P
11:26:40<Vq^>EnglishGent: a proxy visualising the traffic in realtime with that library would be really cool :)
11:27:06<Twey>Hehe
11:27:14<Isajha>so basically there is a deterministic parts and not deterministic parts of a program
11:27:16<Saizan_>non-deterministic doesn't look like the right term
11:27:31<Isajha>the bigger the deterministic parts are the better (most likely)
11:27:33<EnglishGent>ACTION has a look
11:27:51<Isajha>*there are
11:27:56<Saizan_>depending on external factors /= not-deterministic, imo
11:28:08<EnglishGent>no - I havent Vq^
11:28:23<MyCatVerbs>Isajha: yep, you're pretty much got it in one. ^_^
11:28:32<Isajha>nice^^
11:28:45<EnglishGent>but doing it in realtime was my aim - I was inspired by the visual thesuras: http://www.visualthesaurus.com/
11:28:46<EnglishGent>:)
11:29:05<EnglishGent>so that I could have a 'map' showing me where I was in surfing sessions
11:29:13<MyCatVerbs>Isajha: IO gives you, oh, multithreading, raw pointer access (largely for C compatibility, funnily enough ^_^), syscalls...
11:29:16<EnglishGent>I figured it would be really useful for sites like wikipedia, etc :)
11:29:28<Isajha>yep that would be the next question
11:29:29<deeflex>Botje, How do I return a more precise answer? Now I got: map (\[x,y] -> DistElement (from x) "v1" ((dist (x) + dist (x))/ fromIntegral 2)) [[DistElement {from = "a", to = "to1", dist = 1.0},DistElement {from = "a", to = "to3", dist = 1.0}],[DistElement {from = "b", to = "to2", dist = 2.0},DistElement {from = "b", to="to2", dist = 1.3}]] . Returns [DistElement {from = "a", to = "v1", dist = 1.0},DistElement {from = "b", to = "v1", dis
11:29:29<deeflex>t = 2.0}]
11:30:18<EnglishGent>I'm learning Haskell & fairly new to it - but I have lots of experience programming with Lisp, Scheme & other languages - so I figured it would be a good project for me to do :)
11:30:37<Isajha>the parts of a program that are deterministic, the compiler/interpreter can optimize them way more (i.e. automatic distribution on different cpu cores)
11:31:16<MyCatVerbs>Isajha: we're not quite at "automatic distribution on different cpu cores", but yeah. Pure calculations are very easily to safely introduce parallelism to with the par combinator. (*)
11:32:20<Botje>deeflex: what do you mean more precies?
11:32:23<Botje>*precise
11:32:39<MyCatVerbs>Isajha: (* "safety" is defined roughly as "no matter how badly you mess up using (par), it should not break your program, but it might turn out to run slower than without it.)
11:33:37<Gracenotes>:3
11:33:37<MyCatVerbs>EnglishGent: nifty. The main bits that're different in pure computation are that you have laziness and strong typing. The really huge difference IO-wise is that, rather than expressions having side effects, you construct programs using a term algebra on IO actions. :)
11:34:49<deeflex>Botje, the second element should result in 1.65 instead of the rounded value 2.0
11:35:06<MyCatVerbs>EnglishGent: oh and the syntax is infix rather than prefix. As much as I love s-expressions, I was never quite so fond of how hysterically my Scheme programs would implode if I put in one too many or few ('s. :)
11:35:44<Isajha>well I just came across it when i was reading about the dataflow variable based concurrency in CTMCP (all is threaded and when a thread needs an unbound value it waits until another thread binds it; as there is single assignment only he can be sure to continue when it's bound)
11:36:03<EnglishGent>the I/O is the most confusing thing for me MyCatVerbs - but I've been through a couple of tutorials & I can do line based I/O with getLine, putStr & friends
11:36:41<Botje>deeflex: take a good long look at your code :)
11:36:47<EnglishGent>I'm just wanting to avoid writing a whole HTML parser & so on from scratch - I'm sure there must be one already :)
11:37:09<PeakerWork>EnglishGent: If you don't think of an (IO a) as an a, but as some complicated thing that depends on lots of input and has lots of output, of which "a" is directly available, its probably less confusing
11:37:38<MyCatVerbs>EnglishGent: oh yeah, there are a couple on Hackage.
11:37:52<deeflex>Botje, haha lol. Ok got it :)
11:37:54<RayNbow>hmm... I'm reading a paper where the notation for function composition is also used for function application...
11:38:15<MyCatVerbs>AFAIK the one that you are most likely to be interested in is Tagsoup - it's designed for consuming relatively crap HTML (of which the entire web is of course composed) and being usable anyway.
11:38:40<MyCatVerbs>Except that I got the name wrong. It's TagSoup, not Tagsoup. ^_^
11:38:49<MyCatVerbs>http://community.haskell.org/~ndm/tagsoup/ <- ndm FTW.
11:39:01<EnglishGent>ah - ty! I agree - with the application I have in mind I dont think we can assume well-formed HTML!
11:39:05<MyCatVerbs>@where hackage
11:39:05<lambdabot>http://hackage.haskell.org/
11:39:29<mmorrow>this is a good read: http://mail.python.org/pipermail/python-dev/1999-July/000467.html
11:39:54<MyCatVerbs>http://hackage.haskell.org/cgi-bin/hackage-scripts/package/tagsoup <- this is probably a more useful link for TagSoup, come to think of it.
11:47:03<EnglishGent>ACTION looks through TagSoup
11:55:05<EnglishGent>ty all btw :)
12:00:04<mmorrow>does anyone know off-hand whether pthreads has a way to pin a thread to a core?
12:00:28<mmorrow>or does this need hackery?
12:00:43<mmorrow>(in C)
12:01:37<MyCatVerbs>This needs hackery.
12:01:43<mmorrow>ACTION finds the sweet spot in the google search string
12:01:46<Isajha>thanks for the help by the way - that really cleared things up
12:01:58<mmorrow>MyCatVerbs: oh wonderful
12:02:04<MyCatVerbs>mmorrow: sched_setaffinity(2) in Linux.
12:02:15<mmorrow>MyCatVerbs: oh beautiful, thanks
12:04:58<MyCatVerbs>Can't find anything offhand about affinity in the BSDs, though.
12:05:38<mmorrow>reading this currently, not sure if there's a happy ending yet http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2007-02/msg00107.html
12:06:16<mux>MyCatVerbs: http://www.freebsd.org/cgi/man.cgi?query=cpuset&apropos=0&sektion=0&manpath=FreeBSD+7.2-RELEASE&format=html
12:06:21<mmorrow>i should just look at ghc's code for this
12:06:32<mmorrow>mux: wooo, nice
12:06:35<mux>FreeBSD has affinity since 7.1
12:07:03<mux>also, the syscall: http://www.freebsd.org/cgi/man.cgi?query=cpuset&sektion=2&apropos=0&manpath=FreeBSD+7.2-RELEASE
12:07:19<MyCatVerbs>mux: nifty, thank you!
12:07:26<mux>my pleasure
12:07:39<Gracenotes>:O
12:08:09<MyCatVerbs>All I'd been finding was old unanswered questions on mailing lists. >>
12:08:37<mux>doh, finally: http://www.freebsd.org/cgi/man.cgi?query=cpuset_setaffinity&sektion=2&apropos=0&manpath=FreeBSD+7.2-RELEASE
12:09:16<mmorrow>if anyone's interesting in browsing the ghc rts code, i build doxygen docs the other day *with the works* (caller/ee graphs for every function (graphviz), mentions/ed by list, list of structs, lists of fields, lists of types, highlighted code with hyperlinked idents, ...) http://moonpatio.com/ghc/rts/html/main.html
12:09:20<mmorrow>it's handay
12:09:26<mmorrow>*built
12:09:42<MyCatVerbs>mmorrow: is that from stable or the HEAD?
12:09:51<mmorrow>HEAD
12:10:32<mmorrow>MyCatVerbs: but the doxygen config file i used is (stolen from bitc, which it appears stole in the the manual):
12:10:48<mmorrow>http://moonpatio.com/ghc/ghc_rts.doxygen.html.cfg
12:10:53<mmorrow>in ghc/
12:11:03<mmorrow>$ doxygen ghc_rts.doxygen.html.cfg
12:11:07<mmorrow>et voila
12:11:10<MyCatVerbs>Niiifty.
12:11:20<mmorrow>(it's like 200MB of output...)
12:12:24<mmorrow>i've never seen doxygen docs that didn't suck before last week and was stunned by the awesomeness
12:12:30<uzytkownik>Is there any notability rule or any haskell FLOSS project can request a hosting on community.haskell.org? I've created LGPL NNTP library in haskell and it'd be good to 1) share it 2) protect from disk IO errors.
12:12:44<mmorrow>uzytkownik: you should upload it to hackage
12:13:01<mmorrow>(and you can get a community.haskell.org account too)
12:13:31<mmorrow>uzytkownik: http://community.haskell.org/admin/account_request.html
12:13:54<uzytkownik>mmorrow: I know. I read. I just asked about notability rule :)
12:14:04<mmorrow>none such
12:14:29<mmorrow>(the notability rule is to want one in the first place :)
12:16:08<mmorrow>MyCatVerbs: here's ghci's interpreter loop's call graph http://moonpatio.com/ghc/rts/html/Interpreter_8c_93b7c81a9edc64cf6f8e958faacd8d7c_cgraph.png
12:17:42<Ycros>hmm, ton of compiler warnings building Yi
12:19:29<EvilRanter>unsafeSmiteUser 'EvilTerran
12:20:55<kacper_>how Can I make a list of same elements with size n, function = 0:0:0.. of size n, not using my own function?
12:21:08<mauke>:t replicate
12:21:09<lambdabot>forall a. Int -> a -> [a]
12:21:37<kacper_>thanks man
12:25:13<kacper_>and how Can I add el as head for every list in list of lists using prelude?
12:25:39<Saizan_>map (el:) listoflists ?
12:26:14<EvilTerran>> map (x:) [[a,b,c],[d,e],[f],[]]
12:26:15<lambdabot> [[x,a,b,c],[x,d,e],[x,f],[x]]
12:26:29<kacper_>ok, thanks
12:26:50<MyCatVerbs>mmorrow: preeeetty :)
12:27:39<Gracenotes>:O
12:28:18<Gracenotes>> map head $ map (x:) [[a,b,c],[d,e],[f],[],undefined]
12:28:19<lambdabot> [x,x,x,x,x]
12:33:13<kacper_>how create type of 1 | 0 ? i have error all time
12:33:23<ivanm>you can't
12:33:30<ivanm>since 1 and 0 are already taken
12:33:40<ivanm>you can, however, have: data Foo = One | Zero
12:34:33<ivanm>kacper_: ^^
12:34:43<kacper_>is this optimal?
12:34:45<EvilTerran>or data Foo = D0 | D1, say
12:34:54<EvilTerran>or you could just use Bool
12:34:56<EvilTerran>?src Bool
12:34:56<lambdabot>data Bool = False | True deriving (Eq, Ord)
12:36:43<kacper_>thanks
12:41:01<EnglishGent>if kacper_ wants a list of size n - wont he have to use (take n (replicate f)) - not just replicate f?
12:41:24<opqdonut>:t replicate
12:41:25<lambdabot>forall a. Int -> a -> [a]
12:41:31<opqdonut>you're probably thinking of repeat
12:41:32<opqdonut>:t repeat
12:41:33<lambdabot>forall a. a -> [a]
12:41:37<opqdonut>?src replicate
12:41:37<lambdabot>replicate n x = take n (repeat x)
12:41:38<opqdonut>:)
12:42:30<smorg>If i define a recursive function, whats the proper way to grab an output after n iterations?
12:42:40<smorg>The best I can think of is something like: let iter x y = (take (x+1) $ [y])!!x
12:42:58<opqdonut>> iterate (+1) 2 !! 100
12:42:59<lambdabot> 102
12:43:05<opqdonut>:t iterate
12:43:06<lambdabot>forall a. (a -> a) -> a -> [a]
12:43:07<opqdonut>that help?
12:48:12<smorg>Yeah that kind of makes sense. I don't think it would work though If you input a function which already is a recursive function which yields an infinite list. Like fib = 1 : 2 : zipWith (+) fib (tail fib)
12:48:29<opqdonut>fib isn't a function
12:48:33<opqdonut>it's a list
12:49:23<ray>who says lists aren't functions
12:49:23<opqdonut>so you'd want the list that comes out when you apply that definition of fib to itself n times?
12:49:27<mauke>ray: I do
12:49:29<opqdonut>ray: the type
12:49:40<ivanm>@type let fib = 1 : 1 : zipWIth (+) fib (tail fib) in fib
12:49:42<lambdabot>Not in scope: `zipWIth'
12:49:48<ivanm>@type let fib = 1 : 1 : zipWith (+) fib (tail fib) in fib
12:49:50<lambdabot>forall a. (Num a) => [a]
12:49:55<ivanm>^^ no -> there, so not a function
12:50:10<opqdonut>:)
12:50:27<smorg>opqdonut: basically, except the result would just be an int
12:50:50<opqdonut>smorg: you can't just cut a recursive function open
12:51:02<opqdonut>you have to define one step of it as a function and then iterate that n times
12:51:26<opqdonut>what you want isn't really clear
12:53:12<smorg>opqdonut: A function which returns the nth element of fib. by that definition if it were a list, I would think you could go [fib]!!n
12:53:28<opqdonut>[fib] makes no sense
12:53:31<opqdonut>!!n makes sense
12:53:39<opqdonut>> let fib = 1 : 1 : zipWIth (+) fib (tail fib) in fib !! 100
12:53:40<lambdabot> Not in scope: `zipWIth'
12:53:42<opqdonut>gah
12:53:46<opqdonut>> let fib = 1 : 1 : zipWith (+) fib (tail fib) in fib !! 100
12:53:47<lambdabot> 573147844013817084101
12:53:48<opqdonut>there
12:54:02<mauke>@let zipWIth x = zipWith x
12:54:03<lambdabot> Defined.
12:54:08<opqdonut>mauke: :D
12:54:16<ivanm>opqdonut: heh, did my mistake? :p
12:54:29<opqdonut>ivanm: yeah, i copypasted because i was lazy :)
12:54:29<ivanm>or did you copy/paste my original @type rather than my fixed one?
12:54:38<opqdonut>yeah
12:54:41<opqdonut>and didn't pay attention
12:56:03<smorg>but you had to change the function
12:56:34<opqdonut>i didn't change fib
12:57:04<ivanm>just added !! 100
12:57:10<opqdonut>on the other hand, if i have something like "factorial 0 = 1; factorial x = x*factorial (x-1)", theres no way of getting the "nth iteration"
12:57:29<ivanm>without evil hacks like trace
12:57:52<smorg>hm.
12:57:58<smorg>ACTION looks up what "in" does.
12:58:03<sven_>does anyone know a good source for some nice monads & monads transformer exercises?
12:58:18<opqdonut>smorg: let ... in
12:58:19<mauke>smorg: let BINDINGS in BODY
12:59:09<ivanm>mauke: are you starting to channel @yow or something? :p
12:59:25<opqdonut>:P
12:59:29<opqdonut>@yow
12:59:30<lambdabot>I have seen these EGG EXTENDERS in my Supermarket ... I have read the
12:59:30<lambdabot>INSTRUCTIONS ...
12:59:36<mauke>I don't ever want to be a baby thrower, but I can't wait to be a baby catcher!
12:59:47<mmorrow>let BINDINGS in BODY, EQUIP me with MISSILES!
12:59:55<opqdonut>:D
13:00:05<mmorrow>@yow
13:00:06<lambdabot>I just forgot my whole philosophy of life!!!
13:00:12<mauke>I mean, how can they GUARANTEE to blow your mind?
13:00:17<ivanm>@. elite yow
13:00:18<lambdabot>YoUt|-| Of TOD4y! Join mE IN A MASz Ra1Ly for +RadItIONal m3N+A1 aT+iTuD3S!
13:00:21<trofi>@go lolcode
13:00:25<lambdabot>http://lolcode.com/
13:00:25<lambdabot>Title: home · LOLCODE
13:00:45<mauke>@quote lolcode
13:00:45<lambdabot>No quotes match. You untyped fool!
13:08:07<smorg>grr I keep getting confused with python
13:09:05<smorg>Maybe i'll write a 1337 translator in haskell :)
13:10:09<licksjp>Hello
13:16:14<kacper_>can I use pattern: list == [h,t] for list of 2 elems?
13:16:24<kacper_>i have error like not in scope 't
13:17:07<mike-burns>Maybe you should represent that as a pair instead?
13:17:21<harlekin>> let list = (1:2:[]) in list == [1,2]
13:17:22<lambdabot> True
13:17:47<harlekin>You should be able to do that. The error means that t is not in scope. (; t is not defined or defined but not accessible from where you try to access it.
13:23:51<kacper_>| list == [h,t] = ( map ( h: ) solveRow xs hori vert ) ++ ( map ( t: ) solveRow xs hori vert )
13:24:03<kacper_>not in scope 't'
13:26:19<EvilTerran>kacper_, guards don't introduce new variables
13:26:23<EvilTerran>that's what patterns are for
13:27:04<kacper_>but h is ok?
13:27:35<EvilTerran>if it's in scope from somewhere else, you wouldn't get an error
13:28:02<EvilTerran>although you may well not get the behaviour you expect
13:30:16<smorg>let iter x y = last $ take x $ y
13:30:37<EvilTerran>> [a,b,c,d,e] !! 3
13:30:38<lambdabot> d
13:45:36<paolino>hi, is there a wai to forkIO the main loop of gtk2hs and experiment via ghci the IO actions of the library ?
13:46:25<dcoutts>paolino: you'd have to use postGUISync or postGUIAsync
13:46:46<dcoutts>paolino: otherwise it'll go horribly wrong :-)
13:47:43<paolino>mhh, how it gets the right thread ?
13:49:22<dcoutts>paolino: it posts the GUI actions to the correct thread
13:49:57<dcoutts>internally there's global state for the main gtk event loop
13:50:28<paolino>ok
13:50:40<paolino>very unhaskell :P
13:52:05<dcoutts>paolino: yep, that's what we get for wrapping C libs :-)
13:53:49<Geheimdienst>hi, i have a newbie question about this tiny 2-liner i wrote
13:53:54<mike-burns>Is there a tutorial for using a gtk2hs IconView? I'm having trouble figuring it out from the docs alone.
13:56:01<Geheimdienst>this here works: http://pastebin.com/m2ab275ba . now i want to move the contents of main to a new function as outlined. main should only contain this: putStrLn (getconf "abc" "def" "ghi")
13:56:06<Geheimdienst>how?
13:58:33<EvilTerran>Geheimdienst, well, as getconf will be doing IO, it needs to indicate this in the type
13:58:46<EvilTerran>Geheimdienst, so getconf :: String -> String -> String -> IO String
13:58:53<mauke>main = do x <- getconf "abc" "def" "ghi"; putStrLn x
13:59:05<EvilTerran>and then you can do as mauke suggests
13:59:48<EvilTerran>or "main = putStrLn =<< getconf ..."
14:01:23<EvilTerran>Geheimdienst, you wouldn't be able to write putStrLn (getconf "abc" "def" "ghi"), as putStrLn takes a String, and (getconf ...) would be an IO String
14:01:57<Geheimdienst>mauke: ok yes, i actually got that far. but i thought x <- ... putStrLn x was a little clumsy
14:02:18<mux>you can write putStrLn =<< getconf "abc" "def" "ghi"
14:02:26<Geheimdienst>evilterran: yeah, putStrLn =<< getconf was what i was looking for. thanks
14:02:30<mauke>getconf "abc" "def" "ghi" >>= putStrLn
14:02:55<EvilTerran>(=<<) :: (a -> IO b) -> IO a -> IO b -- in this case
14:03:52<EvilTerran>(do x <- m; f x) = (m >>= f)
14:04:49<hackagebot>Added by RohanDrape, Sun Jun 7 13:51:59 UTC 2009.: Haskell Postscript http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hps-0.1
14:04:49<hackagebot>Added by RohanDrape, Sun Jun 7 14:01:44 UTC 2009.: Haskell SuperCollider Unit Generator Database http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-db-0.7
14:06:50<hackagebot>Added by RohanDrape, Sun Jun 7 14:05:41 UTC 2009.: Cairo rendering for haskell postscript library http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hps-cairo-0.1
14:06:52<Geheimdienst>yeah baby, it works. thanks guys. 1 tiny step closer to world domination
14:07:42<gwern>'Unsafe Haskell SuperCollider'
14:07:43<gwern>what
14:10:44<paolino>dcoutts : initGUI >> forkIO mainGUI >> postGUISync (windowNew >>= widgetShowAll) is right ?
14:11:13<paolino>sometimes xmonad seems doesn't show a window ....
14:12:51<hackagebot>Added by RohanDrape, Sun Jun 7 14:12:38 UTC 2009.: Haskell SuperCollider Record Variants http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-rec-0.7
14:13:47<dcoutts>paolino: that should be ok, but note that you loose the reference to the window
14:17:31<paolino>sure
14:18:21<Axman6>@hoogle fork
14:18:22<lambdabot>Control.Concurrent forkIO :: IO () -> IO ThreadId
14:18:22<lambdabot>Control.Concurrent forkOS :: IO () -> IO ThreadId
14:21:23<dcoutts>any OS X users here who can check the behaviour of 'ar' for me? This is so we can make sure Cabal does the right thing.
14:22:19<dcoutts>I want to check if ar -q -s works when we've got duplicate object files
14:22:44<Raevel>dcoutts: sure, how do it check?
14:23:11<dcoutts>Raevel: lets use #haskell-in-depth so we don't annoy everyone else :-)
14:23:22<Raevel>alright
14:24:00<paolino>haskell-in-breadth
14:25:12<opqdonut>:)
14:36:56<mav`>{Uptime} [10:26am up 1:57, 2 users] {Load average} [0.09, 0.17, 0.37]
14:44:58<hackagebot>Added by RohanDrape, Sun Jun 7 14:29:08 UTC 2009.: Haskell SuperCollider Language http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsc3-lang-0.7
14:44:58<hackagebot>Added by RohanDrape, Sun Jun 7 14:32:24 UTC 2009.: Minimalist haskell html library http://hackage.haskell.org/cgi-bin/hackage-scripts/package/html-minimalist-0.1
14:45:06<mike-burns>gtk2hs question: I've written this: http://pastebin.com/m6307b19f as a straight translation of http://www.andreagrandi.it/2008/04/15/using-gtkiconview-in-python-a-small-tutorial/ . It gives me this error when I run it, and no icons: Gtk-CRITICAL **: gtk_icon_view_set_pixbuf_column: assertion `column_type == GDK_TYPE_PIXBUF' failed
14:45:19<mike-burns>Is the IconView implementation wrong, or am I doing it wrong?
14:45:36<dcoutts>mike-burns: I'd ask on the gtk2hs users list
14:45:46<mike-burns>Will do.
15:07:10<mmorrow>is there a standard abbreviation for "complement"?
15:07:18<mmorrow>cmpl, comp, ?
15:07:34<mmorrow>err, i wonder what it is in asm
15:07:48<Philippa>sometimes cmp, where it's not compare
15:08:34<mmorrow>hmm
15:22:24<Botje>IA32 assembly guide only has NEG and NOT
15:22:45<Botje>for negation in two's complement and one's complement, resp.
15:28:35<Raevel>what are the steps necessary to uninstall a cabal package i installed with cabal-install?
15:29:27<dcoutts>Raevel: ghc-pkg unregister [--user] and rm for the files which by default for --user installs are under ~/.cabal/lib/pkgid
15:29:42<Raevel>thank you!
15:48:29<algal>a possibly naive question: is it possible, in principle or in practice, to do automatic worst-case time/space complexity analysis of a haskell function?
15:50:01<EvilTerran>algal, i think haskell being turing-complete renders that problem undecidable
15:50:18<EvilTerran>seeing as you can't even decide termination
15:50:45<Saizan_>it might be workable in practice though
15:50:47<EvilTerran>although you may be able to approximate upper bounds of complexity more easily in haskell than in other languages
15:52:29<algal>Interesting. It seems that if a person can often informally calculate an asymptotic complexity, then it should be automatable some of the time.
15:53:22<algal>But I'm not sure how the possibility of big-O analysis squares with the undecidability of the halting problem (if I'm remembering the issues right).
15:54:59<dcoutts>complexity analysis is complicated by laziness
15:56:01<PeakerWork>it always confuses the hell out of me :(
15:57:40<algal>I wonder if there are automated complexity-analyzers in any language at all..
15:58:02<PeakerWork>you can automatically deduce a worst-case bound, but it won't necessarily be a tight bound
15:58:19<PeakerWork>proving the bound is better than the "obvious" one is very difficult sometimes
15:58:55<mike-burns>There are cyclomatic complexity analyzers (e.g. http://saikuro.rubyforge.org/), but I've never heard of one that will take a function and tell you that it's O(log n).
15:59:10<aavogt>or measure the asymptotic complexity empirically?
16:01:39<algal>hmm, interesting. thanks everyone.
16:06:28<PeakerWork>aavogt: dangerous, and would probably be impossible to differentiate O(1) from O(logN)
16:36:59<Asztal>hmm... I had no idea about the -<< in arrow notation...
16:38:01<Asztal>well that makes things somewhat simpler
16:42:03<dino->oh boy, hackage is failing to respond to my upload
16:43:10<PeakerWork>dino-: use the web page for checking the package upload
16:43:28<hackagebot>Added by DinoMorelli, Sun Jun 7 16:38:52 UTC 2009.: Rename JPEG photo files based on shoot date http://hackage.haskell.org/cgi-bin/hackage-scripts/package/photoname-2.2
16:43:30<dino->checking was quick but upload finally worked after minutes.
16:43:37<dino->I was sure it was going to fail
16:43:52<Geheimdienst>newbie question: how do i write a lambda with pattern-matches? i.e. how would i write this function http://pastebin.com/m1dc86e8c as a lambda?
16:44:19<Axman6>you'd need to use a case statement
16:44:27<mauke>\s -> case s of "charging" -> "+"; "discharging" -> "-"; "charged" -> "+/-"
16:44:45<Axman6>which is basically what that code gets compiled into i think
16:46:44<Geheimdienst>ok thanks
16:47:47<Geheimdienst>out of curiosity, when do you use this? http://haskell.org/onlinereport/exps.html#sect3.3
16:48:11<Geheimdienst>there's no example given for "\ apat1 ... apatn -> exp"
16:48:57<Axman6>\x y -> x + y
16:49:26<roconnor>> (\"hi" "ho" -> "go work") "hi" "ho"
16:49:27<lambdabot> "go work"
16:50:21<Axman6>Geheimdienst: you're not trying to learn haskell by reading the report are you?
16:50:31<Geheimdienst>ah i see, that's just multiple parameters
16:50:59<Geheimdienst>no :) just came across that while googling "lambda pattern matching"
16:52:13<Geheimdienst>thanks guys, you're always very helpful
16:54:41<Gracenotes>so you can have one pattern match in a lambda expression, but case allows many
16:55:05<Gracenotes>unfortunately if there's only one pattern matching scenario, if can fail :/
16:55:37<roconnor>> (\"hi" "ho" -> "go work") "hi" "FAIL"
16:55:39<lambdabot> "* Exception: <interactive>:1:134-156: Non-exhaustive patterns in lambda
16:55:45<Axman6>FAIL!
16:56:15<Gracenotes>it
16:59:23<Pellwurst>how can i run a shell-script within a haskell program?
17:00:05<Botje>hoogle system
17:00:09<Botje>@hoogle system
17:00:09<lambdabot>System.Cmd system :: String -> IO ExitCode
17:00:09<lambdabot>module Distribution.System
17:00:09<lambdabot>package system-inotify
17:00:10<Botje>argh :)
17:00:12<mauke>like any other executable
17:00:16<Botje>or you can look at runProcess
17:00:45<Pellwurst>thx...
17:01:00<roconnor>mauke: don't you need to run the shell and pass it the script?
17:01:04<mauke>no
17:01:15<roconnor>oh
17:01:16<roconnor>nice
17:01:33<Twey>Not if it's got its magic numbers in order...
17:01:35<mauke>one of the executable formats supported by the kernel is #!
17:02:30<roconnor>aww. Chanserve owns #!
17:02:55<sbaader>hi!
17:03:30<sbaader>I'm looking for examples/tutorials fro the SDL bindings, but I apparently don't know where to look ..
17:03:42<sbaader>really new to haskell..
17:03:50<sbaader>any hints?
17:04:23<Axman6>well firstly, how much haskell do you know?
17:04:56<Axman6>if you're trying to use a rather advanced library in a language you're not familliar with, you're just asking for trouble and frustration
17:05:14<sbaader>I know
17:05:28<sbaader>Enough to make sense of example code and learn from modifying it
17:05:40<sbaader>too little to put something otgether on my own
17:06:11<Twey>spoop: http://lazyfoo.net/SDL_tutorials/index.php works fine for Haskell
17:06:15<sbaader>to impationet to chew thhrough list conprenhensions and pure code, i want something on the screen ;)
17:06:16<Twey>Tho transformations are obvious
17:06:25<Twey>The**
17:06:52<Twey>import qualified Graphics.UI.SDL as SDL instead of #include <sdl.h>; SDL.foo instead of SDL_foo
17:06:59<Twey>And of course everything is in IO
17:07:55<sbaader>Thanks. I was using them, but I know SDL but not haskell, so it's hard for me to translate that to haskell...
17:08:06<Axman6>sbaader: pure code is where all the interesting stuff happens
17:08:33<sbaader>Axmann6: sure ;)
17:08:53<Axman6>anyway, sounds to me like you need to use haskell more, before trying to use the SDL bindings
17:08:58<Twey>Yeah
17:09:07<sbaader>hm...
17:09:19<Axman6>i've been using haskell for over a year now, and probably wouldn't touch them (mainly because i have no need though)
17:10:29<sbaader>ok, it doesn't really matter - I just want some real haskell code that runs and modify it to learn haskel lhands on
17:10:52<sbaader>the tutorials are very focused on theoretical execises
17:11:50<Axman6>as they should be really
17:12:01<sbaader>hehe
17:12:17<sbaader>i totally agree that the pure code is the interesting part and that the stringth of haskell in in FP
17:12:30<Axman6>doing things like SDL is probably quite out of the ordinary really
17:13:02<sbaader>but at the end of the day, a program is interesting to me if it does something (elegantly) and not if it does nothing in an elegant way
17:13:10<sbaader>*nods
17:13:27<sbaader>(no criticism intended in that)
17:13:49<sbaader>but -- anything elese you'd recommend for hands-on learning?
17:18:19<Axman6>sbaader: tutorials ;)
17:18:27<Axman6>learn you a haskell is a good start
17:19:01<sbaader>yeah ;)
17:19:30<sbaader>i am reading real world haskell and am doing real world haskell as well
17:19:52<sbaader>they are great
17:20:28<sbaader>they really introduce the possibilities in haskell
17:21:44<sbaader>but - I also like to hack away on an existing program, modify it and learn from that as well. reading and doing tutorials all day is quite theoretical...
17:22:11<sbaader>games are much more fun than fibonnaci series .. ;)
17:22:31<inimino>I think you have an unusual definition of "theoretical"
17:22:33<Axman6>and much less instructive ;)
17:22:38<Axman6>me too
17:23:13<Axman6>fibonacci is used as just one example of some very useful, and extremely iportant concepts (usually recursion)
17:23:33<yitz>sbaader: fibonnaci nim. Start with a pile of stones, each player in turn takes a number of stones equal to a fibonnaci number, the player to take the last stone loses.
17:24:25<sbaader>hehe
17:24:28<sbaader>:)
17:24:52<Axman6>if all you want to do is get your hands dirty and make some form of game, might as well just use VB
17:25:01<inimino>heh
17:25:06<inimino>noooo
17:26:24<minormelodic>Hi!
17:27:22<Axman6>o/
17:28:10<minormelodic>If I have a list and I want a new list with only the 1st 3rd 5th 7th etc. elements, what functions can I use, please ?
17:29:09<mauke>well, you could write it directly
17:29:12<Botje>minormelodic: zip the list with [0..], filter out all element with odd numbers, and discard the numbers
17:29:26<mauke>Botje: I'd zip with cycle [True, False]
17:29:37<Botje>heh, of course
17:29:40<paolino>dcoutts: are gtk2hs widgets multithread tolerant ?
17:29:42<Botje>i wonder if ghc is smart enough to notice that ;)
17:29:55<Axman6>probably not
17:30:07<gwern>Botje: you could submit a rewrite rule
17:30:14<dcoutts>paolino: no, you need to use the provided functions if you want to use multiple threads
17:30:24<mauke>> let f (x : _ : xs) = x : f xs; f xs = xs in f [1 .. 10]
17:30:25<lambdabot> [1,3,5,7,9]
17:30:37<Botje>gwern: it seems too specific :)
17:30:59<gwern>Botje: then maybe there's a research project there in finding generalized rewrite rules for it!
17:31:19<paolino>dcoutts: widgets have special functions ?
17:31:23<Botje>:)
17:31:30<yitz>> let f = tail . map head . iterate (drop 2) in f [1..20]
17:31:32<lambdabot> [3,5,7,9,11,13,15,17,19,* Exception: Prelude.head: empty list
17:31:55<yitz>> let f = tail . map head . takeWhile (not . null) . iterate (drop 2) in f [1..20]
17:31:57<lambdabot> [3,5,7,9,11,13,15,17,19]
17:32:11<yitz>the first one is ok if your lists are infinite
17:32:27<yitz>minormelodic: ^
17:32:36<aavogt>> [1,3..]
17:32:37<lambdabot> [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,5...
17:32:41<minormelodic>thank you all !
17:34:08<paolino>dcoutts: the postGUI functions ?
17:34:14<dcoutts>paolino: right
17:36:39<paolino>so I can share references to widget among threads as long as always use postGUI ? I was thinking to use TVars...
17:45:12<deeflex>Botje, hey again. I need help with my file. Not sure I understand loops. Take a look at this (horrible?) code http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5632#a5633 =) .
17:47:01<Botje>deeflex: woah. complex.
17:47:05<Axman6>ACTION agrees with the horrible
17:47:09<Botje>deeflex: the role of fi in your code is unclear
17:47:16<Axman6>deeflex: you need to break things down into smaller pieces
17:47:20<Botje>according to the type you give for neighborJoining, fi should be [String]
17:47:36<Botje>but then you map selection over fi, which has type [Distance] -> (Distance, Float)
17:47:45<Botje>so which one is it? [String] or [[Distance]] ?
17:47:51<Axman6>"(""++show i)"?
17:48:04<Axman6>that's exactly the same as (show i)
17:49:02<Botje>deeflex: i'd give loop a type annotation
17:49:03<deeflex>Botje, fi should be [String]. As you can see from line 7. I get all "from" from the DistElement, which are strings.
17:49:14<Botje>deeflex: so why are you mapping selection over fi?
17:49:40<deeflex>should be di
17:49:53<deeflex>must have missed that
17:49:55<Botje>well, add a type annotation to loop
17:50:05<Botje>that makes the role of all elements that much clearer
17:51:19<deeflex>Botje, type annotation to a loop? Never done/seen/heard that. How do I do that?
17:51:30<Botje>deeflex: just put a type annotation before it :p
17:51:33<Botje>loop :: .....
17:51:43<Botje>s/before/on the line before/
17:52:09<Botje>for documentation, if nothing else
17:53:11<deeflex>ok didn't know I could do that..hehe
17:53:17<deeflex>still learning :)
17:53:40<Botje>also, that zlist and zlist2 stuff at the bottom looks fishy
17:54:19<akamaus>hi, what's the prefered library for url encoding of strings?
17:56:52<Botje>deeflex: term2x = sum [ dist x | x <- (list:rest), from x == from list]
17:56:57<Botje>likewise for term2y
17:57:03<Botje>so you can skup the zlist stuff
17:57:21<Botje>deeflex: heh, and if you're just going to add the two terms, you can even do:
17:57:32<deeflex>Botje, it is this algorithm I am trying to implement: http://en.wikipedia.org/wiki/Neighbor-joining . The zlist and zlist2 are the \sigmas in Q-matrix.
17:57:35<Botje>term2x = sum [ dist x | x <- (list:rest), from x == from list || from x == to list ]
17:57:37<gwern>'
17:57:38<gwern>'Hi, how can I change the value of a variable.
17:57:38<gwern>let x = 1
17:57:39<gwern>x = x + 2'
17:57:48<gwern>wow. I don't even know how to begin to reply to this email
17:58:09<Botje>"use another language" ? :)
17:58:20<gwern>akamaus: url encoding string? network.uri. the code looks something like 'escapeURIString (isAllowedInURI)'
17:58:36<Botje>deeflex: i don't really have time to inspect your algorithm in detail, i'm just suggesting cleanups to your code atm
17:58:49<gwern>Botje: I think I'll just punt on it. I don't have dons levels of patience to deal with such Fail
17:59:03<Botje>gwern: forward it to dons! that's it! brilliant! :)
17:59:20<Cale>gwern: Email?
17:59:22<gwern>Botje: but dons is already on -cafe, so he'll see it anyway
17:59:28<gwern>Cale: -cafe, as of a few minutes ago
17:59:29<Cale>oh
18:00:51<deeflex>Botje, oh no I didn't want that, but pasted the link to make things more clear. Anyway your help is much appreciated, gonna do the cleanup now.
18:04:36<akamaus>gwern, I have troubles building network for windows and I need to stay crossplatform
18:04:49<akamaus>I use curl for fetching data and need to encode urls for it. There is a bunch if libraries like url, urlencoded, web-encodings. I just can't choose.
18:05:09<gwern>akamaus: network is crossplatform; windows just sucks
18:05:23<gwern>I've told you the right library to use
18:05:49<performance>OT where can one download teh gtksourceview2 source code from? i see only ready made packages on google :(
18:05:56<akamaus>gwern, Personally I agree, but I need to make a windows build of my program )
18:13:04<roconnor>> 2^100
18:13:05<lambdabot> 1267650600228229401496703205376
18:17:20<dever>hey all, i know I can set the attributes of stuff in gtk2hs, but how o I get the attributes of something?
18:17:51<monochrom>Yay, Haskell Weekly News is out!
18:18:27<Cale>dever: set button [ buttonLabel := value ]
18:18:52<dever>yep, thats set, but I want to get the value
18:18:55<monochrom>(that doesn't seem to get)
18:19:04<Cale>er, oh
18:19:08<Cale>heh
18:19:12<dever>:)
18:19:13<Cale>ACTION is not awake
18:19:22<Cale>value <- get button buttonLabel
18:19:33<Cale>http://haskell.org/gtk2hs/docs/current/System-Glib-Attributes.html#t%3AAttrOp
18:19:36<dever>ah ok, cheers cale
18:19:49<pumpkin>looks very glib
18:46:05<Asztal>:t jpeg
18:46:06<lambdabot>Not in scope: `jpeg'
18:46:20<Asztal>you're not my terminal
18:46:29<Asztal>ACTION hides
18:51:43<dev31212>hi all
18:51:54<byorgey>hi dev31212
18:51:58<Axman6>o/
18:52:02<dev31212>hi byorgey
18:52:10<dev31212>I have a question regarding "Show" instances
18:52:27<dev31212>If someone cares to have a quick go at it.
18:52:27<Axman6>ask away
18:52:43<Axman6>rule #1 of IRC: don't ask to ask, just ask
18:53:10<dev31212>ok. The error is "Could not deduce (Show a) from the context (Show (MyTree a))"
18:53:27<dev31212>I am assuming this means it doesnt know how to "Show" whatever the type variable "a" is?
18:53:35<Axman6>yes
18:53:45<dev31212>The type is defined like so: data (Show a)=>MyTree a = EmptyTree | MyTree a (MyTree a) (MyTree a)
18:53:58<dev31212>I am wondering whyt that doesnt solve it...or better yet, how can I fix this?
18:54:01<Axman6>huh, should be ok
18:54:22<dev31212>yeah, odd
18:54:37<lysgaard>Anyone ever used the AdHoc-network library for haskell?
18:54:42<Axman6>though a better way to do it would be data myTree a ...; instance (Show a) => Show (MyTree a) where ...
18:55:47<dev31212>Ahhh
18:55:53<dev31212>ok axman ill try it, thanks :)
18:57:38<dev31212>Thanks, that did the trick
18:58:04<hackagebot>Added by HenningThielemann, Sun Jun 7 18:53:42 UTC 2009.: Non-negative numbers http://hackage.haskell.org/cgi-bin/hackage-scripts/package/non-negative-0.0.5
18:58:25<PeakerWork>I think that (Show a)=> context on a data-declaration does not do what people expect it to do
18:58:38<PeakerWork>dev31212: it also makes the type more useful -- can be used without a Show instance if you don't want to Show the tree
18:58:58<dev31212>That makes good sense.
18:59:31<algal>i am re-implementing the classic search algorithms in multiple languages, for my own edification. Is it really possible to try to implement the standard sorts in Haskell in an FP style (e.g., insertion sort, quicksort, etc.), or are the classic algorithms fundamentally too imperative for that to be possible?
18:59:44<PeakerWork>(I'm not sure what an ADT class restriction actually does)
18:59:58<Cale>algal: It can be done...
19:00:01<algal>I'm sort of guessing it's not really possible, but maybe I'm missing something.
19:00:12<performance>any one compiled Leksah lately?
19:00:21<PeakerWork>Cale: Quicksort swapping of elements requires destructive assignments, doesn't it?
19:00:33<PeakerWork>algal: Haskell is also the world's best imperative language, you know? :)
19:00:36<Cale>But quicksort doesn't really say that you have to mutate anything.
19:00:43<algal>Yeah, quicksort is a good example.
19:00:51<donnelly>a lot of the imperative sorts could be done in a monad, couldn't they?
19:00:54<PeakerWork>Cale: It kinda does say you swap around elements, according to augustuss blog
19:00:55<Cale>It's just a way to recursively break down the problem of sorting.
19:00:56<algal>Cale: don't you need to mutate things to get quicksort's asymptotic complexities?
19:01:09<dev31212>Peaker, what do you say to those people who say Haskell is not practical?
19:01:15<Cale>algal: Not really. Only space complexity is affected.
19:01:22<donnelly>using Data.Array.ST?
19:01:29<Cale>algal: You can get the same time complexity without mutation.
19:01:33<TomMD>@tell Saizan_ A while ago you asked if I was publishing my darcs repo of hackage server. I'm still finishing up the quarter (one more week!), but just shoved the repo up on code.haskell.org/~tommd/hackage-server - all patches should go to dcoutts, not me, I'm not forking!
19:01:33<lambdabot>Consider it noted.
19:01:38<PeakerWork>dev31212: I say they have already been proven wrong. But that's not to say Haskell is ready for practical use in every niche
19:01:48<algal>Cale: is that widely true for some general reason, or only w/r/t to quicksort?
19:01:50<dev31212>Yeah.
19:01:54<ski>PeakerWork : given `data Foo a => Bar a = ...' one might expect to be able to use `Bar a' in types without having to mention the `Foo a' constraint .. also one might expect that matching on a value of type `Bar a' would bring a constraint `Foo a' constraint into scope
19:02:17<ski>PeakerWork : neither of these expectations are fulfilled here, though
19:02:32<Cale>algal: Actually, if you're willing to change your list representation, you can do it with only a log space complexity hit.
19:02:37<Cale>and *that* is general.
19:02:40<PeakerWork>ski: What does it do then? What code would break if you removed all restrictions from ADT's?
19:02:46<Axman6>dev31212: it'd certainly be my first choice for any parallel comutation, at least on a small scale
19:02:50<ski>(it's another question to ask whether any of these expectations would be warranted, though)
19:03:14<Cale>algal: It's possible to devise an immutable associative datastructure with O(log n) lookup and update.
19:03:15<dev31212>Axman, yeah Ive read it is great for that.
19:03:25<algal>Cale: why is that true in general? is there a theorem or some equivalence that explains it.
19:03:26<dev31212>I still only about 3 months into serious study.
19:03:41<PeakerWork>algal: some algorithms are more efficient as imperative, and Haskell allows that with the ST and other monads
19:03:42<ski>PeakerWork : afaik, it adds the `Foo a' constraint to every constructor .. and maybe also requires that matching on `Bar a' *requires* a constraint `Foo a' in scope
19:03:52<Axman6>dev31212: for a quick intro, check out the thread-ring benchmark on the language shootout
19:03:52<ski>@src Complex
19:03:53<lambdabot>data (RealFloat a) => Complex a = !a :+ !a
19:03:54<algal>Cale: ah, so the possibility of this datastructure makes lots of classical imperative algorithms portable to FP with only a space hit?
19:03:55<Cale>algal: Which means that essentially any algorithm that uses mutation could just use one of those instead, with only at most a log factor extra cost.
19:03:59<Axman6>@where shootout
19:03:59<lambdabot>http://shootout.alioth.debian.org/
19:04:03<algal>Cale: I mean, a time hit?
19:04:04<ski>@type (:+)
19:04:06<lambdabot>forall a. (RealFloat a) => a -> a -> Complex a
19:04:07<dev31212>Will do axman, thanks
19:04:08<Cale>algal: Possibly a time cost as well.
19:04:09<PeakerWork>ski: so it can't break compilations, just make code less type-safe?
19:04:19<Cale>algal: But sometimes you can avoid one or both of them.
19:04:23<ski>@type let f (x :+ y) = (x,y) in f
19:04:24<lambdabot>forall t. (RealFloat t) => Complex t -> (t, t)
19:04:37<Philippa>algal: basically it's possible because you can replace the mutable store with an immutable implementation using, say, a binary tree
19:04:38<algal>Cale: thanks. interesting.
19:04:40<Axman6>dev31212: i happen to be the one with the fastest entry there btw (though i only made a small imporvement to other people's work)
19:04:47<ski>@type let f :: Complex a -> (a,a); f = undefined in f
19:04:48<lambdabot>forall a. Complex a -> (a, a)
19:04:49<dev31212>nice
19:04:53<algal>Cale: what's the name for hte immutable associative ADT in haskell?
19:05:01<Philippa>algal: there's a more precise statement, but that's the gist of it
19:05:06<Philippa>algal: Map
19:05:07<Cale>algal: Data.Map
19:05:14<Axman6>dev31212: which i submitted after only using haskell for a year too :)
19:05:17<PeakerWork>Axman6: I think the shootout is misleading. Haskell performance is only great if you're a pretty experienced Haskell hacker
19:05:18<algal>thanks, all.
19:05:29<Cale>algal: Also, just for straight lists you can do something which is identifiably quicksort which is O(log n) average time, and O(n) space complexity.
19:05:36<ski>PeakerWork : those tests suggest that both calling and matching on the constructor *requires* the constraint (the latter arguably a bug)
19:05:40<PeakerWork>I don't think Haskell's uniprocessor performance is that great, when compared to some performance-oriented languages
19:05:42<Axman6>PeakerWork: a lot of the things that make haskell are fast are pretty easy to grasp though
19:06:01<ski>PeakerWork : also, it doesn't appear to be an error to use the *type* `Complex a' in a context where `Foo a' is not known
19:06:03<algal>are their syntactic sugars for the Map? It seems like everything is built for lists, like lisp...
19:06:07<Cale>> let sort [] = []; sort (x:xs) = sort less ++ [x] ++ sort greater where (less,greater) = partition (<= x) xs in sort [5,2,6,2,8,9,1,10]
19:06:08<lambdabot> [1,2,2,5,6,8,9,10]
19:06:10<hackagebot>Added by HenningThielemann, Sun Jun 7 19:05:22 UTC 2009.: Event lists with relative or absolute time stamps http://hackage.haskell.org/cgi-bin/hackage-scripts/package/event-list-0.0.9.1
19:06:13<Cale>algal: ^^
19:06:40<PeakerWork>algal: In a lazy language, lists are a fundamental concept, as they basically encapsulate both the data structure and the concept of iteration
19:06:42<Axman6>anyway, sleep time. night all
19:06:43<Cale>algal: There's no syntactic sugar for Maps, but they are easy to use.
19:06:59<PeakerWork>algal: Maps are less fundamental, but easy to use indeed
19:07:07<ski>PeakerWork : iirc, if you want constructing to require the constraint, and matching to *provide* the constraint, then istr GADT can do that
19:07:10<PeakerWork>I think List's syntactic sugar is unnecessary, too
19:07:11<algal>Cool, thanks.
19:07:41<PeakerWork>ski: thanks for the deeper explanation :)
19:07:49<ski>PeakerWork : i don't know whether it (what exactly is "it" ?) can break compilations
19:07:50<byorgey>you can always make your own syntactic sugar for Maps, since defining new operators is so lightweight.
19:08:03<PeakerWork>ski: an automatic removing of all contexts from ADT's
19:08:07<algal>byorgey: interesting, don't know anything about operator re-definition. still getting started.
19:08:32<byorgey>> let x **& y = x + 2 * y in 3 **& 5
19:08:34<lambdabot> 13
19:08:36<Cale>algal: Basically, operators are not special in Haskell. Any string of symbol characters is a valid name for an infix function.
19:08:37<ski> data Bar :: * -> * where B0 :: Bool -> Bar Int; B1 :: Foo a => Bar a
19:08:52<algal>cool.
19:08:53<Cale>(apart from a few special things reserved by the syntax)
19:08:57<ski>mathcing on `B1' there would *provide* `Foo a' to the local context, iirc
19:09:17<byorgey>so, e.g. you could make --> an alias for map insertion. or whatever.
19:09:18<algal>By the way, is it bad form to use $ as a kind of data-pipe operator? it seems to function that way but I ran into a comment dissing "abuse of $"
19:09:33<PeakerWork>Except for unboxed arrays and ST -- how does one go about improving Haskell's performance?
19:09:41<PeakerWork>any other thumb rules like those?
19:09:44<byorgey>algal: if you have f $ g $ h $ x, it's considered better style to say f . g . h $ x instead
19:09:50<Cale>algal: $ is a very low-precedence function application operator
19:09:52<byorgey>. is function composition
19:09:58<Cale>@src ($)
19:09:59<lambdabot>f $ x = f x
19:09:59<david48>Good evening everyone.
19:10:04<byorgey>hi david48
19:10:10<algal>yeah but if I'm partially applying something in the middle then I can't use . , right?
19:10:16<Cale>You can.
19:10:28<algal>f . g . filter h . j $ data
19:10:36<Cale>> map head . group . sort $ "what letters are in this string?"
19:10:37<lambdabot> " ?aeghilnrstw"
19:10:37<RayNbow>byorgey: are you familiar with the notation where . both means function composition *and* application?
19:10:42<algal>hmm.. I clearly need to experiment with operator precedence more.
19:10:55<Cale>algal: Function application binds tighter than any operator
19:11:02<algal>Cale: thx
19:11:06<byorgey>RayNbow: no...
19:11:10<Cale>algal: That's the rule which is probably more important than any other :)
19:11:14<byorgey>RayNbow: how would that work?
19:11:41<PeakerWork>algal: the idea is that the composed functions are typically more useful than the applied functions on the specific value, and the nice artifact of using a.b.c$d notation means that you can take any valid sub-string in there (e.g: b.c$d or a.b) and its a valid sub-expression you can refactor into its own function
19:11:55<RayNbow>byorgey: this paper by Lambert Meertens on Paramorphisms uses this notation...
19:12:15<Cale>And just the fact that you *can* do this is often enough to help you think about the code in different ways, even if you don't actually do it.
19:12:21<RayNbow>and treats values of type A as nullary functions of type A <- 1
19:12:28<Cale>(with regard to what PeakerWork was saying)
19:12:36<algal>PeakerWork: I see!
19:12:38<byorgey>RayNbow: oh, I get it
19:13:11<byorgey>that's a very category-ish point of view =)
19:13:28<Cale>algal: Also, there is a growing consensus that $ has the wrong associativity.
19:13:40<RayNbow>ACTION has the feeling he has to pick up Awodey's CT book again and continue reading :p
19:13:50<Cale>and so if you write things like f $ g $ h $ x it makes it harder for that to change in the future. :)
19:13:51<algal>Cale: interesting. What is $ really? hard to find the page on is on the 98 report?
19:13:58<Cale>It's just defined as
19:14:01<Cale>f $ x = f x
19:14:19<algal>oh.
19:14:23<Cale>But! It has an infix declaration which gives it very low precedence.
19:14:31<PeakerWork>algal: $ is nothing special, just the fact its very low-precedence function application means its pretty much equivalent to having parenthesis on the full expressions on both of its sides
19:14:33<Cale>That is, it happens last.
19:14:46<Cale>(for some definition of happens)
19:14:49<algal>ok.
19:14:57<Cale>(which is unrelated to evaluation order -- just grouping :)
19:14:58<PeakerWork>algal: so instead of having (f g x y) (blah bleh bluh) you can use: f g x y $ blah bleh bluh
19:15:20<algal>and why is the smart money against it, these days?
19:15:37<PeakerWork>algal: there is quite a bit in Haskell's syntax dedicated to having less redundant ()'s. I think maybe someone was burned by a Lisp experience :-)
19:15:38<Cale>The abuse is just when you chain more than one in a row
19:15:56<ehird>20:13 Cale: algal: Also, there is a growing consensus that $ has the wrong associativity.
19:15:57<ehird>really?
19:16:06<Cale>ehird: At least around here :)
19:16:08<RayNbow>hmm, a new sigfpe blogpost...
19:16:26<ehird>Cale: so a $ b $ c $ d -> a b c d?
19:16:26<PeakerWork>ehird: having the same associativity as (.) means that they overlap where they could cover more useful territory
19:16:29<ehird>that's wacko
19:16:32<Cale>One $ is okay, but if you're writing something like f $ g $ h $ x, it's better style to write f . g . h $ x
19:16:35<ehird>a $ b is intuitively a (b) to me
19:16:38<ehird>and yeah, I know that
19:16:39<ehird>still
19:16:40<algal>Cale: interesting, the abuse was the only usage that attracted me, naively.
19:16:51<PeakerWork>ehird: why not (a) (b) ?
19:16:57<ehird>PeakerWork: well, sure, whatever
19:16:59<ehird>that's not the point :)
19:17:12<mauke>f $ x $ y
19:17:37<algal>a shame we only have capitalized and non-capitalized. would love a way to distinguish types vs functions vs variable, instead of just types vs. (functions or variables)
19:17:40<Cale>f $ x $ y would be equal to f x y if there were any justice in the world. But it's not.
19:18:01<bremner>tanj!
19:18:06<Cale>Instead we have that it's equal to f (x y)
19:18:09<dev31212>ok, be back later
19:18:17<ehird>Cale: that's wacko.
19:18:23<Cale>(because $ is defined as right associative)
19:18:24<ehird>i can't see why you would want that
19:18:37<algal>Cale: thx
19:18:46<mauke>f $ sqrt x $ y + 1
19:18:50<Cale>ehird: Every use of multiple $'s right now can be replaced by one which uses only one $ and function composition.
19:18:52<inimino>Cale: you could introduce a left-associative operator and get people to use it in new code
19:18:57<ehird>Cale: sure, and it's prettier that way
19:18:58<PeakerWork>ehird: because you can already express f (g y) with f . g $ y
19:19:09<ehird>i suppose f $ a b $ c d could be useful BUT
19:19:13<Cale>ehird: But if $ was left associative, then we could write f $ g x y $ h y z, for instance
19:19:15<ehird>to me that's clearer & prettier as f (a b) (c d)
19:19:24<Cale>Also, consider $!
19:19:31<Cale>Have you ever tried to use $! ?
19:19:41<skorpan>:t ($!)
19:19:43<lambdabot>forall a b. (a -> b) -> a -> b
19:19:47<skorpan>@src ($!)
19:19:47<lambdabot>f $! x = x `seq` f x
19:19:53<skorpan>ah well... :P
19:19:55<Cale>I think anyone who does quickly runs into the problem that they have to bracket their expressions in a funny way to use it.
19:20:04<Cale>Essentially forcing $! to be left associative.
19:20:13<hackagebot>Added by HenningThielemann, Sun Jun 7 19:19:29 UTC 2009.: An experimental alternative hierarchy of numeric type classes http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude-0.1.1
19:20:43<Cale>But we certainly would not want $! and $ to have opposite associativities.
19:21:11<Cale>inimino: But there are not many characters which are free or which I'd be willing to steal.
19:21:38<mauke>
19:21:58<Cale>I can't type € very easily.
19:22:01<PeakerWork>ehird: you realize that the choice is pretty arbitrary, and that you're simply more used to one style than the other?
19:22:20<ehird>PeakerWork: yes, but i don't think either way is useful
19:22:20<ehird>:P
19:22:41<Cale>Basically, since function application is always left associative, $ and $! should be as well :)
19:23:26<Cale>Can you imagine what things would be like if function application associated to the right by default in Haskell?
19:23:45<Cale>Using functions with multiple parameters would be painful :)
19:23:51<ehird>Cale: that could be fun
19:23:52<mauke>that's what tuples are for
19:23:52<inimino>Cale: use a Unicode character
19:23:58<ehird>printf "%s" b
19:23:59<ehird>
19:24:00<Cale>inimino: Same problem.
19:24:02<ehird>printf ("%s" b)
19:24:06<PeakerWork>Cale: it could be nice if it was rassoc AND flipped
19:24:08<Cale>inimino: It's too hard to type
19:24:12<ehird>so we'd have strings = constructors
19:24:12<ehird>:-D
19:24:14<PeakerWork>Cale: kind of like FORTH :)
19:24:26<inimino>it's not hard in any decent text editor
19:24:26<Cale>I mean that f x y z would mean f (x (y z))
19:24:29<inimino>I think Haskell users can handle it :)
19:24:36<Asztal>£ is easy to type (for me, anyway :)
19:24:37<Cale>That would be annoying!
19:24:46<ehird>Asztal: ALL YOU THINK ABOUT IS ££££
19:24:50<ehird>doesn't really have the same ring does it
19:26:15<Cale>You would constantly be bracketing things to the left
19:26:43<Tsion>(((f x) y) z)
19:26:52<Tsion>imagine coding like that for a day :S
19:26:52<Cale>Mind you, that is a bit of a straw man, but there is an analogy to be made there.
19:27:08<Tsion>It's like Lisp, heh
19:27:16<PeakerWork>Lisp with currying everywhere
19:27:53<Cale>Basically, I think we should encourage the style which makes maximal use of function composition.
19:28:11<paolino>anyone is able to fill a combobox with gtk2hs , using the ListStore String ?
19:29:05<Cale>(.) is an associative operator, which seems like maybe it's not a big deal, but it really gives you a lot of ways to break down and think about code written with it.
19:29:48<ehird>lisp is inherently inelegant because you can't reduce it to currying without adding an (a b c d) → (((a b) c) d) hack
19:29:50<ehird>/semi-random
19:31:49<mauke>lisp is inherently inelegant because you can't write a g such that (f x y z) == (f (g x y z))
19:32:03<Cale>If you have something like f $ g $ h $ x with the current right associative $, then the subexpressions are f, g, h, x, h $ x, g $ h $ x, f $ g $ h $ x. So there are 7 of them. If you have f . g . h $ x, the effective subexpressions are f, g, h, x, f . g, g . h, h $ x, f . g . h, g . h $ x, and f . g . h $ x, so there are 10 of them. As the chain gets longer, this effect becomes more pronounced.
19:33:00<dons>http://shootout.alioth.debian.org/u64q/shapes.php star graphs of haskell
19:33:06<algal>poor lisp. gets beat up even by the haskellers.
19:33:12<Cale>(essentially linear vs. quadratic growth)
19:33:36<ehird>20:31 mauke: lisp is inherently inelegant because you can't write a g such that (f x y z) == (f (g x y z))
19:33:36<ehird>↑ you can in scheme, with a little bit of bending the standard
19:33:55<ehird>(f (values 1 2 3)) is undefined and its meaning is debated, so...
19:33:59<mauke>come on, this is trivial in perl
19:34:02<mauke>sub g { @_ }
19:34:18<ehird>mauke: besides
19:34:29<ehird>you can't write a g such that (f x y z) == (f (g x y z)) in Haskell, mauke
19:34:46<mauke>yeah, but (f x y z) means something different in haskell
19:35:04<mauke>haskell sidesteps the issue by simply not having parameter lists
19:35:31<algal>thansk for all the help
19:36:04<donnelly>A library packaging question:
19:36:17<donnelly>I wrote a little toy graphics library, similar in concept to chalkboard.
19:36:37<donnelly>Then I got ambitious, and now the library has support for drawing with GTK, WX, and GD.
19:36:59<donnelly>Now I'm trying to figure out cabal, and I want to package it so that the support code for GTK or WX or GD is optional.
19:37:13<donnelly>What's the recommended way to achieve that?
19:37:38<ehird>donnelly: yi does it with flags.
19:37:45<ehird>but then you have to explicitly specify it, to wit:
19:37:54<ehird>cabal install magicdrawything -fgtk -fwx -fgd
19:38:00<donnelly>hmm
19:38:12<donnelly>I considered doing it as multiple packages
19:38:16<donnelly>as in
19:38:18<ehird>donnelly: that is probably the best option
19:38:25<donnelly>'Library', 'Library.WX', 'Library.GTK'
19:38:40<aavogt>ehird: the flags can be on by default
19:38:49<ehird>aavogt: but that'll fail if you don't have e.g. gtk/wx/gd
19:38:53<paolino>Cale, any help with gtk2hs, please ?
19:38:55<ehird>donnelly: +1 for the separate packages idea
19:38:59<donnelly>but then the question becomes, how do I specify that in the cabal file?
19:39:04<ehird>it'll be a lot clearer
19:39:10<ehird>donnelly: oh, i thought you meant separate
19:39:13<donnelly>do I have to keep it all in separate trees and files?
19:39:14<ehird>as in, separate hackage releases and all
19:39:17<ehird>and yes
19:39:20<donnelly>hmm
19:39:32<donnelly>i was hoping for a more elegant solution
19:39:41<Cale>paolino: sorry, what was your question?
19:39:48<Cale>paolino: oh...
19:40:07<ehird>donnelly: it is quite elegant imo :)
19:40:11<ehird>encapsulation and all
19:40:13<paolino>Cale, to fill a combobox, should be trivial ...
19:40:19<donnelly>for some definition of elegant, yes
19:40:21<Cale>paolino: err... I haven't really used that part of gtk2hs before, but I can try to figure out how it's done :)
19:41:00<donnelly>but I'd really like to keep all the associated code in the same source tree, and I'm not exactly sure how to do that and still make multiple separate libraries
19:41:11<paolino>Cale: thanks
19:41:45<Cale>comboBoxModel :: (ComboBoxClass self, TreeModelClass treeModel) => ReadWriteAttr self TreeModel treeModel
19:42:20<Cale>paolino: and a ListStore is an instance of TreeModelClass
19:42:52<Cale>So you should be able to set myComboBox [comboBoxModel := myListStore]
19:43:16<Heffalump>donnelly: what exactly do you mean by same source tree?
19:43:34<Heffalump>would different subdirectories, but using -idir1 -idir2 -idir3 when developing the code be enough?
19:43:45<paolino>Cale: myListStore being ?
19:43:57<Cale>paolino: The ListStore value which you mentioned having
19:44:07<paolino>le <- G.listStoreNew r
19:44:20<donnelly>Heffalump: mainly, the same repository in a VCS
19:44:40<Heffalump>donnelly: well, that's fine, you just have the VCS control the directory at the top
19:44:41<paolino>ACTION tries "set"
19:44:48<Heffalump>and put the cabal packages into subdirectories
19:46:10<donnelly>Yeah, I suppose that's the best option, I just wanted to make sure there wasn't some facility for that kind of thing that I was missing
19:47:50<paolino>Cale, still an empty combobox
19:48:05<Cale>paolino: Did you insert items into the ListStore?
19:48:13<paolino>:) yes
19:48:16<paolino>strings
19:48:23<Cale>hmm
19:48:27<Cale>I will try it.
19:49:48<paolino>Cale , how can it be that there is no constraints on the a of ListStore a ?
19:51:25<Cale>What? Oh, I was looking at the wrong documentation.
19:51:39<Cale>(there's apparently also an order ListStore with no type parameter)
19:51:42<Cale>older*
19:53:55<paolino>that with the TMs, I 've lost time there also :)
19:54:05<bremner>any of you ever call a Haskell library from perl (i.e. not via shell, but via some FFI or so)?
19:54:13<performance>hurraahhh, at last despite my stupidity, i got Leksah to build and install and finally work :) now to actually do something with it
19:54:21<hackagebot>Added by RemcoNiemeijer, Sun Jun 7 19:53:21 UTC 2009.: Benchmarking code through strict evaluation http://hackage.haskell.org/cgi-bin/hackage-scripts/package/StrictBench-0.1
19:54:59<TomMD>dons: ping
19:55:21<performance>@seen Ycros
19:55:22<lambdabot>Ycros is in #haskell-blah, #haskell-in-depth, #arch-haskell and #haskell. I last heard Ycros speak 7h 37m 40s ago.
19:55:44<Heffalump>bremner: I've done the reverse
19:56:09<dons>TomMD: pong
19:56:14<bremner>Heffalump, I want to call pandoc from ikiwiki, so direction is important :-)
19:56:26<FalconNL>Does anybody happen to have a checklist of the required steps to get the documentation for your module on Hackage? Apparently I've missed something.
19:56:34<Ycros>performance: hmm?
19:56:45<Heffalump>FalconNL: did you wait a bit
19:56:49<Ycros>performance: oh, congratulations
19:56:51<Heffalump>it takes some time for it to build the docs
19:57:00<performance>ycros, :) thanks, ultimately i got leksah to work
19:57:37<FalconNL>Heffalump: It's probably been about a minute or two since I uploaded it. How long is it supposed to take?
19:57:52<performance>now to play with some graphics and music
19:58:01<Ycros>performance: yay
19:58:24<Heffalump>FalconNL: not sure, but I think potentially some hours
19:59:09<FalconNL>Heffalump: Really? Ok, can't imagine why it should take that long, but I guess I'll wait
19:59:46<Heffalump>I'm not quite sure either. It's a pain, because I see stuff on RSS and want to look at the docs immediately
20:02:41<paolino>Cale, also I'm using glade-3, maybe that combobox is not the right version for the ListStore ....
20:03:56<FalconNL>Anyway, I just uploaded a little convenience library for benchmarking the strict evaluation of a value: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/StrictBench (see the home page link for a short example).
20:04:03<pumpkin>@where+ whyt http://whathaveyoutried.com/
20:04:04<lambdabot>It is stored.
20:04:55<malouin>Does anyone use Data.BerkeleyDB (distinct from Data.Berkeley.DB)?
20:05:18<Gracenotes>:>
20:05:31<malouin>I have spent about 3 hours trying to figure out how to create/open/close a bdb with this module.
20:06:04<malouin>the interface is seductive, but apparently equally elusive.
20:07:05<ehird>21:04 malouin: Does anyone use Data.BerkeleyDB (distinct from Data.Berkeley.DB)? ← this is the problem with the naming conventions
20:07:26<Cale>paolino: oh, hmm...
20:07:45<Cale>paolino: I just noticed the existence of comboBoxSetModelText, but one moment, I want to try this other way
20:07:45<dmwit>How is that a problem with the naming conventions? I'd say any language that has two libraries for a particular use will have problems like that.
20:08:07<paolino>Cale, that is the first I tried
20:11:13<Cale>hey, I got it to work :)
20:11:25<Cale> combo <- getWidget castToComboBoxEntry "comboboxentry1"
20:11:25<Cale> ls <- comboBoxEntrySetModelText combo
20:11:25<Cale> mapM_ (listStoreAppend ls) ["hello", "there", "world"]
20:12:06<Cale>ACTION tries with a plain combo box
20:12:09<ehird>Cale: looks like a prime suspect for abstraction there
20:12:15<ehird>ehm
20:12:18<ehird>replace subject with a proper word.
20:12:20<ehird>er.
20:12:21<ehird>suspect. argh.
20:12:59<Cale>Yes, it works similarly with a normal uneditable combo box
20:13:27<hackagebot>Added by JinjingWang, Sun Jun 7 20:13:05 UTC 2009.: A simple blog middleware on hack http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamboo-2009.6.8
20:14:13<ehird>"A simple blog middleware on hack"?
20:14:19<Cale>But I wonder what this comboBoxModel property is in general...
20:14:39<ehird>"Bamboo is a port of Panda, but runs on top of Hack."
20:14:39<pumpkin>*on crack
20:14:39<ehird>Ah.
20:14:43<ehird>... how is that middleware?
20:14:57<ehird>Enterprise middleware ajax 2.0
20:15:21<pumpkin>http://jinjing.easymic.com/ ooh
20:15:24<pumpkin>he's running it himself
20:15:31<ehird>wait
20:15:35<ehird>pumpkin: that's the original author of Panda
20:15:42<ehird>how confusing
20:16:27<ehird>@quote ehird
20:16:28<hackagebot>Added by JinjingWang, Sun Jun 7 20:15:20 UTC 2009.: bamboo blueprint theme http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamboo-theme-blueprint-2009.6.8
20:16:28<lambdabot>ehird says: 2009: The Year of the Combinatorial Explosion of Haskell Web Frameworks. Also, the Linux Desktop.
20:16:37<ehird>↑ totally accurate
20:17:04<BMeph>ehird: s/suspect/candidate/ maybe? :)
20:17:18<ehird>BMeph: yes :P
20:19:28<hackagebot>Added by JinjingWang, Sun Jun 7 20:18:43 UTC 2009.: bamboo-launcher http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamboo-launcher-2009.6.8
20:19:38<Botje>@pl minimaal p = or . fmap not . fmap meerderheid . filter (== p) $ subsequences p
20:19:38<lambdabot>minimaal = ap (((or . fmap (not . meerderheid)) .) . filter . (==)) subsequences
20:20:07<malouin>ehird: well, to bamboo's credit, at least Middleware has a technical meaning in Rack/Hack
20:20:21<ehird>in rack it's just app→app
20:20:26<ehird>but i can't see why a blog would do that
20:20:29<ehird>wouldn't it just be app?
20:20:37<malouin>ehird: I had the same question the other day.
20:20:39<mike-burns>Nah, it's a Middleware in Rack.
20:20:41<ehird>heh
20:20:52<ehird>mike-burns: ?
20:20:54<paolino>Cale, thanks, that library is just to messy/complex for me :-/
20:21:14<mike-burns>A Rack middleware is something that implements #call. By analogy to the Hack middleware.
20:21:35<ehird>mike-burns: Sorry, you're completely wrong.
20:21:45<mike-burns>What is a Rack middleware then?
20:21:47<ehird>That's a Rack _application_, and furthermore, Hack is based on Rack, not the other way around.
20:22:08<ehird>mike-burns: A Rack middleware is a Rack application that has Rack application "inside" and wraps over it.
20:22:18<ehird>That is, \app -> \env -> ... pass to app, mangle, etc ...
20:22:28<ehird>There seems to be no reason why some blog software would be one.
20:23:28<mike-burns>So a Rack middleware implements #call but does something else?
20:23:42<malouin>maybe they are expecting the common case to be passing the identity Application, heh.
20:23:44<ehird>mike-burns: Rack middleware is-subset-of Rack application.
20:24:15<ehird>mike-burns: Rack middleware is just an informal term for an application you create by doing FooMiddleware.new(FooApp.new)
20:24:24<ehird>It might, say, add a unicorn to every one of FooApp's page.
20:24:31<ehird>Or change /pony to display a pony and pass every other request through.
20:24:38<ehird>Or catch errors and display a pretty page, etc. etc. etc.
20:24:50<mike-burns>Okay.
20:25:18<ehird>So yeah; no idea why blog software would be middleware.
20:25:19<malouin>ACTION is using Hack atm.
20:25:21<Cale>ACTION fails to understand what is being discussed.
20:25:45<ehird>Cale: Hack, which is a port of Ruby's rack.
20:25:46<malouin>Cale: the hackagebot announcement about bamboo
20:25:51<ehird>And why Bamboo is a Hack middleware.
20:25:54<ehird>Instead of a Hack application.
20:26:29<RyanT5000>does anyone know how to get checkers-0.1.4 running on ghc-6.10.3?
20:26:52<RyanT5000>(i'm trying to install reactive-fieldtrip, and cabal install is failing to install checkers)
20:26:58<malouin>I quite like Hack though, for not really doing anything it is pretty handy.
20:27:19<BMeph>So, does Ruby have a nice rack? ;p
20:28:37<ehird>BMeph: You're so witty.
20:29:00<Asztal>if you mean the AMD/ATI demo girl, then yes :)
20:29:22<BMeph>ehird: Eh, I blame early-onset senility; I turn 40 on Tuesday. ;p
20:29:33<Ycros>sif credit Ruby though
20:29:36<ehird>BMeph: Wow, you're aaaaaaancient. Like a fossil.
20:29:38<ehird>An alive fossil.
20:29:54<Ycros>Rack is based off Python's WSGI, which was probably inspired in part by Java's servlet APIs
20:30:09<ehird>which was, in a time accident, based off Hack
20:30:20<Ycros>thus we come full-circle
20:30:59<BMeph>ehird: Well, I'm not augustss' age, but I aspire to it. I aspire to a lot of his accomplishments, but I'm thinking that his age may be one I can match. ;)
20:31:02<dmwit>a time machine. I accidentally created
20:31:29<ehird>BMeph: older than 40? Impossible. I therefore conclude that augustss is -40 years old. Wrapping integers!
20:32:02<ehird>dmwit: it's actually "Machine. Unexpectedly, I'd invented a time"
20:32:03<BMeph>ACTION pages augustss, pointing to ehird's remark...
20:32:11<pumpkin>BMeph: omg!
20:32:19<ehird>BMeph: ssh! He will destroy us all with the power of his not-being-born-yet.
20:32:34<BMeph>Now I understand that meme...
20:32:51<ehird>BMeph: Wait, which meme
20:33:03<BMeph>the whole thing. Is that dangerous? I accidentally
20:33:08<ehird>!
20:41:57<BMeph>RyanT5000: I've noticed that sometimes, cabal installs get stalled. Try killing the process and re-trying it - checkers installed for me, but I haven't tried it out, so it may not work; I'll check.
20:42:14<RyanT5000>BMeph: it's not stalled; it has an actual error
20:42:25<RyanT5000>src/Test/QuickCheck/Checkers.hs:56:7:
20:42:25<RyanT5000> Could not find module `Test.QuickCheck.Utils':
20:42:25<RyanT5000> it is a member of the hidden package `QuickCheck-1.2.0.0'
20:42:25<RyanT5000> Use -v to see a list of the files searched for.
20:44:15<RyanT5000>i've run ghc-pkg expose QuickCheck-1.2.0.0, though
20:45:33<BMeph>RyanT5000: That shouldn't be a problem if the checkers package is set right - which it looks like to me: http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=5634#a5634
20:46:35<RyanT5000>oh; maybe if i try to install checkers-0.2, it'll work
20:49:20<BMeph>RyanT5000: Maybe. I just installed checkers (no qualification) by itself, and it loaded up just fine - as my ghc-pkg list showed. :)
20:55:15<hape>hi everybody, i try using ghci and want to edit my files with emacs. i've set ":set editor emacs" - fine, but when i open a file with ":edit a.hs" emacs is blocking the ghci shell, until i end it. how can i go in parallel on both, emacs and ghci?
20:56:13<dmwit>hape: Use screen, or two terms?
20:56:36<hape>sorry, i did not understand. what do you mean with screens?
20:56:45<dmwit>?go screen multiplexer
20:56:48<lambdabot>http://www.bangmoney.org/presentations/screen.html
20:56:48<lambdabot>Title: screen - The Terminal Multiplexer
20:56:57<mike-burns>hape: Set the editor to a shell script that launches emacs in the background?
20:58:17<hape>sorry i am new to this materia. ghci is already opening emacs in another window, but i cannot go on in ghi with entering commands, until i leave emacs window and close it.
20:58:28<hape>"in ghci"
20:58:53<SamB>hape: well, how about you start your own emacs window instead?
20:59:08<SamB>using the "&" to make it not block your shell
20:59:21<andrewsw>why not run ghci within emacs?
20:59:21<SamB>*then* start ghci
20:59:27<hape>& i now, but this did not work in the ghci command :set editor emacs &
20:59:29<SamB>or, yeah, you could run ghci inside emacs
20:59:51<SamB>hape: well, I personally just run my own emacs
20:59:59<hape>Thank you
21:00:55<SamB>you could submit a ticket requesting that ":set editor emacs &" try to run emacs asynchronously, though
21:01:28<hape>SamB: i could do this, am i right i find on haskell.org a ticket box?
21:01:41<SamB>let me see...
21:01:45<SamB>@go ghc trac
21:01:47<lambdabot>http://hackage.haskell.org/trac/ghc/
21:01:47<lambdabot>Title: GHC - Trac
21:01:58<SamB>hape: there should be something easy to find there
21:01:59<hape>perfect :-) thanks i do this
21:02:03<hape>thanks
21:03:25<andrewsw>hape: there is an emacs library "haskell-ghci" that does some nice stuff like "haskell-ghci-load-file" etc
21:04:02<hape>andrewsw, i will have a look on that, thanks
21:10:21<RyanT5000>how do i get cabal-install installed globally?
21:10:27<RyanT5000>(instead of in ~/.cabal/)
21:10:31<Heffalump>configure cabal to install things globally
21:10:43<Heffalump>there should be a commented out line in ~/.cabal/config to that effect
21:10:43<thoughtpolice>RyanT5000: it should be in ~/.cabal/config
21:10:50<RyanT5000>thoughtpolice: thanks
21:10:51<Heffalump>then cabal install cabal-install
21:11:53<RyanT5000>Heffalump: thanks :)
21:15:51<RyanT5000>after changing the config of cabal install to generate profiling for all the libraries, is there a way to make it rebuild *all* my libraries with profiling?
21:16:07<RyanT5000>(including the ones already installed)
21:22:36<dmwit>RyanT5000: I don't think there's a convenient way.
21:22:44<RyanT5000>dmwit: alright, np
21:22:51<dmwit>RyanT5000: However, several people have asked for this, so you should check for a cabal bug and vote for it. =)
21:23:23<RyanT5000>where's the bug tracking system?
21:25:57<dmwit>uh...
21:25:59<dmwit>dunno?
21:26:12<RyanT5000>dmwit: alright; i'll look around
21:26:19<dmwit>http://hackage.haskell.org/trac/hackage/wiki/CabalInstall looks promising
21:32:51<skorpan>i cabal installed xmobar but "ghc-pkg unregister xmobar" tells me it's not found
21:32:53<skorpan>any ideas?
21:34:33<skorpan>it's not shown in "ghc-pkg list" either
21:34:37<skorpan>but i'm sure it's installed?
21:35:11<skorpan>meh
21:44:03<alexsuraci>I'm getting an "incorrect header check" error with the Zlib lib, anyone know what that means besides that the header check was incorrect? ;)
21:44:41<alexsuraci>A primitive inspection of what I'm trying to unzip seems to line up with what decompress expects (both the data and a compressed string test begins with "x\156")
21:47:38<alexsuraci>afaik the unzipping works fine with Python's zlib, I'll test now
21:47:42<dmwit>?tell skorpan I don't think xmobar is a library, so it shouldn't be listed in ghc-pkg list.
21:47:43<lambdabot>Consider it noted.
21:48:40<dmwit>alexsuraci: It sounds like there's some checksum that didn't sum. =P
21:49:00<alexsuraci>oh boy :P
21:51:04<pumpkin>ACTION wishes more GHC hackers were in non-European timezones
21:52:01<Alpounet>are there that much European GHC hackers ?
21:52:18<pumpkin>most of them seem to be in the UK :)
21:54:47<sioraiocht>pumpkin: probably because UK universities love to teach Haskell
21:55:52<p_l>sioraiocht: only few of them, it seems
21:56:32<p_l>I'm getting Haskell only in last year, in a course about "alternative computation models"
21:56:58<pumpkin>lol
21:57:02<mmorrow>does anyone know if there's a particular latex symbol used for '::' ?
21:57:32<pumpkin>I know that agda has a special symbol for it
21:57:37<pumpkin>so unicode must define one
21:57:45<mmorrow>yeah, there's the unicode one
21:57:57<pumpkin>\dblcolon
21:58:01<mmorrow>woot, thx
21:58:10<sioraiocht>p_l: which uni?
21:58:10<mmorrow>(was that a guess?)
21:58:14<Gracenotes>hrm. It seems the longest Haskell solution for the shootout is even longer than the longest C one...
21:58:16<pumpkin>mmorrow: http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-a4.pdf
21:58:16<mmorrow>ACTION finds out
21:58:23<Gracenotes>must be the hash table implementation :/
21:58:25<mmorrow>pumpkin: i've got that open :)
21:58:27<pumpkin>mmorrow: :D from mathtools apparently
21:58:27<p_l>sioraiocht: University of Aberdeen
21:58:31<Gracenotes>silly built-in implementation
21:58:43<mmorrow>\dblcolon is a sneaky one
21:58:46<sioraiocht>p_l: ah. Well, most people in the US _never_ see it
21:58:54<pumpkin>whenever I'm writing a mathematical document in LaTeX I have that document open
21:59:44<pumpkin>mmorrow: have you noticed the \Maggie
21:59:49<pumpkin>\Marge etc.
22:00:05<p_l>sioraiocht: in Edinburgh, I had seen haskell book packaged together with Java book, apparently targeting CS majors :D
22:00:05<BMeph>ACTION says, "D'OH!"
22:00:24<sioraiocht>p_l: that's ashame, CS majors shouldn't have to be targeted with Java =p
22:00:42<pumpkin>mmorrow: did it work?
22:01:25<pumpkin>there's also \squaredots that approximates it
22:01:27<pumpkin>but is too square
22:02:09<Gracenotes>you're too square, pumpkin!
22:02:38<pumpkin>:(
22:03:15<pumpkin>does anyone here know what the "desugaring" rules are for FFI declarations?
22:03:21<mmorrow>oh yesh worked nicely
22:03:29<pumpkin>the only FFI spec I can find doesn't mention implementation
22:03:32<mmorrow>(i dunno how i feel about it though, it's kinda narrow)
22:03:54<pumpkin>and \squaredots is too wide
22:03:58<mmorrow>grr
22:04:08<duaneb>so
22:04:11<duaneb>I have been hired
22:04:11<duaneb>to
22:04:16<pumpkin>how about :\hspace -x: ?
22:04:19<duaneb>essentially write a replacement for gmp
22:04:20<mmorrow>i've always wanted to learn metapost .. (now's not the time though ;)
22:04:26<pumpkin>duaneb: :o by whom?
22:04:37<duaneb>pumpkin: a local professor
22:04:44<duaneb>so
22:04:46<pumpkin>duaneb: funny you should mention that :P
22:04:52<pumpkin>mmorrow: just a pair of colons with a negative h space between them?
22:05:03<mmorrow>duaneb: what's his gain from paying you?
22:05:15<duaneb>mmorrow: he gets a gmp replacement
22:05:22<pumpkin>he doesn't want GPL?
22:05:24<mmorrow>pumpkin: oh i'm sure i'd go off the deep end if i ever get around to learning metapost
22:05:26<duaneb>anyway, I can license it however I want to
22:05:38<pumpkin>ACTION is puzzled
22:05:40<bremner>duaneb, AGPL3
22:05:42<duaneb>just so long as he can use it for his own work
22:05:50<pumpkin>mmorrow: any idea on how FFI is implemented in GHC?
22:06:09<mmorrow>duaneb: what in particular do you mean by "implemented"?
22:06:13<duaneb>I understand that haskell has had problems with gmp; anyone have any specific problems with is right now?
22:06:14<mmorrow>err, @pumpkin
22:06:37<duaneb>I've found this: http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes
22:06:48<pumpkin>mmorrow: well, given that at the stage of compilation at which I need the FFI, base does not exist, I can't use IO, Foreign.C.Types (I got around that with unlifted FFI types), and the like
22:07:07<duaneb>bremner: I'm probably going to do MIT
22:07:07<mmorrow>duaneb: pumpkin's been hacking on essentially this exactly for a little while now
22:07:17<p_l>duaneb: good luck
22:07:20<bremner>duaneb, AGPL was not a serious suggestion
22:07:20<pumpkin>mmorrow: and trying to replace IO with a State# RealWorld -> (# State# RealWorld, a #) makes ghc complain about it being inappropriate
22:07:30<p_l>ACTION failed MIT application ^_^
22:07:51<mmorrow>pumpkin: ah, so State# realworld stuff is IO without the monad
22:07:54<Gracenotes>p_l: failed to get in? Me too! :D
22:07:56<duaneb>p_l: thanks :)
22:08:04<pumpkin>duaneb: I'd take the task of writing a gmp replacement separately from integrating it with GHC
22:08:05<mmorrow>pumpkin: you just have to use case to sequence
22:08:07<duaneb>I'll be living in c/assembly for the next three months :|
22:08:08<bremner>p_l, don't worry, I know someone denied as a student, succeeded as a prof :-)
22:08:16<pumpkin>mmorrow: yeah, except the FFI doesn't like that
22:08:24<pumpkin>it complains that the type isn't suitable for an FFI declaration
22:08:27<mmorrow>pumpkin: ohh
22:08:30<pumpkin>so it wants IO, but I have no IO to give it
22:08:36<mmorrow>pumpkin: is this in cmm?
22:08:40<pumpkin>nope, just plain haskell
22:08:45<pumpkin>but haskell - base package
22:08:46<p_l>bremner: I'm more angry at not *trying* to go on MEXT scholarship
22:09:06<pumpkin>mmorrow: it says Unacceptable argument type in foreign declaration: State# RealWorld
22:09:17<duaneb>pumpkin: what's your approach to the problem?
22:09:18<mmorrow>pumpkin: hmm, maybe just fabricate your own fake IO (equivalent to the regular in all respects), an unsafeCoerce
22:09:40<pumpkin>duaneb: well, so far I've been working with Igloo's replacement, called integer-simple (http://darcs.haskell.org/packages/integer-simple/)
22:09:46<Gracenotes>Unacceptable!
22:09:47<mmorrow>pumpkin: ohh, also you can just not have the result be in IO too
22:09:51<alexsuraci>ok, tested GHC zlib vs. Python zlib, GHC zlib fails with "incorrect header check" where Python zlib decompresses fine
22:10:04<pumpkin>mmorrow: yeah, but then GHC might optimize it incorrectly?
22:10:10<mmorrow>foreign import ccall unsafe "malloc" malloc :: Int -> Int -- ;)
22:10:17<p_l>duaneb: Wait, you applying for class of 2013 or 2014? Because 2013 should have their acceptance letters already
22:10:23<mmorrow>pumpkin: we'll find out :)
22:10:33<alexsuraci>Even made sure they have the same zlib options.
22:10:37<pumpkin>mmorrow: lol
22:10:41<mmorrow>pumpkin: (it doesn't seem like you have many options)
22:10:48<pumpkin>duaneb: be aware that if your goal is actually to _be_ GHC's integer replacement, you can't use any of the functionality in the base library
22:10:54<duaneb>p_I: err, what?
22:10:58<pumpkin>mmorrow: Igloo was talking about moving IO out of base and into prim
22:11:15<pumpkin>but that seems like more than what I want to do
22:11:23<duaneb>pumpkin: what base library?
22:11:39<pumpkin>_the_ base library :P the library that contains pretty much everything you're used to
22:11:43<mmorrow>pumpkin: what's the sig of the particular C function you're trying to import, and what's the type that you ave?
22:11:45<mmorrow>*have
22:11:46<duaneb>pumpkin: I'm writing it in c
22:11:53<pumpkin>duaneb: ah
22:11:55<p_l>duaneb: Well, undergraduates starting this year would have already gotten their acceptance letters. So unless you're applying for a year later or as graduate, you'd have your letter already
22:12:05<duaneb>p_I: what are you talking about? :P
22:12:18<p_l>duaneb: concerning MIT ;-)
22:12:27<pumpkin>duaneb: did you see the jmp gmp replacement linked from the replacing gmp bug? mmorrow also had a self-contained gmp link
22:12:28<duaneb>oh
22:12:30<duaneb>hell no
22:12:36<duaneb>I'm going to caltech next year :D
22:12:57<mmorrow>duaneb: ah, those were links into the gmp src
22:12:59<pumpkin>mmorrow: well, even something like mpz_init (mpz_t integer)
22:13:04<p_l>ACTION dropped caltech from his list very fast
22:13:11<pumpkin>where mpz_t is a typedef struct[1]
22:13:30<pumpkin>basically a pointer :P
22:13:34<duaneb>pumpkin: http://hackage.haskell.org/trac/ghc/attachment/ticket/601/jmp.c?
22:13:36<duaneb>err
22:13:39<pumpkin>duaneb: yeah
22:13:41<duaneb>that question mark on the end isn't part of the URL
22:13:47<duaneb>yea, I've been perusing it
22:13:58<pumpkin>duaneb: mmorrow also had a gmp-in-a-file thing
22:14:03<mmorrow>err, so what's the type of the C function and what do you need to squirt through the call hole?
22:14:12<duaneb>ahh
22:14:13<duaneb>well
22:14:16<pumpkin>http://moonpatio.com/repos/LIBS/Language/ghc/gmp/gmp-4.2.1/dumbmp.c
22:14:31<duaneb>I'm in the "let's think about it" stage right now
22:14:42<duaneb>I'm trying to figure out about multiple custom allocators :P
22:15:05<pumpkin>mmorrow: I don't understand? what I have so far for that foreign import is foreign import ccall "__gmpz_init" mpz_init :: MPZ -> IO () where MPZ is Ptr MPZT and MPZT is a void type
22:15:18<mmorrow>duaneb: this header is some nice light reading http://moonpatio.com/repos/LIBS/Language/ghc/gmp/gmp-4.2.1/gmp-impl.h
22:15:23<alexsuraci>Anyone know what's going wrong here? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5637#a5637
22:15:47<mmorrow>pumpkin: ahh, cool. so you can just drop the IO and have it be
22:15:49<duaneb>mmorrow: I was actually thinking about hot-swappable
22:15:53<mmorrow>MPZ -> ()
22:15:57<duaneb>that looks like compile-time
22:16:00<pumpkin>mmorrow: it actually has to be Addr# -> ()
22:16:01<duaneb>err wait
22:16:09<pumpkin>mmorrow: but you sure that'll actually do anything?
22:16:15<mmorrow>Word64 -> ()
22:16:17<pumpkin>I got the impression that it'd be run once
22:16:21<mmorrow>pumpkin: positive
22:16:22<pumpkin>I can actually use Addr#
22:16:44<wot4n>i can't get this example code running in ghci. "length' xs = sum [1 | _ <- xs]" is returning a parse error on the =. i know it's simple, i'm just a newbie
22:17:00<goldenpuffs>general haskell question: is there a way to stop an algorithm prematurely like for example in an imperative language with if (a) return b
22:17:09<mmorrow>oh, i dunno about what'll happen with running it multiple times but it'd be interesting to find out
22:17:20<mmorrow>duaneb: hot-swappable?
22:17:24<mmorrow>duaneb: how do you mean?
22:17:25<pumpkin>mmorrow: yeah, that was my issue :)
22:17:31<erikc>wot4n: in ghci you need to put 'let' in front
22:17:48<duaneb>mmorrow: I mean, you can switch allocators during runtime
22:18:12<Saizan_>goldenpuffs: no, you can throw an exception in some monads, but that's not a normal return
22:18:34<aavogt>goldenpuffs: Control.Monad.Cont, primitive recursion, laziness... maybe other ways too
22:19:01<wot4n>erikc: thanks. :)
22:19:10<duaneb>mmorrow: which is something that, apparently, gmp already has
22:20:37<erikc>goldenpuffs: you need to formulate it as an if/else
22:21:23<pumpkin>duaneb: hot-swappable allocators?
22:21:27<pumpkin>duaneb: that seems unsafe
22:21:42<pumpkin>Be sure to call mp_set_memory_functions only when there are no active GMP objects allocated using the previous memory functions! Usually that means calling it before any other GMP function.
22:21:45<pumpkin>from the GMP manual
22:21:57<goldenpuffs>erikc: using guards for different cases should work as well, right?
22:22:10<pumpkin>you don't want to use one allocator to create an mpz and another allocator's free() to free it
22:22:14<duaneb>pumpkin: well, there would be guards
22:22:14<erikc>sure
22:22:22<goldenpuffs>ok I'll try that then
22:22:29<duaneb>pumpkin: and you couldn't, for example, use an allocator with tagged pointers
22:22:55<pumpkin>what would be the point of allowing it though?
22:23:08<pumpkin>just tell someone to call the allocator setter at the beginning of the program if they need it
22:24:26<duaneb>pumpkin: http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes#ReasonsforReplacingGMPastheBignumlibrary, #2
22:24:31<duaneb>err: http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes#ReasonsforReplacingGMPastheBignumlibrary
22:24:36<pumpkin>I know :P
22:25:13<duaneb>well then, unless you want foreign functions to use separate instances of gmp
22:25:26<duaneb>wouldn't "hot-swappable" allocators be the way to go?
22:25:30<pumpkin>?
22:25:35<duaneb>anyway, I just want to experiment :)
22:25:40<pumpkin>fair enough :)
22:26:33<Gracenotes>whether or not to replace GMP, surely their algorithms are too useful to pass up...
22:27:11<pumpkin>mmorrow: foreign import ccall "malloc" malloc :: Word# -> Addr# ?
22:27:22<pumpkin>ACTION trembles
22:28:41<duaneb>pumpkin: I suspect you're right, but I can always revert to the single (easiest) allocator
22:30:15<Cale_>wot4n: ghci normally doesn't expect you to type declarations at the prompt, it wants expressions instead
22:30:21<Cale_>(things which evaluate to values)
22:30:28<BMeph>pumpkin: Those make great handbags... ;)
22:31:00<Cale_>wot4n: If you want to make a quick temporary declaration, you can prefix it with 'let', but it's usually better just to put it into a file and load that
22:31:13<Cale_>Then when you modify the file, :r will reload
22:38:41<pumpkin>mmorrow: it's not recomputing
22:38:46<pumpkin>somewhat unsurprisingly
22:38:49<pumpkin>bah
22:39:08<pumpkin>main = replicateM 10 (print =<< mallocBytes 5) gives me 10 different addresses
22:39:19<pumpkin>replicateM 10 (print (I# (addr2Int# (malloc (int2Word# 5#))))) doesn't
22:39:36<jmillikin>Is there a built-in list function: split (/= 4) [1, 2, 3, 4, 5, 6, 7] -> ([1, 2, 3], [5, 6, 7]) ?
22:39:48<pumpkin>:t span
22:39:49<lambdabot>forall a. (a -> Bool) -> [a] -> ([a], [a])
22:39:50<PeakerWork>pumpkin: addr2Int# uses unsafePerformIO?
22:39:56<PeakerWork>:t addr2Int#
22:39:57<lambdabot>Not in scope: `addr2Int#'
22:40:01<PeakerWork>@hoogle addr2Int#
22:40:01<lambdabot>No results found
22:40:06<pumpkin>addr2Int# :: Addr# -> Int#
22:40:13<pumpkin>IO doesn't exist at that point
22:40:17<jmillikin>span includes the "sentinel" value in one of the result lists.
22:40:22<PeakerWork>what's malloc?
22:40:31<pumpkin>PeakerWork: a bad FFI binding
22:40:38<BMeph>> span (/= 4) [1, 2, 3, 4, 5, 6, 7] -> ([1, 2, 3], [5, 6, 7])
22:40:39<lambdabot> <no location info>: parse error on input `->'
22:40:39<jmillikin>I'm using it currently, but don't know if I'm re-inventing a square wheel.
22:40:42<pumpkin>PeakerWork: foreign import ccall "malloc" malloc :: Word# -> Addr#
22:40:45<PeakerWork>oh, malloc is an unsafePerformIO around C's malloc?
22:40:50<PeakerWork>pumpkin: ah, heh
22:40:51<BMeph>> span (/= 4) [1, 2, 3, 4, 5, 6, 7]
22:40:51<pumpkin>not even
22:40:52<lambdabot> ([1,2,3],[4,5,6,7])
22:40:59<pumpkin>PeakerWork: I can't use IO :/
22:41:04<PeakerWork>pumpkin: hwy?
22:41:06<PeakerWork>pumpkin: why?
22:41:25<pumpkin>PeakerWork: IO lives in the base package and it hasn't been compiled yet when I need it
22:41:27<mauke>> groupBy (const (4 /=)) [1 .. 7]
22:41:29<lambdabot> [[1,2,3],[4,5,6,7]]
22:41:49<mauke>> groupBy (const (4 /=)) [1,2,3,4,4,5,6,4,1,3,2,4]
22:41:50<pumpkin>PeakerWork: yet the FFI doesn't let me use State# RealWorld either
22:41:51<lambdabot> [[1,2,3],[4],[4,5,6],[4,1,3,2],[4]]
22:41:58<PeakerWork>pumpkin: hmm. what are you doing??
22:42:25<pumpkin>PeakerWork: making an FFI binding to GMP as a replacement for the current system... everything else is ready for it, but I need GMP in a library
22:42:44<PeakerWork>pumpkin: why can't GMP depend on base?
22:43:09<pumpkin>because Integer is used in various places in ghc, and needs to be present very early in the compilation, before base has been compiled, apparently
22:43:43<pumpkin>it's frustrating
22:45:31<RyanT50001>i've got an issue where, after running a certain IO action, ghci takes up 100% of a CPU
22:45:49<RyanT50001>is there any way for me to use the newfangled debugger to track down the thread that's causing that?
22:46:06<RyanT50001>(i can still issue commands to ghci, but they're slow)
22:47:58<RyanT50001>also, quitting ghci doesn't work; it says "Leaving GHCi." and then hangs
22:48:00<PeakerWork>pumpkin: surely its insane to not be able to use base
22:48:27<sioraiocht>RyanT50001: post the cost in hpaste?
22:48:30<PeakerWork>pumpkin: Can't ghc and base inter-depend?
22:48:34<pumpkin>PeakerWork: I'm asking on cvs-ghc now... maybe they'll have some suggestions...
22:48:45<RyanT50001>sioraiocht: cost?
22:48:49<pumpkin>PeakerWork: not sure, it'd be nice, but I don't think things like .hs-boot would work at that level
22:48:55<sioraiocht>RyanT50001: code, sorry
22:51:15<eu-prleu-peupeu>hi
22:51:30<PhDP>Is there a way to get to the nth element of a list without having to go thru the list from the first element to the element n. For example I get reach the element before the last element with pmLastButOne [a, b] = a and pmLastButOne (x:xs) = pmLastButOne xs but it doesn't seem very efficient.
22:52:17<dmwit>PhDP: No, there is no way to do it without going through the list. However, (!!) will go through the list for you.
22:52:44<RyanT50001>sioraiocht: well, it's using a million libraries, but here it is: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5638#a5638
22:52:52<dmwit>:t last . init
22:52:54<lambdabot>forall a. [a] -> a
22:52:58<dmwit>:t (!!1) . reverse
22:52:59<lambdabot>forall a. [a] -> a
22:53:40<dmwit>> last . init $ [1..5]
22:53:42<lambdabot> 4
22:53:47<dmwit>> (!!1) . reverse $ [1..5]
22:53:49<lambdabot> 4
22:53:52<RyanT50001>sioraiocht: it's making a freeglut window and rendering some stuff into it
22:54:22<sioraiocht>RyanT50001: and it never displays the window?
22:54:44<RyanT50001>sioraiocht: it does, but after i close the window it uses 100% of a CPU forever
22:54:48<RyanT50001>until i kill ghci
22:55:12<sioraiocht>yes, I would suggest compiling it with ghc
22:55:13<PeakerWork>RyanT50001: Are you using freeglut?
22:55:21<RyanT50001>PeakerWork: not directly
22:55:29<RyanT50001>it's all through reactive-fieldtrip
22:55:40<PeakerWork>RyanT50001: I remember reading this problem existed in some GLUT that wasn't freeglut
22:55:42<PhDP>But I'm curious, if there's no way to do it without going through the list, how can Haskell be so fast ? Because in practice it seems to be really fast, on the Computer Language Benchmarks Game it recently got behing only C and C++ (+ATS but it's not really a general purpose language) ?
22:56:18<mauke>PhDP: you can't do it faster in C or C++ either
22:56:18<PeakerWork>PhDP: Haskell supports other data structures except linked lists
22:56:19<dmwit>PhDP: If you're trying to pick out the last element of a linked list in any language, you've probably designed your solution incorrectly.
22:56:19<RyanT50001>PhDP: if you need efficient access to the second-to-last member, you can use datastructures other than lists
22:56:27<dmwit>PhDP: Haskell is no exception.
22:56:28<RyanT50001>haha
22:56:51<PeakerWork>dmwit: s/linked list/singly linked list or non-circular doubly-linked-list
22:56:55<dmwit>ACTION nods
22:57:00<RyanT50001>step 1: semi-criticize haskell; step 2: ... ; step 3: profit (in the form of many, many responses)
22:57:24<erikc>RyanT50001: i had a similar problem with ghci and glut, but it was a toy program and worked outside of ghci so i didnt investigate any further
22:57:35<RyanT50001>erikc: ah, ok
22:57:46<RyanT50001>maybe i should just not do 3d graphics from inside ghci... :P
22:58:02<sioraiocht>RyanT50001: that tactic is a common way to try and get attention in IRC help channels
22:58:19<RyanT50001>sioraiocht: yeah, lol
22:58:28<RyanT50001>such tactics don't seem necessary here, though
22:58:44<RyanT50001>this is the one chatroom i've never had any trouble with getting help in
22:58:56<mauke><KimmoA> I used to be all about linked lists. Now I know better, I stay away from linked lists.
23:00:00<PhDP>So in short, if I want to get to the element just before the last element, this solution is among the best I can do; pmLastButOne [a, b] = a and pmLastButOne (x:xs)
23:00:00<PhDP>?
23:00:16<shapr>Does the source version of 6.10.3 include cabal?
23:00:25<sioraiocht>RyanT50001: Asking for help in #haskell usually gets you WAY more than you bargained for
23:00:27<mauke>PhDP: yes
23:00:32<Botje>PhDP: someone gave you "last . init" as a solution
23:01:11<RyanT50001>PhDP: for performance purposes, the naive solutions are basically ideal
23:01:19<erikc>more like #haskelp
23:01:20<dcoutts>shapr: no, you're thinking of the Haskell Platform
23:01:25<shapr>oh
23:02:01<PhDP>mauke & Ryan: ok great. Botje; I'm not looking for a solution, I'm looking for the fastest solution... beside I don't understad the synthax of "last . init", I'll probably get there later.
23:02:17<mauke>PhDP: what other lanugages do you know?
23:04:07<david48>speaking of the haskell platform, it doesn't build on (K)ubuntu unless you manually make a simlink to libGL.so
23:04:09<PhDP>mauke: Well I'm a scientist so I'm not an expert in any language but I've had to deal with C, Java and Matlab (+ a little CPython).
23:04:32<Tsion>PhDP: . is function composition. (last . init) list is the same as last (init list)
23:04:47<gwern>last . init sounds terribly inefficient
23:05:08<mauke>gwern: O(n) :-)
23:05:08<pumpkin>it's still just linear
23:05:33<gwern>mauke: well, when I compare against data.sequence's complexity...
23:05:41<sioraiocht>PhDP: if you want access to both ends of a list there are a LOTof more efficient data structures
23:05:48<dmwit>PhDP: Haskell also has arrays, so if you know the size ahead of time, you can do much better.
23:05:50<sioraiocht>PhDP: data.sequence uses a finger tree
23:06:02<pumpkin>don't give him the finger... tree!
23:06:10<pumpkin>ACTION cries
23:06:13<sioraiocht>ACTION is a big fan of finger trees
23:06:36<pumpkin>me too
23:07:00<PhDP>wow, thanks for all the comments ;). I just tried (last . init) and it does work.
23:07:17<gwern>> (last . init) [1..] -- oh noes
23:07:18<hackagebot>Added by SterlingClover, Sun Jun 7 23:06:42 UTC 2009.: StringTemplate implementation in Haskell. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HStringTemplate-0.5.1.2
23:07:23<PhDP>I guess I'll have to learn a little about big O notation and theory if I want to design efficient code
23:07:23<lambdabot> mueval-core: Prelude.read: no parse
23:07:23<lambdabot> mueval: ExitFailure 1
23:07:41<gwern>last . init will only work on a finite list, and if you have a finite list, data.sequence is your man
23:07:59<pumpkin>or woman, if you prefer those
23:08:06<pumpkin>or anything else
23:08:26<dmwit>Computers hate it when you anthropomorphize them. ;-)
23:08:34<gwern>pumpkin: no, I'm using 'man' in the etymologically old english sense, where man means human, and not male
23:08:57<gwern>man = male is a post-old-english redefinition
23:09:14<david48>so what was male in old english ?
23:09:19<PhDP>I guess I'll have to look at data.sequence. What's the best structure to deal with matrices (say, the kind you have to deal with to solve big Markov processes) ?
23:09:20<erikc>human
23:09:20<pumpkin>so is a lot of what we speak
23:09:26<RyanT50001>david48: "wer"
23:09:39<mmorrow>pumpkin: http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2587#a2587
23:09:51<david48>weird
23:09:53<dmwit>PhDP: Oh, I've got some bad news for you...
23:09:55<gwern>PhDP: matrices? for that I guess you'd have to go hackage
23:09:55<pumpkin>mmorrow: :o
23:10:06<mmorrow>:)
23:10:10<pumpkin>mmorrow: alright, I'll give it a go :)
23:10:28<pumpkin>oh, I didn't realize that ## gave you a word
23:10:46<mmorrow>oh yesh! (iirc it's new in the last year)
23:10:51<pumpkin>nice
23:10:58<pumpkin>alright, back to ugly magichash for me then
23:11:14<mmorrow>yeah, the '#' is imo the ugliest possible one to choose..
23:11:47<mmorrow>it's like a little porcupine stabbing your retinas every time you look at it
23:11:47<PhDP>dmwit: what's the bad news ? I'd rathre know now than after (if) I start writting Haskell code for my thesis ;)
23:12:50<gwern>PhDP: well, when it comes to arrays, we like to say that haskell has the best arrays in the world
23:12:58<gwern>at least, it'd better - we have every other kind of array
23:13:03<pumpkin>mmorrow: foreign import ccall "__gmp_set_memory_functions" mp_set_memory_functions :: Addr# -> Addr# -> Addr# -> Void ;)
23:13:09<mmorrow>weee
23:13:24<gwern>strict ones, lazy ones, boxed ones, unboxed ones, strict unboxed, lazy unboxed, strict lazy cats in hats...
23:13:57<PhDP>So there's no problem
23:14:06<pumpkin>ACTION is basically throwing out all the type safety in this
23:14:11<PhDP>Unless there is a "but..." ?
23:14:26<dmwit>PhDP: Well, a while ago, there wasn't much in the way of good matrix libraries. But Hackage seems to have some stuff now, so maybe my news is out of date. =)
23:14:40<gwern>PhDP: no, that's basically the 'but' for haskell arrays. there's a ton of different ones which nobody knows how they perform
23:14:50<PhDP>As long as it's not GPL I'm ok with it
23:15:14<ArneB>The hmatrix package is GPL.
23:15:25<gwern>zing
23:15:35<PhDP>ah ok, that's a problem, but not so bad, I'll mostly have to deal with trees and I doupt haskell has any problem with those.
23:15:42<PhDP>Then I won't use hmatrix
23:15:54<Hunner>Hi, I have a data type with two constructors of different types. Given a string (say, containing "ID1" and "ID2" which tells which constructor to use) how do I construct a function of type "String -> Datatype"? Or am I going about it wrong?
23:16:21<dmwit>Hunner: Check out the Read class.
23:16:34<dmwit>Hunner: You can add "deriving (Read)" to your data type definition and get such a function written for you.
23:16:58<pumpkin>mmorrow: now for another hard question
23:17:03<pumpkin>mmorrow: foreign import ccall "&__gmpz_clear" mpz_clear_ptr :: Addr#
23:17:19<pumpkin>I need the address of the function
23:17:23<pumpkin>normally I'd use a FunPtr
23:17:29<mmorrow>hmm, that might work?
23:17:32<pumpkin>nope
23:17:34<mmorrow>aw
23:17:43<Hunner>dmwit: thanks
23:17:44<pumpkin>you can't have unlifted constants
23:17:48<pumpkin> Expecting an ordinary type, but found a type of kind #
23:18:25<mmorrow>i guess just write a function void *wrap(int x){return __gmpz_clear;}
23:18:35<pumpkin>ACTION weeps
23:18:39<mmorrow>haha
23:19:25<pumpkin>ah well, freeing memory is for wusses anyway
23:19:31<pumpkin>I'll leave it out for now
23:20:43<ray>you deserve that memory
23:41:56<shapr>Building ghc from source is a pain.
23:42:08<shapr>Brings me back to the days of ghc 5.04.
23:43:26<shapr>Still, cabal is involved, so it's way better than 5.04 days.
23:43:52<dcoutts>shapr: you can use the binaries
23:45:38<shapr>Truly, that would make more sense.
23:46:50<CSWookie>How do I make something like a Python iterator? I want to be able to say, "Give me the next one in that infinite series."
23:47:03<dino->shapr: Whatcha building it for?
23:47:03<SamB>it's called a list
23:47:07<SamB>;-)
23:47:27<dino->shapr: I mean, what OS
23:47:42<BMeph>CSWookie: You mean like "iterate <function> <first value>"? ;)
23:48:22<CSWookie>BMeph: Maybe? Do I?
23:48:42<CSWookie>BMeph: I want to be able to periodically say, give me the next one.
23:49:21<pumpkin>:k (->)
23:49:23<lambdabot>?? -> ? -> *
23:49:31<pumpkin>I don't supposed there's a way of changing that * to a ?
23:49:43<CSWookie>BMeph: I don't think so.
23:49:44<shapr>dino-: Just x86 at the moment, but I figured I should be prepared for ppc.
23:49:59<heatsink>What are these questionmark kinds?
23:50:15<CSWookie>BMeph: For example, I want to make something that counts by 3's.
23:50:18<dino->shapr: Gotcha. Practicing then, sounds like.
23:50:37<CSWookie>BMeph: iterate seems more like it creates a cycle.
23:51:05<heatsink>> take 10 $ iterate (3 +) 0
23:51:06<lambdabot> [0,3,6,9,12,15,18,21,24,27]
23:51:49<dino->> take 10 [x | x <- [1..], x `mod` 3 == 0]
23:51:50<lambdabot> [3,6,9,12,15,18,21,24,27,30]
23:51:51<TomMD>CSWookie: If you have an IO action to perform on each IO input then you can use a Channel - fork a receiver of sorts to get each item and have a worker pulling the work. If you want a more linear approach then perhaps "forM_" is all you want?
23:51:54<dino->oho, iterate
23:52:53<TomMD>CSWookie: There are also a number of libraries to aid you in building a REPL loop for things like interpreters. Haskline is the latest and greatest.
23:52:59<TomMD>@hackage haskeline
23:52:59<lambdabot>http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskeline
23:53:52<TomMD>I've recently used that to improve the REPL of Tim Sheards lambda calculator - it was really quick.
23:54:28<heatsink>CSWookie: If there are no side effects involved, then a Haskell list is a Python generator.
23:54:40<mike-burns>> take 10 [0,3..]
23:54:42<lambdabot> [0,3,6,9,12,15,18,21,24,27]
23:55:20<gwern>TomMD: shellac is better for interpreter repls than plain haskeline
23:55:30<dino->mike-burns: Ah! I guessed (incorrectly) that that would create 0,3,4,5...
23:56:43<TomMD>I used Shallac too - it certainly is more powerful but took not insignificant porting for me to get it to work.
23:56:57<gwern>dino-: right. the enum operator subtracts the first 2 numbers, and then begins incrementing by the difference
23:57:32<dino->gwern: That is handy
23:57:58<gwern>dino-: dunno. I haven't had all that much call to use it
23:58:10<dino->Ok, maybe it's not so much handy as geekily neat.
23:58:28<gwern>well, it is pretty neat

Back to channel and daily index: content-negotiated html turtle