Experimental IRC log haskell-2007-08-20

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:10<desp>this helps
00:00:12<desp>ddarius++
00:00:19<ddarius>I told you.
00:00:30<desp>yeah, I thought it was the other way around
00:00:50<ddarius>desp: But as I said, it may not be what you want.
00:01:07<desp>the code typechecks now, so I think it is what I want ;)
00:02:34<ddarius>class Single a | -> a where ...
00:02:35<chessguy>@quote typecheck
00:02:36<lambdabot>Saizan says: yesterday i was so drunk i was trying to typecheck the people at the party.. "what's your monad!?"
00:02:53<dons>?users
00:02:53<lambdabot>Maximum users seen in #haskell: 395, currently: 365 (92.4%), active: 19 (5.2%)
00:02:57<dons>whoa!1
00:03:03<dons>crikey!!!!111
00:03:20<Eidolos>make that 20 active users *resumes lurking*
00:03:26<dons>ddarius: do you remember when we guessed we'd reach 400?
00:03:28<dduncan>to follow up, it appears that what I missed was running this: sudo ranlib /usr/local/lib/ghc-6.6.1/*.a
00:03:39<dduncan>doing that got me past my stated problem
00:03:45<ddarius>dons: I don't remember guessing, so no.
00:04:33<sorear>ndm: Any word yet on when the AH slides go online?
00:04:35<ddarius>Since there were around 40 people on #haskell when I first joined, it's grown about an order of magnitude in that time.
00:04:57<dons>:)
00:05:09<chessguy>ddarius, when was that?
00:05:23<shapr>mudge: The publishing system is called HOPE.
00:05:24<dons>06.12.18:18:18:06 <dons> so how about 400 by say, next July?
00:05:25<ndm>sorear: mine are both online: http://www-users.cs.york.ac.uk/~ndm/downloads/
00:05:27<ddarius>Early 2002 I believe.
00:05:28<lambdabot>Title: Neil Mitchell - Downloads
00:06:06<shapr>dons: Heh
00:06:13<dons>18:18:33 <sjanssen> dons: I'll place my bet on May
00:06:21<dons>18:19:32 <sjanssen> August
00:06:27<shapr>Well..
00:06:43<dons>so sjanssen might be on the money
00:06:53<sjanssen>ACTION crosses fingers
00:06:58<sjanssen>@users
00:06:58<lambdabot>Maximum users seen in #haskell: 395, currently: 364 (92.2%), active: 19 (5.2%)
00:07:03<Pseudonym>ACTION considers creating some IRC troll accounts to artificially inflate the numbers
00:07:07<dons>:)
00:07:17<kpreid>they need inflation?
00:07:23<kpreid>stop while you're ahead :-)
00:07:27<ddarius>shapr has see two orders of magnitude and is well on his way to three.
00:07:45<sorear>so we're currently the FN #12
00:08:11<sorear>I've seen a binary OOM :)
00:08:18<dons>sorear: who's in 13th then?
00:08:27<sorear>dons: #kubuntu
00:08:31<dons>my stats says we're #13. http://searchirc.com/search.php?SCHANS=1&SSORT=SIZE&N=freenode
00:08:33<lambdabot>Title: Search IRC, displaying all channels on freenode
00:08:33<sorear>dons: #11 is #ruby-lang
00:08:44<dons>ah, so you're missing one channel
00:08:47<ddarius>What we need is to plot the growth of each of these channels over some amount of time.
00:08:54<sorear>ACTION is looking at http://irc.netsplit.de/channels/?net=freenode&chat=&num=10
00:08:56<shapr>Yeah, would be interesting.
00:08:56<lambdabot>Title: freenode - IRC Channels - irc.netsplit.de
00:08:58<bitrot>eh, #haskell is more entertaining to read than others..
00:09:22<shapr>bitrot: How so?
00:09:27<dons>ddarius: yeah, that'd give us some very interesting trend data
00:09:35<MarcWeber>lambdabot: ? :)
00:09:35<lambdabot>Maybe you meant: . activity activity-full admin all-dicts arr ask b52s babel bf botsnack brain bug check choice-add choose clear-messages compose devils dice dict dict-help djinn djinn-add djinn-clr
00:09:35<lambdabot>djinn-del djinn-env djinn-names djinn-ver docs dummy easton echo elements elite eval fact fact-cons fact-delete fact-set fact-snoc fact-update faq figlet figlet' flush foldoc forecast forget fortune
00:09:35<lambdabot>fptools free freshname ft gazetteer get-shapr ghc girl19 google gsite gwiki hackage help hitchcock hoogle hoogle+ id ignore index instances instances-importing irc-connect jargon join karma karma+
00:09:35<lambdabot>karma- karma-all keal kind learn leave let list listall listchans listmodules listservers localtime localtime-reply lojban map messages messages? more msg nazi-off nazi-on offline oldwiki palomer
00:09:38<lambdabot>part paste pl pl-resume pointful pointless pointy poll-add poll-close poll-list poll-remove poll-result poll-show pretty print-notices protontorpedo purge-notices quit quote rc read reconnect redo
00:09:40<chessguy>shapr, where else can you hear about extreme unicycling? :)
00:09:41<lambdabot>[3 @more lines]
00:09:50<shapr>chessguy: Hah, good point
00:10:03<ddarius>We may be passing ##c and ##c++ in the next year or two.
00:10:08<shapr>That'd be amazing.
00:10:09<ricky_clarkson>> get-shapr
00:10:11<lambdabot> Not in scope: `shapr'
00:10:15<shapr>ricky_clarkson: You called?
00:10:17<chessguy>@get-shapr
00:10:18<lambdabot>shapr!!
00:10:24<shapr>chessguy: You screamt?
00:10:45<chessguy>ACTION gets out the shap-signal
00:10:48<shapr>haha
00:10:59<bitrot>shapr: it degenerates better ;). Tangents tend to have more "ooh-cool!" moments.
00:11:13<shapr>That's a neat observation.
00:11:18<sorear>in the next year, I wouldn't be suprised if we pass #ubuntu!
00:11:52<chessguy>sorear, err, that's a big jump
00:12:01<dons>http://programming.reddit.com/info/2gqch/comments
00:12:02<sorear>ACTION thinks haskell is growing way too fast... think snowball rolling down mountain directly at a tree
00:12:02<lambdabot>Title: User-level transactional programming in Haskell (reddit.com)
00:12:08<chessguy>we'd have to quadruple in size in a year, even if they don't grow at all
00:12:21<dons>sorear: how do you think the ruby guys feel?
00:12:30<dons>or the lisp guys ... ;)
00:12:35<shapr>sorear: It's okay though.. if the snowball splits into a bunch of smaller communities, each of those will have something good from the community that was #haskell.
00:12:38<ndm>bogged down under a crappy syntax ;-)
00:12:46<dons>haskell-lang and haskell-happs
00:12:47<ricky_clarkson>You know when a channel gets too big because its topic contains things like "don't paste".
00:12:56<dons>yeah. i agree ricky_clarkson
00:12:58<gigamonkey_>The "<-" syntax is just part of the "do" sugar, right?
00:13:01<dons>we've not reached that yet
00:13:04<dons>gigamonkey_: yep.
00:13:10<dons>?undo do x <- getChar ; return x
00:13:11<lambdabot>(getChar >>= \ x -> return x)
00:13:19<shapr>It's surprising that we've gotten this many people without things breaking down.
00:13:22<sorear>gigamonkey_: it's also used by list comprehensions
00:13:26<mrd>?users
00:13:26<lambdabot>Maximum users seen in #haskell: 395, currently: 364 (92.2%), active: 22 (6.0%)
00:13:31<MarcWeber>How are the Java folks organized ? :) We'll end that way.
00:13:37<pchiusano>yo
00:13:42<gigamonkey_>So it seems like the YAHT explanation of the do translation rules should not use it on the right hand side of the translation rules. Hmmm.
00:13:44<chessguy>hi pchiusano
00:13:51<pchiusano>hey
00:13:51<sorear>ACTION can hear the sound of rivets popping in the background, however.
00:13:51<Eidolos>gigamonkey_: giving up on Lisp? :)
00:14:04<pchiusano>@src last
00:14:04<lambdabot>last [x] = x
00:14:05<lambdabot>last (_:xs) = last xs
00:14:05<lambdabot>last [] = undefined
00:14:08<gigamonkey_>Ah, never mind it doesn't.
00:14:21<shapr>Of course, we have #haskell-blah and #haskell-overflow, and #haskell.{se,de,es,dut,fi,fr,ru,no,hr,it} and more.
00:14:21<MarcWeber>shapr: What hould have broken down? the irc channel?\
00:14:24<reltuk>@src undefined
00:14:25<lambdabot>undefined = error "Prelude.undefined"
00:14:37<pchiusano>will last [a, b, c] evaluate a and b?
00:14:44<gigamonkey_>Eidolos: nope. Just expanding my horizons. Actually I'm hoping to interview Simon Peyton Jones for my next book to I figured I'd better get some learnin'
00:14:47<chessguy>pchiusano, no
00:14:53<shapr>MarcWeber: Most communities reach a certain size and then have a major split resulting in two or more communities.
00:14:55<reltuk>> last [1,2,3]
00:14:57<dons>sorear: i'm not convinced though. there's always the core community that goes to HW. that's not changing
00:14:57<lambdabot> 3
00:15:03<pchiusano>why won't it
00:15:08<dons>nd now we just have lots more people writing libraries
00:15:08<sorear>@users #haskell.es
00:15:09<lambdabot>Maximum users seen in #haskell.es: 1, currently: 0 (0.0%), active: 0 (NaN%)
00:15:19<chessguy>pchiusano, just enough to see that there are actually elements there
00:15:22<reltuk>dons: what's HW?
00:15:22<chessguy>pchiusano, not fully
00:15:27<gravity>We need more apps though. I wish I was actually good at coming up with interesting apps to write.
00:15:33<dons>i don't see any splits yet -- unlike lisp, haskell is too hard to write in a day to create your own incompatible fork :)
00:15:39<dons>reltuk: the haskell workshop
00:15:39<chessguy>> last [[1..],[3]]
00:15:41<lambdabot> [3]
00:15:45<chessguy>pchiusano, ^^
00:15:50<shapr>gravity: You don't have to be good at coming up with apps, you just hack on whatever is available, then things get better!
00:15:53<pchiusano>hmm
00:15:59<gigamonkey_>dons: you're thinking of Scheme.
00:16:02<gravity>shapr: Most of the apps that are available that I want to hack on are in C :-(
00:16:06<dons>gravity: yeah. apps are really useful. darcs, happs, pugs, xmonad. stuff like that.
00:16:19<MarcWeber>dons, shapr That's what would have guessed That ghc keeps all together
00:16:20<shapr>gravity: So port them to Haskell! It doesn't really matter whether you run across major problems, it's the journey that's fun.
00:16:43<dons>that's one way to do it: see xmonad or hmp3 for examples
00:16:51<dons>once the C app is just too annoying, write your own
00:17:12<reltuk>haha
00:17:15<shapr>gravity: Also, feel free to drop a project when you hit a roadblock and learn the right way to do that thing in Haskell.
00:17:20<gravity>The X server is a bit too big for me to want to rewrite it, annoying as it is :-)
00:17:24<dons>:)
00:17:28<shapr>gravity: But trying to write/port stuff is a great way to learn more Haskell.
00:17:32<dons>gravity: how bout XCB?
00:17:35<gravity>shapr: I've dropped quite a few so far, and learned a lot doing it
00:17:40<shapr>gravity: Excellent!
00:17:41<reltuk>ACTION has the impression that an appreciable amount of desktop-level software that dons uses everyday is written in haskell :-p
00:17:52<dons>reltuk: that's true.
00:18:01<gravity>dons: XCB itself? It's probably not the best choice among the X bits, given how old some of it is
00:18:08<gravity>Maybe some of the hidden bits like xinit
00:18:09<mudge>hey dons
00:18:22<dons>hey
00:18:28<shapr>gigamonkey_: Enjoying the #haskell community so far?
00:18:45<MarcWeber>nginit would be a much better choice
00:18:47<gravity>And rewriting debian's startx implementation in haskell might be fun
00:18:59<MarcWeber>aeh initng
00:19:01<wolverian>hm, or ubuntu's upstart
00:19:03<gigamonkey_>Seems pretty friendly. Of course I'm used to #lisp so lot's of things would seem friendly. ;-)
00:19:07<chessguy>hmm, no apparent interest in my bi-directional Data.Map :(
00:19:27<dons>chessguy: did you write one? benchmark it and post it to hackage?
00:19:32<dons>what is the structure?
00:19:38<gravity>wolverian: Well, I have direct influence over one, not the other :-)
00:19:43<chessguy>dons, i emailed -cafe with a proposed API
00:19:53<dons>chessguy: i think you should just write it :)
00:20:11<ddarius>@quote gigamonkey Seems pretty friendly. Of course I'm used to #lisp so lot's of things would seem friendly. ;-)
00:20:12<lambdabot>No quotes for this person. Maybe if you used more than just two fingers...
00:20:12<shapr>Yeah, write it, release it, and demonstrate why it's cool.
00:20:13<chessguy>dons, i'm planning on it, it would just be nice to get some guidance, as a newbie
00:20:18<ddarius>@remember gigamonkey Seems pretty friendly. Of course I'm used to #lisp so lot's of things would seem friendly. ;-)
00:20:18<lambdabot>Done.
00:20:26<phobes>Isn't there a haskell utility that takes API specifications to implementations?
00:20:36<dons>chessguy: hmm, i'd follow the Map and IntMap code for style and examples
00:20:36<ddarius>@djinn a -> b -> b
00:20:37<lambdabot>f _ a = a
00:20:42<mudge>shapr: cool HOPE system
00:20:49<wolverian>gravity, sure :)
00:20:53<shapr>gigamonkey_: Yeah, I wanted to learn CLisp at one point, but I started talking to rahul, and ... I've never really wanted to learn CLisp since then.
00:20:55<chessguy>dons, i basically cannibalized the Data.Map API
00:20:59<dons>good
00:21:07<ddarius>shapr: CL
00:21:09<gigamonkey_>Okay, if you're going to be remembering my flippant remarks at least answer my Haskell question ...
00:21:15<gigamonkey_>shapr: get a good book. ;-)
00:21:27<ddarius>gigamonkey_: Any suggestions...
00:21:37<shapr>gigamonkey_: I prefer an active friendly community mixed with a good book.
00:21:42<chessguy>dons, prepending "left_" for functions that go from k -> a, and "right_" for functions that go from a -> k
00:21:42<reltuk>Practical Common Lisp is free...and I thought it was great =)
00:21:46<gigamonkey_>When I define a type: data Foo = Bar | Baz how are instances of Foo actually represented.
00:21:46<shapr>gigamonkey_: What was your Haskell question?
00:21:52<gigamonkey_>see above.
00:21:59<ddarius>gigamonkey_: However the compiler feels like it.
00:22:02<mudge>gigamonkey: I really like your book on Common Lisp
00:22:04<gigamonkey_>ddarius: Well, I like Practical Common Lisp.
00:22:15<gigamonkey_>ddarius: I figured. But in practice ...
00:22:29<ddarius>gigamonkey_: I remember your announcement(s) in c.l.l.
00:22:46<gigamonkey_>I guess my real question is, there must be some runtime type information kept, right.
00:22:47<shapr>@undo do foo <- bar ; return bar
00:22:47<lambdabot>(bar >>= \ foo -> return bar)
00:22:53<ddarius>gigamonkey_: It's different for each implementation. GHC using something similar to Church encoding.
00:23:18<gigamonkey_>I.e. I can have a list of Foo's and map over it using pattern matching to figure out whether they were constructed as Bar or Baz, right?
00:23:21<ddarius>gigamonkey_: Yes, implementing it as just an Int or some such would be acceptable, but it isn't type information that is being stored.
00:23:25<chessguy>@pl bar >>= \ foo -> return bar
00:23:25<lambdabot>bar >> return bar
00:23:41<ddarius>gigamonkey_: Yes. But both Bar and Baz have type Foo.
00:23:45<Eidolos>I spent most of today reading Practical Common Lisp. I recommend it.. :)
00:23:47<mudge>gigamonkey_: great book on Common Lisp
00:23:56<shapr>Gee, I wonder who wrote that book? ;-)
00:24:02<gigamonkey_>mudge, Eidolos: thanks.
00:24:39<gigamonkey_>shapr: seriously, even #lisp isn't that bad. There are just a few guys you need to learn to ignore.
00:24:48<chessguy>dons, by the way, you don't have benchmarking on "How to write a program in haskell" :)
00:25:00<gigamonkey_>ddarius: so what do you call the difference between Bar and Baz.
00:25:14<shapr>gigamonkey_: Eh, I'd rather they were just banned...
00:25:17<gigamonkey_>a difference in ? constructor? value?
00:25:18<shapr>But I'm picky that way.
00:25:39<Korollary>constructor
00:25:46<pjd>or value
00:25:58<reltuk>so, in the case of constructor tags...that's not really type information, that's value information
00:26:00<gigamonkey_>Well, the thing is, the folks I'm thinking of are not doing anything wrong--they're just not acting in a way that's helpful to new Lispers.
00:26:26<shapr>In my opinion, that's something wrong.
00:26:32<ddarius>gigamonkey_: You can view Int as data Int = 0 | 1 | -1 | 2 | -2 | ...
00:26:39<dons>shapr: did yo usee http://esoteric.voxelperfect.net/wiki/IRP ?
00:26:40<lambdabot>Title: IRP - Esolang
00:26:40<shapr>Newbies are the lifeblood of any community.
00:26:48<gigamonkey_>But #lisp get's perhaps more than it's fair share of trolls and extremely clueless newbies so some people are on a bit of a hair trigger.
00:26:49<mudge>maybe there should be guidelines or write ups on how to help newbies
00:26:51<dons>chessguy: ah good point
00:27:01<reltuk>dons: hilarity
00:27:43<gigamonkey_>shapr: I mostly agree with you. But Lisp seems to attract newbies who come in with the attitude of "I've been programming Lisp for five minutes and here are a bunch of things I think need to change ..."
00:28:12<Korollary>dons: hahah
00:28:17<shapr>Well, #haskell gets its fair share of "Why can't I just get the Int out of IO Int?"
00:28:28<gigamonkey_>Which is particularly galling given Lisp's long history and the fact that many smart people have been hacking on it for a long time.
00:28:35<shapr>And that sometimes leads to "How to fix Haskell" posts on the mailing list.
00:29:10<shapr>gigamonkey_: You could teach them how to modify their own copy of lisp to do what they want :-)
00:29:21<reltuk>shapr: people don't seem to understand that >>= will do that for you...but will force you to put it back in eventually
00:29:32<shapr>reltuk: Yeah, I agree.
00:29:40<ddarius>What we tend to do is say "It's that way for a reason" and then let them figure it out themselves.
00:30:21<phobes>and if that doesn't work talk category theory at them until they leave
00:30:26<shapr>heh
00:30:30<ddarius>gigamonkey_: E.g. http://www.haskell.org/pipermail/haskell-cafe/2007-June/027172.html
00:30:31<shapr>I hope that doesn't really happen :-)
00:30:32<lambdabot>Title: [Haskell-cafe] Re: Perl-style numeric type, http://tinyurl.com/22valk
00:30:39<gigamonkey_>shapr: well, the problem is they don't even have to modify their own copy of Lisp; they *could* usually do it *in* Lisp but then we'd have to have a long conversation about why that's probably a bad idea. Or spend days helping them sort out all their programming questions while the do do it until they realize it's a bad idea. And most folks have run out of patience for either of those paths.
00:31:14<Korollary>I'd like my dessert now
00:31:17<shapr>Hm, I generally take the second path.. if they think it's a good idea, after I've said I don't think it is, I'll help them do it... maybe they're right.
00:31:32<shapr>And if they're not right, they generally end up with a much greater understanding of Haskell, so...
00:31:34<lament>but you can easily get Int out of IO Int :)
00:31:37<kpreid>gigamonkey_: re "runtime type information": note that Haskell completely separates the two things
00:31:43<desp>ddarius: heh
00:31:49<desp>that was indeed entertaining
00:32:32<gigamonkey_>Yeah, but some of these are *really* classic things the Lisp world has hashed out over, and over, and over again. Which an interested newbie could actually read about elsewhere if they cared.
00:32:34<kpreid>gigamonkey_: you can't have subtypes like you can in CL
00:32:49<kpreid>(allowing that makes type inference Hard)
00:32:54<ddarius>gigamonkey_: Indeed. As has been said and illustrated, it happens here too.
00:32:59<shapr>gigamonkey_: But the learning process would still help them hash it out for themselves.
00:33:18<ddarius>The solution is to tell them it's not a good idea and why and if they still insist let them try it themselves.
00:33:33<gigamonkey_>shapr: yes, the question is how much time do people want to spend guiding a seemingly endless stream of newbies through the same learning process.
00:33:47<ddarius>gigamonkey_: It's the nature of the beast.
00:33:50<gigamonkey_>particularly if the newbies seem unwilling to, say, go read a good book first.
00:33:53<shapr>gigamonkey_: Newbies become middies or whatever, and then they can guide the next batch!
00:34:00<ddarius>The new newbie doesn't know what the last newbie just asked.
00:34:23<kpreid>ACTION finds #lisp occasionally cranky and #haskell mildly noisy, and isn't sure which is better.
00:34:44<mrd>> fix ("newbie":)
00:34:46<lambdabot> ["newbie","newbie","newbie","newbie","newbie","newbie","newbie","newbie","ne...
00:34:59<lament>i like how there's a :) in there
00:35:20<SamB>kpreid: consider the topics as well ;-)
00:35:33<kpreid>Hmm?
00:35:37<gigamonkey_>I think any newbie who showed up in #lisp asking questions that demonstrated they had read and understood a reasonable % of Practical Commmon Lisp, would find people to be pretty helpful.
00:35:50<phobes>I think he means would you rather be in a channel about lisp or about haskell...
00:35:50<ddarius>gigamonkey_: I'm sure.
00:36:00<ddarius>gigamonkey_: But most don't do that in any language.
00:36:03<shapr>gigamonkey_: Some newbies don't yet know how to learn.
00:36:08<Olathe>Monads are the work of SATAN !
00:36:29<SamB>@google monads catholic church
00:36:30<lambdabot>http://en.wikipedia.org/wiki/Monism
00:36:30<lambdabot>Title: Monism - Wikipedia, the free encyclopedia
00:36:31<ddarius>Olathe: Possibly.
00:36:33<SamB>hmm.
00:36:48<kpreid>Haskell : monads :: Lisp : parentheses?
00:36:51<shapr>But if they have interest, and are willing to spend time on their interest, they can learn how to learn in the process.
00:37:03<ddarius>kpreid: A little bit, but not that much.
00:37:29<kpreid>ddarius: only in how they appear to newcomers; not so much in their actual role in the language
00:37:29<shapr>gigamonkey_: Or maybe I'm an unstoppable optimist :-)
00:37:48<mudge>I must say as a newbie learning Haskell, that I haven't been sure how much logic, how much computer science, how much actual haskell, and how much math I should learn
00:38:01<mudge>to learn and really understand haskell
00:38:08<lament>probably 100% haskell
00:38:17<ddarius>gigamonkey_: I do admit CL has it (probably much) harder. It takes a few more turns around the block before most people end up at Haskell.
00:38:24<mrd>has anyone tried to compile the unix package with ghc 6.6.1 lately
00:38:25<shapr>Yeah, that's true.
00:38:49<sjanssen>@hoogle setlocale
00:38:49<lambdabot>System.Win32.NLS.setLocaleInfo :: LCID -> LCTYPE -> String -> IO ()
00:38:50<lambdabot>System.Win32.NLS.c_SetLocaleInfo :: LCID -> LCTYPE -> LPCTSTR -> IO Bool
00:38:54<lament>mudge: all programming requires some background in math, logic and computer science, and i doubt haskell requires any more than not haskell...
00:39:03<Cale>mudge: Well, there's haskell, and then there's all this beautiful computer science which is going on around it. It's the CS which requires mathematics and logic.
00:39:11<gigamonkey_>shapr: Yes. I don't know how it is here in #haskell but in #lisp there seem to be quite a few newbies who don't really have interest in Lisp. These newbies (not all of them, but just enough to make it pretty annoying) seem to just want to find an excuse to *not* learn Lisp while maintaining their self-illusion that they're intellectually curious.
00:39:20<EvilTerran>kpreid, i'd say Haskell : Hindley-Milner :: Lisp : parens, and Haskell : Monads :: Lisp : macros. but that's just me.
00:39:22<ddarius>mudge, lament: You also gain knowledge of logic and mathematics just from learning Haskell (whether you realize it or not).
00:39:29<Cale>You'll probably end up picking up lots of it along the way.
00:39:32<shapr>gigamonkey_: Oh, we do get those here. But they don't usually hang around for long.
00:39:36<SamB>gigamonkey_: few come here with no interest
00:39:36<phobes>As another Haskell newbie, IMO haskell requires a much higher level of mathematical understanding than most other languages
00:39:46<SamB>or at least, they don't stick around...
00:39:59<gigamonkey_>That's probably too cynical--most newbies are not that way but Lisp seems to attract a lot who are which leads to the aforementioned hair trigger among old-school Lispers.
00:40:00<phobes>Mathematical maturity at least
00:40:12<Cale>I'm not sure about "requires", so much as that you can benefit from it.
00:40:16<mudge>well I learned PHP, and I tell you that you need to know very little about math, logic and a lot of other stuff, the learning curve is so slight in comparison to haskell
00:40:26<ddarius>phobes: It doesn't -require- mathematical maturity at all.
00:40:38<Cale>mudge: What other languages do you know?
00:40:41<phobes>ok I concede that... but to understand "what's going on"
00:40:42<ddarius>phobes: I'm willing to bet most people here would not say they have "mathematical maturity"?
00:40:44<mrd>mudge: the same notions of computability apply in PHP
00:40:48<phobes>I mean it's not as bad as epigram
00:40:50<shapr>gigamonkey_: I try to be very tolerant to someone without a reputation, and intolerant to someone with a previous record of just distracting people from the topic of learning Haskell, CS, PLT, etc
00:40:57<phobes>but compared to python or something...
00:41:07<mrd>mudge: it probably just never occurred to you to do anything other than ordinary web programming and string manipulation
00:41:13<SamB>shapr: meaning smerdy
00:41:15<Cale>If you already know imperative languages, then learning imperative languages is easy.
00:41:27<shapr>Yeah, Smerdyakov and several others fit into that.
00:41:31<Cale>If you already know functional languages, then learning functional languages is easy.
00:41:33<ddarius>SamB: Smerdyakov was not a distraction.
00:41:47<SamB>ddarius: baiting newbies isn't distracting?
00:41:50<gigamonkey_>shapr: You guys just wait until you've had a few decades of "You should learn Haskell--it'll make you a better programmer in whatever language you really use" and see the kind of newbies you get then and how much patience you have with them. ;-)
00:41:58<shapr>gigamonkey_: Yeah, maybe so.
00:42:06<kpreid>ACTION says that!
00:42:08<shapr>gigamonkey_: But I can hope #haskell won't get cranky.
00:42:17<ddarius>SamB: Well I didn't say exactly what I meant. "distraction" wasn't his worst attribute.
00:42:21<shapr>ddarius: Heh, true
00:42:23<gigamonkey_>ACTION doesn't really excuse the behavior of certain #lisp'ers.
00:42:25<SamB>gigamonkey_: I thought we were planning to move on to a new language before then
00:42:38<mrd>haskell', now with less crankiness!
00:42:41<shapr>w00!
00:42:51<gigamonkey_>SamB: that's the problem with Lisp. Once you know it, you can't move on. ;-)
00:42:52<shapr>gigamonkey_: And I'll do my part to keep #haskell from getting cranky.
00:42:58<shapr>I have my boots of kicking...
00:43:04<gigamonkey_>shapr: Good man!
00:43:05<SamB>gigamonkey_: can you say "blub"?
00:43:06<mudge>Well in PHP the stuff never comes up, the books on PHP are so dumbed down and easy to read, you don't get exposed to logic and a lot of things
00:43:07<ddarius>gigamonkey_: By then C## will be 90% Haskell.
00:43:18<mudge>I'm not saying it is better at all, I think Haskell is a lot better by far
00:43:44<mrd>mudge: in PHP you don't have the ability to really consider functions as values, and higher-order functions
00:43:50<EvilTerran>eval()!
00:44:11<mrd>as every lisper knows, eval does not give you higher-order functions =)
00:44:22<shapr>gigamonkey_: So, what are you learning now?
00:44:52<bitrot>ddarius: re: C##...but it'll have to be called D at that point, which is already there....unless you're in a microtonal system.
00:44:57<EvilTerran>ACTION thinks... i'm pretty sure you could do HOFs in perl, say, with eval and none of the usual HOF support in perl
00:44:59<gigamonkey_>I'm on chapter 9 of YAHT.
00:45:02<gigamonkey_>Monads.
00:45:12<shapr>Oh, what do you think so far?
00:45:18<EvilTerran>and it's definitely been used to do lambdas in Tcl...
00:45:24<shapr>Have you looked at stuff like http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html ?
00:45:26<lambdabot>Title: A Neighborhood of Infinity: You Could Have Invented Monads! (And Maybe You Alrea ..., http://tinyurl.com/ecqzl
00:45:36<gigamonkey_>Seems fine. I'm still enough of a Lisper to think any language without macros is missing something.
00:46:00<wolverian>gigamonkey_, the need for them? :)
00:46:01<SamB>gigamonkey_: if you'd seen our macro systems, you might change your mind
00:46:04<shapr>gigamonkey_: Well, there's Template Haskell... but it's definitely not as integrated as macros.
00:46:12<ddarius>gigamonkey_: We have TH but it's a crappy substitute and for a couple of reasons they're less needed.
00:46:19<pjd>mrd: http://www.steike.com/code/php-closures/
00:46:20<lambdabot>Title: php closures
00:46:26<mudge>mrd: true
00:46:26<EvilTerran>i find a lot of stuff you'd need macros for in lisp is covered by, say, typeclasses and whatnot.
00:46:28<SamB>TH might be lest crappy if macros were more needed
00:46:52<shapr>gigamonkey_: Finding monads easy to understand?
00:47:04<gigamonkey_>shapr: they're beginning to sink in.
00:47:20<shapr>Cool
00:47:32<kpreid>gigamonkey_: lazy evaluation and purity eliminates all the macros that are really just (or can be expressed as) wrapping lambdas around their arguments.
00:47:35<gigamonkey_>Though I have to say, the number of utterly confusing Monad tutorials on the web is disheartening.
00:47:46<SamB>gigamonkey_: agreed!
00:47:56<gigamonkey_>kpreid: yes, but those are not the interesting uses of macros. As you well know.
00:48:00<SamB>why we can't just use academic papers and such is beyond me
00:48:11<Olathe>Academic papers are hard to read.
00:48:23<gigamonkey_>SamB: the academic papers are worse!
00:48:27<kpreid>gigamonkey_: I admit I find it hard to think about what the whole category is
00:48:34<kpreid>here's *one*:
00:48:59<kpreid>in Haskell, for certain fs, you can write [f x, f y, f z], but not map f [x, y, z]
00:49:32<Olathe>Eww.
00:49:36<SamB>yes, if I did a monad tutorial, it'd probably start out like a mathworld article...
00:49:59<mrd>Wadler writes excellent academic papers
00:50:03<SamB>and then I'd just give some example monad implementations
00:50:06<Olathe>I think Mathworld is nice as a reference, but not as a tutorial.
00:50:09<lament>gigamonkey_: give an example for an actual macro that could be useful in haskell
00:50:27<pjd>lament: do blocks?
00:50:37<phobes>heh
00:50:45<SamB>well, I mean, I'd not try to explain what they are beyond the laws...
00:50:47<kpreid>If Haskell had macros, arrow notation would have been provided as macros.
00:50:52<ddarius>gigamonkey_: You find Wadler's papers on monads hard to read?
00:51:21<gigamonkey_>lament: I haven't grokked Haskell well enough to say. However, the kind of macros I'm talking about are things like: http://www.gigamonkeys.com/book/practical-parsing-binary-files.html
00:51:25<lambdabot>Title: Practical: Parsing Binary Files, http://tinyurl.com/9p6ly
00:51:30<gigamonkey_>ddarius: dunno if I've looked at them.
00:51:41<phobes>Macros could be used to hide the machinery of Monads more than just the do notation
00:51:51<ddarius>gigamonkey_: Do so at some point. They're extremely entertaining. Wadler is a gem of the Haskell community.
00:52:00<phobes>Look at how ugly it is to combine monads / monad transformers
00:52:05<mudge>gees, I've never had such interest in an IRC channel before, this channel rocks
00:52:19<mudge>i could read you guys all day
00:52:31<Korollary>You could read the logs
00:52:54<shapr>mudge: Yeah, roughly six years of logs :-)
00:53:02<gigamonkey_>The problem I've had with the monad tutorials I've found is that they're still aimed at Haskell programmers. Which makes a certain amount of sense ...
00:53:40<mudge>Korollary, shapr: I'm also new to IRC in general, kind of, are the logs on the Web?
00:53:40<gigamonkey_>... however I think there may be enough folks like me who say, okay, maybe I want to learn Haskell but first I need to know what these monad things are all about
00:53:57<augustss>gigamonkey_: but you don't
00:54:09<mrd>who is behind libraries@haskell.org?
00:54:22<gigamonkey_>But I do in the sense that I want a hint of how the story is going to end before I start reading the book.
00:54:33<gigamonkey_>ACTION doesn't really read actual books that way, mind you.
00:54:56<augustss>gigamonkey_: but monads is just a chapter in the book
00:54:57<shapr>ACTION grins
00:55:04<kpreid>the primary reason monads aren't readily transferred to other languages is lack of type inference for 'return', I think
00:55:26<ddarius>ACTION just got around to read that IRP link. It's hilarious.
00:55:27<gigamonkey_>It's like people thinking of learning Lisp want to know what the big deal about macros before they decide whether it's worth diving in
00:55:54<augustss>kpreid: the lack of higher kinded type variables makes abstraction of monads impossible
00:56:25<augustss>kpreid: and most languages lack that
00:56:56<ddarius>Haskell did too way back when.
00:57:11<ddarius>Or at least the facility to make type classes over them.
00:57:12<gmh33>wait.. gigamonkey, did you write this book?
00:57:21<gigamonkey_>gmh33: which?
00:57:25<ddarius>gmh33: /whois gigamonkey_
00:57:33<gigamonkey_>Practical Common Lisp? Yes.
00:57:36<gmh33>oh, wow
00:57:44<gmh33>neat
00:57:54<SamB>ACTION doesn't remember having gotten too far in that...
00:58:05<shapr>gigamonkey_: Heh, you're famous!
00:58:14<gmh33>I didn't really get too far into it either ^^;
00:58:19<gigamonkey_>In *very* small circles, yes.
00:58:32<gigamonkey_>you guys don't know what you're missing.
00:58:45<mudge>gigamonkey_: what if there was a separate lisp channel for old-time lispers that don't want to deal with newbies, and a lisp channel for newbies?
00:59:04<ddarius>mudge: That would be a useless waste of time.
00:59:19<SamB>you mean like #grumpy-lisp and #lisp or something?
00:59:26<gmh33>mudge: strange though, that he wrote one of the two most recommended books for common lisp newbies :P
00:59:29<ddarius>Or at least the newbie channel would be and the "old-timers" channel would just be #lisp as it is now.
00:59:37<sorear>it's pretty easy to make monads work in a statically typeless language with dynamic dispatch.
01:00:01<ddarius>sorear: Without closures.
01:00:14<SamB>gigamonkey_: well whenever I try CL I miss, uh, modular libraries, static types, functional programming...
01:00:28<sorear>Pretty much everyone has closures these days.
01:00:32<augustss>ddarius: yes, haskell lacked higher kinded type variables until Haskell 1.3 (I think it was). It was Mark Jones that came up with the idea
01:00:37<ddarius>SamB: Just implement a H-M type inference macro.
01:00:43<pjd>kpreid: it would be interesting to have a language with type-dispatched continuations
01:00:49<gigamonkey_>SamB: no doubt. But at least you'd have macros. ;-)
01:01:21<mrd>argh, libraries@h.o shouldn't be listed as maintainer if it won't accept arbitrary email.
01:01:27<shapr>I'd like to interview Mark Jones about all the cool stuff he's thought up for Haskell.
01:01:33<ddarius>Also lacking TCO...
01:01:39<gmh33>SamB: There's nothing keeping you from programming with a functional style in CL
01:01:46<augustss>gigamonkey_: I've used CL a lot. I don't miss it. Now and then I feel the urge for macros, though.
01:01:51<SamB>gmh33: what about all those nasty #'s
01:01:55<ddarius>gmh33: Nothing except the rest of the language and libraries...
01:02:06<mrd>#' is really the least of the problems
01:02:16<SamB>I didn't get far enough to know
01:02:34<shapr>I think (almost) every language has something worth understanding.
01:02:35<gigamonkey_>I'm interested to see, as I actually learn Haskell, whether it in fact turns out the macros are somehow unnecessary or incompatible with the haskell ecosystem.
01:03:07<gigamonkey_>shapr: except for some of the newer more popular ones. ;-)
01:03:25<mrd>gigamonkey_: a large number of macros are created to introduce different orders of evaluation, and haskell doesn't have that issue
01:03:34<EvilTerran>gigamonkey_, there are some things that TH seems useful for, but they don't seem to actually come up in the field that oftem
01:03:44<gigamonkey_>mrd: that's really the tip of the macro iceberg.
01:03:45<ddarius>gigamonkey_: They aren't strictly incompatible (though it would piss people off not to be able to use them in a "higher order" fashion) and they certainly are necessary for somethings.
01:03:47<EvilTerran>(eg dealing with tuples of arbitrary length)
01:03:48<augustss>But TH is clumsy
01:03:55<mrd>some macros generate boilerplate, which is addressed by libraries like SYB and Uniplate
01:03:56<phr-zzz>there's also liskell
01:03:57<gigamonkey_>EvilTerran: maybe that's because TH isn't powerful enough. I don't know.
01:04:19<gigamonkey_>ddarius: it's not clear to me what higher-order macros even means.
01:04:21<augustss>I miss macros to introduce new variable binding constructs
01:04:28<gigamonkey_>Macros are compiler plugins.
01:04:42<EvilTerran>and, yes, TH is hideously ugly much of the time. gigamonkey_, i mean, although being able to suck the nth value out of a k-long tuple sounds handy, say, it's rarely actually useful
01:04:44<ddarius>gigamonkey_: As mrd points out, there is a feeling of wanting to solve these problems "within" the language too.
01:05:10<ddarius>gigamonkey_: I meant things like (mapcar #'and somelist)
01:05:24<shapr>gigamonkey_: Hey, I wrote some PHP... bet you can guess my opinion.
01:05:36<mrd>I write CL pretty much every day still
01:05:55<mudge>shapr: what's your opinion of PHP?
01:06:06<shapr>I think it could be better :-)
01:06:12<shapr>Was that tactful enough?
01:06:25<mudge>:) I find php boring
01:06:31<shapr>Actually, I hacked on Drupal for a few hours and realized I could cut the code in half with higher order functions.
01:06:40<ddarius>ACTION has never used PHP. Yay!
01:06:57<gmh33>PHP stands for PHP Hates People, right?
01:07:13<mudge>noway, PHP loves people, it hates computer scientists
01:07:24<ddarius>So PHP Hates Programmers?
01:07:25<gmh33>I see
01:07:53<Tac-Tics>PHP is a very ugly language
01:08:01<shapr>mudge: I was looking for software bounties at the time, and Drupal had some. But I don't think Drupal would have accepted a patch that converted the whole codebase to Haskell.
01:08:20<mudge>It's a C language, if you think PHP is ugly, you probably think C is ugly too
01:08:28<mrd>Tac-Tics: you might say a Pretty Hideous Programming language
01:08:29<pjd>(regarding higher-order macros: http://okmij.org/ftp/Scheme/macros.html#Macro-CPS-programming)
01:08:30<lambdabot>Title: Scheme Macro Programming
01:08:39<glguy>PHP is ugly in ways that don't relate back to C
01:08:46<Olathe>C is somewhat nice.
01:08:51<Olathe>PHP is the work of Satan.
01:09:01<ddarius>Along with monads.
01:09:02<Tac-Tics>mrd: hah
01:09:08<SamB>Olathe: you just said that about monads, yes
01:09:14<gigamonkey_>ddarius: yeah, you could imagine wantiing that to work. But for most (interesting) macros, that kind of thing wouldn't even make sens.
01:09:17<Pseudonym>Satan is far too competent in his evil to have done PHP.
01:09:21<gigamonkey_>sense, even.
01:09:37<mrd>SataniT, the evil monad transformer
01:09:47<ddarius>gigamonkey_: I agree. In many of those cases, they could still be useful in Haskell. E.g. things like deriving.
01:09:47<Pseudonym>PHP has it's uses. It's for when SSI isn't quite enough.
01:09:50<shapr>mudge: In my opinion, with serious use of monads and higher order functions, Drupal would probably be 25% of its current size.
01:10:21<mudge>shapr: wow, good to know
01:10:34<phobes>Ya, Haskell is a big language. If it had macros it could conceivably be smaller
01:10:51<shapr>Maybe we should grab TH and clean it up :-)
01:10:59<mudge>shapr: it would have been neat for it Drupal to accept a patch that converted the whole code base to Haskell
01:11:22<ddarius>shapr: Actually, in some regards the problem with TH is it's too "friendly".
01:11:24<shapr>mudge: Don't think it would happen though :-)
01:11:29<shapr>ddarius: How so?
01:12:03<foones>Hi
01:12:05<shapr>hi foones
01:12:08<shapr>How's code?
01:12:20<ddarius>shapr: I want to munge arbitrary crap into Haskell, not type-checkable parseable Haskell.
01:12:23<foones>Does anybody know what something like \ ~x -> ... means?
01:12:33<pjd>foones: lazy pattern matching
01:12:35<foones>(emphasis in the ~ )
01:12:40<ddarius>foones: In that particular case it's identical to \x -> ...
01:12:49<mrd>see http://haskell.org/tutorial/patterns.html
01:12:50<lambdabot>Title: A Gentle Introduction to Haskell: Patterns
01:12:56<ddarius>Good job mrd.
01:13:02<shapr>ddarius: Ohh, so you think a ghc-api that made it easy to produce Haskell source would make more sense?
01:13:06<foones>Ahh =)
01:13:11<foones>Thanks!
01:13:17<mrd>yes, I remembered that and typed it in manually
01:13:37<ddarius>shapr: It's the quoting features that are more the issue not the generation ones.
01:13:43<phr-zzz>does anyone know why GADT's don't support "deriving Show" ?
01:13:55<shapr>ddarius: Huh?
01:14:14<shapr>ACTION thinks about that.
01:15:27<kpreid>with Lisp-style macros the arguments can be any value, not just Haskell source, and those values can be written cleanly in the source
01:15:32<twanvl>What would be cool is if [| . |] was a class method, class Quote a where [||] :: [Token] -> a
01:15:35<glguy>gigamonkey_: do you feel like any of the macro use in PCL gives a particularly compelling case for them in uses other than defining control constructs?
01:15:36<kpreid>s/Haskell/the-language/
01:15:47<gigamonkey_>glguy: see http://www.gigamonkeys.com/book/practical-parsing-binary-files.html
01:15:49<glguy>gigamonkey_: (just looking for a pointer to a chapter to review)
01:15:50<lambdabot>Title: Practical: Parsing Binary Files, http://tinyurl.com/9p6ly
01:15:51<shapr>kpreid: Oh, I see.
01:15:55<glguy>gigamonkey_: cool, thanks
01:16:14<shapr>Has anyone mentioned that idea to SPJ?
01:16:26<gigamonkey_>Also http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html though there are other non-macro ways to do that, especially with HOF.
01:16:28<lambdabot>Title: Practical: Building a Unit Test Framework, http://tinyurl.com/2b99d
01:16:30<Saizan>kpreid: even with TH the arguments can be any value, the difference is that haskell code is not a lisp-list
01:16:50<dons>mrd: thanks for the patch. yeah, it was an internal api change in the base package
01:16:58<ddarius>I think Camlp4 is more along the right lines for a Haskell-like language.
01:17:10<EvilTerran>ACTION would prefer if TH canonicalised quoted expressions more before giving them to you.
01:17:11<kpreid>shapr: that reminds me: does SPJ read his email? :)
01:17:11<mudge>Is the Common Lisp community bigger than the Haskell community?
01:17:17<glguy>gigamonkey_: most of the interesting macro use I've seen was to generate things like classes based on some domain specific representation
01:17:19<ddarius>mudge: Yes.
01:17:30<shapr>kpreid: He replies to me in the rare cases that I send him email.
01:17:30<glguy>but I don't have a ton of Lisp exposure
01:17:36<EvilTerran>but, given that it's not even finished, iirc, never mind that...
01:17:37<gigamonkey_>glguy: that's what that first chapter is, pretty much.
01:17:38<mudge>just curious, I wonder how much bigger
01:17:48<mrd>dons: I sent something about unix-2.0 to libraries@h.o but I don't know if it got through. it's the same deal though.
01:17:49<kpreid>shapr: I heard something in his A Taste of Haskell that makes me think there's some worthwhile ideas he doesn't know of.
01:17:58<gigamonkey_>shapr: you should tell him that he should respond to my email asking for an interview. ;-)
01:18:16<ddarius>mudge: Impossible to tell. It's hard to estimate the size of either. Probably at least an order of magnitude or two more, easily much more.
01:18:27<desp>hmm
01:18:33<desp>another typeclass problem.
01:18:44<shapr>gigamonkey_: You got no response?
01:19:04<mrd>mudge: there's a lot of CL out there which you doesn't manifest on the Internet in any noticeable way
01:19:11<desp>given typeclass Foo a b, how can I have a function (Foo a b) => a -> () ?
01:19:17<mrd>minus the "you"
01:19:29<desp>I actually want a function (Foo a Bar) => a -> ()
01:19:35<mrd>desp: what would said function do?
01:19:38<ddarius>desp: That should be doable.
01:19:47<gigamonkey_>shapr: well, I got an auto-response saying he'd be on vacation until tomorrow.
01:19:50<kpreid>"const ()"?
01:19:51<shapr>Oh
01:20:00<desp>mrd, kpreid: that's just sample code :)
01:20:10<desp>showing the essence of the problem
01:20:13<kpreid>desp: well, that's all your type allows
01:20:18<mrd>@djinn a -> ()
01:20:19<lambdabot>f _ = ()
01:20:20<augustss>desp: what's the problem with having such a function?
01:20:21<mudge>thanks ddarius, mrd
01:20:22<kpreid>desp: so it rather hides the essence of th eproblem
01:20:23<desp>kpreid: the type doesn't typecheck
01:20:25<twanvl>desp: maybe you should split the type class
01:20:26<ddarius>undefined!
01:20:27<gigamonkey_>So hopefully I'll hear from him tomorrow. But if you, or anyone else he knows, wanted to drop him a note saying I'm a reasonable fellow, that'd be fine.
01:20:46<mudge>gigamonkey_: what are you going to ask him?
01:21:00<ddarius>gigamonkey_: I'd imagine he'd look you up if you were asking for an interview if he was at all worried about it.
01:21:04<desp>twanvl: I don't think that's possible
01:21:17<ddarius>I doubt he gets crazies asking for interviews all that often.
01:21:18<gigamonkey_>mudge: I want him to let me interview him for my next book: http://www.codersatwork.com/
01:21:20<lambdabot>Title: Coders at Work
01:21:25<augustss>SPJ gets a lot of email
01:21:55<Korollary>I propositioned SPJ with my Nigerian business plan
01:21:57<hpaste> desp pasted "not so sample code" at http://hpaste.org/2346
01:22:01<mudge>gigamonkey_: wow, that's awesome
01:22:08<desp>kpreid, mrd: ^
01:22:14<desp>if that helps your understanding
01:22:30<kpreid>what's the error?
01:22:38<desp>this isn't valid syntax
01:22:42<desp>(BitFlags a CLong)
01:22:47<shapr>gigamonkey_: I think the binary parser could be done with Parsec and Data.Binary.
01:22:52<SamB>Korollary: lol
01:22:59<mrd>probably will want a fundep
01:23:06<hpaste> desp annotated "not so sample code" with "error" at http://hpaste.org/2346#a1
01:23:26<augustss>desp: are you using -fglasgow-exts
01:23:33<kpreid>desp: that's not a syntax error.
01:23:44<desp>kpreid: yes, you're right. my bad.
01:24:28<shapr>gigamonkey_: I think I'd implement "defmacro define-binary-class" as a typeclass.
01:24:45<desp>ahh.
01:24:46<augustss>desp: annotate fromIntegral so that it's clear that it returns CLong (if that's what you want)
01:24:59<desp>just a simple fundep fixed it.
01:25:16<augustss>that works too
01:25:23<shapr>ACTION looks at the unit test framework macro demo.
01:25:23<desp>oh.
01:25:28<glguy>as long as its what you wanted
01:25:33<glguy>since it has other implications
01:25:34<gigamonkey_>shapr: I don't know enough to say whether that's a good idea or close to equivalent.
01:25:41<glguy>other than allowing your code to compile :)
01:25:47<desp>thanks for the help
01:25:56<gigamonkey_>If you want to actually do it, I'd be interested to see what it looks like.
01:26:30<ddarius>ndm: Have you looked at supercompilation?
01:26:34<mrd>I like the way Binary works. write instances for your types, and it picks out the proper one to use based on what type is expected.
01:26:36<shapr>It would be a nice way to test out xerox' new SoC code.
01:26:40<ddarius>shite
01:26:44<shapr>mrd: Yeah, that's exactly what I was thinking.
01:26:48<ddarius>@tell ndm Have you looked at supercompilation?
01:26:49<lambdabot>Consider it noted.
01:26:52<mrd>QuickCheck also works this way
01:27:09<glguy>gigamonkey_: if you are talking to me, I could give it a look
01:27:12<mrd>when I first saw the code for QuickCheck, I was stunned that it was incredibly short
01:27:28<augustss>QuickCheck is rather clever
01:27:37<gigamonkey_>glguy: actually, I was talking to shapr since he said he'd do it as a typeclass. But the more the merrier.
01:27:37<ddarius>We like our code clever.
01:27:37<glguy>gigamonkey_: I think that the way this would be implemented in Haskell is that rather than defining a new type for each type of binary data to be handled
01:27:38<shapr>Yeah, I think QuickCheck covers the unit test framework, and a bit more.
01:27:45<glguy>gigamonkey_: ah, cool
01:27:53<glguy>gigamonkey_: I'm not following the channel closesly enough to keep up :)
01:27:55<shapr>glguy: Feel free to go for it, I'd rather get FLM working :-)
01:28:11<glguy>what's this FLM thing I've heard mentioned?
01:28:19<SamB>glguy: it depends what kinds of binary data you'd be dealing with...
01:28:26<gigamonkey_>shapr: like I said, the unit test thing can be done lots of ways, especially if you have HOF.
01:28:32<Pseudonym>glguy: It's a marvellous program that unfortunately the channel is too small to describe.
01:28:38<shapr>Yeah, true
01:28:48<glguy>is it publicly available?
01:28:49<shapr>ACTION laughs at Pseudonym's comment
01:29:02<shapr>glguy: What is it? A distributed decentralized wiki-based darcs-backed research paper annotation tool called Fermat's Last Margin.
01:29:08<mrd>perhaps you could sketch it in #haskell-margin
01:29:14<shapr>glguy: How does it work? In short, wget the pdf/ps, throw it into imagemagick, create wiki pages for the resulting page images, and save text annotations into the darcs repo. If your repo is http accessible, anyone can grab your per-page annotations, and you can grab theirs.
01:29:30<shapr>Pseudonym: I'm going to put that into the README :-)
01:29:41<Pseudonym>:-)
01:29:50<gigamonkey_>shapr: the one key feature of the macro-based test framework is that you can make something like (check (= (foo x y) 100)) report the pass or fail but also use '(= (foo x y) 100) in the output *and* tell you the values of x and y.
01:29:57<Pseudonym>"I have written a truly marvellous program, but unfortunately the README is too small to describe it."
01:30:24<mrd>ACTION suspects Fermat didn't really have a proof anyhow
01:30:34<mrd>just good intuition
01:30:55<shapr>gigamonkey_: QuickCheck does something sort of like that. But QuickCheck is pretty kickass, have you seen http://www.accesscom.com/~darius/software/clickcheck.html ?
01:30:56<lambdabot>Title: Clickcheck and Peckcheck
01:31:15<shapr>Clickcheck is a QuickCheck clone in CL, written by my good friend Darius Bacon.
01:31:23<mrd>ACTION is waiting for Paycheck
01:32:06<Pseudonym>mrd: I think he had a proof that he later found was wrong.
01:32:06<mudge>I found the haskell IRC log: http://ircbrowse.com/cdates.html?channel=haskell
01:32:11<lambdabot>Title: Meme Channel haskell by Dates
01:32:25<ddarius>mudge: There's a link to the logs in the topic...
01:32:28<gigamonkey_>shapr: haven't seen that. Thanks.
01:32:29<Pseudonym>If he really had a proof, he'd have published it.
01:33:10<mrd>Pseudonym: yea that's what I mean
01:33:32<mudge>ddarius: oh yea, thanks
01:37:15<shapr>glguy: Anyway, FLM will be useful for me, and hopefully useful for others as well, and it's a good chance to test out all the new HAppS changes too.
01:37:54<glguy>is the happs rewrite public yet?
01:38:01<shapr>It has some neat points. Since most research papers are for personal use only, I only record the annotations. The page images are generated by each user.
01:38:08<shapr>Not yet, but it's very close to ready.
01:40:13<glguy>who is doing the rewriting?
01:42:32<alexj_>glguy, hopefully tomorrow if shae can prove that someone other than me can use the framework to write an app :-)
01:42:32<alexj_>of which?
01:42:47<shapr>ACTION laughs
01:43:21<glguy>what is the goal of the new code?
01:43:28<glguy>what are you trying to make easier / better
01:44:14<MarcWeber>Does anyone know a small ffi using library which already has a cabal file running with hugs?
01:44:42<LoganCapaldo>ffi fie foe fum, I smell the blog of haskellman
01:49:46<ddarius>MarcWeber: Read the documentation for Cabal. It goes over some aspects of it.
01:54:12<ddarius>Er, I just read something about that somewhere.
01:55:53<ddarius>Ah, http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html#system-dependent
01:55:55<lambdabot>Title: 2. Creating a package, http://tinyurl.com/yv8xjt
01:57:12<mudge>It seems to me that programming communities like Common Lisp and Haskell etc. want their communities to get bigger, grow, get more newbies, I was wondering why?
01:57:39<Eidolos>why we want our community to grow?
01:57:44<Eidolos>to crush the heathen languages!
01:57:44<mudge>yea
01:57:53<mudge>that's a good point
01:58:14<Eidolos>human nature I guess.. I want more friends
01:59:02<kpreid>mudge: forall l. Language l => the more people use l, the less original l-users have to interact with software exposing interfaces in other languages / software without the benefits of l / ...
01:59:06<chessguy>and because haskell's such a cool language. we want others to use it too
01:59:41<Nafai>And the more people that use a given language the better chance the rest of us can find employment utilizing said language
01:59:50<chessguy>and in the dream that maybe someday haskell-programming jobs will be less rare than...uh...something really rare
01:59:50<Tac-Tics>chessguy: we *want* others to use it? Or demand it.....?
02:00:07<mudge>yea, that makes sense, I have an urge to pass on cool programming stuff and get other people to use stuff
02:00:28<bitrot>I think the reason behind Haskellers wanting community growth is so they can stop explaining everything twice when talking to people.
02:00:37<mudge>haha
02:00:41<mudge>that'll be awhile
02:00:54<LoganCapaldo>bitrot, but why do Haskellers want community growth?
02:01:04<gigamonkey_>In some of the Monad examples in chapter 9 of YAHT, he evaluates a foldM expression which prints a bunch of stuff and then at the next prompt evaluates "it" and gets a value. What's that about?
02:01:06<bitrot>;)
02:01:47<kpreid>gigamonkey_: ghci doesn't print the results of IO actions
02:01:53<chessguy>@where yaht
02:01:53<MarcWeber>mudge: Have you ever dreamed of running your own language? Why not? Because you would be busy writing the compiler for some time, then you'll be busy writing some basic libraries... That's at least one point why I'd like to seee teh haskell commutunity gowing :_)
02:01:53<lambdabot>http://darcs.haskell.org/yaht/yaht.pdf
02:01:56<kpreid>but it does assign them to "it"
02:02:06<kpreid>that is, it's implicitly "it <- whatyoutyped"
02:02:26<kpreid>except if you typed a non-IO-action it's implicitly "let it = whatyoutyped; print it"
02:02:54<phr-zzz>it looks like there's more haskell jobs available than there are people to fill them
02:02:57<shachaf>"x <- action" also assigns the value to "it".
02:03:01<kpreid>Oh.
02:03:09<mudge>phr-zzz: why do you say that?
02:03:11<shachaf>No, wait.
02:03:15<shachaf>ACTION is wrong, never mind.
02:03:16<wli>Yeah, but what qualifications are they asking for?
02:03:37<chessguy>phr-zzz, huh?
02:03:45<phr-zzz>i remember seeing an ad from galois connections that said basically "if you know haskell, get on a plane immediately, we want to hire you, and if you're not from the u.s. we'll put through visa paperwork"
02:03:56<chessguy>uh
02:04:02<Tac-Tics>phr-zzz: link plz
02:04:13<chessguy>galois has pretty strict requirements on who they hire. you have to be very smart
02:04:23<phobes>* five members of the channel quit to go buy plane tickets
02:04:23<chessguy>@where galois
02:04:24<lambdabot>I know nothing about galois.
02:04:37<phr-zzz>yes, and i think right now all skilled haskell programmers are smart
02:04:47<glguy>if you apply though that link, you'll probably get to meet me in an interview ;)
02:04:49<chessguy>http://www.galois.com/job_SoftwareEngineer.php
02:04:51<liyang>At least for the time being, knowing Haskell is a good enough filter as far as the HR process is concerned.
02:04:52<lambdabot>Title: Software Engineer
02:04:55<glguy>well, depending on who you are of course
02:05:14<glguy>ACTION has been on a couple of hiring committees lately
02:05:44<mudge>how many people work at galois who are also on #haskell?
02:05:46<Cale>hmm... maybe I should apply
02:05:55<phr-zzz>typing "haskell" into google brings up a jane st capital sidebar ad--but they use ocaml ;)
02:06:07<chessguy>glguy, are they hiring just for positions there in OR?
02:06:15<mudge>why is the galois website built in PHP?
02:06:15<glguy>chessguy: as far as I know
02:06:18<Tac-Tics>what about noobie haskell programmers?
02:06:26<Tac-Tics>will they consider the rest of us?
02:06:28<chessguy>mudge, very good question
02:06:44<chessguy>mudge, no doubt it's glguy's fault
02:06:47<phr-zzz>linspire also has been using haskell and might be more receptive to newbies
02:07:07<reltuk>I've experienced a weird phenomenon lately where I have trouble actually understanding why you would want transparent side-effects in a value-oriented/expression-oriented language
02:07:18<phr-zzz>i don't see that galois ad any more, but it sounded practically desperate
02:07:21<johnnowak>reltuk: hm?
02:07:32<reltuk>I've started looking at ocaml as kind of strange
02:07:38<mudge>glguy: why is the galois website built in PHP?
02:07:43<kpreid>reltuk: well, consider hGetContents
02:07:52<glguy>mudge: why not?
02:08:15<chessguy>ACTION snickers
02:08:18<phr-zzz>yeah glguy, they should use this: http://laconic.sourceforge.net/ ;-)
02:08:19<lambdabot>Title: The Laconic programming language family
02:08:26<SamB>mudge: you want them to use sometihng not yet invented?
02:08:31<chessguy>PHP = Please Hack me, Please!
02:08:54<phr-zzz>dependently typed web app programming
02:09:00<mudge>glguy: well I guess it could make sense if you are a Haskell company to build a website in PHP if the focus of your company isn't making websites/web apps
02:09:19<glguy>mudge: we didn't build our office building using haskell either :)
02:09:26<phobes>So do Haskell jobs pay well?
02:09:32<johnnowak>i'm not sure it ever makes sense to use php
02:09:33<chessguy>haha
02:09:51<olsner>aw, that's wonderful... I'm getting up in two hours or so, but still haven't gone to sleep
02:09:58<chessguy>glguy, how's cost of living out there in OR anyway? i'd guess it's pretty expensive
02:10:02<phr-zzz>glguy do you have to do a lot of .mil stuff at galois?
02:10:05<johnnowak>reltuk: what's strange about ocaml?
02:10:55<glguy>chessguy: the cost of living isn't so bad, I was in St. Louis, Mo. before this, and my bills are not noticably higher
02:11:44<glguy>phr-zzz: Galois does a lot of government contract work, to be vague
02:11:52<reltuk>johnnowak: the fact that IO expressions are typed like every other expression
02:12:12<johnnowak>ah.
02:12:23<chessguy>glguy, do they do AI stuff?
02:12:49<glguy>chessguy: not that I can think of...
02:12:55<Nafai>I do a lot of government contract work, but it's all Java :/
02:13:05<phr-zzz>glguy, are security clearances needed?
02:13:13<glguy>phr-zzz: no
02:13:33<phr-zzz>thanx
02:14:14<mudge>glguy: are you okay with me? I didn't mean to be prying about the PHP stuff, just was curious
02:14:31<glguy>mudge: I didn't take offense to it :)
02:14:48<dons>phobes: re. pay well -- if you can get one, they seem to pay very well
02:15:04<glguy>mudge: I was just trying to relate that making business front pages isn't what Galois does
02:15:04<mudge>glguy: cool
02:15:31<mudge>glguy: got ya, makes sense
02:15:45<glguy>ACTION doesn't really know what other people at galois' salaries are
02:15:58<mudge>dons: where do you work?
02:16:00<reltuk>making webpages is what facebook does, and they do it with PHP :-p
02:16:11<mudge>haha yea
02:16:18<mudge>so much stuff on the web is PHP
02:16:31<phr-zzz>laconic compiles into SML, i think ;)
02:16:31<glguy>dons: yeah, where *do* you work?
02:16:36<dons>looks interesting, http://seeker.dice.com/jobsearch/servlet/JobSearch?op=101&dockey=xml/b/5/b5323bcb1cafdd6ec77cc67405bcb839@endecaindex&c=1&source=20
02:16:38<lambdabot>http://tinyurl.com/cza2x
02:16:39<reltuk>isn't dons in school?
02:16:44<dons>`Computer Assurance Engineer - Haskell/Java Developer'
02:16:49<liyang>What gets me is that so many /static/ web pages are written in PHP.
02:17:01<phr-zzz>
02:17:01<phr-zzz>This job has been removed from our site.
02:17:08<dons>the current jobs seem to be 'high assurance' or qant stuff
02:17:10<dons>quant.
02:17:15<dons>e.g. http://www.quantfinancejobs.com/jobdetails.asp?dbid=&guid=&JobID=2782
02:17:20<lambdabot>Title: Quantitative Functional Programmer (VP-level) - NYC, http://tinyurl.com/386meh
02:17:23<SamB>liyang: it is, as someone mentioned, somewhat reasonable for when you need a bit more than SSI
02:17:39<glguy>liyang: that the pages are not interactive doesn't mean that their owners don't want to be able to update them easily
02:17:55<dons>mudge: i'm in sydney, but starting a new haskell job in oregon.
02:17:55<mudge>dons: I heard you've posted a lot of stuff to reddit programming
02:18:06<dons>mudge: some things, yeah.
02:18:24<glguy>dons: maybe I could hook you up with a job at Galois
02:18:27<mudge>dons: that's cool, through reddit is partially how I found out about haskell and got interested
02:18:31<glguy>I'll put in a good word
02:18:32<dons>glguy: that'd be great!
02:18:40<dons>yeah, we should meet up sometime once i'm over there
02:18:40<LoganCapaldo>dons is single handedly responsible for every haskell post on reddit
02:18:49<LoganCapaldo>(I'm exaggerating :) )
02:19:12<dolio>Yeah, it's only like 80%. :)
02:19:18<reltuk>LoganCapaldo: it's probably safe to say he's largely responsible for the wave of haskell enthusiasm...
02:19:22<reltuk>more people are posting haskell posts now =)
02:19:22<liyang>glguy: I know, but PHP isn't the only way. And a pretty bad one at that.
02:19:24<mudge>dons: can you say what, and what company your new job is going to be with?
02:19:37<phr>glguy, how much non-haskell stuff does galois do? i.e. is there much interest there in fancier languages like coq?
02:19:37<dons>there's 5-10 others who post FP stuff too
02:19:46<wli>ACTION is underqualified for any such thing.
02:19:50<dons>mudge: i'm working for galois.com
02:19:52<glguy>phr: I think they use more Isabelle than Coq
02:19:56<liyang>(but hey, just throw in a bigger webserver and what's the diff?)
02:19:57<phr>cool
02:20:25<dons>yeah, it seems galois guys follow the german school of Isabelle :)
02:20:59<mudge>dons: oh cool
02:21:25<phr>out of curiosity does galois have any particular cultural attitude towards the spark-ada crowd?
02:21:44<mudge>there's fancier languages than haskell?
02:22:02<dons>mudge: there's harder languages with stronger type systems - epigram, and the various theorem provers
02:22:12<dons>they're seen as the ultimate limit of haskell's abilities
02:22:18<SamB>dons: you're getting a job, you say?
02:22:25<dons>SamB: seems so!
02:22:29<SamB>nice
02:22:39<dons>all that uni must have been for a reason
02:23:11<glguy>phr: not that I know of
02:23:26<liyang>dons: that reason being getting a tenure?
02:23:45<glguy>phr: We aren't exclusively Haskell, there has been some Scheme, C, PHP, etc.
02:24:19<dons>hey cool, bjorn runs darcs-graph in his google page, http://code.google.com/p/dimensional/
02:24:19<lambdabot>Title: dimensional - Google Code
02:24:42<phr>darcs-graph?
02:24:56<glguy>the tool that shows how active the repository has been
02:25:23<phr>oh that dimensional thing looks neat, it's all done at compile time with types?
02:25:25<dons>http://programming.reddit.com/info/2gr8u/comments :)
02:25:26<lambdabot>Title: Statically checked physical dimensions and SI units for Haskell (reddit.com)
02:25:31<dons>phr: yeah, SI units in the type checker
02:27:08<phr>what's he mean by "boxing and unboxing of numerical units as quantities"?
02:28:21<phr>oh man this is kind of kludgey
02:28:51<araujo>ACTION thought dons would found a Functional Company with all that uni to offer relief to all those Haskell programmers employed by other languages
02:29:11<dons>heh
02:29:15<SamB>araujo: there's still time for that
02:29:22<Olathe>phr: Well, inches is probably a number 2.54 times as large as centimeters.
02:30:26<phr>i did something like this in python where the dimensions were all carried around at runtime
02:32:27<phr>mudge, this is kind of neat: http://www.cs.berkeley.edu/~adamc/papers/PositionPLPV06/ about programming directly in coq. the guy wrote a compiler that way.
02:32:28<dons>what happens in the case of unit conversion failure?
02:32:28<lambdabot>Title: Position Paper: Thoughts on Programming with Proof Assistants
02:33:01<phr>with my python thing? runtime exception.
02:33:10<phr>it was sort of inspired by the frink language
02:33:32<phr>http://futureboy.homeip.net/frinkdocs/
02:33:34<lambdabot>Title: Frink
02:34:46<Eelis>a statically checked quantitative units C++ library was recently added to Boost
02:35:09<phr>Since 1934, Haskell’s has been providing the finest in wines, beers and spirits to our discriminating clients. We appreciate your patronage and we will do ...
02:35:09<phr>www.haskells.com/ - 41k - Cached - Similar pages
02:38:14<araujo>Everything Haskell related is so addictive
02:38:20<lament>especially heroin
02:39:10<phr>dons you're involved in the realworldhaskellbook? it looks way cool, much better than any of the existing haskell books i've looked at
02:40:07<dolio>I'll say. That Richard Bird is a chump who can't write! :)
02:40:48<phr>heh
02:40:49<phobes>phr: have you looked at Haskell for dummies?
02:41:02<SamB>phobes: what the heck?
02:41:03<phr>phobes?!!!! no i didn't know there was something like that. you're joking i hope ? :)
02:41:07<dons>phr: that's the plan.
02:41:17<phobes>yes, joking :)
02:41:17<phr>i have "haskell school of expression" which is readable but doesn't have nearly enough detail
02:41:19<dons>i think phobes is joking :)
02:41:30<SamB>how about "learn haskell in 21 years"
02:41:47<dons>21 years seems too long
02:42:01<SamB>yeah, I'm not even 21 yet
02:42:06<phr>and i looked at "programming in haskell" in the store
02:43:01<phr>more helpful has been the wikibook and various blog posts
02:43:11<phr>but i still feel clueless
02:43:36<fishkandy>OceanSpray!! lolz0r
02:43:41<dolio>SamB: Obviously you don't know haskell, then. :)
02:43:47<OceanSpray>wut
02:43:53<dons>phr: i think you need to write some apps or libs to really learn the language
02:44:00<dons>that's been my experience anyway
02:44:08<dons>heya fishkandy
02:44:13<fishkandy>moin dons
02:44:16<pjd>write a Haskell implementation
02:44:19<phr>dons yeah.
02:44:30<olsner>whatever the language is, I've found you really have to do something real with it to learn it
02:44:34<OceanSpray>kfish, is that you?
02:44:40<fishkandy>OceanSpray, aye
02:44:49<OceanSpray>oh ll
02:45:12<pjd>worked for John Meacham
02:45:13<phr>dons do you know xslt? i have the idea of writing an xslt compiler in haskell
02:45:28<phr>and am wondering if that's insane
02:45:46<SamB>phr: what do you want that junk for
02:45:48<SamB>you have Haskell
02:45:54<dons>phr: that seems interesting.
02:45:59<dons>phr, pretty sure people have thought about it
02:46:10<dons>(i know of some work on fusion for xslt passes, for example)
02:46:19<phr>hmm
02:46:20<dons>you could make serious money out of it :)
02:46:43<phr>heh, i signed an inventions assignment agreement with my employer saying everything i do is released under gpl :)
02:47:07<dons>cool
02:47:13<olsner>for an inventions assignment agreement, that's way cool
02:47:13<ddarius>I wonder if that stops you from dual licensing it.
02:47:57<phobes>heh, ya just don't tell anyone that it's GPL when you're selling it to them
02:48:25<phr>phobes hehe yeah there's a ton of audacity cd's (audacity = gpl'd audio editor) on ebay that don't bother mentioning that little detail
02:49:46<lament>i think that's how RMS originally planned to make money on GPLd software :)
02:51:35<SamB>phr: GPL is the best you could get?
02:51:55<phr>samb, it's part of the package
02:52:20<SamB>are they just going to use the stuff you write, or sell it, or what?
02:52:37<phr>we put it on the net
02:52:55<phobes>do you work for a company that releases its own product under the GPL?
02:53:06<phr>phobes yeah
02:53:32<phobes>phr then that makes sense :)
02:54:29<phr>i have umpty ump gigabytes of xml to crunch and i keep writing all these damn python scripts to do it, so i was thinking of trying to figure out xslt, but that's apparently even slower than python
02:54:37<phr>so then i start wondering if i can compile xslt
02:55:04<phr>do the obvious optimizations and then generate a state machine written in c and call the c compiler
02:56:26<SamB>phr: this begs the question of why you'd want to write xslt in the first place
02:56:43<SamB>it isn't known for it's elegance...
02:56:46<phr>well i think it's designed for the sort of stuff i'm doing... though not necessarily WELL-designed...
02:56:52<sjanssen>phr: I wonder if you can get better performance from one of the Haskell XML packages
02:56:54<phr>i don't know mcuh about it really
02:56:57<phr>much
02:57:08<sjanssen>each of them have some xpath-like query interfaces
02:57:13<SamB>have you seen any?
02:57:25<phr>well as soon as i use a typical xml runtime package i've already lost horribly, because it's going to actually parse the xml into tree structure or something
02:57:29<fishkandy>phr, http://www.ibm.com/developerworks/xml/library/x-matters14.html
02:57:30<lambdabot>Title: XML Matters: Transcending the limits of DOM, SAX, and XSLT
02:57:39<phr>instead of treating it as a big character stream that it occasionally sucks a field out of
02:57:54<sjanssen>haxml has some lazy parsing stuff
02:58:38<phr>fishkandy thanks, this looks cool
02:58:42<Dybber>phr take a look at XQuery. Im not sure if there are any good interpreters, but its a lot cleaner than XSLT.
02:58:45<phr>i didn't know david mertz was writing haskell stuff
02:59:21<phr>XQuery 1.0: An XML Query Language
02:59:44<bparkis>does haskell check to see that a function handles every kind of data that its type signature says it handles?
03:00:02<phr>you mean check that pattern matching is exhaustive? no
03:00:08<phr>there's a package called catch which does that
03:00:10<bparkis>could it in theory do that?
03:00:14<bparkis>ok
03:00:22<phr>i've been wondering whether there's a good reason it doesn't do that. ML does it.
03:00:54<reltuk>it does do it...
03:00:55<dons>interesting link fishkandy
03:01:08<sjanssen>bparkis: GHC can warn you when a function is potentially incomplete
03:01:49<phr>oh cool, is there a flag you have to enable? i get errors all the time from leaving out a case
03:02:19<bparkis>why only "potentially"? isn't it possible to do it exhaustively?
03:02:44<sjanssen>bparkis: it's possible to have incomplete matches that are never reached
03:02:56<Mortoc>anyone here use ghc on gentoo? I can't figure out what I'm supposed to do to get ghci working.
03:03:08<phobes>I think the idea is that sometimes you have higher level understanding of the program and know the pattern match will not fail
03:03:14<allbery_b>phr: -Wall for starters
03:03:23<phr>thanks
03:03:30<sjanssen>so GHC will warn you whenever a case statement is incomplete, but it might be impossible to reach these incomplete cases
03:03:56<fishkandy>dons, phr: that developerworks article is a little out of date, there is a patch on the haxml page
03:04:05<bparkis>but if you have an incomplete match that doesn't arise "in practice," then the function could be re-used and explicitly passed one of the cases it doesn't handle, by accident, in some other program
03:04:33<bparkis>so even if it's good enough for the current program it can't be relied on perfectly
03:04:35<kpreid>@. read run tail . concat . intersperse "i" . map (replicate 2) $ "mssp "
03:04:36<lambdabot> mississippi
03:05:10<sjanssen>bparkis: GHC takes the conservative path and always warns
03:05:17<dolio>See the Epigram mailing list archives for plenty of arguments about incomplete pattern matching on nevertheless total functions.
03:05:33<SamB>bparkis: also GHC is broken
03:05:45<dons>dolio: oh good idea. i should subscribe.
03:05:53<SamB>bparkis: so sometimes it makes a mistake and you won't ever have a pattern match failure
03:06:03<dolio>dons: There isn't much activity.
03:06:06<SamB>(well, even if it wasn't broken it could still be wrong ;-)
03:06:23<sjanssen>SamB: there are only a couple broken pieces
03:06:31<phobes>@src tail
03:06:32<lambdabot>tail (_:xs) = xs
03:06:32<lambdabot>tail [] = undefined
03:06:35<sjanssen>only k and n+k patterns, IIRC
03:06:47<SamB>sjanssen: the piece that generates those warnings seems quite broken to me...
03:06:55<SamB>or at least, from what I've heard it is...
03:07:06<sjanssen>yes, just in a couple corner cases
03:07:09<allbery_b>isn't the correct answer to n+k patterns to disallow them? :)
03:07:20<SamB>allbery_b: sure
03:07:29<dolio>I signed up on gmane via my newsreader, got lots of interesting stuff, and then it all disappeared when the reader cleaned out old threads.
03:07:53<bparkis>why is full covering an undecidable problem?
03:08:10<sjanssen>bparkis: it isn't, unless you include guards
03:08:29<SamB>dolio: your newsreader sucks
03:08:45<dolio>SamB: Probably.
03:09:34<Eelis>i wish there was a nice Haskell IRC library
03:09:35<dolio>But I think I got close to the entire history of the Epigram list in that initial download.
03:09:42<SamB>bparkis: well, it may not even know that even = not . odd
03:10:24<bparkis>ah I see
03:10:57<bparkis>so you could reduce all numbers to just one base case, not covering the other base case
03:10:59<sjanssen>foo p | programHalts p = ... -- :)
03:11:44<phobes>@src programHalts
03:11:44<lambdabot>Source not found. It can only be attributed to human error.
03:13:34<bparkis>hm.
03:17:20<pjd>phr: -fwarn-incomplete-patterns, specifically
03:17:43<phr>thanks
03:17:50<ihope>I want to be able to automatically generate an elegant data declaration for a monad given an intuitive definition of semantics.
03:18:24<wli>ACTION is back to square one on enumeration of lattice points.
03:18:24<LoganCapaldo>I want a pony
03:18:29<Eelis>isn't Control.Monad.Fix a rather odd place for fix?
03:18:30<LoganCapaldo>:)
03:18:46<LoganCapaldo>Eelis, I keep thinking that too
03:19:13<sorear>Eelis: Yep, which is why it's in Data.Function too (base 2.1 only)
03:19:22<lament>ihope: hey!
03:19:23<Eelis>i see, interesting
03:20:12<phr>:l ControlMonad.Pony
03:20:32<ihope>@index fic
03:20:32<lambdabot>bzzt
03:20:33<ihope>@index fix
03:20:34<lambdabot>Control.Monad.Fix, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Error
03:20:38<ihope>Weird.
03:20:42<bparkis>wait a minute, let's say that your function takes as input a certain number of algebraic data types, each of which has a countable number of constructors
03:21:04<Cale>http://fridge.ubuntu.com/files/no-pony-for-you.jpg
03:21:20<bparkis>why can't you simply enumerate every possible combination of constructors for input to the function, and see if it handles that combination?
03:21:35<dons>bparkis: you could do that
03:21:41<wli>ndm has done work here
03:21:47<dons>bparkis: that would be an exaustive QuickCheck property
03:21:58<bparkis>where does the uncomputable come in?
03:22:06<wli>ISTR it was called "Catch"
03:22:06<dons>:t enumFrom
03:22:07<lambdabot>forall a. (Enum a) => a -> [a]
03:22:20<wli>bparkis: Guards.
03:22:26<dons>> enumFrom (minBound :: Ordering)
03:22:27<lambdabot> [LT,EQ,GT]
03:22:38<sjanssen>bparkis: where did you get the impression that it's undecidable? It isn't (except for boolean guards, which can contain arbitrary code)
03:22:48<dons>?check \x -> x `elem` (enumFrom (minBound :: Ordering))
03:22:49<lambdabot> OK, passed 500 tests.
03:22:59<dons>?scheck \x -> x `elem` (enumFrom (minBound :: Ordering))
03:22:59<lambdabot> add an instance declaration for (Serial Ordering)
03:22:59<lambdabot> In the expression: let...
03:23:26<Tac-Tics>What does "denotational semantics" mean?
03:23:36<Tac-Tics>I've never heard that word until I started Haskell
03:23:36<sorear>bparkis: what you're describing is just a working version of -fwarn-incomplete-patterns, catch is a bit more powerful (it lets you have head, warnings are generated on *use*)
03:23:51<sorear>bparkis: also, you can't enumerate a countable set in finite time
03:24:01<bparkis>sjanssen: because Yong Luo said it is on the Epigram ml
03:24:21<wli>I often work around Enum's limitations (largely on precision of integers) with a Denumerable class.
03:24:21<dolio>bparkis: He's talking about dependently typed languages.
03:24:28<OceanSpray>oh hey
03:24:29<dolio>Haskell isn't dependently typed.
03:24:40<conal>Tac-Tics: in DS, you give a mathematical model for the meanings of syntax. and define a "meaning function" that maps syntax to those values. the meaning of a phrase is a function of the meanings of the syntactic components.
03:25:14<sorear>Tac-Tics: denotational semantics is a map between a programming laguage and a set of mathsy-objects, characterized by compositionality - you can replace any subterm of a program by a subterm with the same den. sem. without changing the den.sem. of the program
03:25:28<newsham>shapr: see HAppS question on haskell-cafe? maybe yoou could answer
03:26:02<Tac-Tics>I'm guessing it's one of those things I've got a builtin understanding of, but I haven't formally learned about?
03:26:17<sorear>Tac-Tics: Haskell's DS is particularly simple because the meaning of a term with type a -> b is simply a mathematical function [[a]] -> [[b]]
03:26:24<sorear>Tac-Tics: quite probably
03:26:44<phr>[[a]] ??
03:26:45<kiome>Are there any knows issues with installing Visual Haskell on Vista with UC on?
03:26:47<Tac-Tics>is it worth learning a little about the history of DS?
03:26:58<sorear>[[ ]] is the standard symbol for the "meaning function"
03:26:59<phr>tac-tics the wikibook is pretty good
03:27:02<kiome>*known
03:27:05<Tac-Tics>or is it something one can get by without rigorous understanding?
03:27:08<Tac-Tics>phr: thanks
03:27:10<phr>http://en.wikibooks.org/wiki/Haskell/Denotational_Semantics
03:27:42<phr>oops http://en.wikibooks.org/wiki/Haskell/Denotational_semantics
03:29:31<conal>DS-style thinking is also an approach to creating APIs. I think about meanings of my data types and then the meanings of the library operations in terms of the meanings of the values.
03:32:41<wli>Explaining the difference between a numeral and an integer helps some.
03:33:09<conal>and between a lambda expression and a function
03:33:35<wli>That can sometimes be "too big" to grasp.
03:33:54<conal>wli: agreed. start with numerals & numbers
03:34:44<desp>hmm
03:35:04<desp>is there some usual way to resolve "Functional dependencies conflict between instance declarations:"?
03:35:27<Eelis>with the proposed natural number type for Haskell', will let x = (x :: Nat) + 1 in 3 < x evaluate to True?
03:35:38<sjanssen>desp: not writing fundeps that conflict is a start :)
03:36:02<desp>sjanssen: I know, but I need the fundep that causes the conflict to solve "Could not deduce..."
03:36:05<desp>:)
03:36:39<desp>I guess I probably could make yet another typeclass
03:36:57<desp>I think I'm getting into microoleg territory
03:39:11<newsham>(x,y) in f /\ (x,z) in f --> y = z
03:40:03<Eelis>hm, is (<) strict on Integers ? i expected let x = 1 + (x :: Integer) in 0 < x to evaluate to True but it hangs
03:40:23<Eelis>oh, never mind
03:40:34<Eelis>Integers really are a different story than Nats
03:40:48<Cale>@src Integer
03:40:49<lambdabot>data Integer = S# Int#
03:40:49<lambdabot> | J# Int# ByteArray#
03:41:05<reltuk>what's J#?
03:41:16<Eelis>my other question about Nat i'm still very interested in though
03:41:20<Cale>That's the case when the integer is larger than fits in an Int
03:41:42<reltuk>ahhh, makes sense
03:42:12<reltuk>@src ByteArray
03:42:12<lambdabot>Source not found. You type like i drive.
03:42:24<newsham>when integers have legs
03:42:26<Cale>Eelis: If (1 +) is replaced with the constructor Succ, you can define (<) such that that will terminate
03:42:45<Eelis>Cale: right, so my question is whether Haskell' will actually do it like that :)
03:42:55<Cale>Probably.
03:43:06<Eelis>good
03:43:08<sjanssen>that scares me a little bit
03:43:29<Cale>I don't really know, but it seems kind of pointless to provide a Nat type if it's not going to be lazy.
03:43:37<conal>Eelis: is there a Nat library now that you're using? i don't understand the connection with haskell'
03:43:47<Eelis>conal: http://hackage.haskell.org/trac/haskell-prime/wiki/Natural
03:43:50<lambdabot>Title: Natural - Haskell Prime - Trac
03:43:51<sjanssen>I suspect that the O(n) memory use will cause lots of problems
03:43:51<phr>why does darcs equality check use unsafeCoerce# ?
03:43:56<Cale>I suppose you could implement it the same way as Integer and have it be strict
03:43:57<conal>Eelis: thanks.
03:45:19<Cale>Will there be a Nat type at all in Haskell'?
03:45:59<newsham>peano not good enough for you?
03:46:11<Eelis>Cale: it's listed as "probably yes"
03:46:23<Cale>where?
03:46:28<Eelis>http://hackage.haskell.org/trac/haskell-prime/report/9
03:46:30<lambdabot>Title: {9} Proposals - Haskell Prime - Trac
03:48:48<sorear>phr: because it's darcs, I'm sure
03:49:57<Cale>There's a lot of pretty scary stuff under "maybe"
03:51:24<Eelis>> let f x = x^2 - 6 in (f 3, fix f)
03:51:30<lambdabot> Exception: <<loop>>
03:52:22<chessguy>> map (\n -> (n*n-n)/2) [1..10]
03:52:24<lambdabot> [0.0,1.0,3.0,6.0,10.0,15.0,21.0,28.0,36.0,45.0]
03:52:48<ddarius>> scanl1 (+) [1..10]
03:52:50<lambdabot> [1,3,6,10,15,21,28,36,45,55]
03:53:08<chessguy>err, what the...
03:53:22<chessguy>oh, that's the sums of all the numbers to that point
03:53:25<chessguy>nice
03:53:56<chessguy>i knew that (n^2-n)/2 formula looked familiar
03:54:24<chessguy>> scanl1 (+) [1..20]
03:54:25<lambdabot> [1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210]
03:55:02<Cale>> map (\n -> (n*n-n) `div` 2) [1..10]
03:55:04<lambdabot> [0,1,3,6,10,15,21,28,36,45]
03:55:57<chessguy>> 210 / 6
03:55:58<lambdabot> 35.0
04:08:14<Tac-Tics>> map return [1..4]
04:08:15<lambdabot> add an instance declaration for (Show (m a))
04:08:37<Tac-Tics>> (map return [1..4]) :: [[Int]]
04:08:38<lambdabot> [[1],[2],[3],[4]]
04:08:57<hpaste> desp pasted "another typeclass question" at http://hpaste.org/2347
04:09:44<chessguy>err, what kind of typeclass is that?
04:09:45<Cale>desp: I don't understand the question
04:10:03<desp>I'd like to have datatype Foo parametrized with variable a
04:10:18<desp>er. scratch that.
04:10:25<desp>I'd like to have datatype *Bar* parametrized with variable a
04:10:26<chessguy>is that a GADT?
04:10:36<Cale>chessguy: no
04:10:37<desp>and also to restrict a in each constructor to a specific instance of Foo
04:10:45<desp>is that possible?
04:10:48<glguy>desp: no
04:11:05<Cale>desp: Why would it not just be Bar1 Baz1 ?
04:11:10<glguy>desp: unless you just don't parameterize Bar
04:11:18<desp>Cale: because then I can't parametrize Bar, no?
04:11:23<Cale>You can parametrise Bar and not use the parameter
04:11:28<desp>oh, hm.
04:11:45<Cale>What's the point of having that type parameter if you're not actually allowed to use it?
04:12:50<desp>in order to allow calling one typeclass function on every constructor parameter
04:13:36<desp>Cale: do you understand what I mean? not sure if I'm speaking clearly enough :)
04:13:46<Cale>I'm not sure -- perhaps it's a phantom type?
04:14:03<Cale>Could you give an example?
04:14:29<desp>one moment
04:18:42<hpaste> desp annotated "another typeclass question" with "actual example" at http://hpaste.org/2347#a1
04:19:08<desp>now you can write fromBar (Bar1 Baz1A)
04:19:21<desp>but also you can write fromBar (Bar1 Baz2A)
04:19:26<desp>and I would like to disallow that
04:20:13<Cale>Why bother with the type parameter at all?
04:21:06<desp>hm, you're right.
04:21:11<hpaste> Cale annotated "another typeclass question" with "why not this?" at http://hpaste.org/2347#a2
04:21:23<desp>I assumed I'd need the (Enum a) constraint in fromBar
04:21:37<desp>my bad, thanks
04:23:19<ihope>What's a nice, elegant implementation of delimited continuations?
04:23:59<oerjan>ACTION assumes oleg's is
04:24:02<hpaste> dolio annotated "another typeclass question" with "gadts" at http://hpaste.org/2347#a3
04:24:15<oerjan>@where oleg
04:24:15<lambdabot>http://okmij.org/ftp/
04:24:46<dolio>@hackage CC-delcont
04:24:46<lambdabot>http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont
04:24:48<oerjan>hm, actually didn't someone else make the module based on his work?
04:25:18<dolio>Roughly the same as the stuff you'll find at Oleg's page.
04:27:16<desp>Cale: ah, I know why I thought that way -- I was trying to write fromBar :: (Enum a) => Bar -> a
04:28:21<desp>which doesn't appear to be possible
04:29:01<sjanssen>@type fromEnum . toEnum
04:29:01<lambdabot> Ambiguous type variable `b' in the constraint:
04:29:01<lambdabot> `Enum b' arising from use of `fromEnum' at <interactive>:1:0-7
04:29:01<sjanssen>@type toEnum . fromEnum
04:29:02<lambdabot>forall a a1. (Enum a, Enum a1) => a1 -> a
04:29:10<sjanssen>possible, but perhaps not reasonable
04:29:59<hpaste> desp annotated "another typeclass question" with "possible?" at http://hpaste.org/2347#a4
04:30:31<desp>oh, so you're saying instead of x, toEnum $ fromEnum x?
04:30:56<newsham>?src (<|>)
04:30:56<lambdabot>Source not found. Your mind just hasn't been the same since the electro-shock, has it?
04:31:11<desp>heh.
04:31:15<sjanssen>desp: that gives you the right type, but I doubt it's what you mean
04:31:32<desp>sjanssen: well, it seems rather inefficient
04:31:46<sjanssen>toEnum . fromEnum is pretty fast
04:32:35<desp>dolio: hm
04:32:49<dolio>'(Enum a) => Bar -> a' means you need to be able to produce any kind of Enum from a Bar.
04:33:03<desp>right, I see where this fails
04:33:09<desp>thanks again, all
04:35:08<mudge>@help
04:35:09<lambdabot>help <command>. Ask for help for <command>. Try 'list' for all commands
04:35:15<mudge>@list
04:35:15<lambdabot>http://www.cse.unsw.edu.au/~dons/lambdabot/COMMANDS
04:35:56<mudge>@babel
04:35:56<lambdabot> bzzt.
04:36:16<mudge>@bf
04:36:16<lambdabot>Done.
04:36:32<desp>heh.
04:36:51<mudge>heh
04:36:59<mudge>@haddock
04:36:59<lambdabot>Unknown command, try @list
04:37:01<ddarius>@bf +.
04:37:02<lambdabot> fd:23: hClose: resource vanished (Broken pipe)
04:37:08<mudge>what is bf?
04:37:12<mudge>@list
04:37:12<lambdabot>http://www.cse.unsw.edu.au/~dons/lambdabot/COMMANDS
04:37:12<ddarius>@help bf
04:37:13<lambdabot>bf <expr>. Evaluate a bainf*ck expression
04:37:22<mudge>oh
04:37:47<mudge>how do i get it to say funny things?
04:37:50<gmh33>@bf +.[+.]
04:37:51<lambdabot> fd:23: hClose: resource vanished (Broken pipe)
04:37:55<gmh33>aww
04:38:02<desp>@bf http://desp.night.pl/algorytmy/p0/z4.bf
04:38:02<lambdabot> fd:23: hClose: resource vanished (Broken pipe)
04:38:10<lambdabot>You could always try just asking.
04:38:30<desp>@please execute said bf file
04:38:30<lambdabot>Not enough privileges
04:38:48<mudge>@slap
04:38:48<lambdabot>ACTION beats up
04:38:51<gmh33>lol
04:38:57<mudge>@slap gmh33
04:38:57<lambdabot>ACTION beats up gmh33
04:39:02<gmh33>@slap mudge
04:39:05<lambdabot>ACTION beats up mudge
04:39:05<wli>I ultimately want to trace approximate level curves the way djb describes but that's a serious rewrite.
04:39:28<gmh33>bf is a curious language
04:39:59<wli>A dull language if you ask me, but anyway.
04:40:07<desp>(that program reads two numbers in decimal from stdin and outputs the sum to stdout)
04:40:07<mudge>@todo
04:40:08<lambdabot>0. SamB: A way to get multiple results from a google search
04:40:08<lambdabot>1. dons: improve formatting of @dict
04:40:08<lambdabot>2. dons: write Haskell Manifesto
04:40:08<lambdabot>3. lispy: don't let lambdabot's prettyprinter split the sequence @foo across lines
04:40:08<lambdabot>4. TheHunter: priviledged users should get priviledged listcommands.
04:40:11<lambdabot>[26 @more lines]
04:40:37<mudge>@more lines
04:40:37<lambdabot>5. TheHunter: @type 1 :: Int
04:40:37<lambdabot>6. lispy: haddock gives a link from a type signature to the types. It would be nice if it also let you find functions in the given module that use a type.
04:40:37<lambdabot>7. dons: Implement @whatis
04:40:37<lambdabot>8. dcoutts: implement @cool list, as a clone of the @todo(-add) commands
04:40:37<lambdabot>9. dons: there's some bug in the 'when i left' code of @seen
04:40:39<lambdabot>[21 @more lines]
04:41:03<mudge>@more lines
04:41:03<lambdabot>10. dons: sarahbot style @tell
04:41:03<lambdabot>11. beelsebob_: @tell command - relays a message to someone when they next speak
04:41:03<lambdabot>12. dons: @seen on lambdabot should report lambdabot's channels too
04:41:03<lambdabot>13. ski: when printing first lines of infinite things (or all cases with nonexact), should say 'at least'
04:41:03<lambdabot>14. ski: provide '@more <number>', at least for privmsg
04:41:05<lambdabot>[16 @more lines]
04:41:16<dolio>Is this really something everyone needs to see? :)
04:41:32<mudge>lol
04:41:35<mudge>@tell
04:41:35<lambdabot>Plugin `tell' failed with: IRCRaised Prelude.head: empty list
04:41:53<mudge>@fortune
04:41:53<lambdabot>"I have recently been examining all the known superstitions of the world,
04:41:53<lambdabot> and do not find in our particular superstition (Christianity) one redeeming
04:41:53<lambdabot> feature. They are all alike founded on fables and mythology."
04:41:53<lambdabot> -- Thomas Jefferson
04:42:19<mudge>@fortune
04:42:19<lambdabot>Q: How many gradual (sorry, that's supposed to be "graduate") students
04:42:19<lambdabot> does it take to screw in a light bulb?
04:42:19<lambdabot>A: "I'm afraid we don't know, but make my stipend tax-free, give my
04:42:19<lambdabot> advisor a $30,000 grant of the taxpayer's money, and I'm sure he
04:42:19<lambdabot> can tell me how to do the gruntwork for him so he can take the
04:42:20<lambdabot> credit for answering this incredibly vital question."
04:42:21<desp>mudge: you know you can play with lambdabot in a /query window?
04:42:46<mudge>oh?
04:42:57<mudge>what's a query window?
04:43:06<ihope>/query lambdabot
04:43:10<desp>in private.
04:43:24<mudge>oh, rad
04:43:37<mudge>you guys didn't want to keep seeing the lambdabot stuff?
04:43:50<mudge>i was making a little show for ya
04:43:54<gmh33>mudge: most of the time it's just channel noise
04:43:55<ihope>Hmm, Haskell Manifesto?
04:44:01<mudge>okay
04:44:02<oerjan>aren't a lot of those @todo's already implemented?
04:45:31<bos>BWT functional pearl on reddit: http://programming.reddit.com/info/2gs4q/comments
04:45:32<lambdabot>Title: Inverting the Burrows-Wheeler Transform (PDF) (reddit.com)
04:45:43<mudge>hey, wouldn't it be cool if there was a bot written that taught people Haskell?
04:45:56<mudge>then we could send newbies there
04:47:00<dons>yeah, its a cool idea.
04:47:01<dons>we used lambdabot for a pro
04:47:06<dons>totype of this idea a while ago
04:47:18<dons>you ask questions, and they have to give answers to lambdabot
04:47:22<dons>which then tells you if you got it right
04:47:55<mudge>cool
04:47:59<gmh33>but dons tends to be super helpful anyway :P
04:48:29<phr>there was a big usenet war about that BWT thing and how it's 100x slower than the bzip2 c implementation
04:48:57<bos>phr: oh?
04:48:57<phr>ah, not that same paper
04:50:06<bos>i have a nice suffix tree implementation cooked up that runs in O(n log(n)) time.
04:50:09<mudge>dons: so what has happened with the prototype?
04:51:27<Pseudonym>bos: Hackage!
04:51:34<Pseudonym>People keep asking for suffix trees.
04:51:48<bos>for better or worse, it takes about 2 minutes to construct a suffix tree on my laptop for a half-megabyte input file with 930,000 edges.
04:51:52<mudge>I like this one @faq
04:51:56<mudge>@faq
04:51:56<lambdabot>The answer is: Yes! Haskell can do that.
04:52:14<Pseudonym>?faq Can I convert an IO String to a String?
04:52:15<lambdabot>The answer is: Yes! Haskell can do that.
04:52:17<Pseudonym>Cool!
04:52:20<bos>Pseudonym: yeah, that's the plan.
04:52:26<ddarius>unsafePerformIO!
04:52:49<nornagon>Can I convert an IO String to a String?
04:52:50<bos>?faq can i have a pure language, IO, and a pony?
04:52:50<lambdabot>The answer is: Yes! Haskell can do that.
04:52:56<nornagon>Aw, lambdabot doesn't respond.
04:53:24<olsner>930k edges in 512k of input? that's like half a byte per "edge", whatever that may be in this context
04:53:24<mudge>you have to say the right thing to it
04:54:01<mrd>?faq Can haskell prove P=NP?
04:54:01<lambdabot>The answer is: Yes! Haskell can do that.
04:54:14<mrd>an oracle!
04:54:14<Pseudonym>?faq Can Haskell prove the halting problem?
04:54:15<lambdabot>The answer is: Yes! Haskell can do that.
04:54:19<olsner>?faq Can haskell solve the halting problem?
04:54:19<lambdabot>The answer is: Yes! Haskell can do that.
04:54:21<bos>i'd love to have a linear-time construction algorithm, but don't see how to do that without doing the whole thing in the IO monad.
04:54:26<olsner>Pseudonym: argh, you beat me to it!
04:54:32<bos>or the ST monad, which isn't any better.
04:54:34<Pseudonym>bos: Have you seen the suffix array review paper?
04:54:51<bos>Pseudonym: i've read a big pile of literature, yes.
04:55:01<Pseudonym>ACTION nods
04:55:37<bos>my code is based on giegerich and kurtz's, but scales better on a large input alphabet (e.g. Char).
04:55:50<Tac-Tics>@src mzero
04:55:51<lambdabot>Source not found. Maybe if you used more than just two fingers...
04:56:03<Tac-Tics>@src guard
04:56:03<lambdabot>guard True = return ()
04:56:03<lambdabot>guard False = mzero
04:56:13<olsner>@src Maybe mzero
04:56:14<lambdabot>mzero = Nothing
04:57:51<bos>an O(n log n) algorithm looks great until n gets big. sigh.
04:58:24<Tac-Tics>there are worse algorithms in life
04:58:47<samreid>A lot of O(n) algorithms are really O(n log n) algorithms anyway.
04:59:16<phr>with the log n part implemented in constant time by the hardware as long as log n <= 64 ;)
04:59:41<oerjan>@src MonadPlus
04:59:41<lambdabot>Source not found. Just what do you think you're doing Dave?
05:00:02<Pseudonym>A lot of O(n log n) algorithms are really O(n log n log log n).
05:00:27<Pseudonym>Most sort algorithms on arbitrary length keys, for example.
05:00:58<littledan>where does the log log n come from there?
05:01:19<oerjan>Tac-Tics: mzero is a MonadPlus method
05:01:24<Tac-Tics>I know
05:01:24<Pseudonym>Well, let's take, for example, the cost of sorting 32-bit words.
05:01:30<Tac-Tics>I'm trying to figure out how guard works
05:01:33<Tac-Tics>because I know it does
05:01:37<Pseudonym>Or, say, b bit words.
05:01:37<Tac-Tics>but it is confusing me here
05:01:43<Pseudonym>It takes O(b) time to do the comparison.
05:01:54<Tac-Tics>> let f x = guard (x == 0) >>= (\_ -> [x])
05:01:54<lambdabot> Parse error
05:02:03<Tac-Tics>oops
05:02:06<Tac-Tics>@ let f x = guard (x == 0) >>= (\_ -> [x])
05:02:11<Tac-Tics>@let f x = guard (x == 0) >>= (\_ -> [x])
05:02:14<Tac-Tics>stupid bot
05:02:17<lambdabot>Defined.
05:02:21<Tac-Tics>> f 0
05:02:22<lambdabot> [0]
05:02:25<Tac-Tics>> f 1
05:02:26<lambdabot> []
05:02:29<Pseudonym>So on a b-bit architecture, you can sort at most 2^b numbers.
05:02:41<mudge>do you guys put spaces in your haskell code, like: 5 + 4 or do you do: 5+4
05:02:46<dolio>@src Maybe (>>=)
05:02:46<lambdabot>(Just x) >>= k = k x
05:02:46<lambdabot>Nothing >>= _ = Nothing
05:02:54<mudge>do you do: a/x or a / x
05:02:56<Pseudonym>The time taken, then, will be O(2^b b log(b)).
05:02:59<Pseudonym>Erm.
05:03:05<Pseudonym>Habg on, gotta think about that.
05:03:05<olsner>what's described as O(nlogn) is often O(nlogn) *comparisons* and/or swaps rather than O(f) *time*
05:03:09<samreid>Pseudonym: wait, what? On random inputs compariing b bits it takes O(1) average time since it's exponential decay
05:03:11<Pseudonym>I'm not sure if it's log log n.
05:03:18<Pseudonym>olsner: Right.
05:03:20<Tac-Tics>@src List >>=
05:03:21<lambdabot>Source not found. I feel much better now.
05:03:24<ddarius>@let f x = guard (x==0) >> return x
05:03:25<lambdabot><local>:3:0: Warning: Pattern match(es) are overlapped In th...
05:03:27<olsner>it's just that people don't know what they're saying
05:03:30<ddarius>@undefine
05:03:32<Pseudonym>And that's actually critical if comparisons are expensive.
05:03:32<lambdabot>Undefined.
05:03:35<Tac-Tics>@src List (>>=)
05:03:36<lambdabot>Source not found. You type like i drive.
05:03:42<littledan>Pseudonym: sounds like O(n log^2 n)
05:03:45<Pseudonym>Such problems often show up more in arithmetic on large integers.
05:03:54<olsner>what's log^2?
05:03:55<Pseudonym>Where integer operations are most definitely not O(1).
05:04:05<littledan>err, (log n)^2
05:04:10<olsner>ah, ok
05:04:17<littledan>(my notation, sorry)
05:04:17<Pseudonym>@let bp [] = 1
05:04:19<lambdabot>Defined.
05:04:23<Pseudonym>@let bp [x] = x
05:04:24<lambdabot>Defined.
05:04:31<Pseudonym>@let bp xs = bp (bp' xs)
05:04:31<lambdabot><local>:3:12: Not in scope: `bp''
05:04:32<Tac-Tics>ah, my confusing is coming from >>= on lists, I think
05:04:36<Pseudonym>Crap.
05:04:39<Pseudonym>Should have defined bp' first.
05:04:44<Pseudonym>Let's try that again.
05:05:03<Pseudonym>@let bprod' (x1:x2:xs) = x1*x2 : bprod' xs
05:05:05<lambdabot>Defined.
05:05:13<Pseudonym>@let bprod' xs = xs
05:05:15<lambdabot>Defined.
05:05:17<Pseudonym>@let bprod [] = 1
05:05:20<lambdabot>Defined.
05:05:21<Pseudonym>@let bprod [x] = x
05:05:24<lambdabot>Defined.
05:05:29<Pseudonym>@let bprod xs = bprod (bprod' xs)
05:05:31<lambdabot>Defined.
05:05:34<Pseudonym>OK, now.
05:05:38<Pseudonym>> product [1..100000]
05:05:42<lambdabot>Terminated
05:05:47<Pseudonym>> bprod [1..100000]
05:05:50<lambdabot> 2824229407960347874293421578024535518477494926091224850578918086542977950901...
05:06:02<Pseudonym>Same number of multiplies.
05:06:23<Pseudonym>But in the bprod version, the cost of each multiply is much less.
05:06:49<olsner>cool
05:07:20<olsner>a nice example of how arithmetic is not O(1)
05:07:25<Pseudonym>Yeah.
05:08:12<ddarius>No one pretends that for arbitrary precision integer arithmetic.
05:09:22<samreid>No one you know :-\
05:09:35<gmh33>ACTION laughs
05:10:28<bos>ACTION needs to write an emacs macro to insert SCC annotations into code
05:11:54<olsner>what're SCC annotations?
05:12:14<bos>used for profiling the insides of functions.
05:12:49<wli>I need to figure out some level curve tracing scheme analogous to the one djb brewed up.
05:12:52<bos>stick an annotation inside the body of a function, and GHC's runtime will account for it separately from the top-level form it's found in
05:13:27<phr>anyone read this? is it good? http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/
05:13:29<lambdabot>Title: Type Theory and Functional Programming
05:13:56<desp>Pseudonym: why is bprod better than foldl' (*) 1?
05:15:00<oerjan>desp: because it avoids multiplying large numbers by small ones a lot of times
05:15:21<oerjan>instead keeping the numbers more evenly matched
05:15:36<desp>oerjan: ah.
05:16:01<desp>that's quite a neat trick.
05:17:08<Tac-Tics>Why did haskell decide that !! and ! where two different operators?
05:17:27<ddarius>Because they are.
05:17:28<Pseudonym>That was settled on before type classes or modules.
05:17:35<bparkis>why not have a bounds-checked "mutable array monad" that could be generated without an IO monad, allowing for destructive bounds-checked access to arrays
05:17:35<Pseudonym>!! is from Miranda, at least.
05:17:57<Pseudonym>BTW, ! is actually many different operators.
05:18:05<sjanssen>bparkis: we have such a monad, look for the ST monad
05:18:07<Tac-Tics>is it?
05:18:10<Pseudonym>The Data.Map one doesn't resemble the Array one that closely.
05:18:39<oerjan>:t (Data.Map.!)
05:18:42<lambdabot>forall k a. (Ord k) => Data.Map.Map k a -> k -> a
05:18:59<Pseudonym>:t (Data.Array.!)
05:19:01<lambdabot>forall i e. (Ix i) => Array i e -> i -> e
05:19:06<oerjan>right, it doesn't have an integral argument necessarily
05:19:24<Pseudonym>Moreover, Data.Map is supposed to be imported qualified.
05:19:29<Tac-Tics>wow, I didn't even realize Map had !
05:19:33<Tac-Tics>I've been using lookup
05:19:34<oerjan>er, Array doesn't either
05:19:35<Pseudonym>Because it defines things like "map" that step on the Prelude.
05:19:44<Pseudonym>So in fact, you call it:
05:19:49<Pseudonym>import qualified Data.Map as M
05:19:53<Pseudonym>m M.! k
05:19:59<Pseudonym>So it's actually pretty useless.
05:21:07<Tac-Tics>Haskell has some ugliness when it comes to its module system from what I've seen
05:21:15<Heffalump>is there a recommended regexp library these days?
05:21:31<bparkis>ok ty sjanssen
05:21:39<bos>regex-tdfa
05:21:53<phr>is there a way to get compiler warnings when you import something that steps on an existing symbol?
05:22:07<bparkis>but what is a state thread?
05:22:37<bos>phr: you'll get errors
05:22:52<bos>not when you import it, but if you try to use something ambiguous
05:23:22<Heffalump>bos: ta
05:24:02<littledan>is it ever appropriate to use foldl rather than foldl'?
05:24:05<phr>hmm yeah i've gotten those errors but it was almost like getting them at runtime
05:24:08<bparkis>ah nm I guess I'll find it out sometime
05:24:13<bos>littledan: almost never
05:24:14<phr>i.e. why didn't it flag this earlier??
05:24:25<littledan>bos, then why does it exist?
05:24:45<bos>littledan: it arguably should live in greater obscurity
05:25:07<shapr>Hm: ./SudokuWss 4.73s user 0.05s system 99% cpu 4.804 total ./SudokuWss +RTS -N2 3.80s user 0.07s system 116% cpu 3.334 total
05:25:41<sjanssen>that's not too bad
05:25:47<shapr>Yeah, it gets some benefit.
05:25:48<wli>shapr: Threaded sudoku solver?
05:25:58<shapr>wli: Yup, written by swiert
05:26:07<shapr>http://www.haskell.org/sitewiki/images/1/12/SudokuWss.hs
05:26:58<shapr>wli: Actually, it's not threaded. It's purely STM.
05:27:12<Heffalump>how is that not threaded?
05:27:16<wli>shapr: Well, implicitly threaded, then.
05:27:21<sjanssen>shapr: threading and STM are not mutually exclusive
05:27:21<shapr>Yeah, implicitly threaded.
05:27:21<Heffalump>you wouldn't get any benefit from STM without threading, surely?
05:27:24<glguy>STM doesn't do implicit threading...
05:27:26<sjanssen>it is explicitly threaded
05:27:29<sjanssen>grep for forkIO
05:27:33<shapr>oh, so it is.
05:27:37<wli>Oh, never mind, then.
05:27:48<wli>You used -N2 so I presumed threading of some sort.
05:28:51<taruti>Is it possible to somehow define an instance like: "instance (forall t. Show (c t)) => Show (A c) where ..." ?
05:30:29<Heffalump>taruti: you can define a new class for A to be in, and then make the forall t . Show (c t) condition be part of the context of one of the class methods; but making the Show instance would require overlapping instances
05:31:07<taruti>Heffalump: that is not a problem since that already requires undecidable instances.
05:32:09<Heffalump>the other problem is that you could only have one such Show instance
05:32:20<dons>its full of forkIOs + STM. that's explicit, high level threading :)
05:32:34<Heffalump>I've never actually tried this - I needed it myself for something but decided it was too painful
05:32:36<dons>there are likely published parallel solving algos though?
05:33:30<Pseudonym>There are published parallel algorithms for exact cover problems.
05:33:53<Pseudonym>This is the most abusing:
05:33:53<Pseudonym>amusing
05:33:55<Pseudonym>And abusing, for that matter.
05:33:57<Pseudonym>http://trefoil.math.ucdavis.edu/0708.1962
05:33:59<lambdabot>Title: Front: [arXiv:0708.1962] Exact Cover with light
05:34:14<dons>yeah, so I suspect we could do better here :) And did anyone see harrop's little ocaml troll on the sudoku thread?
05:34:29<taruti>Heffalump: seems like getting automatic instances for the helper class would not work. (class Show2 c where show2 :: c t -> String; instance (Show ???) => Show2 c where show2 = show" Just seems to move the problem around.
05:35:25<wli>Sudoku is an exact cover problem?
05:35:36<Heffalump>no, class show2 a where show2 :: (forall t . Show (c t)) => a c -> String
05:35:46<Pseudonym>wli: You can reduce it to one.
05:35:47<sjanssen>dons: yeah, he seemingly didn't realize that swiert's solution was parallel
05:36:29<Heffalump>actually, I don't think you can make a Show instance at all from it, though. You're stuck with show2
05:36:51<Heffalump>got to go
05:37:32<phr>so does anyone know if these theorem proving languages (that can only express terminating computations) also allow proving anything about running time or space?
05:37:34<taruti>hmm, GHC does not want to admit that either (malformed class instance). I'll try to find an another way.
05:37:44<oerjan>can you have a context of the form forall t . ... at all?
05:37:48<Heffalump>I missed a capital letter in the show2
05:37:52<dolio>I don't see anything about his OCaml version that's OCaml specific.
05:38:00<Heffalump><gone>
05:38:31<sjanssen>dolio: yeah, the Haskell will look the same
05:38:42<sjanssen>minus the ugly bits of OCaml's syntax :)
05:38:51<dolio>Right. :)
05:39:27<sjanssen>ACTION does the slavish porting
05:39:37<sjanssen>a bit hard, because I don't know ocaml
05:40:05<dansa>From Hudak's book. Exercise 2.4. Define a function convex :: Shape -> Bool that determines whether or not its argument is a convex shape (although we are mainly interested in the convexity of polygons, you might as well define it for each kind of shape.) Question: what shape that can be convex or not is not a polygon?
05:40:05<dansa>
05:40:30<phr>curve?
05:40:40<oerjan>circles, ellipses
05:40:50<dansa>are they convex or concave?
05:40:52<Pseudonym>They can't be non-convex.
05:41:02<oerjan>cardiac curves
05:41:06<phr>well something like an annulus is non-convex
05:41:08<dolio>I also don't see where 'n' comes from in his 'invalid' function.
05:41:09<Pseudonym>Yeah.
05:41:11<Pseudonym>Cycloids.
05:41:15<phr>or for that matter a polygon with a polygonal hole in it
05:42:01<oerjan>i suppose this might depend on the Shape type in the book
05:42:26<dansa>look at wikipedia's definition: http://en.wikipedia.org/wiki/Polygon
05:42:34<lambdabot>Title: Polygon - Wikipedia, the free encyclopedia
05:42:45<dansa>a polygon with a polygonal hole in it doesnt seem to fit
05:42:51<phr>well it's a shape but not a polygon
05:43:35<dansa>but what's the definition of convex for a general shape?
05:43:54<phr>given points p,q in the interior of the shape, the line segment connecting p to q is entirely inside the shape
05:44:16<phr>so if there's a hole i guess it's never convex
05:44:17<dansa>but that sounds like that the shape is a polygon
05:44:26<phr>nah, a disc is convex
05:44:36<dansa>yeah
05:44:44<dansa>alright
05:45:06<dansa>so i guess he means just that: write a function that tells whether ``<phr> given points p,q in the interior of the shape, the line segment
05:45:06<dansa> connecting p to q is entirely inside the shape'' is satisfied
05:45:53<sorear>phr: Yes they do, but not reflectively.
05:46:04<phr>?
05:46:42<sorear>phr: Given mergeSort : forall A (l: list A), { l'
05:47:07<sorear> : list A | perm_eq l l' & sorted l' } - you can't prove anything about time.
05:47:26<sorear>phr: but if you have a term in some object language with an operational semantics, then sure
05:47:53<phr>oh sorear i wasn't sure what you were answering. thanks
05:49:33<phr>here's one. you can pretty easily write a type for even natural numbers and prove that it's inhabited (4 is even). similarly for odd numbers. you can also write a type for weird numbers (= numbers that are simultaneously even and odd). i can't think of any examples of weird numbers, so after a while i start to think that type is uninhabited. is there a way to express that and maybe even prove it?
05:49:36<sjanssen>hmm, is ocaml's 'iter' like foldl?
05:50:14<sjanssen>erm, or is it an imperative construct?
05:50:49<SamB>how about numbers that aren't even or odd?
05:50:52<sorear>foldl is an imperative construct in those languages
05:51:01<sjanssen>true
05:51:09<sjanssen>val iter : f:('a -> unit) -> 'a list -> unit
05:51:31<sjanssen>I imagine that unit is like () -- that only seems useful in an imperative context
05:51:45<sorear>phr: sure, (in cic syntax) not (exists x, even x /\ odd x)
05:51:53<phr>and when asking about complexity, i guess i was thinking of two somewhat orthogonal things; 1) just trying to establish some reasonable bounds on the running time of some straightforward algorithm; 2) being able to express that some function is intractable. e.g. that it reduces to SAT where SAT is assumed intractable
05:52:07<dolio>Looks like mapM.
05:52:12<SamB>funny.
05:52:15<dolio>Er, mapM_
05:52:19<phr>hmm how would i prove that not (exists x, even x /\ odd x) ?
05:52:22<SamB>I got an 800 in math on my SAT
05:52:33<phr>congrats
05:52:57<SamB>ACTION finally goes to bed...
05:53:07<Pseudonym>I never did a SAT.
05:53:15<SamB>ACTION wonders if anyone got the horrible joke
05:53:38<phr>this thompson book looks pretty good but it's from way before coq
05:54:14<wli>I'll just say that I've got little reason to be impressed with other people's SAT scores.
05:54:57<dolio>ACTION has flashbacks to freshman orientation.
05:55:08<SamB>it was just a pun on "SAT is assumed intractable" anyway...
05:55:22<phr>ohhhhhh that went whoosh past me heh
05:55:57<SamB>very bad puns run in my family
05:56:13<Adamant>SAT Assumed Tractable
05:56:26<dolio>You mean puns?
05:56:55<SamB>dolio: you believe all puns to be very bad?
05:57:15<dolio>I guess some might be merely 'bad'. :)
06:00:18<wli>phr: Which Thompson book?
06:00:33<phr>wli - type theory and functional programming
06:01:21<SamB>dolio: yes but we specialize in very very bad ones...
06:01:36<dolio>Well done. :)
06:04:47<phr>why do these type theorists do all their proofs in this handwavey natural deduction logic instead of writing down a formal logic explicitly?
06:05:19<wli>phr: It's not handwavy.
06:06:32<phr>well, it's not precise enough to be able to compute the godel numbers of the proofs interoperably :)
06:07:34<phr>i'm also trying to read harper's book on foundations of programming languages, and he starts right out saying that he's purposely keeping the logic sort of vague
06:08:25<hpaste> sjanssen pasted "OCaml sudoku" at http://hpaste.org/2348
06:08:31<phr>i guess it's ok for practical purposes, it's just not what i'm used to from math class
06:08:43<hpaste> sjanssen annotated "OCaml sudoku" with "prettier Haskell" at http://hpaste.org/2348#a1
06:08:45<wli>phr: That seems rare to me.
06:08:57<sjanssen>the OCaml was pretty ugly
06:09:26<wli>sjanssen: That's really short. I'd have thought sudoku would be more involved.
06:09:30<sjanssen>the 'solve' procedure was parametric on a function called on each solution found
06:10:33<sjanssen>the program iterated (like mapM_) when there were multiple paths available
06:10:34<phr>nice
06:10:38<phr>i don't see the ocaml version
06:11:00<steven_ashley>top ;)
06:11:17<sjanssen>so, instead of collecting things in a nice lazy list, you'd do some stupid mutable thing to collect/display your results
06:11:29<glguy>if you diff them, you notice that they have some white space in common ;)
06:11:59<sjanssen>dons: http://hpaste.org/2348
06:12:09<phr>sorear do you think it's bogus that i'm interested in this esoteric type theory stuff, when i haven't even got haskell figured out?
06:12:40<dolio>Just skip straight to the type theory.
06:12:43<dolio>Haskell is too mainstream.
06:12:48<phr>heh
06:13:04<phr>haskell, the next java :)
06:13:19<sorear>phr: Maybe, maybe not. Systems like CIC are much simpler than Haskell because the greater expressiveness means that a lot of things that are confusingly different in Haskell are one and the same in CIC.
06:13:45<phr>hmm interesting
06:13:52<glguy>cic?
06:13:55<sorear>phr: There are no types, kinds and values - it's terms all the way down.
06:13:59<dons>sjanssen: :)
06:14:28<newsham>sjanssen broke my brain
06:14:28<sorear>glguy: Calculus of (co)Inductive Constructions, an example of a dependent calculus whose main notable aspect is that sorear is familiar with it.
06:14:35<phr>oh that's the ocaml
06:14:46<phr>cic is the logic in coq
06:14:48<dons>sjanssen: you should send that to the list :)
06:14:50<glguy>actual lol
06:15:07<alexj>@seen glguy
06:15:07<lambdabot>glguy is in #haskell. I last heard glguy speak 17s ago.
06:15:40<wli>sjanssen: I don't understand how your sudoku solver works.
06:15:40<newsham>sorear: you should write some small coq examples
06:15:40<sorear>The haskell is longer! Oh noes!
06:15:44<glguy>is coq cic?
06:15:52<glguy>is that question nonsensical?
06:16:06<phr>coq is a system written around ciq, it has a big theorem library, proving tactics, code generators etc
06:16:06<newsham>[20:14] < phr> cic is the logic in coq
06:16:08<phr>cic
06:16:20<glguy>oh, cool
06:16:24<glguy>ACTION should read more of the channel
06:16:36<glguy>same goes for alexj, I'm right here ;)
06:16:44<phr>http://coq.inria.fr
06:16:45<lambdabot>Title: The Coq proof assistant
06:16:59<glguy>ACTION has used coq before
06:17:07<glguy>in an attempt to prove state was a monad
06:17:14<glguy>and to follow along with the one for list
06:17:18<glguy>(and some other trivialities)
06:17:26<phr>i saw some blog about using coq to prove the monad laws--was that you?
06:17:35<glguy>that was me following along :)
06:17:49<sjanssen>wli: I don't know how it works either -- I just slavishly translated some code
06:17:56<phr>this is pretty neat: http://www.cs.berkeley.edu/~adamc/papers/PositionPLPV06/
06:17:57<lambdabot>Title: Position Paper: Thoughts on Programming with Proof Assistants
06:18:18<sjanssen>dons: I'll send it tomorrow, once I've gotten a chance to understand what the code is doing, and verified that it works for some inputs
06:19:30<dons>might be an idea to check the performance against the ocaml version too.. :)
06:19:33<sjanssen>I think this is a good example of how imperative paradigms can produce crummy code
06:19:41<dons>oh?
06:19:52<dons>is the ocaml not purely functional -- i didn't read it closely.
06:19:54<phr>there's a book called coq'art that i'm thinking of sending away for -- but i don't want to spend $$ unless i think i'm gonna actually read the book and use coq, which i have my doubts about since my brain is already not big enough even for haskell ;)
06:20:06<dons>phr: i've heard good reviews of it
06:20:09<dons>i wouldn't mind a copy either
06:20:15<sjanssen>the imperative version can only do two things: iteratively print results to the screen, or collect all the results in a mutable var (strictly)
06:20:34<sjanssen>whereas our functional and lazy version has the ultimate flexibility
06:20:44<phr>i emailed the guy who wrote that position paper and he suggested working through some exercises in TAPL first, so i might try that (i have a borrowed copy)
06:20:56<opqdonut>sjanssen: wow, you gave me a deja vu :)
06:21:07<opqdonut>i swear i've heard those two lines before
06:21:18<sjanssen>dons: the ocaml takes a callback function that's applied to each result in order
06:21:32<dons>sjanssen: ah very interesting.
06:21:44<Eelis>(phr: that guy also hangs out in #coq)
06:21:56<phr>eelis, oh neat
06:23:07<sorear>phr: Try not to be offended by his bad communication problems. (and by bad I mean "I got kickbanned from #haskell" bad)
06:23:22<phr>you mean adamc???
06:23:34<hpaste> sjanssen annotated "OCaml sudoku" with "a more direct translation, with ucky imperative junk" at http://hpaste.org/2348#a2
06:23:59<sorear>phr: yup, adamc, aka Smerdyakov (you should have heard that name by now)
06:24:05<phr>yow
06:24:06<phr>heh
06:24:09<phr>i saw that name on his website
06:24:33<phr>but no i've never interacted with him except sending him an email about coq and getting a reply
06:24:39<sorear>phr: So how do you read his slides?
06:24:46<phr>on his site
06:24:55<sorear>phr: Every pdf program I've tried mangles them horribly
06:25:13<phr>yeah maybe xpdf is manglign them too
06:25:21<sorear>http://members.cox.net/stefanor/1187591104.png
06:25:22<sorear>notice the overlap
06:25:27<phr>i guess they're readable though
06:25:41<phr>yeah
06:25:52<phr>the actual paper is in the proceedings of that conference which is online
06:25:55<phr>there's a link in there somewhere
06:26:16<newsham>sorear: same overlap in acrobat reader.
06:26:20<glguy>I tried Acrobat 8.1
06:26:23<glguy>and it doesn't work either
06:26:28<newsham>perhaps animated slides translated down to flat pages?
06:26:41<sorear>xpdf, kpdf, pdfedit all break
06:26:58<sorear>and smerdyakov didn't notice (the question) when I asked him
06:27:18<phr>yeah try this http://www.easychair.org/FLoC-06/PLPV-preproceedings.pdf
06:27:27<phr>it's a big pdf and that paper is way near the end
06:27:30<phr>on p.110 of the pdf
06:28:36<phr>it scares me a bit that all these program verification guys are working on mobile proof-carrying code, which smells a little too much like DRM ;)
06:29:17<wli>No big surprise.
06:29:34<wli>DRM will get rammed down our throats regardless of whether we want it.
06:30:57<ddarius>No it won't.
06:31:36<newsham>drm will flop and be scaled way back
06:31:41<wli>Well, there's a generalized "intellectual property enclosure movement" ongoing of which DRM is a part.
06:32:01<glguy>there was a post on slashdot recently about DRM declining in favor of watermarking
06:32:12<glguy>I don't know if that will happen or not, but it seems somewhat reasonable
06:32:18<glguy>that it could
06:32:42<phr>my boss has this big rant about how copy protection killed the software industry in the 1980's and it's killing the music and movie industries now ;)
06:33:09<ddarius>The software industry is dead?
06:33:09<glguy>"killed the software industry"?
06:33:26<phr>yeah, there's basically about 2 sw companies making money, as opposed to 100's or 1000's in the 80's and 90's
06:33:35<wli>Well, it's going to take much larger economic events to kill the software industry.
06:34:13<phr>it's already dead, to hear this guy tell it
06:34:25<wli>phr: Presumably he means lack of copy protection?
06:35:04<phr>no he means there used to be a lot of profitable software companies but now there's basically just microsoft and adobe. the rest have been killed or absorbed. he blames this on copy protection.
06:35:15<wli>phr: Or lack thereof?
06:35:56<phr>he says they did fine without copy protection in the 80's and made lots of cash, but then they started using copy protection extensively and consequently died on the vine
06:36:17<newsham>isnt that when they started hiring non-caucasians and women?
06:36:38<glguy>wait, women work in the software industry?
06:36:55<newsham>silliness
06:37:04<phr>heh
06:37:14<wli>In my field they've been scouring the world for anyone who can do it for the past 60 years, so "offshoring" is meaningless.
06:38:28<phr>math?
06:38:37<wli>phr: No, kernel crap.
06:38:40<glguy>math has been around more than 60 years
06:38:55<phr>oh
06:39:18<dons>you sure, glguy? wasn't Leibniz an Algol programmer?
06:39:29<wli>There was Lady Ada.
06:39:49<glguy>she could hardly be considered part of the "software industry" :-p
06:39:58<wli>The first programmer, who wrote the first program, which was to compute Bernoulli numbers.
06:40:13<dons>and we continue the tradition to this day :)
06:40:58<dons>i note Bernouilli.hs is the first benchmark in nofib
06:41:14<lament>the first programmer was babbage
06:41:55<lament>whether ada did or didn't actually write any code, babbage certainly wrote some first
06:41:57<dons>wasn't he the first computer engineer?
06:42:47<paolino>good day, is there anything in the standard lib to split a string on a separator character ?
06:42:50<dons>ah i see, Ada Lovelace published some ideas about the difference engine that Babbage didn't.
06:42:56<dons>paolino: 'break'
06:43:09<fishkandy>ada saw the general purpose of the machine, she envisaged tha tit could make music, and "weave algebraic patterns"
06:43:12<glguy>paolino: kind of
06:43:17<wli>lament: There's some reason Ada's cited as the first programmer vs. Babbage. I don't know specifically why. I'm not into this history bit.
06:43:19<paolino>foldr break ?
06:43:27<glguy>paolino: you'd use unfoldr
06:43:41<dons>fishkandy: yeah, she realised you could hack it
06:43:54<paolino>ok, I try that
06:44:11<paolino>:t unfoldr
06:44:13<lambdabot>forall b a. (b -> Maybe (a, b)) -> b -> [a]
06:45:25<steven_ashley>:info unfoldr
06:45:29<steven_ashley>awwh :P
06:45:34<steven_ashley>where is it defined?
06:45:41<dons>Data.List
06:45:41<glguy>Data.List
06:45:45<dons>?src unfoldr
06:45:45<lambdabot>unfoldr f b = case f b of
06:45:45<lambdabot> Just (a,new_b) -> a : unfoldr f new_b
06:45:45<lambdabot> Nothing -> []
06:45:45<glguy>jinx
06:45:47<wli>There need to be more anamorphisms, like unfoldl and unfoldAccumL/unfoldAccumR
06:46:09<dons>wli, I agree!
06:46:20<dons>streamEverything :)
06:47:13<opqdonut>i dislike the maybeness of unfoldr :/
06:47:15<glguy>ACTION didn't realize you could compile Coq proofs and call them from OCaml
06:47:43<glguy>opqdonut: then you should stick with map + iterate :)
06:47:49<dons>glguy: yeah, you can extract src from Coq or Isabele or Twelf, as ML or Haskell and a few others usually
06:48:01<dons>opqdonut: you gotta terminate the list somehow ... usually
06:48:19<opqdonut>dons: yeah i realize that :)
06:48:42<glguy>dons: if you use the version Cale typically mentions:
06:48:49<dolio>If it took a predicate, it'd be easier to use with various other functions.
06:48:50<wli>Writing out iteration to convergence as let xs = iterate step x in fst $ head $ dropWhile (uncurry (/=)) $ zip xs $ tail xs gets repetitive after a while.
06:48:55<glguy>takeWhile f $ map g $ iterate h x
06:49:23<glguy>or maybe it was: map f $ takeWhile g $ iterate h x
06:49:24<hpaste> sjanssen annotated "OCaml sudoku" with "the Map is not needed" at http://hpaste.org/2348#a3
06:49:55<phr>this thompson book is really good, much more accessible for newbies than pierce or harper
06:49:59<dons>sjanssen: ah, good!
06:50:07<paolino>:t unfoldr (\b -> let (l,rs) = break '/' b in if (not.null $ rs) then Just (l,rs) else Nothing) "a/b"
06:50:09<lambdabot> Couldn't match expected type `a -> Bool'
06:50:09<lambdabot> against inferred type `Char'
06:50:12<dons>sjanssen: now you can remove that Map import
06:50:24<glguy>:t break
06:50:24<lambdabot>forall a. (a -> Bool) -> [a] -> ([a], [a])
06:50:30<glguy>paolino: note the a -> Bool
06:51:13<paolino> :t unfoldr (\b -> let (l,rs) = break (=='/') b in if (not.null $ rs) then Just (l,tail rs) else Nothing) "a/b"
06:51:39<msingh>what is this called: [1 .. 10]
06:51:43<glguy>paolino: you had a space before :t
06:51:54<paolino>:t unfoldr (\b -> let (l,rs) = break (=='/') b in if (not.null $ rs) then Just (l,tail rs) else Nothing) "a/b"
06:51:56<lambdabot>[[Char]]
06:52:01<glguy>msingh: sugar for: enumFromTo
06:52:16<paolino>msingh: enumeration
06:52:19<msingh>glguy, i mean the FP term for it, if there is one
06:52:53<paolino>> unfoldr (\b -> let (l,rs) = break (=='/') b in if (not.null $ rs) then Just (l,tail rs) else Nothing) "a/b"
06:52:55<lambdabot> ["a"]
06:53:05<paolino>:/
06:53:18<glguy>paolino: in the case of "b", rs would be null
06:53:25<glguy>paolino: but you return Nothing when that is the case
06:54:11<glguy>paolino: you need to test for b being null, that's when you are done
06:57:05<glguy>> unfoldr (\b -> if null b then Nothing else Just (case break (=='/') b of (xs,'/':ys) -> (xs,ys); pair -> pair)) "a/b/c"
06:57:07<lambdabot> ["a","b","c"]
06:57:18<steven_ashley>lol, that really is too much effort :(
06:57:57<sjanssen>there's a neat one with groupBy, let me find it
06:58:11<paolino>> unfoldr (\b -> if null b then Nothing else let (l,rs) = break (=='/') b in if (not.null $ rs) then Just (l,tail rs) else Just (l,[]) "a/b"
06:58:11<lambdabot> Unbalanced parenthesis
06:58:28<paolino>> unfoldr (\b -> if null b then Nothing else let (l,rs) = break (=='/') b in if (not.null $ rs) then Just (l,tail rs) else Just (l,[])) "a/b"
06:58:29<lambdabot> ["a","b"]
06:58:30<glguy>> unfoldr (\b -> if null b then Nothing else Just (let (xs,ys) = break (=='/') b in (xs,drop 1 ys))) "a/b/c"
06:58:31<lambdabot> ["a","b","c"]
06:58:37<sjanssen>@type \p -> map (dropWhile p) . groupBy (const (not . p))
06:58:40<lambdabot>forall a. (a -> Bool) -> [a] -> [[a]]
06:59:01<sjanssen>@type (\p -> map (dropWhile p) . groupBy (const (not . p))) (=='/') "a/b/c"
06:59:03<lambdabot>[[Char]]
06:59:11<sjanssen>> (\p -> map (dropWhile p) . groupBy (const (not . p))) (=='/') "a/b/c"
06:59:11<lambdabot> ["a","b","c"]
06:59:24<glguy>> unfoldr (\b -> if null b then Nothing else Just (let (xs,ys) = break (=='/') b in (xs,drop 1 ys))) "a/b//c"
06:59:26<lambdabot> ["a","b","","c"]
07:01:10<glguy>> unfoldr (\b -> guard(not $ null b) >> return (second (drop 1) (break (=='/') b))) "a/b//c"
07:01:11<lambdabot> ["a","b","","c"]
07:02:58<glguy>> unfoldr (liftM2 (>>) (guard.not.null) (Just . second (drop 1) . break (=='/'))) "a/b//c"
07:02:58<lambdabot> ["a","b","","c"]
07:03:27<glguy>> unfoldr(liftM2(>>)(guard.not.null)(Just .second(drop 1).break(=='/')))"a/b//c"
07:03:29<lambdabot> ["a","b","","c"]
07:03:33<wli>sjanssen: What's going on with n = 3 there? Is that the board size?
07:03:33<dolio>Clearly there ought to be 'f p g x = guard (not $ p x) >> return (g x)' somewhere in the standard libraries.
07:03:43<sjanssen>wli: cell size
07:04:09<sjanssen>wli: it's used to determine whether two coordinates are in the same box
07:04:24<sjanssen>wli: would you like a description of the algorithm?
07:04:27<glguy>paolino: didn't promise it'd be pretty
07:04:45<wli>sjanssen: Yeah.
07:05:48<sjanssen>search :: [(Coordinate, [Value])] -> [(Coordinate, Value)]
07:06:16<sjanssen>the argument is the list of potential values that can fit in each square
07:06:56<wli>okay
07:07:01<glguy>in this case... unfoldr doesn't have much to offer since the explicit solution seems shorter and clearer...
07:07:03<glguy>> let f "" = []; f xs = a : f (drop 1 b) where (a,b) = break (=='/') xs in f "a/b//c"
07:07:03<sjanssen>at each step of 'search', we chose one of the potential values for the first coordinate in the list, and remove all coordinate, value pairs that conflict with that choice
07:07:04<lambdabot> ["a","b","","c"]
07:08:04<sjanssen>eg. if we choose 3 for (0, 0), we know that 3 can't appear elsewhere in the first row or column, and it can't be in the upper left box
07:08:15<wli>sjanssen: Sounds like a big fat list monad do { }
07:08:28<sjanssen>wli: it is, essentially
07:08:34<sjanssen>see the latest version of the paste
07:08:53<wli>sjanssen: Yeah, I'm looking.
07:10:21<dons>this is what happens, http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx
07:10:23<lambdabot>Title: LukeH's WebLog : Monadic Parser Combinators using C# 3.0, http://tinyurl.com/2srswy
07:11:03<sjanssen>wli: does that illuminate things?
07:11:26<sjanssen>'add' is the procedure that prunes our search space
07:11:30<wli>sjanssen: Yeah. The Int's for random crap kind of obfuscated it.
07:12:09<sjanssen>it also sorts by the number of potential values in a square as an optimization
07:12:45<wli>sjanssen: So what does the input to all this look like/
07:13:26<hpaste> sjanssen annotated "OCaml sudoku" with "with the emptyBoard" at http://hpaste.org/2348#a4
07:13:35<sjanssen>wli: emptyBoard is one possible output
07:13:37<sjanssen>s/output/input
07:14:52<wli>okay, so that clears up more of how it works.
07:15:21<sjanssen>'search emptyBoard' produces all suduko solutions
07:15:23<dolio>dons: So concise.
07:16:20<dons>dolio: heh
07:16:54<paolino>> (\p -> groupBy (const (not . p))) (=='/') "a/b/c"
07:16:56<lambdabot> ["a","/b","/c"]
07:17:05<wli>I wonder how it would look as one huge do { }
07:17:31<glguy>> (\p -> groupBy (const (not . p))) (=='/') "a/b//c"
07:17:31<lambdabot> ["a","/b","/","/c"]
07:17:58<wli>I think it can be unraveled.
07:18:33<paolino>@dict unraveled
07:18:33<lambdabot>Supported dictionary-lookup commands:
07:18:33<lambdabot> all-dicts devils easton elements foldoc gazetteer hitchcock jargon lojban vera web1913 wn world02
07:18:33<lambdabot>Use "dict-help [cmd...]" for more.
07:20:14<sjanssen>wli: 'search' is really the only function that uses that sort of non-determinism
07:20:17<glguy>Conclusion
07:20:17<glguy>The little parser combinator framework here is very much a toy implementation. It's horribly inefficient, doesn't do error reporting, and doesn't support any form of error recovery. But it's a fun 150 lines of code!
07:20:28<wli>sjanssen: add doesn't so much prune as it goes forward assuming that the chosen solution is the case.
07:20:58<sjanssen>you might be able to simplify a bit by making select, invalid, add, etc. let bound variables in the do
07:21:29<dolio>@remember JonHarrop Conversely, I find the practical problem of being unable to compare two values for equality in O(1) very disturbing...
07:21:29<lambdabot>Done.
07:21:46<sjanssen>dolio: reference?
07:21:54<dolio>comp.lang.functional
07:22:45<dons>glguy: so don't quit your day job yet to do C# monad hacking? :)
07:23:01<glguy>dons: I quit my C# day job already to do Haskell hacking
07:23:11<glguy>probably won't be going back
07:23:14<dons>dolio: hah. typical JDH.
07:24:46<dolio>Apparently he likes reallyUnsafePtrEquality.
07:24:51<dolio>As does some Lisp guy.
07:24:52<dolio>:)
07:25:06<dons>dude, its fast!
07:25:25<sjanssen>they just don't see the value of real purity
07:25:25<Pseudonym>Hell, if you want a wrong answer, I can write a faster one.
07:25:26<glguy>that's like saying "wait, you mean to tell me that Int has a maxbound??"
07:25:59<glguy>its the sort of thing that you keep to yourself
07:26:08<glguy>because you should have learned it years ago
07:26:41<dolio>Of course, in OCaml, it's named ==, apparently.
07:26:47<dolio>That's a little less scary.
07:26:56<glguy>"it"?
07:27:04<dolio>reallyUnsafePtrEquality
07:27:23<glguy>what is the operator for actual equality
07:27:23<sjanssen>there goes referential transparency
07:27:29<dolio>=
07:27:53<sjanssen>let x = foo in x == x -- True
07:27:53<dons>:)
07:27:55<sjanssen>foo == foo -- False
07:28:10<sjanssen>where foo is some complicated (not shared) expression
07:28:11<augustss>sjanssen: referential transparency is already gone in OCaml
07:29:04<dons>i find that the hardest thing about reading ocaml : side effects dropped into the middle of an expression
07:29:19<dons>and you have to step back and realise you have no idea now what the code is really doing
07:29:19<glguy>dons: everyone likes easter eggs
07:29:42<dons>glguy: they're a fun surprise!
07:29:43<sieni>except perhaps customers
07:30:52<sjanssen>augustss: I suppose you can't miss what you've never had ;)
07:31:16<augustss>exactly
07:31:26<opqdonut>:))
07:37:30<sorear>C programmers break RT immediately. O'Caml programmers do it after looking a few minutes for a better way. Haskell programmers would rather jump off cliffs.
07:37:54<opqdonut>?remember sorear C programmers break RT immediately. O'Caml programmers do it after looking a few minutes for a better way. Haskell programmers would rather jump off cliffs.
07:37:54<lambdabot>Done.
07:38:05<dons>sorear: you think the ocaml guy waits a few minutes? i've seen some surprising shootout code where they didn't hold back -- but it could just be the shootout.
07:38:20<opqdonut>?quote ocaml
07:38:20<lambdabot>vincenz says: [Ocaml] used to be pretty, Haskell made it ugly
07:38:23<dons>or say, the jdh soduku
07:38:23<opqdonut>?quote ocaml
07:38:23<lambdabot>qwe1234 says: the problem is that ocaml has mandatory garbage collection.
07:38:37<sorear>yeah, shooutout does bad things for style
07:38:37<dons>qwe has so many fun ideas
07:39:14<dons>sorear: yeah, basically you have to do exactly what the C or C++ version does usually, since they've already picked an optimal data structure and evaluation order
07:39:22<opqdonut>the garbage collection isn't mandatory, you could just pass around a map with all the structures you use :)
07:39:28<dons>there's some exceptions -- but the low level stuff is of that sort
07:40:47<sorear>I would imagine that ICFP entries (regardless of language) are much more functional.
08:00:49<reltuk>dons: like when qwe claimed polymorphic numeric constants didn't make any sense
08:02:35<dons>oh, it was more zen than that. he claimed they didn't exist at all.
08:02:43<dons>i still ponder that one in quiet moments.
08:04:53<reltuk>I bet he's killer at a cocktail party
08:05:36<njbartlett>About the RT thing... speaking as somebody who came from Java, I think it takes some time working with Haskell, getting pissed off that you can't have side effects, before you start to appreciate that it's actually a good thing
08:06:12<dons>njbartlett: yeah, that seems reasonable.
08:06:27<dons>the initial reaction is something near to disbelief, I've noticed :)
08:07:17<iguana_>isn't Either a Monad?
08:07:25<njbartlett>Yeah. And the next reaction is write everything in the IO monad
08:08:42<dons>iguana_: yep.
08:09:11<dons>?src Either (>>=)
08:09:11<lambdabot>Left l >>= _ = Left l
08:09:11<lambdabot>Right r >>= k = k r
08:10:13<iguana_>hm, what does "No instance for (Monad (Either String))" tell me then?
08:10:41<DRMacIver>Morning
08:11:58<iguana_>(I want to use a StateT with an inner Either to pass errors)
08:13:59<DRMacIver>iguana_: Hm. Maybe the monad instance is defined in some other module?
08:14:53<doserj>Control.Monad.Error
08:15:38<iguana_>ahhh
08:15:41<iguana_>thanks!
08:17:01<iguana_>hm, looking at Control.Monad.Error, I should probably be using ErrorT, shouldn't I?
08:18:52<njbartlett>Maybe you want Control.Monad.Error.Class. It has this instance declaration:
08:19:07<njbartlett>Error e => MonadError e (Either e)
08:19:31<njbartlett>And String is an instance of Error
08:22:55<psykotic>@info Error
08:22:56<lambdabot>(Error)
08:23:01<opqdonut>:D
08:47:56<laz0r>is it possible to have multiple patterns in lambda notation?
08:49:28<laz0r>map (\[] -> "*") [[],"a","b"] would not work because of the non-exhaustive pattern
08:50:00<opqdonut>no
08:50:01<doserj>map (\x -> case x of ...)
08:50:07<opqdonut>you have to use \x -> case
08:50:07<opqdonut>damn, too slow
08:50:10<doserj>:)
08:50:24<laz0r>ah, thanks
08:54:22<osfameron>ACTION looks at hints to Euler 18 and cries
09:01:39<TSC>Isn't Euler problem 18 a straight
09:01:41<TSC>...-forward dynamic programming problem?
09:03:48<osfameron>TSC: er... I guess dynamic programming problems are easy if you understand them?
09:04:05<the_dormant>TSC: you can discard computed values in each step, so it's not necessary a dynamic programming kind of problem
09:04:51<osfameron>I was just keeping a list of "this is my position and this is my sum" and then exponentially multiplying the size of my data structure...
09:05:14<osfameron>which worked very well for the 4 row problem, but makes my laptop unhappy for the real question
09:07:03<osfameron>can you necessarily discard computed values? A low-scoring path at the top might lead to a higher scoring path below
09:07:51<the_dormant>just go from the bottom
09:08:03<sorear>trying to figure out a response to C.Maeder that won't start a flamewar, but the best I can come up with is "The road to perl is paved with "improvements" like this." But it just feels so wrong to ignore a directly addressed message...
09:08:35<doserj>osfameron: a naive recursive versions gives the result immediately in ghci for me
09:08:55<popcount>How can I rewrite this s.t. it becomes lazy? \z -> filterM (\e-> liftM2 (>=) (bar e z) (bar e z)) list
09:09:10<popcount>How can I rewrite this s.t. it becomes lazy? \z -> filterM (\e-> liftM2 (>=) (foobar e z) (bar e z)) list *
09:09:34<gebb>osfameron: You don't need the path. Just the sum.
09:09:41<sorear>popcount: You don't need to. Just use a lazy monad.
09:09:51<sorear>(or ideally none at all)
09:10:37<osfameron>gebb: I suppose. I thought it would be useful to double check the results
09:10:56<osfameron>doserj: oh, well, I was probably overcomplicating things due to having no idea how to write this in haskell
09:11:10<the_dormant>gebb: it isn't that hard to keep the path too
09:11:35<kral>ahoy
09:12:48<osfameron>of course, I say "overcomplicated" but it's still only about 8 lines of code... maybe I just underthought it
09:17:41<fasta>I have a macro ASSERTM, which expands when DEBUG = 1. I call GHC as: ghc -cpp -DDEBUG=0 <more options>. In the profile, the operation inside the ASSERTM still shows up. What am I doing wrong?
09:22:07<sorear>using #ifdef maybe?
09:24:38<fasta>*** Deleting temp files: ... I am interested in those temp files. How can I see them?
09:24:52<sorear>Yes.
09:25:03<fasta>-keep-tmp-files
09:25:13<steven_ashley>well done
09:25:26<fasta>GHC's manpage seemed to have improved.
09:25:55<sorear>fasta: Even if it hadn't, this information has been in the HTML manual for as long as I can remember
09:26:19<fasta>sorear: yes, but the HTML manual is not searchable
09:26:27<sorear>fasta: Obviously, it's going to be a flag. Scroll down to Flag Reference. Oh look, 4.17.5. Keeping intermediate files
09:26:36<sorear>?!
09:26:36<lambdabot>Maybe you meant: . v
09:27:16<sorear>in MY browser of choice, / foo <RET> works.
09:27:26<osfameron>doserj: OK! got that working with a recursive solution
09:27:32<sorear>I'm pretty sure FF and IE have it too.
09:27:39<fasta>sorear: you have the one page version?
09:28:08<sorear>No, but almost all questions can be answered using the TOC>
09:28:24<fasta>sorear: most, yes. Let's stop this silly discussion.
09:28:44<xerox>?go Keeping intermediate files site:haskell.org/ghc/docs/latest/html/users_guide
09:28:47<lambdabot>http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html
09:28:47<lambdabot>Title: 4.6. Filenames and separate compilation
09:29:51<fasta>The "current" user guide or libraries are often broken.
09:30:06<fasta>The only way to get the newest documentation is to build it yourself.
09:30:22<fasta>(which was broken two days ago)
09:31:13<osfameron>ah! perhaps using !! to index in my first solution was a bad idea, as indexing on a list is O(n) rather than O(1) on an array
09:32:36<doserj>osfameron: the index is quite small, so it shouldn't make much difference (I'm using !!)
09:33:13<osfameron>doserj: oh! well, $deity knows then. I did get the hint to use "tail" from the wiki hints, but I'm doing it recursively for now
09:47:37<dozer>is there interest in yet another suduko solver?
09:48:57<roconnor>dozer: always
09:49:07<popcount>dozer, one that works parallel and is faster than any sequential C version.
09:49:07<roconnor>@wki Suduko
09:49:08<lambdabot>http://www.haskell.org/haskellwiki/Suduko
09:49:22<roconnor>hmm
09:49:31<roconnor>I wish @wiki was a bit more intellegent
09:49:31<dozer>ouch - that's all blank now
09:49:49<laz0r>@wki Sudoku
09:49:49<lambdabot>http://www.haskell.org/haskellwiki/Sudoku
10:27:27<osfameron>is it possible to do alternatives in a case statement?
10:27:34<osfameron>like: 1,2,3 -> whatever;
10:27:59<Eelis> x | x `elem` [1,2,3] -> whatever;
10:28:02<wli>What do you mean?
10:28:02<wli>Pattern guards?
10:28:07<wli>Yes, you can do pattern guards in a case statement.
10:28:11<popcount>osfameron, no
10:28:19<osfameron>ah, you use elem, ok
10:28:25<osfameron>thanks :-)
10:28:35<EvilTerran>wli, those are not pattern guards... those are just guards
10:28:52<wli>I'm not convinced there's a distinction.
10:28:53<Igloo>Or you can bind whatever in a where clause and use 3 case branches
10:29:02<popcount>Pattern guards are p1, p2 = ... IIRC
10:29:03<EvilTerran>a pattern guard would be x | Just y <- blah x -> ...
10:30:17<EvilTerran>the guard BOOLEXP is the same as the pattern guard True <- BOOLEXP
10:33:38<MyCatVerbs>What's guard used for, anyhoo? I'm not sure I understand it at all.
10:39:45<dmwit>MyCatVerbs: I usually use guards to eliminate long if/then/else chains.
10:40:19<popcount>dmwit, do you have an example of that?
10:40:39<dmwit>not handy
10:41:40<matt__r>MyCatVerbs: Guards also help when you need to choose between alternives based on values, not patterns
10:41:58<matt__r>MyCatVerbs: lets see if I can come up with a good example.....
10:42:15<MyCatVerbs>dmwit: ahh, ookie.
10:42:23<MyCatVerbs>ACTION <3 this room. You people are all just wonderful.
10:45:02<hpaste> mattr pasted "use for guards" at http://hpaste.org/2349
10:45:42<Eelis>not the best of examples, because theSame (LChar c) (LChar c') = c == c'
10:45:43<matt__r>Check the example - without the guards, we would need to code the failure into each example
10:46:21<matt__r>yeah - I know,
10:46:29<matt__r>but I needed a short one
10:46:29<matt__r>:)
10:53:13<xpika>i need the fuction to that takes an angle between 0 2pi plus a magnitude and returns the coordinate
10:53:55<xpika>can it be done via complex numbers?
10:54:26<Eelis>wasn't it something like (-sin(r), cos(r)) ?
10:54:40<Eelis>er
10:54:47<Eelis>(-sin(r)*m, cos(r)*m)
10:57:01<xpika>Eelis: that only works for 1 quadrant
10:57:17<Eelis>ok. then i give up
10:57:28<xpika>Eelis: i tried that too
10:57:41<Eelis>solution can't be far off, but i can't be bothered at this hour :)
11:04:28<xerox>> let toCartesian theta r = (r * cos theta, r * sin theta) in map (uncurry toCartesian) [(pi/4,(sqrt 2)),((3/4)*pi,sqrt 2),((5/4)*pi,sqrt 2),((7/4)*pi,sqrt 2)]
11:05:39<xerox>[(1.0000000000000002,1.0),(-1.0,1.0000000000000002),(-1.0000000000000002,-1.0),(0.9999999999999998,-1.0000000000000002)]
11:21:11<matt__r>I just saw about 100 ** left the room messages
11:21:13<matt__r>now they are all back :)
11:21:14<matt__r>server glitch I guess
11:22:03<tuxplorer>matt__r: it was a netsplit
11:22:37<osfameron>irssi++ # pretty netsplit info
11:22:47<wli>I've got all that crap ignored (literally called "crap" by irciII-EPIC4 as a /ignore pattern).
11:22:47<matt__r>wli: shall I give you the short and innacurate - but still enlightening version?
11:22:50<tuxplorer>http://en.wikipedia.org/wiki/Netsplit
11:22:51<matt__r>wli: of GADTs I mean
11:22:57<MyCatVerbs>matt__r: ohhh, crap, sorry, wrong concept.
11:23:02<wli>matt__r: Go for it.
11:23:04<MyCatVerbs>matt__r: I was actually after a use for the "guard" function in Control.Monad. >_>
11:23:06<MyCatVerbs>:t guard
11:23:07<lambdabot>forall (m :: * -> *). (MonadPlus m) => Bool -> m ()
11:23:10<matt__r>wli: use GADTs when you want one of your constructors to have a more specific version of the full datatype's type
11:23:16<MyCatVerbs>(func; | pred = expr; | pred2 = expr2... seems straightforwardly useful for terseness, to me)
11:23:17<matt__r>you typically use this to add extra or tighter type contraints to some part of your program.
11:23:47<wli>Now to develop the intuition of when it makes sense to use them.
11:25:05<matt__r>wli: probably not as often as you might think :)
11:25:39<wli>I've got TH and arrows to learn, too.
11:25:50<matt__r>wli: just be sure you don't learn things you won't need. I spent way too much of my PhD time learning new and exciting haskell extensions and then having no use for them :)
11:25:51<matt__r>its fun, but I have work to do!
11:26:14<wli>matt__r: Well, the whole reason I'm on about this is pedagogical, to "brush up" or "complete" learning from college, so...
11:26:15<dons>?users
11:26:15<lambdabot>Maximum users seen in #haskell: 395, currently: 380 (96.2%), active: 11 (2.9%)
11:26:17<matt__r>wli: aha - have fun then!
11:26:28<wli>Well, there are plans within plans, but that's one of them.
11:26:50<dmwit>MyCatVerbs: Oh! That's a different story.
11:26:50<dmwit>:t guard
11:26:52<lambdabot>forall (m :: * -> *). (MonadPlus m) => Bool -> m ()
11:27:06<dmwit>> do { x <- [0..20]; guard (odd x); return x }
11:27:06<lambdabot> [1,3,5,7,9,11,13,15,17,19]
11:27:07<dmwit>(Bad example, I know.)
11:27:08<dmwit>?instances MonadPlus
11:27:08<lambdabot>Either e, ErrorT e m, IO, Maybe, RWST r w s m, ReaderT r m, StateT s m, WriterT w m, []
11:27:20<dmwit>Monad comprehensions would desugar to use guard.
11:28:21<matt__r>tuxplorer: ??
11:28:24<lambdabot>Title: Netsplit - Wikipedia, the free encyclopedia
11:28:41<tuxplorer>matt__r: ?
11:28:43<matt__r>tuxplorer: ahh - thanks
11:28:51<MyCatVerbs>dmwit: no, good example! Thank you.
11:28:52<tuxplorer>matt__r: :) welcome
11:29:56<MyCatVerbs>> [0..20] >>= (guard . odd)
11:29:56<lambdabot> [(),(),(),(),(),(),(),(),(),()]
11:29:58<opqdonut>:))
11:29:59<MyCatVerbs>...methinks I did something vewwy vewwy wrong there.
11:30:00<opqdonut>?t guard
11:30:00<lambdabot>Maybe you meant: tell temp thank you thanks thx time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ft v
11:30:00<wli>> [0..20] >>= (guard . odd >> return)
11:30:00<lambdabot> Add a type signature
11:30:00<MyCatVerbs>> [0..20] >>= (\x->(guard . odd) >> return x)
11:30:00<lambdabot> Couldn't match expected type `[]' against inferred type `(->) a'
11:30:01<opqdonut>:t guard
11:30:01<lambdabot>forall (m :: * -> *). (MonadPlus m) => Bool -> m ()
11:30:03<wli>> [0..20] >>= (guard . odd . (>> return))
11:30:04<opqdonut>see, m()
11:30:04<lambdabot> add an instance declaration for (Integral (a -> m a))
11:30:07<MyCatVerbs>> [0..20] >>= (\x->(guard . odd $ x) >> return x)
11:30:07<lambdabot> [1,3,5,7,9,11,13,15,17,19]
11:30:07<opqdonut>yeah
11:30:07<EvilTerran>> [0..20] >>= liftM2 (>>) (guard . odd) return
11:30:08<opqdonut>guard doesn't return the value
11:30:08<lambdabot> [1,3,5,7,9,11,13,15,17,19]
11:30:18<EvilTerran>ACTION mixes his monads
11:30:18<MyCatVerbs>> { x <- [0..20]; True <- odd x; return x; }
11:30:18<lambdabot> Parse error
11:30:20<opqdonut>do
11:30:21<MyCatVerbs>> do { x <- [0..20]; True <- odd x; return x; }
11:30:21<lambdabot> Couldn't match expected type `[t]' against inferred type `Bool'
11:30:21<opqdonut>:)
11:30:22<MyCatVerbs>> do { x <- [0..20]; True <- (odd x); return x; }
11:30:22<lambdabot> Couldn't match expected type `[t]' against inferred type `Bool'
11:30:29<MyCatVerbs>> do { x <- [0..20]; [True] <- (odd x); return x; }
11:30:29<lambdabot> Couldn't match expected type `[t]' against inferred type `Bool'
11:30:32<opqdonut>try let True = odd x
11:30:33<opqdonut>or something
11:30:34<opqdonut>or <- [odd x]
11:30:34<wli>argh
11:30:34<MyCatVerbs>> do { x <- [0..20]; <- [odd x]; return x; }
11:30:34<lambdabot> Parse error
11:30:35<opqdonut>:)
11:30:35<EvilTerran>(i think that liftM2 is in (e->), and the (>>)s are in list)
11:30:36<MyCatVerbs>> do { x <- [0..20]; True <- [odd x]; return x; }
11:30:36<lambdabot> [1,3,5,7,9,11,13,15,17,19]
11:30:37<opqdonut>EvilTerran: yeah
11:30:37<EvilTerran>@src (->)(>>=)
11:30:38<lambdabot>Source not found. You speak an infinite deal of nothing
11:30:38<EvilTerran>@src (->) (>>=)
11:30:39<lambdabot>f >>= k = \ r -> k (f r) r
11:30:39<MyCatVerbs>opqdonut: danke.
11:30:40<doserj>> do { x <- [0..20]; guard (odd x); return x; }
11:30:40<lambdabot> [1,3,5,7,9,11,13,15,17,19]
11:30:41<matt__r>tuxplorer: hello
11:30:44<EvilTerran>ACTION likes reader's liftM2 for pointsfreeing stuff.
11:30:45<MyCatVerbs>@src (>>)
11:30:46<lambdabot>m >> k = m >>= \_ -> k
11:31:07<EvilTerran>liftM2 f g h x = f (g x) (h x), i believer
11:31:07<EvilTerran>-r
11:31:09<wli>Well, I think I'm getting pretty good with monads, if nothing else.
11:32:03<tuxplorer>matt__r: hi!
12:28:07<Choko>@src foldl
12:28:08<lambdabot>foldl f z xs = lgo z xs
12:28:08<lambdabot> where lgo z [] = z
12:28:08<lambdabot> lgo z (x:xs) = lgo (f z x) xs
12:28:32<EvilTerran>that's horrible!
12:28:39<doserj>"@src" should really show the report definition :)
12:28:43<wli>I can't imagine what that manual program transformation is for.
12:28:48<opqdonut>mhmm
12:28:50<EvilTerran>foldl f z [] = z; foldl f z (x:xs) = foldl f (f z x) xs; iirc.
12:29:01<doserj>it is supposed to help the ghc optimiser (builder/consumer framework, i think)
12:29:07<opqdonut>yeah
12:29:09<EvilTerran>i agree with the sentiment that it should be the prelude definition
12:29:12<EvilTerran>*report prelude
12:29:13<opqdonut>doserj: that's how dons or somebody explained it here
12:29:13<popcount>But the prelude is wrong in some cases
12:29:13<wli>I guess it's something of a stopgap measure until the optimizer can do that for itself.
12:29:20<araujo>morning
12:29:21<opqdonut>morn
12:29:21<EvilTerran>@src fold
12:29:21<lambdabot>Source not found. Wrong! You cheating scum!
12:29:21<EvilTerran>@src foldr
12:29:22<lambdabot>foldr k z xs = go xs
12:29:22<lambdabot> where go [] = z
12:29:22<lambdabot> go (y:ys) = y `k` go ys
12:30:17<EvilTerran>ah, it would appear what i was looking for was gmapT . mkT
12:31:01<ddarius>worker/wrapper
12:32:09<ddarius>popcount: Where is the prelude wrong?
12:32:17<popcount>If I have a function which only modifies one thing in a state monad, will that be inlined automatically?
12:32:36<Lemmih>popcount: Yes.
12:32:40<Lemmih>popcount: If your Haskell compiler feels like it.
12:32:51<opqdonut>good answer :D
12:33:13<ddarius>Be sure to give it lots of coffee before hand.
12:33:18<wli>y=3^(1/2)*x is very very close to the curve 3*x^2-y^2=n
12:33:35<popcount> ./Main+RTS -K200M -p -xc -RTS shouldn't this make a Main.hp file when compiled with -prof -auto-all?
12:33:36<popcount>+space
12:33:43<DRMacIver>The monadic parser combinators for C# look really awful. :)
12:34:02<Lemmih>popcount: I think you need -hc or something.
12:34:06<Liskni_si>where is the definition of instance Functor ((,) a) ?
12:34:16<ddarius>C# has monadic parser combinators?
12:34:23<opqdonut>?index Functor ((,) a)
12:34:23<lambdabot>bzzt
12:34:24<opqdonut>bah
12:34:26<popcount>Lemmih, thanks, I disabled that by accident
12:34:28<opqdonut>i'g guess Control.Monad.Instances
12:34:42<Liskni_si>opqdonut: that's it, thanks
12:34:46<opqdonut>that's where all the funky instances are
12:35:04<doserj>*all* is a bit exaggerated. It has only 4 instances (and only 1 Monad instance, acutally...)
12:35:07<wli>I can bound it between 3^(1/2)*x >= y >= 3^(1/2)*x-n^(1/2) and x >= (n/3)^(1/2)
12:35:11<doserj>but they are the funky ones, yes :)
12:35:40<wli>As well as y <= x - 1
12:37:34<popcount>If I do l <- expensive; l' <- expensive2; return () in the ST monad and l and l' are not used anywhere, and expensive does no writes, will the run-time cost be close to zero?
12:37:40<wli>The active constraints seem to be x-1 >= y >= 3^(1/2)*x-n^(1/2) and x >= (n/3)^(1/2)
12:37:54<wli>It looks like a big fat triangular wedge.
12:38:22<wli>x <= (n^(1/2)-1)/(3^(1/2)-1) from the intersection point of the triangle, but one can do better when 0 <= x-1-(3^(1/2)*x-n^(1/2)) <= 1
12:38:44<popcount>ddarius, various lazy behaviours are not desirable. If you take the position that the prelude is the definition and therefor is correct, you would be right, of course.
12:38:45<wli>It's just x <= (n^(1/2)-2)/(3^(1/2)-1)
12:39:09<Cale>fail is in Monad. I'd say that's a bug :)
12:39:20<doserj>Functor is not a superclass of Monad (also a but :)
12:39:20<doserj>*bug
12:39:20<popcount>Cale, and where should the pattern match goes wrong semantics go then?
12:39:22<Cale>popcount: MonadZero
12:39:23<Cale>popcount: Just like in Haskell 1.4
12:39:31<doserj>Eq, Show are superclasses of Num...
12:39:32<Cale>If you attempt a possibly failing pattern match, you get a MonadZero constraint, because the translation uses mzero
12:39:39<doserj>Cale: it should still use fail:: String -> m a
12:39:44<doserj>with default implementation fail _ = mzero
12:39:45<Cale>doserj: Sure if you want to add that to the MonadZero class.
12:39:46<EvilTerran>nothing stopping that being a method of MonadZero
12:39:49<doserj>yep
12:39:53<Cale>Oh, and the associativity of ($) is wrong
12:39:55<Cale>That's a rather big one :)
12:40:36<doserj>(and foldl shouldn#t be in the prelude *cough*)
12:40:53<opqdonut>:D how so?
12:40:57<Cale>Nah, it should, it's just that foldl' should perhaps be as well.
12:41:17<fasta>Are there some inherent inefficiencies in using lots of STRefs?
12:41:29<fasta>Lots is "thousands"
12:42:17<ddarius>fasta: No.
12:42:41<fasta>I implemented a doubly linked list, but it spends all the time in that thing. I think I disabled all the debugging code already.
12:42:52<Cale>Then there's the exception system and the difference between Prelude.catch and Control.Exception.catch
12:42:58<fasta>AFAIK, everything should be constant time operations.
12:43:15<opqdonut>well constant time doesn't tell much :)
12:43:27<fasta>opqdonut: how complicated can a doubly linked list be...
12:43:56<fasta>I think I will just try to make a million element list and see what happens.
12:45:51<fasta>mapM <newtype constructor> is a nop, right?
12:46:02<opqdonut>huh?
12:46:04<popcount>er map
12:46:27<opqdonut>don't know how well the compiler optimizes it
12:46:34<ddarius>fasta: Possibly, but unlikely. It will most likely recreate the list, but maybe not.
12:46:36<fasta>popcount: Yes, you are right, map.
12:46:38<ddarius>Check the core.
12:47:04<popcount>:)
12:47:16<DRMacIver>You presumably could define a rewrite rule to change map <newtype constructor> into unsafeCoerce. :)
12:47:20<ddarius>I imagine there is some optimization that makes map id go away and a newtype constructor shouldn't get in the way but...
12:48:18<fasta>This is the best format -ddump-prep?
12:48:55<Saizan>-ddump-simpl i think
12:49:19<fasta>(and where does it dump it?)
12:49:59<Saizan>(stdout iirc)
12:50:20<roconnor>http://www.haskell.org/haskellwiki/Performance/GHC#Core_by_example
12:50:21<lambdabot>Title: Performance/GHC - HaskellWiki, http://tinyurl.com/yduwfl
12:50:44<fasta>Right, stdout...
12:52:33<fasta>Heh, it doesn't fit on my terminal.
12:52:58<roconnor>Simon Peyton-Jones says: GHC doesn't do full CSE.
12:52:59<roconnor>:(
12:53:03<roconnor>:'(
12:53:13<roconnor>WTF?
12:53:24<roconnor>:@
12:53:37<xerox>Right. You ought to name things explicitly to enable sharing.
12:53:57<ddarius>roconnor: Doing full CSE is a bad thing.
12:54:16<roconnor>Yeah, but doing CSE hand makes programs hard to read.
12:54:16<ibid>roconnor: iirc full CSE creates memory leaks
12:54:33<roconnor>and makes my code look like OCaml
12:54:34<ddarius>roconnor: Harder to read ... or exponential memory leaks...
12:54:39<ibid>roconnor: so you need to apply judgment in when to do it
12:55:08<roconnor>I was promised the compiler would be smart enought to make these decisions.
12:55:41<ddarius>let powerset [] = [[]]; powerset (x:xs) = powerset xs ++ map (x:) (powerset xs) -- good
12:55:43<ibid>to make the tradeoff between speed and memory? the problem is, the compiler cannot read you mind
12:55:51<ibid>*your
12:56:07<roconnor>I knew it was all lies
12:56:08<ddarius>let powerset [] = [[]]; powerset (x:xs) = xss ++ map (x:) xss where xss = powerset xs -- bad
12:56:17<roconnor>I'm going to program in ocaml.
12:56:18<fasta>() !k !n !alt !a1 !a2 !a3 !a4 !a5 !a6 !a7 !a8 !a9 !False <- how can this work? Since when is () a function?
12:56:37<ari>Is there a way to explicitly name things without causing sharing, btw? I'm interested because I was bitten by naming [minBound..maxBound] once...
12:57:01<ddarius>ari: You could add a () argument.
12:57:15<roconnor>ibid: we already know how to make that trade off. Got with speed, and screw memory.
12:57:18<EvilTerran>> filterM (const [False,True]) "abcd" -- better, ddarius? ;]
12:57:18<dons>fasta: that looks out of context -- and weird
12:57:19<lambdabot> ["","d","c","cd","b","bd","bc","bcd","a","ad","ac","acd","ab","abd","abc","a...
12:57:21<ddarius>Also if it's polymorphic it already won't be shared.
12:57:33<roconnor>ibid: if there is a memory leak, fix it with annotations.
12:57:58<ibid>roconnor: so that's why gtk2hs wouldn't install on my old laptop, screw the installation causing trashing
12:58:16<ibid>roconnor: the annotation is, do you name it or not :)
12:58:21<ddarius>roconnor: There is a special relativity in program execution where space and time are intermingled.
12:59:19<ddarius>The "good" definition of powerset recalculates powerset xs the "bad" definition does not but takes a combinatorially large amount of memory which is going to destroy performance.
12:59:25<ibid>roconnor: sometimes going for more memory causes a performance loss which is not comparable to the intended performance gain (if the working set exceeds main memory size)
12:59:48<roconnor>ibid: but the default is backwards. Do CSE unless I tell it not to.
12:59:55<roconnor>ibid: most of the time CSE is safe I assume.
13:00:22<|Jedai|>@src List
13:00:22<lambdabot>Source not found. Wrong! You cheating scum!
13:00:31<fasta>I never heard of bigForth before: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=bigforth&lang2=ghc
13:00:31<|Jedai|>@src length
13:00:31<lambdabot>Source not found. I've seen penguins that can type better than that.
13:00:32<lambdabot>Title: Forth bigForth benchmarks | Gentoo : Intel&#174; Pentium&#174;&nbsp;4 Computer L ..., http://tinyurl.com/2ua2y9
13:00:37<Saizan>@source Data.List
13:00:37<lambdabot>http://darcs.haskell.org/packages/base/Data/List.hs
13:01:06<fasta>dons: http://www.haskell.org/haskellwiki/Performance/GHC#Core_by_example
13:01:06<ibid>roconnor: the problem is, without CSE you can predict the memory usage better. with CSE, you can't apply the laziness assumption to reason for memory consumption
13:01:08<lambdabot>Title: Performance/GHC - HaskellWiki, http://tinyurl.com/yduwfl
13:01:39<roconnor>ibid: not doing CSE is like saying that we should work in a strict language and just use lambdas to simulate laziness when you need it.
13:02:10<ddarius>I'd rather the source do what I'm telling it to do.
13:02:16<ibid>roconnor: no, it's not
13:02:31<ibid>roconnor: CSE is a problem precisely because we work with a lazy language
13:02:57<roconnor>roconnor: but CSE is only possible in pure langauges.
13:03:12<roconnor>ugh
13:03:19<roconnor>ibid: but CSE is only possible in pure langauges.
13:03:24<roconnor>ACTION is still talking to himself.
13:03:35<DRMacIver>CSE is possible in almost every language. You just need to guarantee that the particular expression has no side effects when evaluated.
13:03:52<DRMacIver>It's not like C compilers haven't been doing CSE for years. :)
13:04:08<ibid>roconnor: purity and laziness are separate issues
13:04:19<roconnor>DRMacIver: sure, in little tiny cases.
13:04:20<fasta>How am I supposed to see the "core" when it's still running?
13:04:24<DRMacIver>ACTION shrugs
13:04:25<fasta>It keep spitting out code.
13:04:41<ddarius>fasta: Pipe it to a file.
13:05:08<roconnor>Now I have to go give every common expression it's own fucking name.
13:05:11<ibid>roconnor: optimization should be _opti_mization, not pessimization
13:05:12<roconnor>god damn it.
13:05:36<ibid>not every one of them
13:05:42<ibid>the compiler does do some CSE
13:05:43<fasta>ddarius: it's more than a MB of output already
13:05:50<ibid>basically when it can prove it's safe
13:05:59<roconnor>Instead GHC does "opportunistic CSE". If you have
13:05:59<roconnor> let x = e in .... let y = e in ....
13:05:59<roconnor>then it'll discard the duplicate binding. But that's very weak.
13:06:05<fasta>ddarius: 2,6M now
13:06:13<roconnor>ibid: is that the extend of CSE?
13:06:22<ddarius>fasta: What the heck are you doing?
13:06:34<ibid>roconnor: well, i haven't studied the ghc optimizer recently :)
13:06:53<fasta>ddarius: I gave that dump flag to my main project build command.
13:07:02<fasta>ddarius: it are about 70-80 modules.
13:07:21<ddarius>Don't you just want to dump the result of one of them?
13:07:21<fasta>ddarius: nothing terribly odd, right?
13:07:31<roconnor>ibid: the optimizer does all sorts of things that can make execuction worse.
13:07:55<fasta>ddarius: I am not sure which one is the problem.
13:08:05<fasta>ddarius: 8,2M already...
13:08:13<ibid>roconnor: in some special cases, perhaps. generally it tries to avoid that sort of things
13:08:22<roconnor>Is CSE that bad?
13:08:35<roconnor>that it doesn't even qualify?
13:09:06<ddarius>fasta: ? I thought you just wanted to see if the map NewTypeConstructor was taken out. "Dumping the core" just dumps the intermediate language of your code.
13:09:33<ddarius>roconnor: Exponential space consumption isn't that bad?
13:09:49<roconnor>ddarius: but how common is that.
13:10:01<fasta>ddarius: well, I didn't want to see only that.
13:10:03<ibid>roconnor: yes, it can bite hard and often (full CSE, that is)
13:10:04<roconnor>ddarius: I mean the inliner can go into an infinite loop, that's far wrose.
13:10:44<roconnor>*sigh*
13:10:54<ddarius>roconnor: The inliner going into a loop doesn't lead to me having slow programs.
13:11:05<roconnor>ddarius: it leads you to having no programs.
13:11:42<fasta>The compiler could say: warning not applying full cse opportunity here and there (like SBCL does)
13:11:44<DRMacIver>Why is this really a big problem? Do you really get that many hard to compute common subexpressions which you want eliminated?
13:11:50<ddarius>And CSE doesn't often cause exponentially bad space-usage (simply because people don't often make code that generates exponential amounts of stuff) but it does often cause space-leaks.
13:12:32<ddarius>Why not have it say: warning full cse opportunity taken here.
13:12:48<rhz>Haskell Equational Reasoning Assistant. Where is this?
13:13:03<diakopter>I'm having trouble building lambdabot on debian sid (ghc 6.6.1).
13:13:03<ddarius>The compiler shouldn't be warning you about compiling your code as written.
13:13:03<fasta>What does an @ mean in core output?
13:13:08<fasta>The Core format is not documented, is it?
13:13:15<roconnor>DRMacIver: I want to write clear code, and that sometimes means writing common subexpressions. I expected the compiler to remove them for me.
13:13:32<wli>I've got a Frankenstein Debian due to lots of packages from unstable atop normal stable.
13:13:44<roconnor>fasta: I think @ has something to do with type variable parameters.
13:14:49<diakopter>re: lambdabot - Setup.hs can't find haskell-src-any
13:16:34<diakopter>anyone have any tips?
13:16:49<fasta>roconnor: dictionary passing?
13:17:09<roconnor>fasta: could be.
13:17:51<fasta>diakopter: lambdabot is not designed s.t. other people can compile it.
13:18:02<fasta>diakopter: it's natural that it's hard to install
13:18:41<diakopter>fasta: ok... I want to set up an instance to run on the magnet network
13:19:25<diakopter>fasta: I wasn't complaining, btw... no need to justify why it doesn't work with every single system/setup :P
13:19:33<cognominal__>are Simon Peyton jones and Mark P. Jones from the same family? just curious...
13:19:41<wli>No.
13:20:30<fasta>Was the single origin theory solved while I was away? ;)
13:20:30<cognominal__>the first is English and the second American apparently
13:21:55<mudge>anyone here?
13:22:24<mudge>its empty at 6:20 in the morning
13:22:24<rhz>no
13:22:30<mudge>ok
13:22:36<mudge>i wonder where haskellers are from
13:22:42<evir>It's not 6:20 everywhere. :-)
13:22:45<wli>I'm here.
13:22:46<opqdonut>it's 16:20 here
13:22:49<earthy>15:22
13:22:50<roconnor>@losers
13:22:50<lambdabot>Maximum users seen in #haskell: 395, currently: 385 (97.5%), active: 23 (6.0%)
13:22:53<evir>15:22.
13:22:57<opqdonut>channel was quite active until just a minut ago
13:22:57<wli>It's 6:20 in PDX.
13:23:04<earthy>that's weird
13:23:08<earthy>must be 2 minutes off. :P
13:23:09<mudge>oh
13:23:30<diakopter>fasta: and I can't install http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-1.0 because I don't have/want an X server running...
13:23:33<lambdabot>http://tinyurl.com/3yxn4n
13:23:56<fasta>diakopter: why does it require X?
13:24:00<diakopter>fasta: I don't know...
13:24:10<fasta>diakopter: are there no dummy x servers?
13:24:11<diakopter>I was hoping someone here could tell me
13:24:25<fasta>diakopter: like /dev/null for sound drivers
13:24:43<mudge>i was wondering, how long do you have to study and write haskell until you're no longer a newbie?
13:25:01<Syzygy->mudge: Some say that you end being a newbie with the first own monad tutorial you write. ;)
13:25:29<mrd>ACTION is still a newbie
13:25:41<roconnor>I'd guess about 3 years
13:25:43<mudge>Syzygy: ah, well I'm on my way then, as I've already wrote a Currying tutorial: http://www.nickmudge.info/?post=42
13:25:52<lambdabot>Title: Explanation of Haskell Currying
13:26:07<mudge>but haven't even really begun to start studying monads
13:26:24<Syzygy->mudge: Currying - the programmatic version of the isomorphism Hom(AxB,C) -~-> Hom(A,Hom(B,C))
13:26:24<desegnis>mudge, depends on for whom you do not want to be a newbie. A PhD with a Haskell-related thesis topic will probably do in most cases, though
13:26:25<Syzygy->:)
13:26:25<mudge>ah 3 years
13:26:29<fasta>Getting the first element of a tail recursive list generating function is bound to be slow, right? :)
13:26:37<Syzygy->desegnis: I'm wondering whether my thesis topic qualifies for that.
13:27:02<hpaste> diakopter pasted "(no title)" at http://hpaste.org/2350
13:27:06<desegnis>Syzygy, the topic being?
13:27:36<mudge>I don't go to college so a PhD in Haskell related thesis topic won't happen I don't think, unless you don't have to go to college to get PhD
13:27:58<mrd>honorary doctorate?
13:27:59<Syzygy->desegnis: Computation of A-infinity structures in group cohomology. One of my thesis chapters will discuss a Haskell implementation of one of the most relevant algorithms for my work.
13:28:10<mudge>yea, is it possible to get honorary doctorates?
13:28:12<fasta>mudge: phdonly50dollar.com
13:28:22<Syzygy->mrd: You don't tend to write a thesis for a honorary doctorate.
13:28:39<roconnor>mudge: I suppose one can ask you to write factorial in haskell to judge your progress. :)
13:28:46<opqdonut>:)
13:28:48<mrd>you tend to have already demonstrated qualifications ;)
13:29:43<Syzygy->> let fac n = prod [1..n] in fac 5
13:29:43<lambdabot> Not in scope: `prod'
13:29:44<Syzygy->Hmmm.
13:29:44<Syzygy->> let fac n = product [1..n] in fac 5
13:29:44<lambdabot> 120
13:29:48<Syzygy->Hah.
13:29:53<roconnor>Syzygy-: nice work.
13:30:01<Syzygy->:)
13:30:06<doserj>diakopter, try "runghc Setup.hs configure"
13:30:12<wli>I have no qualification for anything. I just sort of barely learned how to deal with monads after 10 years, which probably puts me in the "don't touch" category, since 10 years to figure out monads probably means there's something wrong with me.
13:30:17<mudge>fasta: the phdonly50dollar.com URL didn't work
13:30:25<roconnor>Syzygy-: you have level ``Tenured professor''
13:30:32<Syzygy->roconnor: Great. Does it come with tenure?
13:30:42<doserj>diakopter, you are calling Setup.hs as a shell script, an "import" happens to be a command that queries the X Server
13:30:57<roconnor>Syzygy-: nope
13:31:05<Syzygy->Awwwwww
13:31:13<wli>(OTOH I've by no means been trying on any sort of regular or consistent basis over that time period.)
13:31:25<desegnis>Syzygy, that topic sounds good enough. Just add a footnote saying that the complete Haskell implementation, covering everything what you discuss, is just too trivial. (Sorry, I'm not enough into CS/maths to really talk about this :-/)
13:31:33<Syzygy->desegnis: Pbtbtbtbtbt. :)
13:31:49<Syzygy->desegnis: I'm currently trying to get my implementation published in a mathematics journal.
13:31:51<Syzygy->:)
13:31:53<mudge>oh so it is possible to get an honorary doctorate, do you think it is hard?
13:32:11<Syzygy->mudge: Being famous and doing good work for a discipline tends to be a couple of the prerequisites.
13:32:13<opqdonut>well you have to be linus torvalds or somesuch person, mostly
13:32:47<Syzygy->opqdonut: The two major universities in Stockholm awarded, within a few years from another, honorary doctorates to Linus Torvalds and Bill Gates while I was still studying here...
13:32:59<opqdonut>yeh :)
13:33:05<Syzygy->I think the Linus doctorate was more or less a reaciton to the Gates one. IIRC
13:33:22<fasta>I heard Bill G. also got one from the maffia.
13:33:51<mudge>neat
13:34:00<diakopter>doserj: thanks :) that helped a lot; it got further.
13:34:08<mudge>well maybe if you ask for one its easier than universities just giving you one
13:34:55<Syzygy->mudge: I should think most universities would be offended if you waltz in and ask for a honorary degree.
13:35:15<doserj>not if you offer to finance a new department :)
13:35:31<opqdonut>i think honorary degrees are nothing to count on :)
13:35:56<mudge>maybe we should get honorary Phds when we understand monads, after all it can take up to 10 years
13:36:20<opqdonut>there is nothing to understand in monads :)
13:36:24<opqdonut>don't stress it
13:37:14<roconnor>opqdonut: there is Kleisli arrows to understand.
13:37:19<Syzygy->opqdonut: They're only monoidal objects in the comma category anyway. Or was it the functor category?
13:37:48<opqdonut>nah, i didn't mean in the ct sense but in the "programmer's abstraction" sense :)
13:38:07<opqdonut>but yeah, if you do ct they're trivial too
13:38:07<Syzygy->mudge: I'm getting the feeling that your idea of a PhD differs significantly from that of most in the academia.
13:38:21<Cale>Syzygy-: They're monoid objects in the category of endofunctors over the category of Haskell types
13:38:21<roconnor>Do monad tutorials talk about the importance of functions of the type a -> m b ?
13:38:32<Syzygy->opqdonut: Note that I did CT before I did HAskell, and was drawn here by the density of CT in the community.
13:38:41<Syzygy->Cale: Yeah, that's it. Thanks!
13:38:42<mudge>whoa, Benjamin Franklin got an honorary phd
13:38:50<opqdonut>Syzygy-: ok
13:39:17<opqdonut>i think having so many CT guys around is one of the reasons people think haskell is hard to learn :)
13:39:30<opqdonut>but in the end, "you could've invented monads"
13:40:04<roconnor>CT clarifies so many things though.
13:40:04<opqdonut>coming either from a CT or a programminf point of view
13:40:05<mudge>opqdonut: what is CT?
13:40:10<opqdonut>Category Theory
13:40:22<mudge>is that a programming language?
13:40:27<opqdonut>a branch of mathematics
13:40:28<Syzygy->No.
13:40:39<fasta>Is there a lazy foldM?
13:40:40<opqdonut>monads and functors and so on come from there
13:40:42<wli>I'm totally ignorant of category theory and it's resisted various meager efforts of mine to understand it for over half my lifetime (15+ years).
13:40:42<mudge>i'm jokin ;)
13:40:52<mudge>i'm surprized no one laughed at that
13:40:53<Syzygy->mudge: It's hard to tell.
13:41:04<mudge>lol
13:41:04<wli>Pass the dunce cap my way.
13:41:16<Syzygy->mudge: The difference between "ignorant" and "joking" can be very thin at times.
13:41:26<opqdonut>true, true
13:41:31<mudge>well you guys are awfully nice
13:41:38<roconnor>ACTION often thinks of CT as Church's Thesis.
13:41:54<opqdonut>roconnor: i think of it as counter-terrorists mostly
13:42:03<opqdonut>tho not when i see it on #haskell :)
13:42:06<roconnor>opqdonut: we lead different lives
13:42:06<Syzygy->ACTION leaves the keyboard for now.
13:42:11<roconnor>:)
13:42:21<opqdonut>:)
13:42:50<cognominal__>the problem is not so much category than the example given in category book are from areas unkown from us. Now that I learn haskell, category theory starts to make sense
13:43:04<cognominal__>s/example/examples/
13:43:06<DRMacIver>roconnor: Category theory doesn't so much clarify as obfuscate in pretty ways. ;)
13:46:05<matthew-_>mmmm. London Hug soon. Geeks + Beer = happiness
13:46:35<roconnor>I should go to the hackathon this year
13:46:35<roconnor>@seen dons
13:46:35<lambdabot>dons is in #xmonad, #haskell-soc and #haskell. I last heard dons speak 49m 16s ago.
13:46:48<roconnor>@time dons
13:46:49<lambdabot>Local time for dons is Mon Aug 20 23:46:47 2007
13:47:23<mudge>you know what sucks about an honorary PHd is that I think by the time that you get it, you don't need it
13:49:14<opqdonut>ya think?
13:49:45<njbartlett>DRMacIver: Got a good question for you from a commenter on the London HUG blog
13:49:57<njbartlett>How on earth do you recognize a collection of Haskellers in a pub?
13:50:25<wli>njbartlett: I stand out like a sore thumb in most pubs.
13:51:05<DRMacIver>Ha.
13:51:10<DRMacIver>That's a good question. :)
13:51:21<DRMacIver>(Thanks. I should have been checking that comment thread)
13:51:29<wli>Though it's doubtful anyone would suspect me of being a Haskeller.
13:51:41<DRMacIver>njbartlett: Hm. I see no comments...
13:52:02<DRMacIver>Anyway, I'll bring a sign saying London HUG. :)
13:52:11<wli>Is there a PDX HUG yet?
13:52:33<wli>Or is PDX considered to be one huge HUG as it stands? ;)
13:52:35<DRMacIver>(Which is humourously open to misinterpretation for those who don't know what it means, but never mind...)
13:52:41<DRMacIver>PDX?
13:52:50<pejo>wli, Portland State University?
13:53:11<wli>PDX is an abbreviation for "Portland Oregon"
13:53:36<evir>Wow, neither a D nor an X are in that name.
13:53:42<wli>The abbreviation is borrowed from the airport code.
13:54:44<DRMacIver>Ah
13:54:44<wli>And yes, PDX has PSU, OGI, and Galois.
13:55:12<SamB_XP>I thought PSU was Penn State University
13:55:30<wli>It is also that. They're conflicting abbreviations/acronyms.
13:55:32<DRMacIver>ACTION thought it was Power Supply Unit. :)
13:56:02<SamB_XP>DRMacIver: that's not an organization, so it doesn't conflict much
14:04:07<njbartlett>DRMacIver:
14:04:08<DRMacIver>njbartlett:
14:04:10<njbartlett>Grr, sorry :-)
14:04:45<njbartlett>It was a first-time commenter, so I needed to approve it. Getting so much comment spam at the moment!
14:04:52<DRMacIver>Ah, right.
14:05:12<njbartlett>It's a shame I don't have time to send you one of my London HUG shirts. Although, I only have XL...
14:05:40<fasta>$f2 in module Foo is taking 66% of all the time. Is there any way to find where that is exactly?
14:06:14<DRMacIver>njbartlett: Oh well. :)
14:06:14<opqdonut>add cost centers?
14:11:42<Cale>I wonder if you could make a tower defense game based on the lambda calculus... hmm :)
14:12:13<fasta>How can I inline a method with {-# INLINE liftST #-}?
14:12:21<fasta>It seems it cannot be placed in a class implementation
14:12:49<wli>gah, gnuplot is so weak; there's no implicit plotting command
14:13:11<fasta>opqdonut: that's a rather inefficient algorithm
14:13:22<desegnis>Question time. Is there a very good reason newtypes exist in Haskell? Books say that the compiler can then optimize the constructor away, but what would prevent it from optimizing if I used “data” instead of “newtype”?
14:13:55<DRMacIver>desegnis: I think newtype deriving seems to be the big thing.
14:14:29<DRMacIver>(Basically you can lift type class implementations from the old type to the new one)
14:14:43<fasta>DRMacIver: heh, talking about not answering the question... :)
14:15:04<doserj>desegnis: "data" constructors are lazy, newtype constructors are strict, so the compile cannot always optimize the data constructors away
14:15:16<DRMacIver>fasta: Well, it's a good reason for newtype to exist in that it's something you can't do with 'data'.
14:15:20<fasta>desegnis: newtype and data are about the same modulo that the newtype has an implicit !.
14:15:36<fasta>DRMacIver: no, because that wasn't in H98.
14:15:39<DRMacIver>Oh, wasn't it?
14:15:47<desegnis>ah, fasta, doserj, that makes sense to me
14:15:48<DRMacIver>My mistake then. :)
14:16:02<desegnis>DRMacIver, I was just wondering... but np ;)
14:16:28<DRMacIver>Anyway, it's still a good reason for newtype to exist in Haskell, just not in Haskell98. ;)
14:16:53<wli>ACTION adds an NIH of gnuplot to the long TODO.
14:17:01<doserj>newtypes are a very nice sweet spot between type and data declarations
14:17:13<doserj>having the best of both worlds
14:17:20<fasta>So... nobody knows about the inline question?
14:17:28<fasta>Or cares (more likely)
14:17:44<desegnis>well, now I'm wondering why we have newtypes if we have data ... ! ... anyway. The ! are Haskell98 too, aren't they?
14:18:21<fasta>desegnis: in data type definitions, yes.
14:18:31<ivant>wli, no wonder gnuplot doesn't support implicit plotting. It is very nontrivial to implement it correctly. Cylindrical decomposition and such stuff
14:18:37<fasta>desegnis: yes, you could argue about that with somebody else. ;)
14:19:06<roconnor>fasta: How can you inline a class method?
14:19:06<desegnis>fasta, :)
14:19:19<roconnor>fasta: shouldn't you write a speciallized version and inline that?
14:19:19<fasta>roconnor: very funny
14:19:26<wli>ivant: I'm not sure what you mean about cylindrical decomposition. I mostly thought of e.g. BFGS to find starting points and so on.
14:19:29<roconnor>ACTION is confused.
14:19:30<fasta>roconnor: oh, it wasn't a joke.
14:19:35<fasta>roconnor: sorry ;)
14:19:38<roconnor>:)
14:19:46<roconnor>fasta: maybe I didn't read back far enough
14:19:53<fasta>roconnor: yes, that's the only logical alternative without anyone answering.
14:19:59<fasta>roconnor: I'd thought about that already.
14:20:03<wli>ivant: And from a starting point just follow the tangent.
14:20:27<roconnor>fasta: okay, it's also the best idea I have.
14:20:39<ivant>wli, suppose you want to draw a curve which corresponds to x^2+y^2=1. How would you do it?
14:21:35<desegnis>fasta, well, you cannot inline a class method if you use it on a polymorphic value, because then you wouldn't know what method to choose. or didn't I read far enough back either?
14:21:41<fasta>ivant: solve the equation first if it's decidable
14:21:43<ivant>wli, the correct answer is, you use the cylindrical algebraic decomposition algorithm to get two solutions which are easy to plot
14:21:46<wli>ivant: Find a solution via BFGS, follow the tangent in both directions until it either falls off plotting boundaries or the two traversals meet.
14:22:07<ivant>fasta, haha, this is an NP problem :-)
14:22:24<fasta>ivant: NP? Where do you read that?
14:22:42<wli>ivant: Or if not using a minimization algorithm on the square of the residual, then a direct root-finding method.
14:23:00<ivant>fasta, reading right now about it: it is equivalent to Positivstellensatz
14:24:19<ivant>wli, using your method you'd get only one half of the circle (or do I miss some point?)
14:24:19<wli>ivant: I've never even heard of the cylindrical algebraic decomposition algorithm.
14:24:23<xerox>wli: there's this thing which draws charts, I'm not sure how advanced it is, but it spits out pretty graphics: <http://www.dockerz.net/software/chart.html>
14:24:27<fasta>ivant: Ok, in that case, I would still try to solve it when it takes less than 10 seconds.
14:24:29<ivant>wli, http://mathworld.wolfram.com/CylindricalAlgebraicDecomposition.html
14:24:30<lambdabot>Title: Cylindrical Algebraic Decomposition -- from Wolfram MathWorld, http://tinyurl.com/338vjm
14:24:31<wli>ivant: Following the tangent should lead all the way around the circle; following it in both directions gets the two cursors to meet.
14:24:32<fasta>ivant: after 10 seconds, tell the user: "do you want to continue this lengthy computation?"
14:24:47<ivant>wli, oh, I see what you mean
14:25:27<ivant>wli, so you're computing gradient and try to chose it so that you're always at the solution
14:25:33<wli>ivant: Yes.
14:26:21<ivant>fasta, and do so every 10 seconds :-)
14:26:22<wli>ivant: This is just for plane curves anyway, so I'm not concerned with anything like full generality in n dimensions.
14:26:31<roconnor>xerox: I've hacked on the charting library, it's fun!
14:26:45<ivant>wli, what should you do when you have more than one branch? :-)
14:26:52<xerox>roconnor: cool, what have you hacked on it?
14:26:52<roconnor>xerox: I always wanted to replace gnuplot with a haskell library.
14:27:17<roconnor>xerox: I wrote a routine to automatically generate log axis from a data set.
14:27:32<wli>xerox: That looks useful.
14:27:36<ivant>wli, e.g. ((x-1)^2+y^2-1)((x+1)^2+y^2-1)=0
14:27:46<roconnor>xerox: My function is actually kinda crappy, but it is the best automatic log axis generation that I've seen :)
14:27:46<fasta>ivant: nah, there's C-c for that.
14:28:41<xerox>roconnor: I see :) This is one of the main users of the cairo library bindings so far. Graphics look indeed quite nice.
14:29:00<ivant>fasta, hmm, I have a plan, we can pretend doing some ‘serious computations’ until the user gives up :-)
14:29:09<roconnor>xerox: I need to make an SVG backend.
14:29:29<fasta>ivant: that works until the user finds a different implementation.
14:29:29<wli>ivant: I don't know how to deal with that offhand.
14:29:39<ivant>roconnor, and a TeX (eps) backend
14:29:43<ivant>roconnor, :-)
14:29:48<xerox>roconnor: there is one, I think!
14:30:11<roconnor>then I could have pretty charts for my blog
14:30:44<ivant>wli, I only wanted to say that probably gnuplot isn't the right tool for such things. Mathematica can do implicit plots
14:31:12<ivant>wli, probably Maple can also
14:31:18<roconnor>the charting library doesn't chart mathematical functions, .. but it could
14:31:19<xerox>roconnor: the svg stuff was in fluctuating stages when I implemented that. There were two or three options, none of them officially supported, but maybe the situation has changed now. I believe dcoutts__ has written some binding code for one of them at the time.
14:31:30<wli>ivant: Well, I'm not really willing to deal with Mathematica. Some chunk of Haskell code to do it might be nice, too.
14:31:48<roconnor>xerox: well... we don't need GTK to do an SVG backend.
14:32:11<roconnor>roconnor: wait, is Cairo part of GTK?
14:32:16<roconnor>ACTION gets so confused.
14:32:20<xerox>roconnor: right. No it isn't.
14:32:53<ivant>wli, I thought of implementing cylindrical decomposition algorithm in Haskell some time ago, but fortunately I don't need it. It is quite involved and I don't really understand most of it yet
14:33:13<roconnor>xerox: anyhow, it needs to be done sometime; hopefully if I just wait long enough it will appear. ... That happens surprisingly often.
14:33:14<wli>ivant: I'm not sure how cylindrical decomposition applies to all this.
14:34:12<wli>ivant: e.g. how it deals with your disjoint circles.
14:34:13<xerox>roconnor: maybe you are a sleepwalking coder ;-)
14:34:23<roconnor>And with augustss' math expression printer, one could make nicely labeled mathematical plots.
14:34:46<roconnor>xerox: maybe, but usually other people are to blame.
14:35:31<ivant>wli, to put it simply, it decomposes an inequality (e.g. x^2+y^2<1) into separate "cylinders" of the form a<x<b, f(x)<y<f(g),... (e.g. -1<=x<=1, -sqrt(1-x^2)<y<sqrt(1-x^2) )
14:36:38<ivant>wli, more precisely, it decomposes to the conjunction/disjunction of such cylinders
14:36:45<wli>ivant: Yeah, I just don't see how it solves your disjoint circle problem.
14:37:54<ivant>wli, oh, when we're talking about equations like x^2+y^2=1 it decomposes into (-1<=x<=1 && y=-sqrt(1-x^2)) || (-1<=x<=1 && y=sqrt(1-x^2))
14:38:25<wli>ivant: The most I can see happening here is factoring the multivariate polynomial somehow.
14:38:48<ivant>wli, so you have 2 branches here. we'd get 4 branches for the previously mentioned equation
14:39:05<ivant>wli, yes, that's the basic idea, however it also includes separation into branches
14:40:09<wli>Okay, so it differs from Wolfram's description in being boundary-based.
14:41:24<ivant>wli, what do you mean by ‘boundary-based’?
14:41:32<glen_quagmire>http://en.wikibooks.org/wiki/Haskell/YAHT/Type_basics/Solutions#Multiple_Constructors I don't get this Either stuff
14:41:34<wli>So given f(x_1,...,x_n) = 0, solve for x_n, disjoin for each root of f(x_1,...,x_n) as a polynomial in x_n over R[x_1,...,x_{n-1}]
14:41:37<lambdabot>http://tinyurl.com/25x7pf
14:41:55<sjanssen>@yow!
14:41:55<lambdabot>I guess it was all a DREAM ... or an episode of HAWAII FIVE-O ...
14:42:01<glen_quagmire>fromTuple (Two a b) should return (a,b)
14:42:08<glen_quagmire>but, instead it returns Left (Right (a,b))
14:42:35<axm>has someone here experience with automatic decisions about program equivalence (maybe using something like Term Rewrite Systems)?
14:42:39<wli>ivant: Wolfram's description would yield -1 <= x <= 1, -(1-x^2)^(1/2) <= y <= (1-x^2)^(1/2) vs. what you described.
14:43:03<sjanssen>glen_quagmire: it *can't* return (a, b), because (a, b) and (a, b, c) are different types
14:43:28<sjanssen>glen_quagmire: 'Either a b' is one way to express sum types
14:43:38<ivant>wli, sort of (this is elimination==projection), however CAD can decompose (f(x)>0 && g(x)>0 && ...)
14:43:42<sjanssen>it means we _either_ have a value of type 'a', or a value of type 'b'
14:43:55<glen_quagmire>sjanssen: then what is Left 1?
14:44:05<xerox>sjanssen: do you remember a nice way to write splitBy?
14:44:09<SamB_XP>axm: I'm under the impression that it's very hard
14:44:09<glen_quagmire>:t Left 1
14:44:17<lambdabot>forall t b. (Num t) => Either t b
14:44:26<sjanssen>that has type 'Either Integer a'
14:44:26<ivant>wli, you're probably talking about x^2+y^2<=1?
14:44:39<sjanssen>(or Num t => ..., I'm trying to simplify a bit ;)
14:44:43<xerox>I think it was an unfoldr, or something.
14:44:48<wli>ivant: I have no idea how one does this when they're transcendental equations or not solvable in closed form.
14:45:03<axm>same here, at the moment it is more the termination question that is considered
14:45:31<SamB_XP>axm: hmm, you have to solve the halting problem, no? so it's tricky.
14:45:39<sjanssen>@src Either
14:45:39<lambdabot>Source not found. I've seen penguins that can type better than that.
14:45:54<glen_quagmire>fromTuple (Two 1 2) returns Left (Right (1,2)) ..So, do I need type of fromTuple to see what is Left (Right ..) ?
14:46:00<axm>in my case i could live with a timeout
14:46:07<wli>ivant: That is even if one only considers plane curves.
14:46:11<ivant>wli, there is a thing which I learned today: it is called algebraic numbers (actually I probably had learnt it at some point of algebra course)
14:46:11<sjanssen>data Either a b = Left a | Right b -- | means or/choice/sum type
14:46:37<SamB_XP>ivant: what are those?
14:46:39<sjanssen>glen_quagmire: yes, the type of fromTuple says what the type of (Left (Right ...)) should have
14:46:44<wli>ivant: I remember a little Galois theory from my freshman year. What about them?
14:46:46<ivant>wli, algebraic numbers are those which can be represented as a solution of a polynomial (univariate)
14:46:49<glen_quagmire>fromTuple :: Tuple a b c d -> Either (Either a (a,b)) (Either (a,b,c) (a,b,c,d)) -- according to this function type, I know Left (Right (a,b)) is of type (a,b)
14:46:54<axm>I got the impression the TRS people do that as well as last resort
14:46:59<ptolomy>good lordie.. I go on vacation for a week, and when I come back I have 48 messages waiting for me in my Cafe folder. I'm not getting any work done today.
14:47:04<SamB_XP>ivant: ah.
14:47:11<glen_quagmire>sjanssen: ah thank you. so there is no way to return just (a,b)
14:47:12<ivant>wli, and the good thing is that they form a field
14:47:17<sjanssen>glen_quagmire: no, (Left (Right (a, b)) :: Either (Either (a, b) ???) ???
14:47:22<SamB_XP>ptolomy: you don't have to read your whole cafe folder at a time
14:47:45<wli>ivant: Sure, Q[x]/(p(x)) where p(x) is the minimal polynomial.
14:47:46<sjanssen>glen_quagmire: the type says that the thing that fits in (Left (Right ???))
14:47:47<ivant>wli, and there is some theory behind saying how to add and multiply them
14:47:47<sjanssen>is of type (a, b)
14:48:09<ptolomy>SamB_XP: I don't have to finish a whole box of oreos in one sitting either, but I will pretty much every time.
14:48:10<wli>ivant: The number field is isomorphic to Q[x]/(p(x)), yes.
14:48:33<SamB>ptolomy: you need less money
14:48:37<glen_quagmire>:t Left (Right (1,2))
14:48:39<lambdabot>forall t t1 a b. (Num t, Num t1) => Either (Either a (t, t1)) b
14:49:12<glen_quagmire>oh haskell is challenging
14:50:21<earthy>programming is
14:50:22<wli>ivant: Where's this come into the picture? Algebraic extensions of Q[y]?
14:50:23<ptolomy>SamB: If I keep spending my time at working reading unrelated mailing lists all day, it won't be a problem. :)
14:50:42<earthy>haskell just doesn't put drudgery in the way of the challenge
14:51:05<earthy>(well, not much drudgery at least)
14:51:20<sjanssen>glen_quagmire: btw, we wouldn't usually write a function like 'fromTuple' in Haskell
14:51:43<wli>ivant: Or, rather, when eliminating y, the implicit solutions are represented as elements of Q[x]/(p(y)) where p(y) has coefficients in Q[x]?
14:51:46<sjanssen>encoding the sum of more than one data type is really annoying with Either
14:51:58<wli>GRR
14:52:17<wli>ivant: Q[x][y]/(p(y)) where p(y) has coefficients in Q[x]
14:53:40<wli>ivant: One more time: Q(x)[y]/(p(y)) where p(y) has coefficients in Q(x), Q(x) being the rational function field with indeterminate x vs. Q[x] being the ring of polynomials in x with coefficients in Q.
14:54:23<ivant>oops, sorry, I was distracted by the phone call
14:56:27<wli>ivant: Am I anywhere near close?
14:56:53<ivant>wli, I don't know the details exactly (and I also remember too little from the Galois theory), but I expect this to be right “when eliminating y, the implicit solutions are represented as elements of Q[x]/(p(y)) where p(y) has coefficients in Q[x]”
14:57:32<wli>ivant: I think Q(x)[y]/(p(y)) where p(y) has coefficients in Q(x), Q(x) being the rational function field with indeterminate x vs. Q[x] being the ring of polynomials in x with coefficients in Q.
14:57:56<ivant>wli, I learnt about algebraic numbers today which explained some of the things I didn't know about the possible implementation before, but I'm nowhere near the real knowledge of how the algorithm works
15:00:04<glen_quagmire>sjanssen: yup. i sensed this was for exercise. if haskell was like this, it wouldn't be so enterprise ready
15:00:26<wli>I'm mostly trying to find ways to enumerate solutions to 4*x^2+y^2=n, 3*x^2+y^2=n, and 3*x^2-y^2=n for all possible n in order so I can count the number of solutions for each polynomial for each n of some form.
15:00:27<sjanssen>bleh, "enterprise ready"
15:00:47<wli>Methods involving isqrt seem to be unacceptably slow.
15:00:53<DRMacIver>sjanssen: Haskell is web 2.0 enabled. ;)
15:01:12<ivant>wli, where n∈Z?
15:01:25<ivant>wli, oh, I mean n∈N
15:02:10<wli>ivant: n in N, with various lower bounds assumeable even (basically one can just tabulate the first few primes to accommodate any small lower bound).
15:02:59<wli>4*x^2+y^2 is for n = 1 mod 4, 3*x^2+y^2 is for n = 1 mod 6, and 3*x^2-y^2 is for n = 11 mod 12.
15:03:34<ivant>wli, let me digest this
15:03:53<wli>ivant: Only natural number solutions are of interest, where for 3*x^2-y^2 it's furthermore required that x > y
15:04:07<ndm>ACTION just managed to beat GHC on nqueens :-)
15:04:07<lambdabot>ndm: You have 1 new message. '/msg lambdabot @messages' to read it.
15:04:09<wli>ivant: In fact positive natural number solutions, x, y >= 1.
15:04:55<ndm>@tell ddarius yes, but if you have a good "nice intro" paper or technical summary paper i'd appreciate it, most of them were written in not very accessible manners
15:04:55<lambdabot>Consider it noted.
15:05:08<ndm>(or maybe i've been spoiled by SPJ papers...)
15:07:04<ivant>wli, not sure if it helps you, but here is a very good workshop materials which are talking about the existence of solutions (and dual problems): http://www.control.lth.se/seminars/SanjayLall-2004-12/
15:07:04<lambdabot>Title: Semi-definite Programming Relaxations and Algebraic Optimization with Engineerin ...
15:07:26<ivant>wli, probably you can restate your problem in the suitable form
15:07:33<wli>ivant: They're not optimizations of course...
15:07:36<ricky_clarkson>ndm: Just glancing at your homepage - what do you think of restarts (a la lisp) instead of crashes?
15:08:17<ivant>wli, they are equivalent/dual to the optimization problems :-)
15:08:22<ivant>wli, basically, this is what the workshop is about
15:08:23<wli>ivant: The problem here is largely related to enumeration.
15:08:46<jedai>@source Control.Monad
15:08:46<lambdabot>http://darcs.haskell.org/packages/base/Control/Monad.hs
15:08:49<ivant>wli, SAT problem is about enumeration too :-)
15:08:50<wli>ivant: It's no problem at all to find solutions. It's to enumerate them in such a way that I can count the solutions for a given n.
15:09:25<wli>ivant: Basically a number is prime depending on whether the number of solutions is even or odd.
15:09:30<wli>ivant: (and it being squarefree)
15:10:06<ndm>ricky_clarkson: hmm, no particular opinion - never used restarts, and obviously crashes are something you don't want to happen
15:10:35<wli>ivant: Using this to sieve for primes is called the Sieve of Atkin. It's an array-based algorithm to sieve over finite intervals as presented in its paper.
15:12:04<wli>ivant: It's faster than Eratosthenes et al in the array-based context. However, its not so straightforward to translate it to generating infinite lists of primes as is possible for Eratosthenes et al.
15:12:17<ricky_clarkson>ndm: If crash means segfault or equivalent, then yes. If a crash means getting bottom, then there seem to be cases where avoiding the crash is worse than having the crash.
15:12:25<ivant>wli, I feel that I don't really follow you, too many maths for me today (I've digested a large chunk of that workshop today)
15:13:26<wli>ivant: In order to generate infinite lists of primes, you have to be able to get some kind of ordering constraint on the n so that f(x,y)=n where f is one of 4*x^2+y^2, 3*x^2+y^2, or 3*x^2-y^2
15:14:18<ivant>wli, what is the connection of primes and these functions?
15:14:22<wli>ivant: Getting this set up to find solutions for a particular n at each iteration is not hard but it is slow.
15:14:25<ricky_clarkson>ndm: I work in the CS dept at Salford, and I don't know anyone here who has done even a quarter of the amount of useful work that you have.
15:14:30<ndm>i am now also faster than GHC on the primes benchmark in nofib!
15:14:43<wli>ivant: A squarefree number is prime if the number of solutions to f(x,y) = n is odd.
15:14:48<mrd>ndm: are you calculating by hand? =)
15:15:19<ndm>ricky_clarkson: avoiding bottom usually isn't that hard, esp if you have a tool like Catch and are willing to do some work, some people (Turner) even think that avoiding partial patterns entirely isn't that hard
15:15:25<ndm>ricky_clarkson: thanks :) - although stanford checker is dead cool
15:15:29<shapr>Good morning #haskell!
15:15:30<ivant>ndm, are you good at executing DNA sequences? I mean, comparing to the ghc :-)
15:15:39<ivant>Good morning, shapr
15:15:54<ndm>(but dead secret, sadly)
15:15:59<ndm>ivant: i should be faster, but nofib first :)
15:16:01<wli>ivant: The way the array-based algorithm works is just traversing a region and flipping bits in a table corresponding to the value of f(x,y) for each n in the region. If n is out of bounds it's ignored.
15:16:07<ndm>mrd: yes, breaking a sweat, but just outpacing GHC :)
15:16:35<wli>ivant: Generating an infinite lazy list of primes makes the region infinite.
15:17:02<wli>ivant: There needs to be some way to tell when we're done looking at candidates for a given n.
15:17:02<ivant>wli, aha, I'm starting to understand it
15:17:15<mrd>humans emit much nicer error messages than ghc, at least
15:17:37<ndm>not true in my case, error "crap" is the only one that hardcoded
15:17:38<wli>ivant: Otherwise we can't decide whether n is a member of the infinite list of primes or not and the iteration it's translated to never terminates.
15:17:46<ndm>(and i'm not kidding, my version really does replace all error messages with error "crap")
15:20:06<wli>So anyway I now have something like bounds on x and y in terms of n, which I'm not entirely sure how to translate to anything that would help with this.
15:21:48<wli>The basic thought is that we're going over pieces of the first quadrant and given that we've iterated over so much of the first quadrant, we want to know lower bound on the n's whose primality is not fully determined.
15:26:16<ivant>wli, I'm still not sure what your algorithm is, but here is what I understood:
15:26:35<Botje>"The" ? :)
15:27:29<ivant>wli, for each n in [1..], you want to count the number of integer solutions to {f(x,y)=n}
15:27:42<wli>[2..] but yes
15:28:03<wli>ivant: http://www.ams.org/mcom/2004-73-246/S0025-5718-03-01501-1/S0025-5718-03-01501-1.pdf
15:28:04<lambdabot>http://tinyurl.com/2sno9x
15:28:06<wli>ivant: That's the algorithm.
15:28:20<ivant>wli, I don't have an access to ams
15:28:39<wli>ivant: You don't need it. I have no such access and can view it.
15:29:10<ivant>wli, it says “Subscription is required for AMS and AMS-distributed electronic journal access”
15:29:24<wli>ivant: It's available from citeseer also.
15:29:27<Botje>ivant: tried bugmenot ?
15:30:11<wli>ivant: http://citeseer.ist.psu.edu/452169.html
15:30:11<lambdabot>Title: Prime Sieves Using Binary Quadratic Forms - Atkin, Bernstein (ResearchIndex)
15:30:37<Tac-Work>Does anyone know if it's possible to use #!/usr/bin/env runhaskell at the top of a haskell program?
15:30:56<Tac-Work>I want to run haskell as a shell script-like program, but it gives a syntax error
15:31:11<ivant>wli, so you do something like length [undefined| x<-[0..xmax], y<-[0..ymax], f x y = 0 ]
15:31:30<mrd>Tac-Work: it's easiest in a .lhs file
15:31:43<wli>ivant: Vaguely yes.
15:32:04<Tac-Work>what's a .lhs file?
15:32:11<wli>Literate Haskell
15:32:11<ivant>wli, and the problem you have is that you can't find xmax and ymax?
15:32:28<ivant>wli, or I'm missing some other part?
15:32:37<mrd>Literate Haskell -- either "Bird"-style where "> " prefixes every line of code, or "LaTeX"-style where code is surrounded by \begin{code} ... \end{code}
15:33:11<Tac-Work>that sounds like a big workaround
15:33:16<wli>ivant: No. It's that doing it that way is dogslow. It has to be an iteration over portions of the first quadrant without explicitly searching for solutions for a particular n otherwise it's too slow.
15:33:17<Tac-Work>it seems like runhaskell should have a flag built into it for ignoring the first line or something
15:33:41<mrd>on the contrary, Literate programming is a good thing to get accustomed to
15:33:49<ndm>grr, literate programming is horrid
15:34:00<ndm>ACTION has an item on his todo list, to remove .lhs source from yhc
15:34:11<ivant>wli, dogslow, yes :-) what is first quadrant?
15:35:22<wli>ivant: x, y > 0
15:35:28<wli>ivant: Except for 3*x^2-y^2, where the search is over x > y > 0
15:35:30<mrd>LaTeX-style will have minimal impact on your code layout
15:35:31<shapr>Man I love this job.
15:37:01<ivant>wli, oh, you mean we don't want to search over all [0..xmax]*[0..ymax] for solutions. Yes, I was supposing that
15:37:03<Syzygy->shapr: How so?
15:37:23<shapr>Syzygy-: I get to hack on very cool Haskell code every day.
15:37:29<Syzygy->Nice
15:37:39<shapr>And I'm working on stuff I've been dreaming about writing for years.
15:37:51<Nafai>ACTION hates this job
15:38:23<ivant>wli, so is there some useful criteria for choosing parts of [0..xmax]*[0..ymax]?
15:38:26<shapr>I wished I had this Haskell ADT <-> XML that uses syb-with-class for as long as I've been using Haskell.
15:38:34<sjanssen>shapr: any chance alexj is hiring?
15:38:37<wli>ivant: Yeah, there are congruence constraints on x and y.
15:38:42<krishn_bhakt>Anything like R coded in Haskell?
15:39:17<byorgey>sjanssen: heh, I just asked the same question the other day =)
15:39:25<krishn_bhakt>:)
15:39:36<shapr>sjanssen: Yeah, there's a chance :-)
15:39:39<byorgey>sjanssen: but don't worry, I'm not actually very serious about it, I was just curious
15:40:27<conal>shapr: what's HappS's business model? selling consulting?
15:40:46<ivant>wli, oh, are they simply following the curve in this paper?
15:41:53<wli>ivant: They can get away with that because they have some sort of bounded region.
15:42:37<ivant>wli, don't you have it bounded for each n as well?
15:42:50<wli>ivant: I originally tried to follow successive regions of the form used in the paper but the algorithm appeared to be broken.
15:43:09<wli>ivant: Algorithm(s) rather.
15:43:30<hpaste> osfameron pasted "how do I memoize this? (long division function)" at http://hpaste.org/2351
15:43:55<osfameron>ACTION thinks of words like "fix" and "lifting" but is getting confused
15:43:55<ivant>wli, suppose we take 4x^2+y^2=n
15:45:36<ivant>wli, we start with (x,y)=(0, floor $ sqrt n) and move along the curve until we hit ((/2) $ floor $ sqrt n, 0) counting the number of integer solutions
15:45:58<shapr>conal: That's part of it, but being able to implement new ideas for websites quickly is the biggest part.
15:46:00<ivant>wli, thus you don't even need an array
15:46:31<ivant>wli, and the number of tests can be made quite small if we are smart in following the curve
15:46:34<ptolomy>Anyone aware of a haskell library that facilitates message-passing concurrency in a nicely abstracted way?
15:46:39<wli>ivant: The specific form of the bound and the specific tracing method are the parts killing me here.
15:46:54<ivant>ACTION starts remembering what he read about ellipse drawing in some book about computer graphics
15:46:58<wli>ivant: It's also a family of curves.
15:47:21<wli>ivant: The paper claims to draw explicitly on graphics algorithms for level curve tracing.
15:47:35<ivant>wli, what do you mean by family of curves? you execute the algorithm for each fixed n
15:47:53<ivant>wli, wow, I'm close to getting the idea :-)
15:49:11<wli>ivant: Well, not so much executing the algorithm for each fixed n but implicitly considering f(x,y)=n for each fixed n.
15:49:28<krishn_bhakt>is there any book which explains 'algorithms and data-structures' using Haskell
15:49:54<shapr>@seen dcoutts
15:49:55<lambdabot>I saw dcoutts leaving #gentoo-haskell, #haskell-overflow, #haskell and #ghc 3d 1h 30m 44s ago, and .
15:49:55<shapr>aww
15:49:55<wli>It's implicit because there is a sort of "batch" of n's considered in each region 60*L <= n < 60*(L+B)
15:50:25<shapr>Who's the most active Cabal hacker these days? Is it dcoutts?
15:50:33<ivant>wli, what's the difference? why can't you do ‘map isPrime [3..]’ where isPrime traces 3 curves?
15:50:37<wli>Somehow it constructs a region of the plane/lattice.
15:50:57<wli>ivant: The curves are for mostly disjoint subsets of integers, for one.
15:52:06<byorgey>krishn_bhakt: there's a list of Haskell books here: http://haskell.org/haskellwiki/Books_and_tutorials
15:52:30<byorgey>krishn_bhakt: in particular you might take a look at Chris Okasaki's book, "Purely Functional Data Structures"
15:52:45<wli>ivant: 4*x^2 + y^2 = n for n `mod` 4 == 1, 3*x^2 + y^2 == n for n `mod` 6 == 1, and 3*x^2 - y^2 = n for n `mod` 12 == 11
15:52:51<lambdabot>Title: Books and tutorials - HaskellWiki
15:52:58<shapr>Now that HAppS is split into several darcs repositories, I wish that cabal-install could pull new patches for a bunch of repos, and rebuild packages with new patches, *and* all packages that depend on packages with new patches.
15:53:34<ivant>wli, do these equations are joined with && or ||?
15:53:50<mnislaih>shapr: that sounds good. Why not fill a feature request thinking in the incoming Hackathon ?
15:53:56<ivant>wli, why do we have these `mod` something?
15:54:26<wli>ivant: They're only valid tests for n of the congruence classes mentioned.
15:54:48<shapr>mnislaih: Yeah.. but I'm not sure how version dependency would work... unless darcs tag were used to match up a tag to a version?
15:55:07<wli>ivant: Whenever the sequences intersect the results for different f's will agree except where n within the intersection is not squarefree.
15:55:43<shapr>Hiya d-bug
15:55:54<mnislaih>shapr: but then cabal-install would have to understand darcs ?
15:56:04<shapr>Yeah, that's what I'm wondering...
15:56:20<wli>ivant: This is basically resolved by moving to mod 60 and making the congruence classess for the different binary quadratic forms' tests completely disjoint.
15:56:32<shapr>Or darcs would have to be served up by things that understood http://foo.com/repo?tag=0.9
15:56:32<daniel_larsson>hackage has idea where the source code is, apart from the tarball uploaded, right?
15:56:38<wli>ivant: (actually I think mod 12 would be sufficient)
15:56:43<d-bug>hi ho
15:56:48<daniel_larsson>err... has *no* idea..
15:56:49<Choko>@wiki primes
15:56:49<lambdabot>http://www.haskell.org/haskellwiki/primes
15:56:51<shapr>d-bug: Godmorgon!
15:57:00<d-bug>tack :)
15:57:03<shapr>daniel_larsson: I think that's correct.
15:57:06<xerox>daniel_larsson: it could, if the .cabal fice specified a repository
15:57:19<byorgey>osfameron: check out http://www.haskell.org/haskellwiki/Memoization
15:57:22<lambdabot>Title: Memoization - HaskellWiki
15:57:31<shapr>xerox: That's a good point.
15:58:04<shapr>But still, how would you pull to a certain version in the cabal file?
15:58:50<byorgey>osfameron: the general idea is to change the longdiv function so it takes an extra parameter f, which it calls instead of calling itself recursively: longdiv f x y = ... f (x * 10) y ...
15:58:59<ivant>wli, ok, I need to get some tea and continue reading about the systems of multivariate polynomial inequations. Thanks for taking time to explain me this thing, sounds like a cool way to sieve (although I'd need to read the paper some time later)
15:58:59<xerox>shapr: I think darcs can pull exact tags?
15:59:12<byorgey>osfameron: applying fix to that would give you back your original longdiv function
15:59:29<shapr>xerox: How often does a darcs tag match the cabal file version?
15:59:31<byorgey>osfameron: but you can transform it with a 'memoize' function before applying fix
15:59:58<xerox>shapr: exactly as often as when packages are uploaded to hackage, in principle, I think.
16:00:13<shapr>hmm
16:00:18<shapr>That's a good point.
16:00:21<osfameron>byorgey: thanks for the wiki ref
16:00:59<xerox>shapr: actually, it probably must be the case, hackage does a lot of checks to incoming packages. Or if it is not yet enforced, it might be. We've got a community server paid for by the soc money anyway :)
16:01:03<byorgey>osfameron: sure. skimming the wiki page it looks like it's not explained as well as it could be, but there are also some links at the bottom which might be useful too.
16:01:41<shapr>xerox: Yeah, that would be a useful convention, to have code version match up with darcs tag.
16:01:47<byorgey>osfameron: I'd explain it myself but I don't remember all the details off the top of my head =)
16:02:21<daniel_larsson>shapr: You want cabal-install to find versions in darcs repos that haven't been uploaded to hackage yet?
16:02:34<osfameron>byorgey: hehe, thanks anyway :-) it's probably best I work through the Fine Manual first anyway to try to understand it myself
16:02:56<byorgey>osfameron: indeed.
16:03:30<shapr>daniel_larsson: I'm not sure. I know I want cabal-install to pull the latest patches from many repos, and then rebuild the repos that have new code, and all repos that depend on those repos.
16:04:16<shapr>That's pretty important to me because HAppS has just been split into several repositories.
16:04:22<fasta>shapr: Cabal has no trust built-in, right?
16:04:22<shapr>What's the best solution for that?
16:04:51<shapr>fasta: I'm not sure, I don't think so.
16:04:59<fasta>Not having trust in a new package system is a rather bad idea.
16:05:11<fasta>Even Java has had that for years.
16:05:23<mnislaih>shapr, what about a local hackage set up ?
16:05:23<eivuokko>shapr, You can make a makefile; Depend on darcs inventory and write stamps for successfull build + register.
16:05:41<fasta>ADSF has for years
16:05:42<shapr>fasta: Feel free to fix it :-)
16:05:42<fasta>(and probably other systems)
16:06:01<roconnor>fasta: what's trust?
16:06:39<shapr>eivuokko: Hm, that would work.
16:06:41<fasta>roconnor: I put a package on Cabal. You install the package. You lost your home dir.
16:06:52<alexj>shapr: it would take a really small modification of searchpath to have it always try to get the most recent files from the internet rather than using the local cache.
16:06:52<alexj>I think that would do what you want. Modifying searchpath to use darcs to grab repos instead of curl would also be relatively easy, but a larger task.
16:07:02<Tac-Work>@src fromInt
16:07:02<lambdabot>Source not found. Where did you learn to type?
16:07:14<shapr>fasta: Ah, it does require a login to upload to Hackage.
16:07:26<fasta>shapr: and anyone can register?
16:07:35<shapr>No, you have to get admin approval.
16:07:43<roconnor>fasta: can anyone upload to Cabal?
16:07:44<fasta>shapr: or does it go through some non-trivial process?
16:07:53<fasta>shapr: e.g. you need to give physical address
16:08:01<fasta>shapr: passport identification ;)
16:08:05<roconnor>fasta: oh, you are asking.
16:08:24<shapr>Well, I only had to ask... but then, I've met most people in the community.
16:08:25<ndm>fasta: you ask Ross, he gives you a login
16:08:37<daniel_larsson>fasta: show me another package system that asks for passport identification ;)
16:08:39<ndm>shapr: for everyone its just a question of ask
16:08:41<fasta>e.g. roconnor should be able to pounch my face when I do something malicious.
16:08:50<roconnor>@slap fasta
16:08:50<lambdabot>ACTION slaps fasta
16:08:59<shapr>ndm: oh
16:09:03<fasta>Otherwise, it's just waiting for the system to be exploited.
16:09:04<roconnor>just testing
16:09:09<ndm>shapr: but you are still special ;-)
16:09:17<shapr>daniel_larsson: Actually, debian does.
16:09:46<wli>I didn't know the wiki had Euler problem pages.
16:09:49<daniel_larsson>I'm sure hackage doesn't yet need to though )
16:10:07<eivuokko>Hackage had gnupg-based authentication in past.
16:10:10<shapr>fasta: In any case, if you think it's a serious problem, go fix it!
16:10:14<oerjan>@users
16:10:14<lambdabot>Maximum users seen in #haskell: 404, currently: 402 (99.5%), active: 23 (5.7%)
16:10:19<eivuokko>But it was pretty experimental at the time.
16:10:19<shapr>eivuokko: Yeah, true.
16:10:43<oerjan>O_O
16:10:46<roconnor>oerjan: wan't the maximum seen lower than that a few hours ago?
16:10:54<oerjan>i recall it being around 380
16:11:03<shapr>Yay, we got over 400!
16:11:08<fasta>I will believe that number when active is higher than 100.
16:11:24<fasta>Some people are logged in three times.
16:11:33<shapr>fasta: It's the real number.
16:11:42<shapr>fasta: I was on #haskell when it had one user :-)
16:11:59<fasta>shapr: I know, but the ratio active/all is so low
16:12:10<roconnor>fasta: I'm interested in how you think a trust system should work.
16:12:17<daniel_larsson>How's "active" defined?
16:12:24<lament>shapr: my channel just hit an all-time peak yesterday due to being featured on reddit, and i can't say i'm very happy about that :)
16:12:27<shapr>When enough people get active, it's hard to have a conversation.
16:13:33<fasta>roconnor: getting a good trust system requires some thought, but I would look at ASDF and make it user friendly.
16:13:45<roconnor>@where ASDF
16:13:45<lambdabot>I know nothing about asdf.
16:13:57<shapr>fasta: I do agree that people who write code and are actively learning more Haskell contribute the most, so idle #haskell clients aren't a big indicator of community activity.
16:14:00<fasta>roconnor: also advocato has some ideas
16:14:00<roconnor>asdf? were you just pounding on your keyboard?
16:14:06<roconnor>;)
16:14:16<shapr>advogato?
16:14:27<lament>if you take asdf and try to make it user-friendly, you'll get aoeu
16:14:28<fasta>shapr: right
16:14:38<shapr>I like the debian approach.
16:14:54<oerjan>lament: seeing that 404, i wondered if #haskell had been somewhere too (but reddit is full of haskell already, iiuc)
16:15:09<fasta>lament: that's a joke, right?
16:15:18<lament>fasta: yes. It's very funny. Laugh.
16:15:18<shapr>fasta: Yes, it's a dvorak joke!
16:15:36<fasta>lament: I suspected that within a second, but it could have been some lame Lisp pun.
16:15:41<shapr>aoeu is the left hand home row on dvorak.
16:16:00<roconnor>fasta: http://constantly.at/lisp/asdf/ <- this?
16:16:00<lambdabot>Title: asdf Manual
16:16:10<shapr>daniel_larsson: I think active is "spoke in the last two hours".
16:16:10<lament>oerjan: reddit is chock-full with haskell but i haven't seen explicit mentions of the irc channel
16:16:23<fasta>roconnor: right
16:16:35<lament>shapr: if active ever rises too high, it will be hell.
16:16:37<fasta>roconnor: maybe asdf-install is the actual crypto tool
16:16:47<fasta>roconnor: I don't know, as I am not a hard-core CL user
16:16:57<shapr>lament: Nah, I think it'll just move some conversation to #haskell-overflow or spoken language specific channels.
16:17:35<osfameron>byorgey: yeah... the wiki article suggests implementing memoFix in terms of "memoize", about which it is mysteriously silent. I'll have to look at this later, the email threads seem very much in terms of lazy lists, whereas I *think* I need Data.Map
16:17:35<ivant>I wonder when #haskell_ru would be more than 10 active users :-)
16:17:42<oerjan>does anyone have a theory why #haskell has so many inactive users?
16:17:49<lament>shapr: i assume #debian has all those extra channels, but it's hell anyway
16:17:50<oerjan>and btw are they always inactive?
16:18:01<xerox>ivant: hey, ten is pretty nice, we'd like to have ten in .it :)
16:18:06<ricky_clarkson>#debian has all those extra channels, yes.
16:18:14<shapr>oerjan: No, they're not always inactive. I think there are just a few major reasons for inactive users on #haskell
16:18:27<oerjan>would it be possible to ask lambdabot for the number of nicks that have not spoken in a given period?
16:18:37<shapr>Some people want to learn Haskell, and they idle here and osmose information before they get around to really jumping in...
16:18:40<ivant>oerjan, it's really hard to have that many conversations going on at the same time
16:18:47<ivant>oerjan, , I mean, to follow them
16:18:54<alexj>shapr: just pushed modification to search path add --newest to have it always try to pull the newest versions of the modules from net rather than use the local cache.
16:19:02<shapr>Some people have real jobs and lives that suck up most of their time, but want to keep up with the cool stuff going on here, so they idle and then jump in when they're active.
16:19:06<shapr>alexj: spiffy, thanks!
16:19:17<osfameron>shapr: I think it's hard to osmose on #haskell though, at least without sufficient maths/comp sci background
16:19:25<wli>ACTION <-- realjobbing
16:19:34<glen_quagmire>jobbing?
16:19:42<shapr>osfameron: Yeah, sometimes that's true.
16:20:10<pejo>oerjan, I'm usually inactive when I do other things. And sometimes I just read the stuff said in the channel. I the same goes for many people in here.
16:20:15<lament>there's a lot of idlers in every big channel
16:20:48<lament>some people join tens of channels and never talk in any of them
16:20:50<shapr>lament: Hey, have you written any Haskell code lately?
16:20:55<lament>shapr: a little
16:20:57<shapr>Anything nifty?
16:21:04<lament>i'm writing a tagger to manage all the junk in my public_html... so, no :)
16:21:15<shapr>Sounds nifty to me.
16:21:20<oerjan>lament: perhaps the fraction is not so different in #haskell, then?
16:21:24<daniel_larsson>shapr just described me, more or less :) I'm not very active around here
16:21:36<shapr>haha
16:21:49<ivant>xerox, we had 6 active maximum, as far as I know, but that was when we were participating in the ICFP contest this year
16:22:32<ivant>xerox, we simply occupied the channel :-)
16:22:36<glen_quagmire>come to #haskell-women
16:22:38<ivant>xerox, now it's mostly 2 users, me and lambdabot included
16:22:38<shapr>Sometimes I'm not very active on #haskell for months at a time. But I'll come back and be active at some point :-)
16:22:52<ivant>ACTION thinks that he doesn't qualify for #haskell-women
16:23:01<shapr>ACTION neither
16:23:15<shapr>lament: Got any source online?
16:23:19<lament>no
16:23:20<shapr>aww
16:23:43<lament>you just wanna see random haskell source, or some proof that i actually program? :)
16:24:22<shapr>Well, tagging all the stuff in my ~/public_html would be cool, but I don't know how I'd do it, so I thought I'd see how you did it.
16:24:31<shapr>Sounds useful.
16:24:57<glen_quagmire>I wrote this function: sex :: (Male a) -> (Female b) -> a
16:25:04<lament>i'm a bit fuzzy on the details myself
16:25:30<lament>guess type based on extension, ask the user to fill in a basic description
16:25:37<lament>then generate an html page with a list of files for each type
16:25:50<Botje>glen_quagmire: ITYM sex :: (Adult a) -> (Adult b) -> Maybe (Either a b)
16:26:03<lament>track files by md5 so you notice when they simply get renamed, and keep the old info
16:26:36<lament>by md5 and inode actually
16:26:45<glen_quagmire>hah Botje
16:27:25<roconnor>glen_quagmire: what are you doing with people's sex?
16:27:50<Vulpyne>Giggety.
16:28:16<glen_quagmire>that sex funciton can be useful for game of life
16:28:29<lament>shapr: better tell me this. You have two files, a.txt and b.txt. You open both in an editor, swap their contents and save them. Would you say the files were renamed, or that their contents changed, or that the new files are independent from the old files? :)
16:28:54<roconnor>glen_quagmire: conway's life, or that board game?
16:29:46<oerjan>lament: if they have different permissions, then the effect may actually be different
16:30:17<lament>for extra fun, we can afterwards swap their filenames, too.
16:30:35<lament>and perhaps permission flags if you wish :)
16:31:15<oerjan>lament: aiming for the equivalent of referential transparency?
16:31:28<lament>a simpler statement of the problem is: we create a new file, copy all content from the old file, and delete the old file.
16:32:03<lament>mutability introduces all sorts of object identity problems :)
16:32:44<glen_quagmire>roconnor: conway's life
16:32:59<ivant>glen_quagmire, I don't remember a notion of sex there :-)
16:33:00<oerjan>lament: indeed. what if there were other hard links to the same file...
16:33:02<roconnor>glen_quagmire: Aren't the cells sexless?
16:33:18<glen_quagmire>ACTION loses
16:33:49<lament>oerjan: or just copies. That's another issue.
16:34:58<oerjan>lament: i suggest the only proper solution is to create a custom monad to model and experiment with the problem ;)
16:35:30<lament>silly haskellers, "create a monad" is their solution to everything :)
16:35:50<oerjan>lament: i was just trying to get back on topic
16:36:07<oerjan>you could try with an arrow if you want
16:36:14<lament>fine, fine
16:38:00<Tac-Work>I think I should write a monad which writes other monads
16:38:44<oerjan>i never meta-monad i didn't like
16:38:58<glguy>@slap oerjan
16:38:58<lambdabot>ACTION slaps oerjan
16:39:14<oerjan>ouch :D
16:51:36<mrd>lament: except when "create an Arrow" is the solution
16:54:00<glen_quagmire>yay gtk2hs compiled when I used -O0 option
16:57:55<glguy>is there a good way to "trim" (remove leading whitespace) a string in the shell
16:58:17<Vulpyne>sed 's/^ *//g'
16:58:39<oerjan>i don't think you need g
16:58:51<Vulpyne>That's probably true. Habit.
17:01:19<oerjan>also, that may trim whitespace from each line, if that is a problem
17:03:51<glguy>I ended up using ^\s*
17:03:58<glguy>but that does exactly what I needed
17:41:03<glen_quagmire>i'm making gtk2hs package. I built it using --without-pkgreg . in the post installation script for the package, how do I register it to GHC? ghc-pkg register /path/to/gtk2hs/imports/glib/System/Glib.hi ?
17:42:37<glen_quagmire>oh i think it's .conf file.. i was looking for .cabal file
17:44:18<shapr>Ya know, I'd like to have lambdabot show all the darcs patches I've submitted to various community projects, that would be nifty.
17:45:37<sjanssen>it'd be really neat if http://www.ohloh.net supported darcs
17:45:37<lambdabot>Title: Ohloh, the open source network
17:46:20<glguy>what is the purpose of the 'x' in [ "x${SOME_VAR}" = "xSOME_VAL" ]
17:46:20<glguy>?
17:46:28<glguy>(bash script)
17:47:16<oerjan>perhaps to make sure it's a string and not number comparison?
17:47:24<earthy>ACTION nods
17:47:31<earthy>but not only that
17:48:00<earthy>it's also to make sure that the variable expansion for ${SOME_VAR} does not result in the empty string
17:48:02<Vulpyne>To make sure the left side can't expand to blank.
17:48:10<Vulpyne>But since there's the quotes, it's kinda not necessary.
17:48:11<glguy>what is the consequence of a blank left side?
17:48:13<earthy>for that may well break the implementation of test
17:48:26<Vulpyne>[ = "SOME_VAL" ] is an error.
17:49:00<glguy>but "" = "SOME_VAL" is ok?
17:49:05<Vulpyne>Yeah.
17:49:15<Vulpyne>Some people just get in the habit of doing it that way.
17:49:16<Vulpyne>Even if they quote the string.
17:49:16<earthy>glguy: may be okay, depending on which particular instance of bourne-like shell you have
17:49:23<glguy>hm, ok
17:49:25<glguy>just curious
17:49:35<earthy>Vulpyne: you haven't yet run into almost-standard implementations of the bourne shell, have you?
17:50:12<Vulpyne>Bash or bust!
17:50:15<earthy>ghe
17:50:34<earthy>busybox ships with 3 versions of its shell
17:50:53<earthy>they are somewhat sh compatible... for differing values of somewhat
17:50:55<earthy>whole worlds of pain there. ;)
17:50:57<shapr>sjanssen: Yeah, I agree.
17:51:11<shapr>sjanssen: But it wouldn't be too hard to write our own.
17:51:34<sjanssen>dons already has some stuff that comes close
17:51:40<pejo>Vulpyne, or take /bin/sh in Solaris. I bet the older AIX and HP-UX shells are somewhat broken too.
17:52:33<wli>The pain in/around shells is really signal and tty handling.
17:52:58<wli>This is not even considering line editing.
17:58:26<shapr>sjanssen: Is his code online?
17:58:55<fasta>What's a fast way to pass alternating False and True to a loop? I.e. a function that should be executed in the loop should first execute with the argument False, and then with True etc. I can zip (infinite_list_false_and_true) other_args and then apply foreach, but I would like to eliminate the list completely.
17:59:24<wli>cycle [False, True] seems plausible.
18:00:50<fasta>wli: did you read that last part of the last sentence?
18:00:54<xerox>> let f x n | n > 0 = (n,x) : f (not x) (n-1) | otherwise = [] in f True 10
18:00:56<lambdabot> [(10,True),(9,False),(8,True),(7,False),(6,True),(5,False),(4,True),(3,False...
18:01:21<fasta>I wonder what's faster.
18:01:57<wli>Just pass the arg. Deforestation can handle it.
18:03:58<mrd>deforestation is killing millions of endangered cons cells
18:04:21<thetallguy>those things grow like weeds
18:04:26<oerjan>@remember mrd deforestation is killing millions of endangered cons cells
18:04:26<lambdabot>Done.
18:05:14<thetallguy>I have some that mutated into cosn cells
18:05:21<thetallguy>and now my screen is all wavy
18:05:29<fasta>My profile shows all black with "OTHER" costs.
18:05:36<fasta>That's good, I guess.
18:08:07<byorgey>@botsnack
18:08:22<byorgey>oh no! lambdabot!
18:08:36<byorgey>ACTION sobs
18:10:25<lambdabot>:)
18:10:35<byorgey>!
18:10:46<byorgey>lambdabot's a bit laggy today...
18:10:46<SamB>what?
18:11:21<oerjan>@boss
18:11:22<lambdabot>Maybe you meant: b52s docs
18:11:38<oerjan>not to me
18:11:40<byorgey>oh... maybe it's byorgey's internet connection that's laggy?
18:11:48<oerjan>not that much
18:12:05<oerjan>definitely not enough to sob about, anyhow :)
18:12:08<byorgey>weird... when I typed @botsnack it took about two minutes for the :) to show up
18:12:41<oerjan>oh? i saw them within seconds, i think
18:13:07<oerjan>not quite sure, since i wasn't really paying attention
18:13:44<byorgey>no matter, all is right with the world once more
18:13:47<byorgey>@botsnack
18:13:51<lambdabot>:)
18:18:22<shapr>Monads turn break action into full auto.
18:19:06<shapr>Does main-is: handle hs-source-dirs ?
18:20:49<glen_quagmire>why is that type of foldl and foldr are different?
18:21:28<fasta>glen_quagmire: because otherwise the replace with ':' method doesn't work anymore.
18:21:32<Vulpyne>HappS doesn't support SSL, does it?
18:21:36<glen_quagmire>it seems like arguement order is different for the function passed to foldl/r
18:21:48<fasta>glen_quagmire: that's because it is different
18:22:09<shapr>Vulpyne: It would support ssl behind apache, but it doesn't support SSL directly. I don't think it would be hard to add though.
18:22:23<Vulpyne>Ah.
18:22:28<glen_quagmire>oh i see. (:) is list_element : accumulator
18:22:33<Vulpyne>Hmm, I guess I wanted to do outgoing SSL connections, actuall.
18:22:34<Vulpyne>y
18:22:34<conal>@pl \ m g -> m >>= \ x -> g x >> return x
18:22:34<lambdabot>(. flip (liftM2 (>>)) return) . (>>=)
18:22:42<Vulpyne>I really wish there was something like Twisted for Haskell. :(
18:22:43<conal>ick.
18:22:44<glen_quagmire>so, any other function f should be f list_element accumulator
18:22:45<oerjan>glen_quagmire: it's so that if the argument is a function you can just place it between the list elements, with the initial element at the proper end
18:23:08<oerjan>and parentheses stacked correctly
18:23:24<fasta>oerjan: if the argument is a function? What argument isn't a function?
18:23:26<oerjan>*function = operator
18:23:34<oerjan>typed the opposite of what i meant
18:23:35<thetallguy>conal: that really is ugly
18:23:50<shapr>Vulpyne: http://www.cs.helsinki.fi/u/ekarttun/hsgnutls/ should be easy to integrate, especially since the author hsgnutls wrote much of the core HAppS code.
18:23:52<lambdabot>Title: hsgnutls
18:24:01<conal>@ty \ m g -> m >>= \ x -> g x >> return x
18:24:04<lambdabot>forall (m :: * -> *) a a1. (Monad m) => m a -> (a -> m a1) -> m a
18:24:08<Vulpyne>shapr: Thanks.
18:24:11<conal>@ty \ m g -> m >>= g `mappend` return
18:24:26<lambdabot>forall a (m :: * -> *). (Monoid (a -> m a), Monad m) => m a -> (a -> m a) -> m a
18:24:28<conal>better. hm. less general type.
18:24:29<glen_quagmire>hrm i don't think I don't understand foldl/r fully
18:24:30<oerjan>e.g. foldl (-) 1 [2,3,4] = ((1-2)-3)-4, foldr (-) 1 [2,3,4] = 2-(3-(4-1))
18:24:58<conal>oh -- because (>>) discards info.
18:25:51<conal>i'd like to see (>>) have type m () -> m a -> m a, for better type-checking.
18:26:06<conal>and use `mappend` instead for monoidal accumulation.
18:26:16<fasta>How can I surpress the redundant import warnings that result from a call to a CPP macro?
18:26:18<glen_quagmire>oerjan: is that all one needs to know? it says foldl is more efficient. I'm not sure why
18:26:30<fasta>suppress*
18:27:06<oerjan>conal: and use an ignore :: m a -> m () operator like in ocaml?
18:27:19<thetallguy>@ty (>>)
18:27:19<lambdabot>forall (m :: * -> *) a b. (Monad m) => m a -> m b -> m b
18:27:42<fasta>If I could mix import statements there wouldn't be a problem.
18:27:42<conal>oerjan: yes: fmap (const ())
18:28:10<thetallguy>conal: wouldn't that defeat the purpose?
18:28:22<conal>whenver i use (>>) on a more general type, it turns out to be a bug that gets past the type-checker.
18:28:25<fasta>conal: that would be horrible
18:28:37<conal>thetallguy: which purpose is that?
18:28:41<oerjan>glen_quagmire: foldl', not foldl, or you lose most of the efficiency unless the compiler can deduce strictness
18:28:50<thetallguy>conal: it's purpose is to throw away that information
18:29:17<conal>thetallguy: maybe there are two purposes, and we can separate them.
18:29:25<thetallguy>conal: it's purpose is to implement sequencing only
18:29:55<conal>thetallguy: another is to elide the "\ () ->"
18:30:00<thetallguy>conal: which is why I never use it
18:30:08<thetallguy>conal: so I see your point
18:30:14<EvilTerran>i see where you're coming from, conal, but it'd be contraversial. you could, perhaps, use a (>>!) operator of your own devising or something
18:30:22<thetallguy>conal: yes.
18:30:51<conal>EvilTerran: yes, I could. The bummer is that do notation desugars into >> and not >>!
18:30:56<thetallguy>conal: The purpose is to implement only sequencing
18:30:56<eivuokko>Maybe there the (>>) (and it being in Monad class) have something to do with desugaring do and efficiency (at that time)?
18:31:06<thetallguy>conal: the elision is there for brevity
18:31:13<SamB>conal: at least you can't throw out the information and then accidentally pull something out of your ass instead of using the information like in C
18:31:38<conal>eivuokko: do you mean a third purpose of keeping constant stuff out of a lambda??
18:31:50<EvilTerran>conal, otherwise it'd have to desugar into an equivalent, but uglier, construct.
18:32:00<thetallguy>conal: I guess I don't fully understand what you want the type checker to do here?
18:32:06<conal>thetallguy: agreed. i like the brevity, and i'd like better static checking.
18:32:08<thetallguy>conal: warn you that you are throwing info away?
18:32:23<conal>thetallguy: exactly
18:32:34<glen_quagmire>:t foldl'
18:32:35<lambdabot>forall a b. (a -> b -> a) -> a -> [b] -> a
18:32:39<thetallguy>conal: isn't that the same roughly as an _ in the pattern world?
18:32:49<EvilTerran>unless you want to require all lines with implicitly discarded results in do{}s to return ().
18:32:55<thetallguy>conal: oh, I see, no, it's more like an unused reference
18:32:57<conal>and if i want to throw away info, i use the general tool of const (), rather than a monad-specific tool.
18:33:03<glen_quagmire>how come my GHCi doesn't know foldl' ?
18:33:11<int-e>glen_quagmire: import Data.List
18:33:13<fasta>glen_quagmire: :m + Data.List
18:33:20<EvilTerran>thus requiring an explicit ignore function. as others've mentioned, it's a brevity vs sanity checking thing...
18:33:37<shapr>:t foldl'
18:33:38<lambdabot>forall a b. (a -> b -> a) -> a -> [b] -> a
18:33:45<shapr>@index foldl'
18:33:45<lambdabot>Data.List
18:33:46<oerjan>thetallguy: ocaml does this with it's ; operator, if the first argument does not have type () it gives a warning
18:33:46<EvilTerran>conal, you might be able to do something with -fno-implicit-prelude, but it'd be ugly.
18:33:47<thetallguy>conal: so you again lose the brevity
18:34:05<glen_quagmire>oh now it knows thanks
18:34:13<thetallguy>oerjan: yes
18:34:14<oerjan>*() = unit
18:34:16<Heffalump>apart from compiler warnings, you don't get complaints when you throw away values in pure code, normally
18:34:35<eivuokko>conal, Hmm? I've just assumed (>>) is an artifact of efficient do-translation. Not sure if lambda would be the source of such problems.
18:34:35<thetallguy>conal: I guess that explains why I never use (>>)
18:34:41<SamB>conal: where have you actually done this?
18:35:10<conal>SamB: lost valuable info?
18:35:17<thetallguy>but I imagine that I've used the equivalent in do notation often
18:35:17<SamB>forgot to use it
18:35:31<EvilTerran>it seems to me that typing >> instead of >>= should be a type error in most cases
18:35:43<SamB>and couldn't you just as easily have bound a variable but forgotten to use it?
18:36:12<conal>SamB: when i forget to use a bound var, ghc tells me. and i'm glad.
18:36:27<SamB>so you'd be happy if a warning could be devised?
18:36:31<fasta>I think an electro-shock when you forget something works better.
18:37:30<conal>fasta: please file that feature request with the ghc folks. but make it optional, okay? ;)
18:37:46<SamB>yeah.
18:37:52<SamB>not everyone has the hardware for that
18:38:12<conal>SamB: sure, a warning would be enough.
18:38:21<conal>SamB: even off by default.
18:38:32<SamB>have you created a ticket?
18:38:33<segher>everyone who lets me install hardware for them has hardware for it :-)
18:38:41<Eelis>i would like such a warning
18:38:43<conal>SamB: areyou asking me or fasta?
18:38:51<SamB>conal: you
18:39:16<evir>Huh? Could not find module `Control.Monad.Error'
18:39:17<evir>Where do I get that from?
18:39:45<eivuokko>evir, mtl
18:40:05<conal>SamB: i don't know how the warning idea could work. (>>) is not built-in language magic. It's just a method.
18:40:06<evir>eivuokko: mtl?
18:40:13<thetallguy>conal: why are you using (>>)?
18:40:29<eivuokko>evir, package named mtl
18:40:39<evir>eivuokko: Ah, thank you.
18:40:55<fasta>Is there a project transformation that removes all unused imports?
18:40:56<conal>thetallguy. i'm not. it comes out of do notation. which i also rarely use now that i'm into applicative.
18:41:03<thetallguy>conal: I still don't see why you would use it in place of (>>=)
18:41:06<thetallguy>conal: ah
18:41:17<thetallguy>conal: yes, now I understand
18:41:18<fasta>Who said Real Programmers don't need refactoring tools...
18:41:53<thetallguy>conal: so rephrased, you would like a warning if any generated valud in a do doesn't get used?
18:42:24<Heffalump>all he needs is a new warning in GHC if you use m a where a isn't () as the LHS of a >>
18:42:28<eivuokko>Except ()?
18:42:30<conal>thetallguy: yeah. it comes down to that. if i used (>>), i'd want the same.
18:42:37<thetallguy>conal: I'm glad to hear that about the do/applicative. I'm intending to follow you down that path soon
18:42:47<Heffalump>(with appropriate translation back if it came from a desugared do)
18:43:34<glguy>conal: I'm trying to figure out what's going on from the backlog... are you saying that getLine >> getLine should cause a warning?
18:43:34<conal>thetallguy: i'm delighted with applicative. so very elegant. and inherently more optimizable than monads. i'd be happy to answer questions.
18:43:35<thetallguy>conal: I expect to write some combinators that spit out actionscript graphics objects and I think this issue will come up
18:43:58<thetallguy>conal: excellent. I will be talking more with you.
18:44:07<thetallguy>conal: by the way, this is Cliff Beshers
18:44:12<conal>thetallguy: oooh! i'm very interested in that application.
18:44:25<conal>thetallguy: Cliff!!
18:44:44<thetallguy>conal: yes, I'm sure. Things will be picking up in the graphics department
18:44:59<thetallguy>conal: I'm no longer at Linspire
18:45:00<conal>thetallguy: what are you up to? you left Linspire, right??
18:45:21<thetallguy>conal: David Fox and I are starting a company to do math skills on the web for kids
18:45:45<thetallguy>conal: you've been talking to stepcut
18:45:55<conal>thetallguy: stepcut??
18:46:15<conal>thetallguy: wow -- your app sounds very fun. i don't know david. perhaps i could help
18:46:30<thetallguy>conal: Hmm... If not stepcut, then who told you about Linspire?
18:46:45<thetallguy>conal: stepcut == Jeremy Shaw
18:47:28<conal>thetallguy: i don't remember where i heard that you left. i don't know jeremy either. is he from linspire?
18:47:59<thetallguy>conal: yes, he is still there. The only other people I've told are Norman R and Jeremy G
18:48:14<thetallguy>conal: not that it matters, but I'm curious
18:48:34<conal>hm.
18:48:34<thetallguy>conal: I've been meaning to get in touch with you about this. David and I will be at ICFP
18:49:23<conal>thetallguy: wonderful. i'll be in Frieburg from Sept 25 thought Oct 7. Staying at the Black Forest Hostel.
18:49:23<thetallguy>conal: stepcut may have told someone else who told someone else. Just curious about connections
18:49:33<thetallguy>We arrive the 28th, I think
18:49:35<thetallguy>Friday
18:49:55<conal>staying for the hackathon?
18:49:57<thetallguy>We're at someplace wiht a wonderful name
18:50:09<thetallguy>conal: maybe Friday
18:50:41<thetallguy>conal: we've promised to be in Munich sometime that weekend
18:50:47<thetallguy>conal: well, I've promised.
18:50:55<conal>thetallguy:; what's going on in munich?
18:51:52<thetallguy>conal: oktoberfest!
18:52:16<conal>thetallguy: oh! btw, what's your nick mean?
18:52:21<thetallguy>conal: a friend will be there for oktoberfest, another is a professor there, and I want to visit the place since I was there for a college semester .
18:52:26<thetallguy>conal: uhhh...
18:52:34<conal>oh -- i misparsed!
18:52:35<thetallguy>conal: lol
18:52:35<conal>i read "theta"
18:52:42<conal>:)
18:52:49<thetallguy>conal: I was going to say, I must not have made much of an impression...
18:53:12<thetallguy>conal: lol Very amusing
18:53:26<thetallguy>conal: what's your preferred email?
18:53:29<conal>thetallguy: a different impression. and favorable.
18:53:40<thetallguy>conal @elliott.net or something?
18:54:07<conal>thetallguy: see the bottom of http://conal.net
18:54:07<lambdabot>Title: Conal Elliott's home page
18:54:33<conal>thetallguy: IM info there also
18:54:38<fasta>Does anyone of you mount /tmp on a ramdisk to speed up compilation?
18:55:15<thetallguy>conal: good, I don't have to remember how many l's an t's in Elliott
19:07:00<Eelis>can lambdabot show operator fixities?
19:07:20<glen_quagmire>:t (+)
19:07:22<lambdabot>forall a. (Num a) => a -> a -> a
19:07:30<mauke>:i (+)
19:07:40<mauke>@info (+)
19:07:40<lambdabot>((+))
19:07:44<mauke>:(
19:08:05<oerjan>mauke: @info is actually @undo, spell corrected
19:08:19<mauke>hahaha
19:08:27<mauke>makes "sense"
19:09:53<EvilTerran>@index (+)
19:09:55<lambdabot>Prelude
19:10:09<eivuokko>Heh, that's nasty spell correction.
19:10:12<oerjan>@list type
19:10:12<lambdabot>type provides: type kind
19:10:59<EvilTerran>@where Prelude
19:11:00<lambdabot>http://www.haskell.org/onlinereport/standard-prelude.html
19:11:13<Eelis>so then, no way to query fixity? can i drop this in a suggestion box somewhere?
19:11:15<glen_quagmire>what is fixities? infix vs. outerfix?
19:11:16<glen_quagmire>i mean, prefix
19:11:19<EvilTerran>"infixl 6 +, -"
19:11:21<mauke>infixl 6 +
19:11:33<mauke>it works in ghci
19:11:56<glen_quagmire>:i infixl
19:11:57<paolino>can I use a parsec function to make an instance of Read ?
19:11:57<oerjan>glen_quagmire: precedence and associativity
19:12:22<glen_quagmire>hrm those aren't part of haskelll type
19:12:34<shachaf>@where report
19:12:34<lambdabot>http://www.haskell.org/onlinereport/
19:12:47<glen_quagmire>:: a -> b -> c -- no way to tell
19:12:57<oerjan>glen_quagmire: fixities are declared with infixl, infix or infixr
19:13:23<Tac-Work>Is there a way to defined + on functions such that f + g = \x -> f x + g x?
19:13:26<Eelis>@todo-add Operator fixity querying.
19:13:28<lambdabot>Entry added to the todo list
19:13:28<Tac-Work>I'm getting type errors
19:13:30<glen_quagmire>oh infixl was a keyword
19:13:51<byorgey>Tac-Work: yes, you have to define a Num instance for functions.
19:14:29<shachaf>Tac-Work: There's liftM2 (+).
19:14:30<mauke>Tac-Work: for some functions, yes
19:14:32<paolino>I tried http://sequence.complete.org/node/117 but it doesn't compile
19:14:33<lambdabot>Title: instance Read a, given a Parsec parser | The Haskell Sequence
19:14:34<byorgey>Tac-Work: see http://www.haskell.org/haskellwiki/Num_instance_for_functions
19:14:42<mauke>basically, you can lift Num to Applicative
19:14:46<oerjan>paolino: what error do you get?
19:14:49<lambdabot>Title: Num instance for functions - HaskellWiki
19:14:56<paolino> Illegal instance declaration for `Read a'
19:14:56<paolino> (The instance type must be of form (T a b c)
19:14:56<paolino> where T is not a synonym, and a,b,c are distinct type variables)
19:14:56<paolino> In the instance declaration for `Read a'
19:15:21<oerjan>paolino: sounds too general
19:15:37<shachaf>paolino: Did you use -fallow-undecidable-instances?
19:15:51<paolino>yes in the PRAGMA
19:16:05<EvilTerran>Tac-Work, i think the approach would be something like instance Num b => Num (a -> b) where ....
19:16:10<Tac-Work>"This article is in category Proposals in order to show people that this idea was already proposed, but that one should think twice implementing it."
19:16:21<byorgey>Tac-Work: just using liftM2 (+) as shachaf suggests is probably a better idea though.
19:16:40<byorgey>Tac-Work: right. you can do it, but there are good reasons not to.
19:16:53<byorgey>Tac-Work: which is not to say you can't/shouldn't.
19:17:16<Tac-Work>hmm
19:17:19<Tac-Work>yeah
19:17:23<Saizan>paolino: -fglasgow-exts?
19:17:25<EvilTerran>but, as others've mentioned, it'd be restricted. the first problem that springs to my mind is that you'd have to instantiate Read as well
19:17:33<shachaf>paolino: It works if you add -fglasgow-exts.
19:17:34<EvilTerran>although "read = const . read" might be sufficient
19:17:35<paolino>shachaf UndecidableInstances
19:18:06<Tac-Work>Is there a reason 'read' throws an error instead of returning a Maybe?
19:18:11<oerjan>EvilTerran: Num doesn't require Read
19:18:17<oerjan>but Show
19:18:26<shachaf>Tac-Work: there's reads.
19:18:26<shachaf>@ty reads
19:18:28<lambdabot>forall a. (Read a) => String -> [(a, String)]
19:18:55<Tac-Work>yeah, I saw that yesterday
19:19:01<mauke>Num requires Eq and Show for no good reason
19:19:07<damg>is there a way to define a data type which is a subset of an existing one? e.g. natural numbers
19:19:20<EvilTerran>sorry, Show. what am i talking about...
19:19:36<EvilTerran>damg, unfortunately there's no easy way.
19:19:42<mauke>http://mauke.ath.cx/stuff/haskell/fun.hs
19:20:05<EvilTerran>but you could create a newtype, and instantiate it to Num etc with bounds checking in all the methods.
19:21:19<damg>EvilTerran, ok, thank you, I'll do an instance
19:23:28<paolino>TypeSynonymInstances in the PRAGMA , thanks
19:24:36<oerjan>> let x a b = (+ a $ b) in "Test"
19:24:37<lambdabot> The operator `+' [infixl 6] of a section
19:24:37<lambdabot> must have lower precede...
19:24:42<oerjan>hah!
19:25:38<sorear>@users
19:25:38<lambdabot>Maximum users seen in #haskell: 411, currently: 408 (99.3%), active: 22 (5.4%)
19:26:12<oerjan>> (+ a $ b)
19:26:13<lambdabot> Not in scope: `b'
19:26:26<mauke>> (+ ?a $ ?b)
19:26:26<lambdabot> Parse error
19:26:33<oerjan>> (+ 0 $ 0)
19:26:34<lambdabot> The operator `+' [infixl 6] of a section
19:26:34<lambdabot> must have lower precede...
19:28:31<Winterstream>Hi everyone :)
19:29:11<byorgey>hi Winterstream =)
19:32:23<ivant>> (/2) $ 8
19:32:24<lambdabot> 4.0
19:32:36<ivant>wow, cool, prefix notation
19:32:54<ivant>> ((/ 2) 8)
19:32:54<lambdabot> 4.0
19:32:54<EvilTerran>> (/ 8 2) -- hey look, lisp is a subset of haskell :D
19:32:55<lambdabot> add an instance declaration for (Num (t -> a))
19:33:02<ivant>yep :-)
19:33:25<EvilTerran>> ((/) 8 2) -- hey look, lisp is a subset of haskell :D
19:33:25<lambdabot> 4.0
19:33:25<EvilTerran>there we go. =p
19:34:54<Tac-Work>That is such a syntax error in lisp
19:35:52<byorgey>Tac-Work: true. I don't think EvilTerran was claiming that lisp is a *syntactic* subset of Haskell. =)
19:35:59<EvilTerran>it was a joke anyway.
19:36:10<desp>actually, isn't every language a subset of lisp?
19:36:13<desp>or lisp.
19:36:16<shachaf>(let ((/ (lambda () /))) ((/) 8 2))
19:36:16<Adamant>Turing completeness FTW
19:36:30<shachaf>Tac-Work: Besides, it's not a syntax error -- the syntax is fine.
19:36:30<Tac-Work>desp: even better, every language is a subset of every other language
19:36:30<desp>Adamant: expressiveness-wise
19:36:56<ivant>desp, I'd go as far as defining the equivalence classes then
19:37:42<desp>this reminds me to learn template haskell
19:47:44<glen_quagmire>if I want to query for avialable operations on Char, what should I do?
19:48:10<mauke>read the docs for all installed libraries
19:48:14<glen_quagmire>?hoogle Char -> [Char]
19:48:18<lambdabot>No matches, try a more general search
19:48:23<Cale>http://haskell.org/hoogle/?q=Char
19:48:24<lambdabot>Title: Char - Hoogle
19:48:33<mauke>glen_quagmire: show, (: [])
19:49:14<glen_quagmire>oh i thik i need String
19:49:29<Cale>String = [Char]
19:55:07<EvilTerran>@instances Char
19:55:10<lambdabot>Couldn't find class `Char'. Try @instances-importing
19:55:15<EvilTerran>buu
20:15:15<opqdonut>nicest way to check for no duplicates in list?
20:15:22<opqdonut>\xs -> length (nub xs) == length xs -- ?
20:15:39<ari>ap (==) nub
20:15:40<mauke>:t ap (==) nub
20:15:43<lambdabot>forall a. (Eq [a], Eq a) => [a] -> Bool
20:15:57<mauke>stereo!
20:16:09<opqdonut>well yeah that's just nub xs == xs
20:16:13<ari>Incidentally, that's the only place where I know how to meaningfully use ap :(
20:16:28<mauke>:t nub >>= (==)
20:16:29<Cale>ari: ap (,) is also handy
20:16:31<lambdabot>forall a. (Eq a, Eq [a]) => [a] -> Bool
20:16:34<Syzygy->Does that really do it?
20:16:39<Cale>> ap (,) (^2) 5
20:16:39<lambdabot> (5,25)
20:16:52<Cale>> map (ap (,) (^2)) [-10..10]
20:16:52<Syzygy->> (ap (==) nub) [1,2,3,2,4] [4,2,3,2,1]
20:16:53<lambdabot> [(-10,100),(-9,81),(-8,64),(-7,49),(-6,36),(-5,25),(-4,16),(-3,9),(-2,4),(-1...
20:16:53<lambdabot> Couldn't match expected type `t1 -> t' against inferred type `Bool'
20:16:58<Syzygy->No wait.
20:17:01<mauke>> ((^2) >>= (,)) 5
20:17:01<Syzygy->> (ap (==) nub) [1,2,3,2,4]
20:17:03<lambdabot> (25,5)
20:17:05<lambdabot> False
20:17:09<kilimanjaro>I wish I knew what "nub" and "ap" were abbreviations of
20:17:09<Syzygy->Yeah, I guess it does.
20:17:20<Syzygy->kilimanjaro: ap would be apply or application. *guess*
20:17:29<mauke>kilimanjaro: nub isn't an abbreviation AFAIK
20:17:30<Cale>kilimanjaro: nub is not an abbreviation
20:17:43<kilimanjaro>Let me guess, nub is the sound made by the act of nubbing?
20:17:46<byorgey>"ap" is presumably an abbreviation for "apply"
20:17:47<Cale>ap is short for apply
20:17:48<ari>The stereo is strong tonight
20:18:10<byorgey>@go define nub
20:18:14<lambdabot>http://www.thefreedictionary.com/nub
20:18:16<kilimanjaro>Haskell has concise syntax, you guys don't really need to start removing letters from words do you?
20:18:18<conal>ap also opens the way to applicative functors!
20:18:20<Cale>nub n. 3. The heart of a matter; the crux or central point of a discussion, argument, etc.
20:18:36<Olathe>kilimanjaro: y
20:18:48<kilimanjaro>Olathe, :)
20:19:07<mauke>ITYM "k"
20:19:33<Cale>1834 S. SMITH Sel. Lett. J. Downing lxx. 205 That's pretty much the nub of the business. 1859 J. R. BARTLETT Dict. Americanisms (ed. 2) 297 The nub of a story is the point or gist of it. 1899 Scribner's Mag. 25 105/2 It's the nub of the whole matter. 1933 P. G. WODEHOUSE Heavy Weather viii. 166 ‘The problem..is, how the hell is one to get it away from the blighter?’ ‘Quite.’ ‘That is, as you might say, the n
20:19:34<Cale>ub?’ 1974 Times 22 Oct. 14/6 The nub of the judges' difficulty lay in..the claim..that the judge had no authority in law to give a direction binding on the press. 1999 Independent 3 June II. 11/5 Decide on the nub of your idea, then sell it doggedly to the people who you think could help.
20:19:58<Cale>(usage examples :)
20:21:43<Cale>kilimanjaro: the idea is that ap is largely used as an infix operator, so you want it to be short.
20:22:15<Cale>return f `ap` x `ap` y `ap` z is the same as liftM3 f x y z (but obviously gives a generalisation)
20:23:25<conal>as pure f <*> x <*> y <*> z is liftA3 f x y
20:23:53<conal>(oops -- add in the z's)
20:24:03<desp>@pl (\d i j k l -> liftM fromBool (f d i j k l))
20:24:03<lambdabot>((((fmap fromBool .) .) .) .) . f
20:24:04<desp>ugh
20:24:04<conal>liftA3 f x y z
20:24:33<conal>desp: there's a really lovely way to look at that one
20:24:42<desp>conal: huh?
20:24:49<desp>@hoogle liftA3
20:24:50<lambdabot>No matches found
20:24:58<conal>desp: do you know about first & second?
20:25:08<conal>@ty first
20:25:09<lambdabot>forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a (b, d) (c, d)
20:25:13<conal>@ty second
20:25:15<lambdabot>forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a (d, b) (d, c)
20:25:17<conal>@ty (.)
20:25:26<lambdabot>forall b c a. (b -> c) -> (a -> b) -> a -> c
20:25:44<conal>if you specialize first & second to the (->) arrow, then (.) has the same form
20:27:53<conal>it directs functions into the result part of a function. just as first & second direct functions into the fst & snd of pairs.
20:27:58<desp>hmm
20:28:03<desp>so how would this little bit of code look like?
20:28:05<conal>see http://www.haskell.org/haskellwiki/DeepArrow
20:28:05<lambdabot>Title: DeepArrow - HaskellWiki
20:28:15<conal>like ((.).(.).(.).(.)) fromBool f
20:28:20<Syzygy->> first (+2) (2,3)
20:28:20<lambdabot> (4,3)
20:28:21<Syzygy->> second(*3) (2,3)
20:28:21<lambdabot> (2,9)
20:28:22<desp>huh
20:28:27<desp>that certainly does make an interesting graphic pattern
20:28:27<conal>that's why i use "result" as a synonym for (.) in this kind of use.
20:28:31<desp>but I'm not comfortable in using that in this code ;)
20:28:38<desp>s/in/with/
20:28:55<conal>desp: check out DeepArrow. maybe you'll get comfortable. mixing first, second & result in arbitrary compositions makes for a nice way of doing "deep editing" of values.
20:29:04<conal>better yet, it generalizes way beyond functions, to "deep arrows"
20:29:34<desp>as soon as I have some breathing time ;)
20:29:34<conal>and is the theoretical basis of eros
20:29:36<conal>@where eros
20:29:36<lambdabot>http://conal.net/papers/Eros
20:29:39<conal>desp: no prob
20:29:47<desp>functional manipulation of images sounds quite interesting
20:30:20<conal>desp: :) it's a lovely fit. the simplest approach imaginable to image synthesis & manipulation.
20:30:37<conal>and way more expressive than conventional approaches.
20:31:07<falconair>conal, i tried sending you a private message ... basically an apology for not getting back to you about algorithmic trading with app. functors
20:31:51<conal>falconair: hm. i missed your message. no problem. i have lots of stimulating things going on right now. when you're ready, just let me know.
20:32:07<arjanb>falconair: you need to identify with nickserv to be able to send pm's
20:32:19<sorear>falconair: you can only send PMs if you are idnentified OR the target has umode +6
20:33:02<falconair>cool, your work looks very interesting ... the scala folks are also coming out with an FRP framework ... using their for comprehensions
20:33:04<sorear>ACTION has umode +6, gets PMs from everybody, and has never seen one of those spams that supposedly motivated the restriction...
20:33:10<pjd>sorear: ditto
20:35:04<waern>falconair: cool.. have the scala folks built anything on top of that framework also?
20:35:09<conal>btw, has anyone here read "Monads for incremental computing" (http://www.citeulike.org/user/conal/article/1554283 )? it's another precursor to app functors
20:35:09<lambdabot>Title: CiteULike: Monads for incremental computing
20:35:48<conal>falconair: Scala & FRP? do you have a pointer?
20:36:10<falconair>conal: i didn't realize "Monads for incremental computing" was in any way related to app functors...gives m even more reason to check it out ... i read that paper in relation to "Incremental Algorithms" by Johan Jeuring
20:36:34<falconair>sorry, no pointers for Scala FRP yet, the author of the dissertation will be releasing it shortly (I believe)
20:37:06<ivant>?ty ((.).(.).(.).(.))
20:37:08<lambdabot>forall a a1 a2 b c a3. (b -> c) -> (a -> a1 -> a2 -> a3 -> b) -> a -> a1 -> a2 -> a3 -> c
20:37:43<ivant>?ty ((.).(.).(.).(.).(.)
20:37:44<ivant>?ty ((.).(.).(.).(.).(.))
20:37:44<lambdabot>parse error (possibly incorrect indentation)
20:37:48<lambdabot>forall a a1 a2 a3 b c a4. (b -> c) -> (a -> a1 -> a2 -> a3 -> a4 -> b) -> a -> a1 -> a2 -> a3 -> a4 -> c
20:37:57<ivant>aha, I see where it's going
20:38:05<pjd>ivant: yay for the dots
20:38:07<conal>falconair: thanks for the ref. i'll check it out.
20:39:03<conal>ivant: nice, yes??
20:39:05<ivant>ACTION thinks there should be some cute haskell code obfuscater
20:39:18<EvilTerran>it's called pl
20:39:31<conal>?ty (first.(.).second.(.).(.).first)
20:39:31<lambdabot>forall d a d1 a1 a2 b c d2. (b -> c) -> (a -> (d1, a1 -> a2 -> (b, d2)), d) -> (a -> (d1, a1 -> a2 -> (c, d2)), d)
20:39:53<pjd>dot (dot3, dot4 etc.) should be standardized
20:39:59<EvilTerran>@pl \xs ys -> map (zip xs . repeat) ys
20:39:59<ivant>EvilTerran, no, @pl is often easy and it doesn't obfuscate complete programs
20:39:59<lambdabot>map . (. repeat) . zip
20:40:02<conal>> let result = (.)
20:40:03<lambdabot> Parse error
20:40:06<byorgey>@. unpl pl \x y -> y y x
20:40:08<lambdabot>(\ b c -> ((\ d -> d) >>= \ e -> e) c b)
20:40:11<falconair>conal: no problem, I've been trying to convince Johan to put out a functional pearl using his techniques...the paper I mentioned earlier is quite old and the notation is very difficult to read
20:40:12<EvilTerran>that was a joke...
20:40:17<Cale>It would be nice to have a Mathematica-frontend-like Haskell environment.
20:40:31<EvilTerran>@let result = (.) -- conal
20:40:38<byorgey>how about unpl . pl ? =)
20:40:40<lambdabot>Defined.
20:40:40<conal>falconair: thanks for the warning.
20:40:42<conal>EvilTerran: thanks!
20:40:44<xerox>Cale: definitely.
20:40:49<waern>Cale: yes!
20:40:59<EvilTerran>> result (*2) (+1) 6
20:40:59<lambdabot> 14
20:41:02<conal>?ty first.result.second.result.result.first
20:41:04<lambdabot>Not in scope: `result'
20:41:04<lambdabot>
20:41:04<lambdabot><interactive>:1:20: Not in scope: `result'
20:41:13<Cale>Especially with the new "UI controls as values" approach. :)
20:41:14<conal>hm
20:41:17<EvilTerran>ah. yeah, ?type can't see ?let'd stuff
20:41:27<Cale>I wonder how much trouble we'd be in to steal that idea :)
20:41:59<monochrom>ACTION contemplates Haskell programming using Wii and PS3 input devices, a la Mathematica.
20:42:05<Cale>:)
20:42:06<conal>why doesn't 'result' work?
20:42:30<Cale>hmm, is @let broken?
20:42:31<xerox>?type result=(.) in first.result.second.result.result.first
20:42:33<lambdabot>parse error on input `='
20:42:33<conal>Cale: "the new "UI controls as values" approach. " ?
20:42:37<xerox>let :)
20:42:56<kaol>ACTION considers using MaybeT in his code, just for the heck of it (monad transformers, eek, never used those before)
20:43:13<Cale>conal: Are you generally familiar with mathematica?
20:43:16<EvilTerran>Cale, i think someone's done something like that for haskell. built on top of wxHaskell, iirc.
20:43:28<ivant>Cale, the bad thing about Mathematica frontend is that the editor there is not very good for writing programs. Although it is nice for typing mathematical expressions
20:43:41<conal>Cale: i used it a bunch in 1989 but not much since
20:43:43<xerox>ivant: it got really better in this last version. Really.
20:43:45<Cale>ivant: It's gotten much better in that regard lately.
20:44:00<kaol>am I right in thinking that IO can be the inner monad?
20:44:06<Cale>ivant: It even colours variables differently depending on whether they're free or bound.
20:44:17<conal>Cale: does it have functional UIs?
20:44:26<ivant>xerox, Cale, is it any better on linux now? it was completely unusable when it was, I think, 5.2
20:44:28<Cale>conal: It has something which is very FRP-like
20:44:42<xerox>ivant: yup.
20:44:48<conal>Cale: oh, yeah. some kind of dynamic values that propagate.
20:45:16<conal>Cale: and tie in to UIs.
20:45:18<monochrom>Yes kaol. I use "CCT r IO a" all the time. "CCT" is the delimited continuation monad transformer. (package CC-delcont)
20:45:20<ivant>anyway, I switched from Mathematica to Haskell for writing my thesis anyway
20:45:37<xerox>ivant: the synhl for example is quite advanced, arguments change color as they are bounded or not. Visual hints for missing arguments, and so on.
20:45:46<Cale>conal: As the simplest possible example, if you evaluate Dynamic[x] in the frontend, it will appear to evaluate to the current value of x, but what's really there is a box which the frontend keeps updated automatically with the present value of x.
20:45:56<EvilTerran>Cale, have you seen Phooey?
20:46:00<Cale>EvilTerran: yep
20:46:12<ivant>xerox, in 5.2 the frontend was so buggy I couldn't even use it
20:46:14<conal>?type let result=(.) in first.result.second.result.result.first
20:46:16<lambdabot>forall d a d1 a1 a2 b c d2. (b -> c) -> (a -> (d1, a1 -> a2 -> (b, d2)), d) -> (a -> (d1, a1 -> a2 -> (c, d2)), d)
20:46:35<ivant>xerox, I mean, on linux. It was completely screwed up
20:46:46<Cale>conal: This scales all the way up to things like plots. There are also controls, which take Dynamic values as parameters in order to manipulate the values which they view.
20:46:48<augustss>@djinn (b -> c) -> (a -> (d1, a1 -> a2 -> (b, d2)), d) -> (a -> (d1, a1 -> a2 -> (c, d2)), d)
20:46:49<lambdabot>f a (b, c) =
20:46:49<lambdabot> (\ d ->
20:46:49<lambdabot> case b d of
20:46:49<lambdabot> (e, f) -> (e,
20:46:49<lambdabot> \ g h ->
20:46:51<lambdabot> case f g h of
20:46:54<lambdabot> (i, j) -> (a i, j)),
20:46:58<lambdabot> c)
20:47:03<xerox>ivant: on osx now the ui is native, on linux it is probably not, but mixes nicely
20:47:05<conal>there we go. see how the string of first etc give a path in the type saying exactly where to direct a function.
20:47:05<EvilTerran>crikey.
20:47:13<conal>augustss: howdy!
20:47:22<augustss>Hi Conal
20:47:37<Cale>For example, Slider[Dynamic[x], {0,1}] will give a slider control which manipulates the present value of x.
20:47:47<conal>about Phooey: i'm drastically simplifying the implementation and removing the arrows interface and maybe the monad one.
20:48:14<ivant>xerox, I recall they used motif or something on linux
20:48:15<SamB>xerox: by native do you mean "not written in Java"?
20:48:18<Cale>Controls like that are first class values, and can be manipulated in the same ways that all expressions can.
20:49:12<ivant>SamB, I wish they had the frontend implemented in Java. At least then I could make it work on my linux laptop
20:49:20<ivant>s/could make/could have made/
20:49:29<SamB>what other non-native ways are there to write it?
20:49:52<conal>Cale: does mathematica separate controls and time-varying values cleanly? for instance, let s = slider (...) in s + s. one slider or two?
20:49:57<ivant>SamB, write UI engine from scratch, I guess
20:50:37<SamB>conal: I don't think you can do that cleanly without purity...
20:50:57<Cale>conal: You'd get two sliders manipulating the same value. Actually, heh, you'd get 2 <slider>
20:51:05<SamB>heh
20:51:22<Cale>(because + is normal addition, and mathematica simplifies the expression blindly)
20:51:29<SamB>why wouldn't it be 2<slider>
20:51:29<conal>SamB: oh, i see. the dynamic is an argument to Slider, saying what it's to side-effect. :P
20:51:35<Cale>right
20:51:42<xerox>SamB: like this, hang on
20:52:17<conal>Cale: which simplification would be mistaken.
20:52:41<conal>i don't know how to clean up that confusion w/o monads, AFs, or arrows.
20:53:05<kaol>hmm? is there no MaybeT in ghc 6.6.1's libraries?
20:53:17<kaol>or am I looking at the wrong places...
20:53:21<SamB>ivant: how is writing a toolkit from scratch any less native than ... well, anything?
20:53:24<xerox>SamB <http://img403.imageshack.us/my.php?image=plotow2.png>
20:54:04<samreid>kaol: no. But http://www.haskell.org/haskellwiki/New_monads/MaybeT
20:54:04<lambdabot>Title: New monads/MaybeT - HaskellWiki
20:54:10<Cale>http://cale.yi.org/autoshare/Screenshot-Dynamic.png -- like this, as you drag the slider, the 3D plot updates in real-time.
20:54:31<xerox>:)
20:54:48<conal>Cale: very nice. :)
20:54:50<ivant>SamB, I wouldn't call UI native if it has its own window-/controls-drawing engine (as well as different user interaction behaviour)
20:55:18<ivant>oh, cool
20:55:24<SamB>ivant: ALL guis on Linux have this to some extent or other...
20:55:36<conal>btw, more cheerleading for AFs. we don't need AF transformers, because AFs compose, unlike monads.
20:56:00<ivant>SamB, except for console-based programs (which are not gui-based, though)
20:56:23<SamB>even aptitude!
20:56:24<conal>with monads, we have Reader & ReaderT, Writer & WriterT, etc. with AFs, just g `O` f.
20:56:39<ivant>xerox, is it still hell to debug complex Mathematica programs?
20:56:49<xerox>ivant: they seem to have a debugger.
20:56:53<monochrom>Evail.
20:57:09<wolverian>AF?
20:57:20<conal>applicative functor
20:57:38<ivant>xerox, they had Debug functions since, maybe 2.2 or even earlier, but they were completely unusable for any non-trivial purposes
20:57:39<wolverian>thanks :)
20:58:30<xerox>ivant: I'm not sure, ever debugged anything in Mathematica.
20:58:55<ivant>xerox, that's one of the reasons I switched to haskell
20:59:24<ivant>xerox, in haskell we have a cool type-checker
20:59:30<xerox>ACTION makes a screencast :)
21:00:06<ivant>ACTION waves hand hoping to get into the screencast
21:00:50<Cale>ivant: I mostly do functional programming anyway, so there's not much use for a debugger there.
21:02:01<ivant>Cale, so did I, but Mathematica is very sloppy in returning corner-case results, thus it was sometimes hard to track down, at what place exactly I get an empty list/head application
21:02:15<conal>Cale: not a run-time debugger anyway. ;)
21:02:34<Cale>yeah
21:02:51<Cale>The evaluation mechanism is really crazy though :)
21:02:52<ivant>Cale, I guess my coding style had some serious problems, but I couldn't come up with a good one, which would provably eliminate such bugs from my code
21:02:57<kaol>ACTION considers using ListT instead since it's already in ghc and it's almost like MaybeT
21:03:13<Cale>kaol: Watch out, sometimes it doesn't produce a monad.
21:04:40<llewyenoh>if i wanted to print the date (in the '+%A %m/%d %r'), should i be using System.Time or Data.Time? and what's the difference?
21:04:49<llewyenoh>*in the format
21:04:53<Cale>Data.Time.Format
21:05:17<llewyenoh>ok, thanks
21:05:28<Cale>The time libraries are fairly comprehensive, but currently are not completely integrated.
21:05:55<Cale>System.Time has the standard (H98) time library with a few small extensions
21:06:15<llewyenoh>ah, i see
21:06:16<Cale>Data.Time has a large number of useful time and date manipulation stuff
21:06:34<Cale>er, things :)
21:06:54<llewyenoh>hm.....
21:06:57<Baughn>I'm probably overlooking something obvious, but - how do I parse a timestamp back in from a string (on 6.6)?
21:07:09<hpaste> dozer pasted "where does Int come from?" at http://hpaste.org/2353
21:07:16<dozer>weird - I'm getting a crazy error
21:07:21<dozer>is it me being dumb (again)?
21:07:43<Cale>getCurrentTime will get you a UTCTime which you can then use the formatTime function on
21:07:53<EvilTerran>@kind Either
21:07:53<lambdabot>* -> * -> *
21:07:59<EvilTerran>Either needs two type parameters...
21:08:10<Cale>EvilTerran: It might be partially applied there
21:08:31<EvilTerran>Cale, not in the type sig for a value, surely?
21:08:32<dozer>of course, but it's partially applied - gets attached to the 'a' of PU a
21:08:40<llewyenoh>what's the difference between parseTime, readTime, and formatTime?
21:08:45<Cale>EvilTerran: PU might take a functor as a parameter
21:09:14<EvilTerran>oh, yeah, i see. i'm silleh.
21:09:31<kosmikus>dozer: what's the type of unpickleDoc?
21:09:55<Cale>llewyenoh: formatTime is for converting times into strings
21:10:07<hpaste> dozer annotated "where does Int come from?" with "with unpickleDoc" at http://hpaste.org/2353#a1
21:10:23<llewyenoh>Cale: so i'm assuming that's the one i want?
21:10:36<Cale>llewyenoh: parseTime and readTime are similar, except that parseTime gives a Maybe t value, whereas readTime will throw an exception if parsing fails.
21:10:39<Cale>llewyenoh: yeah
21:11:01<Cale>llewyenoh: er, similar to each other :) They're for turning strings into times
21:11:18<kosmikus>dozer: is there a non-standard definition of trace in scope?
21:11:39<llewyenoh>Cale: almost like a reverse formatTime?
21:12:21<dozer>kosmikus: possibly - I don't explicitly import one
21:12:26<Cale>llewyenoh: yes
21:13:20<viklund_>Hello! How do I patternmatch a type constructors name?
21:13:32<Cale>viklund_: f TyCon = ...
21:13:49<Cale>viklund_: Or do you mean something else?
21:13:52<wli>ACTION wishes there were a time formatting thing that did the "right thing" for program timings by default.
21:14:10<kosmikus>viklund_: a type constructor is a type, do you mean a data constructor?
21:14:13<viklund_>I don't know yet, need to check the TyCon thing...
21:14:17<viklund_>ahh, yes
21:14:24<dozer>kosmikus: mentioning Debug.Trace.trace explicitly seems to have fixed it - thanks
21:14:32<viklund_>kosmikus: yes
21:14:51<kosmikus>dozer: you're welcome
21:14:51<kosmikus>viklund_: then what Cale said ...
21:14:56<Cale>viklund_: That was just the name of the data constructor to match
21:15:12<Cale>(I probably should have corrected that naming issue as well ;)
21:15:28<Cale>If you have
21:15:33<Cale>data T = A | B | C
21:15:38<Cale>then you can write:
21:15:39<Cale>f A = 5
21:15:43<Cale>f B = 7
21:15:44<Cale>f C = 12
21:15:59<Cale>Or is that not what you mean?
21:16:34<viklund_>Kind of, I have data T = A {stuff} | B {possibly other stuff}
21:16:44<Cale>okay
21:16:45<viklund_>and only want to know if it's an A or a B
21:16:53<Cale>ah, there's a nice trick for that:
21:17:01<Cale>f (A {}) = ...
21:17:05<Cale>f (B {}) = ...
21:17:23<Cale>This is actually permitted, even if you didn't define T using record syntax.
21:17:34<viklund_>Cale: Great! I'll do that then
21:17:41<monochrom>Interesting! Nice.
21:17:54<wli>ACTION usually does f (A _) = ... ; f (B _) = ...
21:18:01<llewyenoh>Cale: do i have to do anything special to get Data.Time.Format?
21:18:04<dozer>ACTION does as well
21:18:15<Cale>wli: The only problem there is that it's annoying if the number of fields changes.
21:18:18<llewyenoh>Cale: since importing it directly doesn't seem to be working
21:18:24<wli>(insert additional underscores as-needed
21:18:24<viklund_>see you later guys!
21:18:40<Cale>llewyenoh: oh...
21:18:45<Cale>llewyenoh: Which GHC version?
21:18:45<wli>Cale: Yes, I see a distinct advantage in the record syntax.
21:18:50<Cale>llewyenoh: It appears to be new.
21:19:01<llewyenoh>6.6
21:19:29<wolverian>possibly you want to install libghc6-time-dev
21:19:31<Cale>ah, Data.Time.LocalTime
21:20:07<EvilTerran>Cale, does that work with parameterless constructors?
21:20:09<Cale>EvilTerran: yeah
21:20:14<monochrom>nullity
21:20:23<ari>> 0/0
21:20:28<lambdabot> NaN
21:20:45<ari>> 0^0
21:20:45<lambdabot> 1
21:21:12<llewyenoh>Cale: ah, ok, it finds that, but i'm having trouble figuring out what to pass to formatTime
21:21:20<Cale>I really like that Haskell largely gets 0^0 right. (Modulo issues with Complex)
21:21:40<SamB>Cale: I think that's probably a bug
21:21:43<sjanssen>> 0**0
21:21:45<lambdabot> 1.0
21:21:56<sjanssen>> 0**0 :: Complex Double
21:22:01<lambdabot> NaN :+ NaN
21:22:07<sjanssen>> 0^0 :: Complex Double
21:22:09<roconnor>> exp (log 0 * 0)
21:22:09<lambdabot> 1.0 :+ 0.0
21:22:10<lambdabot> 1.0
21:22:10<Cale>http://www.haskell.org/ghc/docs/6.6/html/libraries/time/Data-Time-LocalTime.html#v%3AformatTime
21:22:13<lambdabot>http://tinyurl.com/24m4h5
21:22:17<roconnor>> exp (log 0 * 0)
21:22:18<lambdabot> 1.0
21:22:18<SamB>Cale: unless that's actually ambiguous?
21:22:24<roconnor>awsome!
21:22:25<Cale>SamB: It's a spec-bug.
21:22:41<SamB>Cale: spec bugs are bugs too
21:22:43<Cale>right :)
21:22:49<Cale>They're just worse
21:23:01<SamB>yes
21:23:03<llewyenoh>Cale: right, but where can i get a timelocale?
21:23:06<SamB>because you have to argue intent!
21:23:41<Cale>llewyenoh: If you click on TimeLocale there, you'll be sent to the documentation for that, and you should see defaultTimeLocale :: TimeLocale
21:23:43<SamB>and if the committee is gone, that can also be problematic
21:24:23<llewyenoh>Cale: oh, my bad. thanks
21:28:05<dozer>@hoogle arrL
21:28:05<lambdabot>No matches found
21:28:24<dozer>:(
21:28:40<Cale>And now... a definition from "The Age of Wire and String".
21:28:50<Cale>Rare Waters, The: Series of liquids containing samples of the first water. It is the only water not yet killed. It rims the eyes, falls from them during certain times, and collects at the feet, averting the clasp of hands, which are dry, and need it.
21:29:38<monochrom>Is that a haskell program trying to get out.
21:31:56<reffie>only the mediocre man is always at his best
21:34:23<Cale>Rhetoric: The art of making life less believable; the calculated use of language, not to alarm but to do full harm to our busy minds and properly dispose our listeners to a pain they have never dreamed of. The context of what can be known establishes that love and indifference are forms of language, but the wise addition of punctuation allows us to believe that there are other harms -- the dash gives the reader a cle
21:34:23<Cale>ar signal that they are coming.
21:35:20<monochrom>Does anyone know what is happening to Cale's computer? Is it gaining self-consciousness?
21:35:28<lament>cale is trying to fail the turing test
21:35:28<Cale>This is a great book. :)
21:35:41<llewyenoh>could someone tell me what i'm doing wrong here?: http://hpaste.org/2354
21:36:01<Cale>llewyenoh: getCurrentTime is an action, you have to run it
21:36:11<greenrd>Cale: Did you by any chance find it while searching for boxes and bananas?
21:36:14<Cale>llewyenoh: do t <- getCurrentTime
21:36:20<Cale>and then putStrLn $ ...
21:36:30<EvilTerran>main = putStrLn . formatTime defaultTimeLocale "+%A %m/%d %r" =<< getCurrentTime
21:36:40<llewyenoh>oh, i see
21:36:52<llewyenoh>thanks, both of you
21:37:16<EvilTerran>greenrd, sounds like a monad tutorial in the making ;]
21:37:19<lament>getAncientTime
21:37:29<Cale>haha
21:38:00<Cale>getCurrentThompson
21:38:08<dozer>woot! I have a version of XmlPickle that reports errors on deserialization!
21:40:58<Cale>greenrd: The whole book is written as a sort of report on aspects of a universe a few milligrams away from our own. The passages have the overall style of making sense, but it's as if the words are not content to mean what they usually mean, though they preserve many of their existing relationships to one another.
21:41:32<greenrd>I see
21:41:36<dozer>sounds like a certain category of novel
21:42:04<sieni>Cale: a few milligrams of acid perhaps?
21:42:12<greenrd>so you are looking for isomorphisms? ;)
21:42:12<Cale>sieni: that was the idea, yeah
21:43:32<Cale>There might not actually be a direct translation, but just reading the passages without thinking about them too closely has a kind of dreamlike aspect to it through which meaning is still conveyed.
21:46:01<Cale>I suspect it's sort of an elegy to the author's brother.
21:48:51<llewyenoh>why does %S return a number with decimal points after it?
21:49:05<llewyenoh>isn't that the one that truncates the decimal?
21:49:45<Cale>hmm
21:50:16<Cale>that's a good question...
21:50:38<Botje>ooh, i bugrepped that
21:50:49<llewyenoh>so it's actually a bug?
21:50:53<SamB>Text.Printf doesn't follow printf(3) very well yet
21:50:57<Botje>apparently you're supposed to use a package on hackage instead of the GHC-provided one
21:51:08<llewyenoh>ah, ok
21:51:08<Cale>ah
21:51:12<Botje>(time, iirc)
21:51:33<SamB>oh, that's for time?
21:51:34<SamB>sorry.
21:51:47<shapr>I wonder if GHC will build on the Tilera cpu...
21:53:50<EvilTerran>anyone else about who's familiar with the "data types a la carte" paper?
21:55:47<ddarius>"we are on a bit of a sticky wicket"
21:55:48<lambdabot>ddarius: You have 1 new message. '/msg lambdabot @messages' to read it.
21:57:32<EvilTerran>ACTION notices that his prime factor finding program is still crunching away, severl hours after he started it
21:59:06<EvilTerran>so much for trying to factorise a certain hex number starting 09F9... I can't even remember why i wanted to do that; i just found a bit of haskell that did it in my dumping folder and spotted the memory leak that meant it died after a few minutes.
21:59:26<EvilTerran>...and so, having fixed that, ran it again. ;]
22:00:39<EvilTerran>looks like it's been running full-tilt on one of my processors since then
22:02:04<xerox>puff, pant, done.
22:02:26<xerox>Now, where to upload a video...
22:02:49<SamB>video?
22:03:00<xerox>Right.
22:03:20<SamB>what video?
22:03:25<xerox>A screencast.
22:03:52<SamB>how about google videos?
22:03:54<wli>EvilTerran: What algorithm?
22:04:12<xerox>Oh well.
22:05:24<xerox>http://darcs.haskell.org/( {
22:05:24<xerox>http://darcs.haskell.org/ {-1.1, 0.9},
22:05:24<xerox> {-1.4, 0.3}
22:05:26<xerox> } )ops
22:05:27<lambdabot>Title: Index of /
22:05:28<xerox>...ops.
22:06:51<ddarius>EvilTerran: So far Data Types a la Carte looks like a collection of well-known folklore.
22:09:58<damg>what's the right way to convert an Integer to an Int?
22:10:15<pjd>fromInteger?
22:10:36<damg>ah, thank you very much
22:10:51<pjd>the result can actually be any Num instance
22:11:27<ddarius>fromIntegral
22:13:53<damg>thank you
22:16:16<phobes>Has anyone looked at augustss' post on quick sort?
22:16:24<phobes>http://augustss.blogspot.com/2007/08/quicksort-in-haskell-quicksort-is.html
22:16:29<lambdabot>Title: Things that amuse me, http://tinyurl.com/2hq6cn
22:21:11<mrd>phobes: what about it?
22:26:21<greenrd>He's right you know.
22:26:42<greenrd>The commonly-given example of quicksort in Haskell, isn't quicksort.
22:27:27<wli>Eratosthenes likewise.
22:27:30<bluestorm>:]
22:27:58<DRMacIver>There is indeed an alarmingly large proportion of blatant lies among the common "Look, isn't Haskell awesome!!" examples given to newbies. ;)
22:28:17<SamB>DRMacIver: I thought the sieve thing was just ignorance
22:28:26<bluestorm>hm
22:28:28<DRMacIver>SamB: Well, probably. A lot of them are. :)
22:28:47<SamB>blatant lies are a lot different from ignorance
22:28:55<bluestorm>the sieve one is dangerous because the complexity completely changes
22:28:55<ray>that's because if you show people real awesome things, they won't know what you're talking about!
22:28:58<DRMacIver>SamB: Ok. blatant untruths.
22:28:58<bluestorm>but isn't this one harmless ?
22:29:10<SamB>but I think we all realize the quicksort isn't quite the same
22:29:24<augustss>but not all realize it
22:29:37<bluestorm>i mean, maybe it isn't a "in-place array qsort" but it has the good complexity and feature most of the qsort ideas anyway, doesn't it ?
22:29:38<ray>maybe it should be called quickishsort
22:30:14<ddarius>Here's my somewhat direct translation http://www.haskell.org/haskellwiki/Introduction/Direct_Translation
22:30:21<DRMacIver>(Other common untruths including the standard burbling about memoising, CSE and automatic parallelisation)
22:30:23<lambdabot>Title: Introduction/Direct Translation - HaskellWiki, http://tinyurl.com/ytokyh
22:30:41<ihope>I think this shift/reset implementation is pretty simple.
22:30:52<ihope>Apart from the obvious nontermination in reset.
22:31:00<mrd>bluestorm: not really
22:31:17<ihope>...Well, that's not a non-simplicity so much as an inaccuracy. But I'll have to terminate it somewhere.
22:31:18<mrd>first of all, quick sort requires a randomized pivot
22:31:56<bluestorm>hm
22:32:04<mrd>otherwise the worst-case is not guaranteed to be O(nlogn)
22:32:09<bluestorm>aren't you talking of randomized quickosrt ? ^^
22:32:11<bluestorm>hm
22:32:27<bluestorm>randomized quicksort isn't guaranteed to be O(nlogn)
22:32:33<DRMacIver>Surely randomising something can't change the *worst case* guarantee.
22:32:36<augustss>mrd: you can't guarantee O(n log n) even with a random pivot
22:32:43<SamB>oracle!
22:32:46<augustss>you could pick the wrong one all the time
22:32:55<mrd>you can on average
22:32:56<DRMacIver>Because you can always have bad luck and choose exactly the wrong pivot. :)
22:32:58<mrd>this is weird sounding
22:33:11<mrd>saying things like that is not how you do randomized analysis
22:33:27<augustss>you said worst case
22:33:28<DRMacIver>You're talking about *expected* time. That's not the same as worst case...
22:33:31<SamB>mrd: well if you want to be stastical you better use a real RNG
22:33:44<SamB>and, yeah, that's not worst case anymore, it's true
22:33:49<DRMacIver>By virtue of meaning something completely different. :)
22:33:49<monochrom>ihope: how could you manage to get reset to nonterminate?!
22:33:58<mrd>an attacker cannot figure out the worst case input of a randomized quick sort
22:34:07<bluestorm>yes, but it exists, still
22:34:15<SamB>mrd: that would be where you are wrong
22:34:18<augustss>attacker? We're talking worst case here
22:34:22<mrd>ignoring pseudo random problems
22:34:22<SamB>the attacker is allowed to use an oracle ;-)
22:34:39<monochrom>Pointfree debates.
22:34:46<augustss>yes
22:34:51<ddarius>mrd: Having qsort run O(n^2) is hardly a DoS attack.
22:34:54<samreid>If oracles are possible, then the RNG could use a counter-oracle.
22:35:06<SamB>actually, the attacker is allowed to destroy all universes not giving the worst case
22:35:19<DRMacIver>> fix ("you're wrong! No, " ++)
22:35:19<bluestorm>:p
22:35:25<bluestorm>"complexity theory : a game semantic"
22:35:26<lambdabot> "you're wrong! No, you're wrong! No, you're wrong! No, you're wrong! No, you...
22:35:32<DRMacIver>monochrom: Something like that? :)
22:35:38<monochrom>hahahaha
22:35:48<LoganCapaldo>counter-oracle
22:35:50<LoganCapaldo>hehehhe
22:36:14<mrd>the O(nlog n) on randomized quicksort is a worst-case expected time bounds
22:36:22<SamB>@remember DRMacIver <monochrom> Pointfree debates. <DRMacIver> > fix ("you're wrong! No, " ++)
22:36:22<lambdabot>Done.
22:36:22<LoganCapaldo>I'm going to have to find a way to use that in normal conversation
22:36:53<monochrom>the oracle destroys all non-worst case worlds. the counter-oracle destroys all worst case worlds. what is left?
22:37:08<ddarius>Peace and quiet.
22:37:31<monochrom>I guess. No more pointfree debates.
22:37:32<ray>> fix error
22:37:34<lambdabot> Exception: <<loop>>
22:37:35<SamB>monochrom: the fact that both are imaginary?
22:37:44<SamB>ray: hahahaha
22:37:51<monochrom>hhahahahaha
22:37:52<ray>it's a lot more impressive in ghci
22:38:06<LoganCapaldo>Wait, I haven't done the fix error thing in the channel?
22:38:25<LoganCapaldo>I so made that joke a while a go
22:38:28<LoganCapaldo>to myself
22:38:30<LoganCapaldo>alone
22:38:30<SamB>ray: it's funnier here
22:38:31<ray>i'm sure you've fixed plenty of errors
22:38:31<LoganCapaldo>apparently
22:40:08<mrd>the recurrence relation for randomized quick sort is: T(n) = (n-1) + (1/n) \sum_{i=0}^{n-1}{ T(i) + T(n-i-1)).
22:40:11<SamB>ray: though there is a certain amount of humour involved in having the exception handler repeatedly re-raise the same exception...
22:40:12<mrd>when you solve a closed form for that you get T(n) <= cn ln n
22:42:05<mrd>and ddarius, you'd be surprised. one time I compared a naive deterministic qsort to a randomized in-place version, and the difference was something like 2 orders of magnitude.
22:42:21<augustss>mrd: I agree for expected time. I don't know what you are really arguing about :)
22:42:32<mrd>it's expected worst-case time
22:42:40<ray>that introduction page compares lazy evaluation to unix pipes, completely sidestepping the issue of #%)&*@ buffering
22:42:55<SamB_XP>mrd: asymptotic worst-case time
22:43:17<augustss>mrd: yes. But there is still a sequence that will give you O(n^2)
22:43:46<wli>There's always heapsort for determinism.
22:43:48<LoganCapaldo>This is why we just need to use radiix sort for everything
22:43:54<LoganCapaldo>O(n) all the way
22:43:58<samreid>lies
22:43:58<LoganCapaldo>or counting sort
22:44:09<DRMacIver>How about we stop using terms which we obviously can't agree on and instead go to definitions...
22:44:17<augustss>O(n), but for a different way of measuring n
22:44:38<monochrom>Like, is non-termination a side-effect?
22:44:57<augustss>good question!
22:44:58<LoganCapaldo>I know, defining the ordering to be the order the container is in. then you get O(1) sorting
22:45:39<monochrom>ACTION notes down: do not use "natural numbers" when DRMacIver is around...
22:45:57<mrd>augustss: that's like saying "well, quantum theory predicts that you could teleported to timbuktu. the chance is only one in two hundred gazillion"
22:46:35<ihope_>What's radix sort O(n) in?
22:46:36<augustss>mrd: I'd agree with that statement
22:46:38<monochrom>the number of things to be sorted
22:46:42<DRMacIver>monochrom: I'm only saying this because they're obviously talking past eachother when I'm sure if they just defined their terms there would be no argument. ;)
22:46:49<augustss>ihope: number of bits in the input
22:46:59<ray>logancapaldo: i'll implement that one in a library for you
22:47:07<ihope_>And already I've been given two different answers.
22:47:51<monochrom>The two answers are proportional to each other, for each thing to be sorted has a fixed number of bits.
22:48:34<monochrom>I mean all the things have equal number of bits.
22:48:45<samreid>As you grow the number of distinct elements to be sorted, the number of bits grows as log(n).
22:48:57<mrd>number of buckets, basically
22:49:27<wli>There's also proxmapsort.
22:50:08<SamB_XP>monochrom: OPTION BASE 0
22:50:43<monochrom>Please don't remind me of BASIC. :)
22:50:53<mrd>monochrom: epigram talks about a monadic approach to general recursion, istr
22:51:58<monochrom>Interesting!
22:53:10<alar>ACTION doesn't understand how general recursion can be approached with a monad
22:53:28<Cale>alar: hmm?
22:53:51<augustss>alar: the simple answer, take general recursion out of the language and then provide fix in a monad
22:54:12<Cale>oh, I was missing context :)
22:54:12<mrd>:t mfix
22:54:15<lambdabot>forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a
22:55:26<DRMacIver>I'm not sure I follow what the monad operations would be...
22:55:41<DRMacIver>Oh, is it just the identity monad with mfix attached?
22:55:44<ddarius>DRMacIver: It's just the identity monad.
22:55:57<DRMacIver>That's less exciting than I imagined. :)
22:56:12<alar>augustss: do you mean "IO" monad? or something that encapsulates "outside world"
22:56:12<ddarius>Though semantically it adds a "point".
22:56:34<DRMacIver>(I suppose it couldn't be anything else though)
22:56:37<DRMacIver>Ah, undefined?
22:56:41<augustss>alar: no, just a monad with fix. like the identity monad with fix
22:56:45<Korollary>alar: iirc, not just IO
22:56:48<ddarius>DRMacIver: Yes.
22:56:55<xerox>DRMacIver: many monads are MonadFix.
22:57:16<alar>ACTION doesn't understand why monad is the right place to define fix
22:57:58<ddarius>alar: It isn't necessarily, but it was effectively the monad Moggi was first looking at before he came to Notions of Computation.
22:58:07<augustss>alar: it might not be the "right" way. but this way, if you ever use fix you'll have a monadic type. so you know that if there's a possibility of non-termination you'll have this monadic type
22:59:15<Korollary>augustss: but, how do you take general recursion out of haskell? Doesn't its type system allow me to write my own fix?
22:59:24<alar>ACTION understands now
22:59:36<alar>augustss: thank you
22:59:54<ddarius>Korollary: Only with recursive types.
23:01:10<Korollary>ddarius: so I still have general recursion on lists
23:01:11<augustss>Korollary: you'd have to restrict recursive types too
23:01:34<llewyenoh>can anyone tell me what function/libraries i need to use to set a timezone on a timelocale?
23:01:50<Saizan>> let x = x in x -- is this recursive?
23:01:51<lambdabot> Exception: <<loop>>
23:02:00<ddarius>Saizan: Clearly.
23:02:03<mrd>@src fix
23:02:03<lambdabot>fix f = let x = f x in x
23:02:03<augustss>Saizan: yes
23:03:04<Saizan>:t let x = x in x
23:03:08<lambdabot>forall t. t
23:03:21<augustss>Korollary: many recursive types are ok. there are simple syntactic restrictions that give you many of the ok ones
23:03:28<Saizan>ehm, as a type?
23:04:28<augustss>Korollary: Haskell is clearly too far down the general recursion track to go back. but in a new design you could
23:05:14<wli>What's this for? Termination analysis?
23:05:40<ddarius>@users
23:05:42<lambdabot>Maximum users seen in #haskell: 411, currently: 380 (92.5%), active: 22 (5.8%)
23:05:54<alar>yes, there is implicit fix in "let"
23:07:13<Korollary>I suppose you can have that monad now and leave the responsibility of not using GR outside that monad to the users like the proof of monad laws for instances.
23:08:29<augustss>wli: it's for stamping out the evil General Recursion! :)
23:09:21<llewyenoh>how can i get the equivalent output of the UNIX date command in haskell? getClockTime returns UTC, i believe. the timezones are not applied.
23:09:38<monochrom>Recall that in djinn the type "a -> b" means also a function that terminates.
23:10:14<rc-1>http://paste.lisp.org/display/46447 check at bottom what this could be replaced with :)
23:10:22<Korollary>llewyenoh: System.Time has some formatting functions iirc
23:10:26<pjd>stupid question: what's an example use of the MonadFix List instance?
23:10:36<sieni>llewyenoh: have you tried googling "unix date haskell"?
23:10:43<pjd>i tried to wrap my head around it yesterday without too much success
23:11:26<llewyenoh>sieni: yeah, but for some reason, mine's not taking a timezone
23:11:29<ihope>Well, here's my completely untested shift/reset implementation, complete with nontermination in reset: http://pastebin.ca/664947
23:11:58<llewyenoh>sieni: i already have a date being printed out, it's just in the wrong timezone
23:13:09<Liskni_si>well, getClockTime returns the unix timestamp, more or less. there's no timezone in it at all, of course
23:13:26<llewyenoh>Liskni_si: right, so how can i apply one?
23:13:43<llewyenoh>Liskni_si: besides manually adding through addUTCTime, i mean
23:14:23<Liskni_si>llewyenoh: the toCalendarTime should be the equivalent of localtime(3)
23:15:18<llewyenoh>Liskni_si: ah, there we go.
23:17:48<ddarius>pjd: I find using the mdo syntax more illuminating than using mfix directly.
23:27:52<phobes>My reason for citing augustss' article was that I think that kind of code is a good example of why you should have macros in Haskell :)
23:28:40<phobes>Compare that implementation to an implementation of quicksort in an imperative language ... it has alot of complicated plumbing
23:28:55<phobes>(maybe not too complicated, but quick a bit of plumbing anyway)
23:29:27<phobes>And I'm not sure there's anything more general about it than what could be extracted from an implementation in the imperative language
23:30:04<ddarius>phobes: That code is specifically designed to look like and mimic the imperative code.
23:30:27<phobes>ddarius: but imperative code isn't that ugly :)
23:30:50<Tac-Tics>that depends
23:30:55<phobes>with macros you could hide alot of the plumbing there
23:31:25<ddarius>augustss: By the way, why not uncurry qsort'?
23:32:33<ddarius>phobes: The plumbing of the algorithm or the plumbing of the "look like C-ness"?
23:32:56<phobes>well, like ... "iLTj = i < (j :: E m i)"
23:33:30<phobes>I had to stop and scratch my head to figure out what was going on
23:34:58<phobes>I'm sure that's largely just Haskell inexperience, but I don't see any value added by this syntax compared to an imperative language...
23:35:25<lament>augustss: the formatting on your blog is broken for me (firefox), by the way
23:35:33<phobes>It's like an embedded imperative DSL with bad syntax
23:35:36<dolio>The value is that you get to write most of your code in Haskell.
23:35:42<SamB>phobes: well there isn't really any when we're just writing imperative code...
23:35:53<ddarius>phobes: It's not trying to add value it's -only- trying to look like C. Nevertheless it does add value, albeit not necessarily with respect to a decent imperative language.
23:36:32<phobes>Sorry, I think I'm not communicating my point well - I understand the advantages of Haskell over the imperative language, even in this case
23:36:47<phobes>you've encapulated the mutation
23:37:11<phobes>but if you added macros to Haskell, it looks like you could have a *nice* embedded DSL for imperative code that had the same properties as that code
23:37:30<phobes>except with more sane syntax for imperative work
23:37:32<SamB>you may overestimate macros ;-)
23:37:33<dons>isn't it just a fun exercise in how far you can push embedded syntax?
23:37:45<Korollary>dons: not fun
23:38:04<ddarius>ACTION agrees with both SamB and dons on this.
23:38:14<dolio>What was wrong with the line you posted? Are macros going to infer the type that GHC doesn't?
23:38:52<dons>it is slightly common to add new syntax with a preprocessor, btw. harp does that (the fancy regex library)
23:39:33<alar>dons: I'm sure I can't push embedded syntax farther than Oleg does
23:39:35<phobes>dolio: Think what that code would look like in an imperative language and you'll see the difference
23:39:48<dons>alar: :)
23:40:06<dolio>You mean 'iLTj = i < j'?
23:40:57<ddarius>phobes: In most imperative languages that would look like 'iLTj = i < j' modulo any type annotation that may be necessary.
23:41:04<DukeDave>Hey team, can anyone (karma on offer!) suggest a reason why hugs would complain "Ambiguous variable occurrence" cite 'Hugs.Prelude.or' as the other 'or' when I've got 'import Hugs.Prelude hiding or'... It troubles me :|
23:41:12<phobes>Aren't i and j _integers_?
23:41:23<phobes>Indices
23:41:50<phobes>Any decent imperative language wouldn't have any trouble inferring the type of those variables
23:42:12<phobes>The way monads are typed in Haskell isn't really that strong I think
23:42:16<dolio>It wouldn't? How much type inference does C do?
23:42:24<phobes>decent****
23:42:31<phobes>I did say decent
23:42:46<dolio>So, that's, what? C# 3.0?
23:42:53<SamB>and which ones are decent?
23:43:14<phobes>So I don't actually want to claim a decent one exists
23:43:25<phobes>But haskell with nice syntax would probably be a good start
23:43:27<SamB>C# 3.0 is the only one I've heard of that meets this restriction, yes...
23:43:36<ddarius>Haskell does have nice syntax.
23:43:38<phobes>C++ 0x has auto
23:43:44<EvilTerran>DukeDave, have you tried it in ghc too?
23:43:50<phobes>IMO Haskell doesn't have nice syntax for imperative work
23:44:04<phobes>I do really like Haskell's syntax for functional code
23:44:12<ddarius>Haskell is not an imperative language.
23:44:15<dons>phobes: i think that's uncontested -- the syntax is optimised for functions
23:44:18<DukeDave>EvilTerran, all, just sorted, apparently List exports 'or' as well :|
23:44:37<phobes>I seem to recall someone (SPJ) saying that "haskell is the best imperative language in the world"
23:44:39<EvilTerran>yeah, i was about to suggest hiding Data.List.or too
23:44:42<dons>not mutable updates. and mutation is considered fundamentally unsound
23:44:51<dons>so the lightest syntax, whitespace and . is given to composition and appication of functions
23:44:52<ddarius>phobes: That's not contradictory...
23:44:57<phobes>ddarius: true
23:45:05<Tac-Tics>"return" isn't a good name either for the monad function
23:45:16<Tac-Tics>once you realize "monads are sorta like imperative"
23:45:20<dons>safest, most flexible, was the point I think. (first order actions! programmable monadic effects)
23:45:24<Tac-Tics>it's easy to mess up with "return"
23:45:32<SamB>Tac-Tics: ... so?
23:45:37<EvilTerran>what about such things as http://augustss.blogspot.com/2007/08/programming-in-c-ummm-haskell-heres.html, ddarius? ;]
23:45:37<lambdabot>Title: Things that amuse me, http://tinyurl.com/2948p6
23:45:51<phobes>I can follow that ... but it's kind of far from the most convenient for many imperative programming tasks
23:46:33<lament>Tac-Tics: brown is not a good color for a bike shed.
23:46:47<Tac-Tics>return doesn't return anything
23:46:52<Tac-Tics>it packs it
23:46:52<phobes>It also seems to me that Monads aren't typed strongly enough for what you'd want in an imperative language
23:46:52<SamB>lament: hahahahahaha
23:47:05<phobes>I don't see anyway to express state changing types
23:47:09<EvilTerran>ACTION wonders if he's come up with a good excuse for -fallow-incoherent-instances or whatevr it's called
23:47:28<ddarius>EvilTerran: No, you have not.
23:47:44<EvilTerran>it's still an excuse, i'm not denying that ;]
23:47:53<monochrom>The "haskell is the best imperative language" quote is from http://research.microsoft.com/%7Esimonpj/Papers/marktoberdorf
23:47:57<lambdabot>Title: Simon Peyton Jones: papers
23:50:57<lament>btw am i the only one who thinks this is pathetic: http://haskell.org/haskellwiki/Comparison_of_functional_programming_languages
23:50:58<lambdabot>Title: Comparison of functional programming languages - HaskellWiki, http://tinyurl.com/26neho
23:51:08<SamB>lament: no!
23:51:20<SamB>I think it is pathetic just by looking at the URL
23:51:24<lament>it's linked directly from the intro to haskell page
23:51:36<phobes>dolio: BTW In defense of C, ... "int i,j;" is a heck of alot easier to read than "iLTj = i < (j :: E m i)" :)
23:51:40<SamB>in particular, how it is in haskell.org/haskellwiki/
23:52:32<ddarius>phobes: int i,j; isn't the same thing.
23:52:40<dons>lament: hmm? its a very old table from the mid90s
23:52:57<dons>lament: do you think its wrong?
23:53:02<phobes>ddarius: No, it's not, but that's how you'd do it in C
23:53:04<monochrom>I don't understand the complaint.
23:53:19<phobes>at no loss of generality AFAICT
23:53:21<EvilTerran>er... those do completely different things...
23:53:50<SamB>phobes: in C, you'd do it like this:
23:54:00<SamB>int iLTj = i < j;
23:54:05<dmwit>dons: Not necessarily wrong, just woefully incomplete.
23:54:06<ddarius>phobes: Presumably it should be possible to put the type annotations at the binding sites.
23:54:06<lament>dons: it's not about factual correctes, it's about the fact that that's what Introduction#Comparisons_to_other_languages links to.
23:54:16<phobes>SamB: No, in C there would be no point of creating a variable for iLTj... you'd just repeat i < j
23:54:25<lament>dons: (and it's the only content of that section)
23:54:36<ddarius>phobes: You can do that in augustss code too.
23:54:54<phobes>ddarius: Yes, but the reason he made a variable is because that code that needs to be repeated has the ugly cast
23:54:58<EvilTerran>phobes, given enough context, the type shouldn't be necessary in haskell either
23:54:59<monochrom>A decent language, imperative or functional, is likely bound to admit a few undecidable types, and you will have to annotate.
23:55:28<phobes>.... we're talking about inferring that the loop variable is an integer... this isn't the halting problem
23:56:12<SamB>phobes: have you tried it the way you'd like it to be?
23:56:14<timthelion>would it be possible to make/already has been, a pure piping system for haskell, so that you could compile an executable that instead of returning X() would return some pure data that could be piped to another precompiled program? this would be identical to a directory with a tone of .o files and one .hs that contained includes, and main = function . function .funcion... except that you could add a function defined in on
23:56:16<EvilTerran>even if it requires more type information than you'd provide just as you go along, there's usually more elegant ways of adding inferences than that.
23:56:16<phobes>SamB: No - does it work?
23:56:19<SamB>phobes: I'm not sure
23:56:20<phobes>SamB: I have been working under the assumption that the code needed to be structured like this for a reason
23:56:26<ddarius>phobes: Why do you keep saying integer. Does E m i look like Int to you?
23:56:45<SamB>that's another good point
23:56:51<EvilTerran>timthelion, sounds like you'd need some kind of general serialization system
23:57:01<SamB>this code does buy you polymorphism that you'd need to use at least C++ to get...
23:57:20<timthelion>EvilTerran: that would defeat the purpose of strict typing :(
23:57:20<phobes>ddarius: If those variables aren't integers, can you tell me what value this generalization gets me?
23:57:36<phobes>Those would be integer loop indices in C. What else could they be? and why is that helpful?
23:57:43<EvilTerran>not necessarily, with Typeable you should be able to encode the type in the frozen form
23:57:51<ddarius>phobes: It will run in a variety of monads and for a variety of array index types.
23:58:09<SamB>ddarius: phobes has got a point though
23:58:22<phobes>ddarius: Fair enough. In "templatized" C++ code, that would translated to "IndexType i,j"
23:58:37<phobes>The rest would look the same
23:58:40<lament>premature generalization sounds almost as bad as premature optimization
23:58:56<monochrom>Naw. Premature specialization is the evil one.
23:59:03<SamB>but Ix doesn't work in reverse so it is USEFUL
23:59:11<SamB>even if it doesn't seem like it ought to be necessary
23:59:17<timthelion>EvilTerran: It's possible for a C program to pass a pointer to a peice of memory. if there was some kind of deamon that would keep the memory without needing serialisation...
23:59:50<EvilTerran>ACTION envisages class Freeze a where { freeze :: a -> ByteString; thaw :: ByteString -> a }; instance Data a => Freeze a where...

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