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:33 | <monochrom> | Hahaha. "I'm just parsing a file!" Yes, you should just use a moand, and you made the right choice! :) |
| 00:02:43 | <ricky_clarkson> | Some people, when confronted with a problem, think "I know, I'll use monads". Now they have no problems. |
| 00:03:32 | <ndm> | when your tool of choice is a hammer, everything looks like a thumb |
| 00:03:34 | <LoganCapaldo> | lies :) |
| 00:06:05 | <monochrom> | when your tool of choice is taste, everyone looks tasty! :P |
| 00:08:50 | <dons> | so i'm unsure whether this kind of thing is good or bad. |
| 00:08:58 | <monochrom> | Yikes, now I need to learn bidirectional generators. |
| 00:09:20 | <dons> | i can only think that more exposure to monad stuff helps haskell, but sometimes other feature adoption dilutes the reasons to use haskell. |
| 00:09:30 | <dons> | think what happened to smalltalk |
| 00:09:34 | <dons> | or lisp. |
| 00:10:09 | <monochrom> | The original "yield" generator was said to be less powerful than continuation (or delimited continuation). Perhaps bidirectional generator fills the gap? |
| 00:10:24 | <dons> | they're so innovative :) |
| 00:11:33 | <monochrom> | Every program evolves to include an email MUA. Every language evolves to expose continuations? |
| 00:11:47 | <ddarius> | dons: People don't come to Haskell for monads. |
| 00:11:55 | <dons> | right. so i don't think that hurts. |
| 00:12:05 | <dons> | it just lowers the barrier to entry if you find them elsewhere |
| 00:12:11 | <dons> | like people to go to lisp for closures. |
| 00:12:15 | <LoganCapaldo> | ACTION came for the list comprehensions but stayed for the company |
| 00:12:17 | <dons> | s/dont'/ |
| 00:12:42 | <monochrom> | A human brain is large enough to hold ten or twenty programming languages, don't worry. |
| 00:12:56 | <dons> | so people really do go to erlang for distribution and fault tolerance. and haskell for well, what, correctness, and hopefully multicore in the next few years. |
| 00:13:01 | <monochrom> | Haskell and Python don't need to compete. They can easily win together. |
| 00:13:02 | <BMeph> | Haskell: The come for the lambdas. They stay for the monads. ;) |
| 00:13:11 | <dons> | (i.e. the banks, galois, aetion, all about correctness) |
| 00:13:28 | <sarehu> | personally, I came because I wanted to see what this toy interpreted language was all about |
| 00:13:37 | <dons> | and no matter how many monad you add to python, its not going to be high assurance any time |
| 00:13:43 | <dons> | sarehu: hah |
| 00:14:13 | <dons> | ruby, you mean? :) |
| 00:14:21 | <ndm> | i came for the lambdas, and stayed for them - monads really are still second class programming in Haskell |
| 00:14:56 | <Valodim> | what |
| 00:15:01 | <dons> | i came for the lambdas, and stayed for the type system and optimiser |
| 00:15:35 | <Valodim> | I came for.. uh, nothing in particular about haskell, more about the boringnes of other languages |
| 00:15:45 | <ndm> | i stayed for hindley milner, type classes, lazy evaluation and equational reasoning as well |
| 00:16:03 | <cjay> | ACTION came because I wanted to find out about that weird language the icfp winning teams were using :) |
| 00:16:06 | <dons> | yeah, i love f . g == id tests |
| 00:16:13 | <dons> | cjay: interesting |
| 00:16:25 | <ndm> | if only we had functional equality :) |
| 00:16:33 | <LoganCapaldo> | ACTION has never actually sed equational reasoning on a haskell program (at least not consciously) |
| 00:16:42 | <LoganCapaldo> | but it's nice to know I could if I wanted |
| 00:16:51 | <dons> | i presume you refactor sometimes, LoganCapaldo ? :) |
| 00:16:52 | <ndm> | i also hope i'll be staying for the equational reasoning theorem prover at some point... |
| 00:16:54 | <BMeph> | cjay: Thirsty for Functional Beer? ;) |
| 00:17:02 | <ndm> | LoganCapaldo: you do, you just don't realise with Haskell |
| 00:17:56 | <cjay> | BMeph: I didn't admire functional languages at that time, was just curious |
| 00:18:00 | <ddarius> | ndm: Switch to Clean? |
| 00:18:19 | <ndm> | ddarius: for Sparkle? |
| 00:18:27 | <ddarius> | ndm: Among other things. |
| 00:18:34 | <dons> | but we have Dazzle! :) |
| 00:18:43 | <ricky_clarkson> | I came for the static typing, to see how good it could get. |
| 00:19:16 | <hpaste> | oxy pasted "xmonad.hs" at http://hpaste.org/4863 |
| 00:19:16 | <ndm> | dons: not heard of it... |
| 00:19:48 | <dons> | ndm, oh, its a graph drawing system from utrecht, written in haskell. used in some commercial project (iirc) |
| 00:19:53 | <ndm> | oh, yeah, i have |
| 00:20:03 | <ndm> | i've also seen blobs, which was based off it |
| 00:20:11 | <dons> | yep |
| 00:20:37 | <ndm> | ACTION gets the feeling he may have to write the Haskell theorem prover... |
| 00:20:57 | <basti_> | like "coq"? |
| 00:21:01 | <dons> | well, at least a fullish haskell model in isabelle or Coq |
| 00:21:12 | <dons> | would be more useful (you can build on others work then) |
| 00:21:20 | <dons> | these are starting to appear |
| 00:21:21 | <ndm> | ACTION remembers he has actually started that project - too many projects, too little brain |
| 00:22:46 | <cytzol> | this pasta > * |
| 00:22:50 | <shapr> | @yow ! |
| 00:22:51 | <lambdabot> | We are now enjoying total mutual interaction in an imaginary hot tub ... |
| 00:22:53 | <cytzol> | ...eh, wrong server, sorry. |
| 00:24:05 | <jfredett> | okay- kindof a meta-haskell question, I've been working on a Directed Acyclic Graph Library, and I was wondering about two things- 1) has anyone already done this (I looked in the FGL library, it doesn't really do an implementation of DAG) and 2) would anyone possibly ever want to use it, I ask because write now, its basically a hack (though I got the Show instance to dump graphviz output, which is cool) and If someone might w |
| 00:24:11 | <jfredett> | sorry for the long message, btw |
| 00:24:11 | <jfredett> | :) |
| 00:24:39 | <cjay> | it was cut by the server "..someone might wa" |
| 00:24:47 | <jfredett> | oh- hmm |
| 00:25:09 | <jfredett> | "If someone might want to use it, I'll try to clean it up and release it, but otherwise, I'll probably just leave it in its hackish state." |
| 00:25:13 | <jfredett> | sorry |
| 00:25:55 | <ndm> | someone may want it |
| 00:26:02 | <dons> | i think it could be wanted, yep |
| 00:26:05 | <jfredett> | okay |
| 00:26:09 | <dons> | graphs come up once a fortnight here |
| 00:26:18 | <jfredett> | i just wanted to make sure it was worth cleaning up |
| 00:26:37 | <jfredett> | because it looks like a 2$ whore after a long night of working right now... |
| 00:26:38 | <waern> | is it just me or is there waaay too little haskell stuff on planet.haskell.org? |
| 00:26:53 | <dons> | waern: mm. someone else mentioned that. |
| 00:27:04 | <dons> | we need to kick this scala pr guys some lambdas |
| 00:27:07 | <dons> | ?users #scala |
| 00:27:07 | <lambdabot> | Maximum users seen in #scala: 71, currently: 66 (93.0%), active: 6 (9.1%) |
| 00:28:01 | <jfredett> | i can has hasktivism? |
| 00:28:28 | <BMeph> | ACTION thinks SuDoKu is a Master Plan to get Haskell programmers into equational reasoning... |
| 00:28:39 | <jfredett> | BMeph: lol |
| 00:28:43 | <waern> | well, there's not just scala. there's also food, babies and santa claus |
| 00:29:17 | <jfredett> | waern: problem is they index whole blogs, which for some people are not strictly about Haskell |
| 00:29:30 | <dons> | i think the editorial guide is that you can write about anything, if you're a haskell person |
| 00:29:32 | <LoganCapaldo> | ACTION doesn't see the appeal of sudoku, seems so mechanical |
| 00:29:55 | <jfredett> | LoganCapaldo: it is, but it makes people feel smart, cause it has numbers |
| 00:30:16 | <ddarius> | waern: The purpose of Planet Haskell isn't to display Haskell stuff. |
| 00:30:48 | <waern> | but who wants to read non-haskell stuff from haskell people? :) |
| 00:31:14 | <ddarius> | waern: Read http://planet.haskell.org/policy.html |
| 00:31:15 | <lambdabot> | Title: Membership policy - Planet Haskell |
| 00:31:17 | <BMeph> | Haskell people without enough projects? ;) |
| 00:31:32 | <ddarius> | waern: If you don't want to read it, don't. |
| 00:31:59 | <resiak> | Currently, hfuse doesn't expose any way to keep mutable state. libfuse itself has a void* in the contex struct that the application is meant to use to keep its state. From reading the FFI addendum, it seems like I should be storing a StablePtr (MVar a) in it, and either make each Fuse callback have type ... -> StateT IO a b where the state ends up being read from and written to the MVar, or just have a function to let the callbacks retrieve the ... |
| 00:32:04 | <resiak> | ... MVar if they want it. Am I on the right lines? |
| 00:32:40 | <dons> | it seems like a good idea to do the thread safety on the haskell side, anyway |
| 00:33:37 | <resiak> | Yeah, the other thing that occured to me is to ignore the void* in the context and do the state entirely in Haskell |
| 00:34:15 | <waern> | ddarius: I understand the policy, it's just that I think most people read planet.haskell.org for the haskell stuff |
| 00:34:35 | <ddarius> | waern: I don't read it just for the Haskell stuff. |
| 00:36:57 | <ddarius> | In fact, I would say about half or probably more of the posts I find interesting are not particularly Haskell related. |
| 00:37:44 | <dons> | so who're the python guys going to go to, to help them do monads ? :) |
| 00:37:52 | <dons> | anyone want a python-fp consultancy gig :) |
| 00:38:17 | <byorgey> | ACTION agrees with ddarius |
| 00:38:51 | <dons> | i enjoy watching the pain of others in the python and scala entries |
| 00:39:14 | <ddarius> | "How can we implement Haskell in ...?" |
| 00:39:39 | <byorgey> | I think I'll go write a blog post on implementing monads in assembly |
| 00:39:45 | <ddarius> | ACTION remembers when Martin Odersky and co. first announced Scala. |
| 00:40:01 | <ddarius> | byorgey: It would be easier than in some languages. |
| 00:40:10 | <Pseudonym> | ACTION likes Martin Odersky |
| 00:40:11 | <byorgey> | ddarius: lol, so true. =) |
| 00:40:14 | <Pseudonym> | He's a nice guy. |
| 00:40:21 | <waern> | hm, okay then... perhaps I am in the minority |
| 00:40:32 | <Pseudonym> | The Mercury group had some great conversations with him. |
| 00:40:53 | <dons> | its funny watching all the researchers who grew up on haskell, go out and mess up^h^h^h add lovely features to Java, C#, Scala, et al :) |
| 00:41:12 | <Pseudonym> | It's like SPJ said. |
| 00:41:22 | <Pseudonym> | They're making "dirty" languages cleaner. |
| 00:41:33 | <dons> | we need to get some more ex-haskell committee people into the dynamic language camp |
| 00:41:34 | <Pseudonym> | Everyone is heading towards useful and clean. |
| 00:41:39 | <Pseudonym> | Or useful and beautiful. |
| 00:41:42 | <dons> | slowly, yeah. |
| 00:41:47 | <Pseudonym> | We're heading there from the "beautiful" direction. |
| 00:41:53 | <Pseudonym> | They'er heading there from the "useful" direction. |
| 00:41:59 | <dons> | and there's nowhere else to go for new language features, basically |
| 00:42:08 | <mrd> | if you use dirty languages like J*va do you have to wash your computer out with soap afterwards? |
| 00:42:19 | <Pseudonym> | mrd: Just your brain, I suspect. |
| 00:42:21 | <ddarius> | mrd: I highly recommend it. |
| 00:42:27 | <oerjan> | ACTION wouldn't recommend it. |
| 00:42:37 | <dons> | mrd, no, you go buy wadler's book on java generics, cry a little bit, then come running over to #haskell |
| 00:42:48 | <byorgey> | mrd: don't use soap, use a big magnet |
| 00:43:07 | <mrd> | i didn't need a book for generics to make me cry |
| 00:45:17 | <ddarius> | While Haskell wasn't intended to be -just- a research language, research was certainly one of its goals. That the ideas now make there way to other language is success of a type that even Haskellers can get behind. |
| 00:45:55 | <dons> | yeah, though its double-edged. |
| 00:46:11 | <byorgey> | dons, how so? |
| 00:46:13 | <dons> | i'm more of the embrace, extend, extinguish kind of guy in this respect, i must admit :) |
| 00:46:39 | <BMeph> | Don Stewart: FP Commando! >;) |
| 00:46:47 | <dons> | since i'd like not to have to do my monads with "self.run(lambda val" |
| 00:46:52 | <ddarius> | dons: We can't embrace and extend if we are the fore-runner. |
| 00:47:45 | <MyCatVerbs> | Crikey on a stick, the user list here is bloody lon. |
| 00:48:17 | <dons> | ddarius: i just worry about what happened to smalltalk and lisp. though i don't see research going anywhere soon, which is something lisp and smalltalk lost long ago. so we'll stay a forerunner, even as the features developed in the 90s make their way out |
| 00:48:22 | <MyCatVerbs> | *long. Also, my hands are cold, which is making me emo. (//_o) |
| 00:48:24 | <LoganCapaldo> | does crikey on a stick taste good? |
| 00:48:35 | <dons> | ?userss |
| 00:48:35 | <lambdabot> | Maximum users seen in #haskell: 439, currently: 413 (94.1%), active: 21 (5.1%) |
| 00:48:55 | <MyCatVerbs> | LoganCapaldo: probably not, though I suppose it'd be worth a try. |
| 00:49:05 | <byorgey> | LoganCapaldo: doesn't sound like it. Although I'm not sure what 'crikey' is. maybe dons would know =) |
| 00:49:18 | <dons> | streuth! |
| 00:49:23 | <dons> | byorgey: you in OR yet? |
| 00:49:34 | <byorgey> | dons: heh, I wish =) |
| 00:49:36 | <dons> | pdxfunc is next Monday, we'll be doing beer and parser combinators |
| 00:49:46 | <byorgey> | dons: not for a few weeks yet, I think |
| 00:49:46 | <mrd> | is that a new drinking game |
| 00:49:49 | <dons> | ok. |
| 00:49:54 | <dons> | mrd, that's right! :) |
| 00:49:59 | <dons> | you get a type error, you lose |
| 00:50:00 | <byorgey> | dons: sounds like fun, I'll be sad to miss it |
| 00:50:05 | <keseldude> | ?seen davidL |
| 00:50:05 | <lambdabot> | I saw davidL leaving #xmonad and #haskell 18h 37m 13s ago, and . |
| 00:55:59 | <ddarius> | dons: Stories of either Smalltalk's or Lisp's demise are greatly exaggerated. |
| 00:56:36 | <dibblego> | ACTION chuckles at "greatly exaggerated" :) |
| 00:57:25 | <ddarius> | I'm pretty sure Haskell has long since reached the point where it will live forever. |
| 00:57:50 | <dons> | ddarius: their loss of influence + failure to make commercial inroads. :) maybe that's haskell's fate too though. unless we can get some more multicore hardware... |
| 00:58:07 | <dons> | i want a 16 core laptop already! hurry up! |
| 00:58:14 | <dons> | these `par`'s won't run themselves |
| 00:59:18 | <LoganCapaldo> | i was under the impression that what success smalltalk had was largely commercial |
| 00:59:34 | <dons> | until java |
| 01:00:02 | <shapr> | dons: I may end up with an 8-core dual-quad box soon... |
| 01:00:19 | <pjd> | dons: markdown in IRC? |
| 01:00:37 | <dons> | oh, weird, pjd. i guess that was in my spinal memory. |
| 01:00:44 | <dons> | i comment on reddit too much :) |
| 01:00:46 | <pjd> | heh |
| 01:01:23 | <oerjan> | @users |
| 01:01:24 | <lambdabot> | Maximum users seen in #haskell: 439, currently: 412 (93.8%), active: 16 (3.9%) |
| 01:01:45 | <mrd> | ACTION got to use a dual-quad box last semester |
| 01:02:33 | <ddarius> | dons: Haskell is not going to be the next C# ever. If nothing else, some new language would be developed that just happened to be rather like Haskell but was new! and shiny! |
| 01:02:54 | <ddarius> | dons: What is "Haskell succeeding"? |
| 01:02:55 | <pjd> | #kell |
| 01:03:06 | <Korollary> | and #kell-blah |
| 01:03:17 | <dons> | ddarius: i'd like just a few more companies using it. |
| 01:03:21 | <mauke> | I can has kell? |
| 01:03:32 | <ddarius> | dons: That's definitely going to happen. |
| 01:03:34 | <dons> | continued research, enough jobs to keep the phd students in work |
| 01:03:56 | <shapr> | I dunno, I think Haskell could be the next C# |
| 01:03:58 | <Korollary> | phd students can succ it. |
| 01:04:17 | <ddarius> | If Brian Beckmann isn't a fluke, I think we may be at the very beginning of a hype bubble for FP. |
| 01:04:18 | <dons> | shapr: we'd need MS or Sun or someone to kick us some monies |
| 01:04:19 | <shapr> | Especially after hanging out on ##csharp for a few days... |
| 01:04:28 | <shapr> | ddarius: BrianBec r0xx0rs |
| 01:04:36 | <LoganCapaldo> | ACTION would rather Haskell became the next C++ |
| 01:04:39 | <shapr> | dons: We only need advertising, we got everything else. |
| 01:04:42 | <Korollary> | I was in a cave. Who's Beckmann? |
| 01:04:50 | <dibblego> | shapr, what did you learn from hanging out in #csharp that would make you think that? |
| 01:04:55 | <dons> | and MS got their F# for that instead. C# got Meijer, Java got Wadler, Scala got Odersky |
| 01:04:58 | <ddarius> | shapr: His monad talk is ridiculous. |
| 01:05:29 | <shapr> | dibblego: I learned that the community on ##csharp is ... not likely to outperform #haskell. |
| 01:05:37 | <shapr> | That may be the most tactful thing I've ever said. |
| 01:05:51 | <dibblego> | shapr, heh; I coulda told you that! |
| 01:05:58 | <dons> | strategic positioning is tricky. my strategy at the moment is to write all the code we can, and publicise anything useful. more user groups are helping, and the continued trickle down effect of ideas into other langs. |
| 01:06:01 | <ddarius> | dons: Scala didn't really "get" Odersky. He set out to make Scala and I have to say, he's done quite a bit better than I originally thought. |
| 01:06:25 | <shapr> | ddarius: Can you point me to BrianBec's monad talk? |
| 01:06:27 | <dons> | ddarius: my point was that someone like that can do a viable haskell-lite |
| 01:06:35 | <bos> | dons: and the book :-) all the code isn't going to help if people can't grok the language. |
| 01:06:42 | <dons> | and the book is huge, actuallyy |
| 01:06:47 | <dons> | just look at the effect on scala |
| 01:06:52 | <ddarius> | dons: Scala isn't Haskell-lite + OO? |
| 01:07:03 | <dons> | it is, isn't it? :) |
| 01:07:27 | <dibblego> | Odersky would object to you saying that |
| 01:07:31 | <dibblego> | but I wouldn't agree anyway |
| 01:07:45 | <dibblego> | it's more like Java-plus than Haskell-lite |
| 01:07:57 | <dons> | ok, so less FP, more OO |
| 01:08:04 | <dibblego> | yes |
| 01:08:06 | <dons> | and funny section syntax :) |
| 01:08:15 | <dons> | like DRMacIver said, don't go to scala looking for FP |
| 01:08:17 | <dibblego> | I seem to be the only one who uses it in a "pure sense" |
| 01:08:39 | <Korollary> | That sucks. A friend of mine is hanging on to Scala as his last hope to be able to use FP at work. |
| 01:08:40 | <dibblego> | and conceding where it's not worthwhile |
| 01:08:46 | <ricky_clarkson> | Scala has FP, but it's not pure. |
| 01:08:55 | <dons> | i'd like to see the haskell fans able to use haskell for their day jobs. that'd be success enough |
| 01:08:57 | <dibblego> | Korollary, he'd be right in doing so |
| 01:09:02 | <ricky_clarkson> | ..its types are somewhat lacking, but hugely better than mainstream langs. |
| 01:09:29 | <ddarius> | shapr: http://channel9.msdn.com/ShowPost.aspx?PostID=358968 |
| 01:09:30 | <lambdabot> | Title: Brian Beckman: Don't fear the Monads |
| 01:09:32 | <sarehu> | if you want FP at work, there's always XSLT :P |
| 01:09:54 | <Saizan> | sarehu: C++ templates then.. |
| 01:13:37 | <shapr> | ddarius: Looks cool |
| 01:15:48 | <shapr> | Anyone in Boston? |
| 01:16:18 | <ddarius> | shapr: It starts off odd but reasonable and then goes spiraling downhill until it finally ends. At least two people in here couldn't stand to watch the thing through, and I can empathize. |
| 01:16:42 | <shapr> | I just finished an 8 hour conference call. This is not so painful :-) |
| 01:17:51 | <notsmack> | shapr: 8 hours?! |
| 01:17:58 | <Korollary> | ddarius: I couldn't watch the first five minutes. |
| 01:18:09 | <Korollary> | and not that I am an expert on the subject. |
| 01:18:28 | <shapr> | notsmack: Yeah.. 8 hours. |
| 01:18:49 | <notsmack> | shapr: can you say what about? |
| 01:18:52 | <Korollary> | shapr: Were you actively participating throughout? |
| 01:18:56 | <ricky_clarkson> | shapr: You should charge that customer porno rates. |
| 01:19:07 | <shapr> | notsmack: Company orientation |
| 01:19:19 | <notsmack> | shapr: how many orientees? |
| 01:19:21 | <shapr> | Korollary: Not actively, but I had to listen at all times for when I had to be active. |
| 01:19:25 | <notsmack> | and what company? |
| 01:19:26 | <shapr> | notsmack: um... I don't remember. |
| 01:19:40 | <notsmack> | shapr: sorry, i'm just bewildered by the idea of an 8 hour conference call :) |
| 01:19:46 | <dons> | wow, shapr. |
| 01:20:02 | <shapr> | notsmack: My new job... |
| 01:20:26 | <shapr> | Anyway, they're trying something new for the orientation, and we give feedback afterwards. |
| 01:20:33 | <shapr> | ACTION shrugs |
| 01:22:11 | <jaa> | shapr is there a boston-fp. seems strange that the town that gave birh to Lisp wouldnt have one but NY and Bayarea do? |
| 01:22:20 | <BMeph> | Hmm, anyone familiar (and willing to help with) ghc compiling issues in WIndows? |
| 01:22:58 | <Korollary> | Seattle has SeaFunc, too, even though it largely sucks. |
| 01:24:19 | <shapr> | jaa: I don't know, I haven't been here long enough. |
| 01:24:23 | <jaa> | theres 3 ruby ones though |
| 01:24:27 | <jaa> | which is just wtf. but whatever :) |
| 01:24:40 | <Korollary> | Maybe Ruby needs 3. |
| 01:24:56 | <shapr> | jaa: Are you in Boston? |
| 01:25:00 | <jaa> | nearby |
| 01:25:08 | <shapr> | jaa: If there isn't a boston-fp, I'll start one. |
| 01:25:37 | <jaa> | MIT HR has 33 job posts for Java. 0 for Scheme, 0 for Lisp, 0 for HAskell |
| 01:25:43 | <shapr> | suck |
| 01:25:45 | <jaa> | the search box even suggests 'Java' |
| 01:25:49 | <jaa> | yeah, impressive |
| 01:25:56 | <shapr> | jaa: So, are you showing up on Saturday at the random geek meet? |
| 01:26:34 | <shapr> | ACTION wanders off to play games with friends |
| 01:26:56 | <Korollary> | MIT jobs should be as mainstream as your random state college jobs. Java makes no less sense. |
| 01:27:13 | <jaa> | i guess 'dogfood eating' is only important at places like Microsoft, 37signals, etc |
| 01:27:56 | <dons> | Korollary: is any haskell discussed at SeaFunc? |
| 01:28:10 | <BMeph> | I'm building haddock 2.0, and I keep getting a msg about bytestring 0.9.0.1, which I don't even have installed any more. |
| 01:28:11 | <dons> | should it be on haskell.org's user groups page, or is it a lisp ghetto? |
| 01:28:29 | <dons> | hmm, 0.9.x should work, BMeph |
| 01:29:05 | <BMeph> | I agree, but it says, "ghc.exe: unknown package: bytestring-0.9.0.1 (dependency of ghc-6.8.2)" |
| 01:29:42 | <dcoutts_> | BMeph: you removed bytestring-0.9.0.1 but the ghc package depended on that, so the ghc package is now borken |
| 01:29:53 | <dons> | the ghc package depends on bytestring? |
| 01:30:02 | <Korollary> | dons: The only haskell related subject is "I didn't understand monads" That's about it. |
| 01:30:03 | <dcoutts_> | hence you cannot compile haddock-2.0 which uses the ghc package |
| 01:30:18 | <dcoutts_> | dons: yep |
| 01:30:20 | <emmmi> | type var reachability question: I can define a function with type "forall a b. (C a, D a b) => a -> a -> Bool", but how can I ever use it? i.e. how to instantiate the type variable b? |
| 01:30:22 | <dons> | Korollary: that's a pity. pdxfunc is the opposite |
| 01:30:29 | <dons> | dcoutts_: what does ghc use bytestrings for? |
| 01:30:38 | <dcoutts_> | dons: not very much really |
| 01:30:44 | <dcoutts_> | a little bit in ghci iirc |
| 01:30:53 | <dons> | ghci/InteractiveUI.hs:import qualified Data.ByteString.Char8 as BS |
| 01:30:55 | <dons> | huh |
| 01:31:01 | <dons> | codeGen/CgUtils.hs:mkByteStringCLit :: [Word8] -> FCode CmmLit |
| 01:31:11 | <dons> | we better not break things :) |
| 01:31:16 | <oerjan> | emmmi: you'll need a functional dependency from a to b in the D class |
| 01:31:26 | <oerjan> | otherwise, you cannot |
| 01:31:58 | <BMeph> | dcoutts_: That makes sense. I'll swap out the newer one for -.0.1, and see. |
| 01:31:59 | <emmmi> | oerjan: really? it's surprising that I can legally define that function if I cant instantiate it, no? |
| 01:32:33 | <oerjan> | emmmi: i suppose there could have been some warning, yeah |
| 01:33:52 | <emmmi> | oerjan: thanks for clearing that up! |
| 01:35:07 | <oerjan> | :) |
| 01:36:02 | <emmmi> | oerjan: does functional dependency mean that for each instance of 'a the corresponding instance of 'b? |
| 01:36:14 | <emmmi> | *the-> there will be |
| 01:36:30 | <TSC> | exactly one corresponding instance of b |
| 01:36:55 | <TSC> | Perhaps "instance" is the wrong word there |
| 01:37:08 | <emmmi> | I see, so it would be an error to declare two instances with the same 'a? |
| 01:37:14 | <oerjan> | yep |
| 01:37:20 | <emmmi> | good, good |
| 01:39:51 | <monochrom> | I believe there is more. |
| 01:40:26 | <monochrom> | You can't have two "instance MyClass MyType". That is already true of ordinary type classes, before MPTC, before fundep. |
| 01:41:36 | <monochrom> | If you now have MPTC but no fundep yet, you are allowed "instance MyClass2 T S" and "instance MyClass2 T U" to co-exist. Even "instance MyClass2 X S" too. |
| 01:42:02 | <monochrom> | Now add fundep. Say "class MyClass2 a b | a -> b", just that. |
| 01:42:06 | <ddarius> | The a -> b in class M a b | a -> b can be read as "a determines b" (or "a fixes b" or whatever) |
| 01:42:28 | <monochrom> | Then you must choose one of "instance MyClass2 T S" and "instance MyClass2 T U". Pick one. Throw away the other. |
| 01:42:47 | <monochrom> | But you're still allowed to add "instance MyClass2 X S". |
| 01:42:59 | <emmmi> | that sounds right. |
| 01:43:09 | <GoMittGo> | GOVERNOR ROMNEY: "And further, if I were fortunate enough to be elected your President, I'd call for a National Summit of Nations to create a new partnership – a Partnership for [Progress] and Prosperity." |
| 01:43:10 | <GoMittGo> | "This Partnership would assemble the resources of all the nations of the world to work to assure that Islamic states that are threatened with violent Jihad have public schools that are not Wahhabi madrasas; that they have micro-credit and banking, the rule of law, human rights, basic health care, and competitive economic practices." (Governor Mitt Romney, Remarks At Yeshiva University, 4/26/07) |
| 01:43:44 | <mauke> | er |
| 01:43:44 | <Pseudonym> | Bleah. |
| 01:43:47 | <Pseudonym> | Full ban list. |
| 01:44:02 | <Valodim> | wtf? |
| 01:44:11 | <mauke> | so clean it? |
| 01:44:11 | <Pseudonym> | Can someone clear out some ban list entries right now please? |
| 01:44:12 | <GoMittGo> | GOVERNOR ROMNEY: "And further, if I were fortunate enough to be elected your President, I'd call for a National Summit of Nations to create a new partnership – a Partnership for [Progress] and Prosperity." |
| 01:44:12 | <GoMittGo> | "This Partnership would assemble the resources of all the nations of the world to work to assure that Islamic states that are threatened with violent Jihad have public schools that are not Wahhabi madrasas; that they have micro-credit and banking, the rule of law, human rights, basic health care, and competitive economic practices." (Governor Mitt Romney, Remarks At Yeshiva University, 4/26/07) |
| 01:44:21 | <chessguy> | Cale, dons |
| 01:44:33 | <chessguy> | glguy |
| 01:44:40 | <monochrom> | You need to free up banlist space first. :) |
| 01:44:41 | <chessguy> | ACTION tries to remember who else are ops |
| 01:44:42 | <mauke> | Pseudonym: can you /remove him instead of /kick? |
| 01:44:52 | <Pseudonym> | No. |
| 01:44:56 | <Pseudonym> | ACTION doesn't have that macro |
| 01:45:01 | <jaa> | /ignore #haskell JOINS PARTS KICKS |
| 01:45:06 | <mauke> | it's a server command |
| 01:45:44 | <chessguy> | is he goine? |
| 01:45:44 | <Botje> | now may not be the best time to ask the question, but how do you solve GHC errors due to "variable is wobbly" ? |
| 01:45:44 | <Pseudonym> | shapr, you wanted to know what a politbot was. |
| 01:45:56 | <Pseudonym> | If you're still around, that's one. |
| 01:46:05 | <Pseudonym> | Gone I think. |
| 01:46:16 | <ddarius> | Botje: Don't use GADTs? |
| 01:46:16 | <allbery_b> | the last time it left under its own power |
| 01:46:27 | <monochrom> | wobbly variable is very advanced :) |
| 01:46:47 | <monochrom> | only thing I know is "rigid" vs "wobbly". |
| 01:46:47 | <LoganCapaldo> | tell to stop standing so close to the edge |
| 01:46:56 | <LoganCapaldo> | *it |
| 01:47:02 | <Pseudonym> | OK, it's in the autorem list, anyway. |
| 01:47:03 | <Botje> | :) |
| 01:49:51 | <Pseudonym> | Anyway. |
| 01:49:53 | <Pseudonym> | BBS |
| 01:56:56 | <Romney08> | GOVERNOR ROMNEY: "And further, if I were fortunate enough to be elected your President, I'd call for a National Summit of Nations to create a new partnership – a Partnership for [Progress] and Prosperity." |
| 01:56:59 | <Romney08> | "This Partnership would assemble the resources of all the nations of the world to work to assure that Islamic states that are threatened with violent Jihad have public schools that are not Wahhabi madrasas; that they have micro-credit and banking, the rule of law, human rights, basic health care, and competitive economic practices." (Governor Mitt Romney, Remarks At Yeshiva University, 4/26/07) |
| 01:57:18 | <monochrom> | onoes |
| 01:57:52 | <Botje> | maybe it'll quiet now |
| 02:00:03 | <byorgey> | what's the point? who makes bots like that? |
| 02:00:07 | <Romney08> | GOVERNOR ROMNEY: "And further, if I were fortunate enough to be elected your President, I'd call for a National Summit of Nations to create a new partnership – a Partnership for [Progress] and Prosperity." |
| 02:00:07 | <Romney08> | "This Partnership would assemble the resources of all the nations of the world to work to assure that Islamic states that are threatened with violent Jihad have public schools that are not Wahhabi madrasas; that they have micro-credit and banking, the rule of law, human rights, basic health care, and competitive economic practices." (Governor Mitt Romney, Remarks At Yeshiva University, 4/26/07) |
| 02:00:10 | <Valodim> | people |
| 02:00:15 | <lucca> | -.- |
| 02:00:20 | <byorgey> | *sigh* |
| 02:00:21 | <bos> | sigh. the banlist is full. |
| 02:00:21 | <Valodim> | it's a form of spam, and spam lost its purpose ages ago |
| 02:00:22 | <byorgey> | people are dumb |
| 02:01:01 | <lucca> | so set mode +i, kick, clean up the banlist, mode -i |
| 02:01:32 | <sarehu> | If #haskell keeps growing it might get delegates to the Republican convention |
| 02:01:32 | <monochrom> | Garbage collection :) |
| 02:01:39 | <Valodim> | haha |
| 02:01:41 | <monochrom> | hehehe |
| 02:02:53 | <byorgey> | OOC, who is allowed to have "channel operator status"? |
| 02:03:43 | <ricky_clarkson> | Why do you not ban him? |
| 02:03:55 | <byorgey> | ricky_clarkson: the ban list is full, apparently |
| 02:03:56 | <oerjan> | will you for heaven's sake _stop_ kicking them without banning? It only _adds_ to the noise!!!! |
| 02:04:09 | <felipe> | fun stuff |
| 02:04:23 | <ricky_clarkson> | Well remove some bans. ChanServ can maintain a longer banlist. |
| 02:04:44 | <felipe> | allbery_b 1 - 0 Romney08 |
| 02:04:46 | <bos> | ok, gone for now. |
| 02:04:55 | <Valodim> | haha |
| 02:05:02 | <mauke> | how about *!i=ubuntu@gateway/tor/x-26e2ccc44e60a27d or *!*@p54B6E4C0.dip.t-dialin.net |
| 02:05:34 | <Botje> | I keep thinking network-wide spam alterts would be nice |
| 02:05:53 | <allbery_b> | ACTION has not had ops here or involvement therewith for long enough to know which bans are safe to nuke |
| 02:05:57 | <Botje> | just monitor some of the large channels for annoyances, .. |
| 02:06:22 | <Botje> | nuke the oldest first :) |
| 02:06:27 | <oerjan> | ACTION doesn't know about this, but are the bans ordered by age? Just remove the oldest ones |
| 02:06:29 | <allbery_b> | (there are some obvious ones) |
| 02:06:44 | <allbery_b> | I think the oldest ones are keal, who's still active |
| 02:06:45 | <bos> | no, the bans are not particularly ordered. i just chose an old one at random. |
| 02:07:09 | <mauke> | e.g. *!*@p54B6E4C0.dip.t-dialin.net is a random dial up address |
| 02:07:17 | <allbery_b> | or is that protontorpedo? gschuett |
| 02:07:22 | <mauke> | he is |
| 02:07:38 | <pragma_> | It's not hard to sort the bans. |
| 02:07:55 | <mauke> | recently seen as boogooo!n=g@147.21.16.3 |
| 02:08:05 | <Botje> | @protontorpedo |
| 02:08:11 | <Botje> | awwh :( |
| 02:08:14 | <oerjan> | @bot |
| 02:08:23 | <allbery_b> | also, the dates I see are mostly from some mass load in early december |
| 02:08:44 | <oerjan> | You killed lambdabot! You bastards! |
| 02:08:51 | <allbery_b> | ACTION wonders if his rapid-reaction kicks confused her |
| 02:09:10 | <Botje> | \bot isn't dead, she's just resting :) |
| 02:09:22 | <Botje> | lambdabot: are you dead? |
| 02:09:39 | <allbery_b> | ex-parrbot? |
| 02:10:08 | <Botje> | heheh |
| 02:10:14 | <Botje> | (+1) allbery_b |
| 02:13:06 | <allbery_b> | hm, right, once I release ops playing with the banlist is ineffective :) |
| 02:13:53 | <allbery_b> | ok, a little more space fo rbans now |
| 02:14:00 | <int-e> | the lisppaste ban can probably go, too? at least #haskell isn't listed on http://paste.lisp.org/channels anymore |
| 02:14:35 | <allbery_b> | good point, missed that one |
| 02:14:42 | <allbery_b> | 6 open slots now |
| 02:15:24 | <LoganCapaldo> | 6 open graves |
| 02:15:39 | <LoganCapaldo> | ACTION rubs hands together evilly |
| 02:15:50 | <Valodim> | why are there so many bans on this chan? |
| 02:16:16 | <LoganCapaldo> | it's an exclusive club |
| 02:16:31 | <allbery_b> | for some reason we seem to attract trolls and bots |
| 02:16:49 | <allbery_b> | (heck, I'm in 10 channels here and for the most part only #haskell gets the politibots. huh?) |
| 02:17:08 | <allbery_b> | probably being in the top channels makes us a target |
| 02:17:11 | <mauke> | #perl also gets them |
| 02:17:22 | <mauke> | (+ regular visits from gschuett) |
| 02:23:43 | <dbueno> | @paste |
| 02:24:06 | <int-e> | http://hpaste.org/ |
| 02:24:54 | <hpaste> | dbueno pasted "IArray Foldable instance" at http://hpaste.org/4864 |
| 02:25:25 | <dbueno> | I can't divine the problem given that error message. Could someone shed some light? |
| 02:25:47 | <dbueno> | There are some imports I didn't paste; ask if you need them. |
| 02:26:15 | <oerjan> | dbueno: Foldable's need to be parametric in the result type |
| 02:26:21 | <oerjan> | but IArray's are not |
| 02:26:57 | <oerjan> | i.e. the e is fixed |
| 02:26:58 | <glguy> | ?bot |
| 02:27:24 | <dbueno> | oerjan: So there's no way to fix it? |
| 02:27:30 | <glguy> | shapr: you about? |
| 02:27:37 | <dons> | url module failed in contextual handler: thread killed |
| 02:27:47 | <allbery_b> | ah |
| 02:27:52 | <oerjan> | dbueno: hm, not that i know of |
| 02:27:58 | <allbery_b> | I was worried the bot battles confused it |
| 02:28:05 | <sarehu> | > 2 + 3 |
| 02:28:10 | <allbery_b> | @bot |
| 02:28:15 | <lambdabot> | 5 |
| 02:28:17 | <lambdabot> | :) |
| 02:28:29 | <dons> | hehe, "Wow, I guess I should actually learn what the hell monads do sometime." |
| 02:28:40 | <dons> | http://programming.reddit.com/info/64th1/comments |
| 02:29:01 | <dbueno> | oerjan: Thanks for the help. |
| 02:29:08 | <TomMD> | Hey! Don't laugh at quote I could have easily made myself! ;-) |
| 02:29:14 | <oerjan> | ACTION started wondering what the Hell monad did |
| 02:29:30 | <oerjan> | probably best not to know. |
| 02:33:58 | <nelhage> | What's the recommended way to generate FFI bindings for C code these days? c2hs? |
| 02:34:01 | <chessguy_> | isn't that like learning what XML "does"? |
| 02:34:26 | <TomMD> | That depends on what your definition of does, does. |
| 02:35:08 | <chessguy> | good point |
| 02:35:11 | <chessguy> | i think |
| 02:35:32 | <TomMD> | wow, a west coaster left because my lame joke - I feel bad. |
| 02:35:34 | <Lemmih> | nelhage: That depends on the complexity of the foreign library. |
| 02:35:50 | <chessguy> | bah, who needs west coasters anyway? |
| 02:36:02 | <chessguy> | ACTION ducks |
| 02:37:29 | <nelhage> | Lemmih: what are the different options? |
| 02:37:49 | <Lemmih> | nelhage: hsc2hs and c2hs are popular. |
| 02:42:31 | <EvilTerran> | iirc, i've seen both used in the same project on occasion |
| 02:53:40 | <Jomyoot> | hi |
| 02:55:05 | <byorgey> | hi Jomyoot |
| 03:13:54 | <sjanssen> | @quote |
| 03:13:57 | <lambdabot> | MyCatVerbs says: does that make any sense, or should I go find some gin and try to explain that again? |
| 03:17:03 | <MyCatVerbs> | sjanssen: damn you, now I'm thirsty. |
| 03:22:41 | <monochrom> | gin would make you more thirsty |
| 03:24:12 | <MyCatVerbs> | monochrom: +tonic. |
| 03:24:39 | <MyCatVerbs> | monochrom: also, I might be drunk enough to stop caring, so it wouldn't even matter. Yaaaay! |
| 03:25:02 | <monochrom> | gin and tonic make you thirsty and monotonic. |
| 03:25:12 | <shapr> | ugh, politbot |
| 03:25:35 | <MyCatVerbs> | monochrom: ...*headdesk* |
| 03:26:02 | <monochrom> | Haha. I looked at "monochrom: +tonic" and thought of monotonic. |
| 03:26:21 | <monochrom> | ACTION is monochromic and monotonic. :) |
| 03:26:36 | <Random08> | Hey, vote for Random! |
| 03:26:44 | <monochrom> | ... |
| 03:26:59 | <Pseudonym> | OK, works. |
| 03:27:29 | <Pseudonym> | Excellent! |
| 03:27:43 | <Pseudonym> | Still some noise, but it's an auto-kick. |
| 03:27:53 | <monochrom> | also /ban works |
| 03:28:17 | <sjanssen> | what exactly triggers the kick? |
| 03:28:27 | <Pseudonym> | ChanServ kicks. |
| 03:28:28 | <mauke> | anything that contains "vote for"? |
| 03:28:40 | <Pseudonym> | No. |
| 03:28:59 | <Pseudonym> | I'm testing out a macro that instead of +b'ing, adds an entry to the ChanServ autorem list. |
| 03:29:04 | <mauke> | ah |
| 03:29:11 | <Pseudonym> | Just in case the ban list fills again. |
| 03:29:47 | <Pseudonym> | BRB |
| 03:30:11 | <glguy> | when did the ban list fill? |
| 03:30:12 | <Pseudonym> | Cool. |
| 03:30:14 | <Pseudonym> | ACTION is now powerful and stuff |
| 03:30:24 | <glguy> | what client did you write the macro for? |
| 03:30:28 | <Pseudonym> | sirc |
| 03:32:04 | <bos> | that ajb fellow was always kind of shifty. we're better off without him. |
| 03:32:58 | <Pseudonym> | I'm not really voting Random in '08. |
| 03:33:00 | <Pseudonym> | ACTION is just saying |
| 03:34:23 | <bos> | ACTION updates his prior and votes Bayes |
| 03:35:14 | <glguy> | I need to script in some clever kick messages |
| 03:35:24 | <glguy> | I never remember when I actually need to use them |
| 03:37:29 | <skew> | shapr: cheer up! https://www.cs.kent.ac.uk/pubs/2006/2381/content.pdf |
| 03:38:27 | <zeeeee> | @seen Cale |
| 03:38:27 | <lambdabot> | Cale is in #haskell-overflow, #haskell and #ghc. I don't know when Cale last spoke. |
| 03:40:33 | <MyCatVerbs> | Y'know what's awesome? xmonad, counterstrike, fridge door. ^_^ |
| 03:41:05 | <mauke> | Even electronic brain pancake crystal elderly. |
| 03:55:40 | <monochrom> | I will vote Probability Measure Monad. |
| 04:02:43 | <shapr> | skew: Hiya! |
| 04:03:38 | <shapr> | skew: Hmm, double ended queue of delimited continuations? |
| 04:04:05 | <skew> | yep |
| 04:04:19 | <skew> | or, closures that print a bit more of the output |
| 04:05:12 | <skew> | seems like finally a functional pretty printing algorithm with optimal complexity and laziness that's reasonably simple |
| 04:07:04 | <shapr> | @users |
| 04:07:06 | <lambdabot> | Maximum users seen in #haskell: 401, currently: 395 (98.5%), active: 13 (3.3%) |
| 04:10:08 | <monochrom> | Scary. |
| 04:11:23 | <skew> | shapr: If you haven't heard I've been writing a little structure editor thingy |
| 04:11:33 | <shapr> | Oh? |
| 04:11:39 | <shapr> | I haven't heard much. |
| 04:12:09 | <skew> | one bit is a hacked up pretty printer that a) wraps by pixel width of the text and b) produces an index from character offsets back to subexpressions |
| 04:12:31 | <shapr> | Oh neat, so you could layout variable width fonts? |
| 04:12:35 | <skew> | yep |
| 04:12:49 | <shapr> | Wow, that's cool. |
| 04:12:50 | <skew> | works almost perfectly, except gtk seems to deliver resize events out of order or something |
| 04:13:38 | <skew> | I can catch it overful, but if I strech the window vertically to trigger a resize it wraps again |
| 04:13:47 | <shapr> | Do you have any screenshots? |
| 04:14:04 | <skew> | no |
| 04:14:45 | <shapr> | I'd like to see some. |
| 04:14:52 | <shapr> | If you get time to make them. |
| 04:15:30 | <skew> | I'm planning to release some code once it's a little more together |
| 04:15:47 | <shapr> | Cool |
| 04:15:49 | <skew> | The pretty printer is based on wadler's now, but I'm thinking of moving to Olaf's |
| 04:16:03 | <skew> | among other things, his does align efficiently |
| 04:16:13 | <hpaste> | (anonymous) pasted "darcsify" at http://hpaste.org/4865 |
| 04:16:26 | <skew> | I'm just getting the syntax together tonight |
| 04:16:45 | <skew> | following McBride and McKinna |
| 04:16:57 | <monochrom> | nice nice nice |
| 04:17:01 | <skew> | hugs on my XO is pretty nice for hauling around |
| 04:17:21 | <clanehin> | Puzzled. It seems like parList yields a () immediately after sparking for each element. I want to wait until the list is fully deeply evaluated. |
| 04:17:25 | <skew> | case of case seems to be working |
| 04:17:57 | <shapr> | I just got a luggable, wish I had an XO. |
| 04:18:02 | <sjanssen> | clanehin: par doesn't work like that -- it's asynchronous |
| 04:18:10 | <shapr> | On the good side, I might get to meet one or two of the XO team this weekend :-) |
| 04:18:14 | <skew> | the immediate goal is a nice GUI for manually driving supero |
| 04:18:38 | <sjanssen> | now that sounds interesting |
| 04:19:07 | <sjanssen> | skew: allow the user to choose sites to optimize, because doing it on an entire program is too expensive? |
| 04:20:01 | <skew> | sjanssen: I think I see how to get some nice optimizations from the transformations, but the terminations conditions prevent it |
| 04:20:31 | <MyCatVerbs> | \o/ |
| 04:20:41 | <clanehin> | sjanssen: it's entirely impossible using par and seq? |
| 04:20:53 | <ricky_clarkson> | gigamonkey: Have you interviewed SPJ yet? |
| 04:21:09 | <MyCatVerbs> | ACTION rejoices. Much code is deleted. Many neurons and cycles saved! Also, his music player just came up with some Moby. <3 |
| 04:21:24 | <sjanssen> | clanehin: you can first spark parList, then seq each element of the list in turn |
| 04:22:12 | <skew> | sjanssen: I'm mostly hoping to divise something automatic by playing around interactively and thought that it would be fairly awkward with a text interface and independently interesting to write the GUI and syntax manipulation stuff myself |
| 04:25:38 | <skew> | sjanssen: but it will be like what you said. |
| 04:28:17 | <monochrom> | Oh! I forgot to recharge my mp3 player! |
| 04:46:56 | <visof> | i had some problem when i install lambdabot |
| 04:47:00 | <visof> | can some help me |
| 04:47:03 | <visof> | ? |
| 04:47:24 | <newsham> | what problems |
| 04:47:53 | <visof> | when i try to do ./Setup.hs configure "for installing lambdabot" i had:: |
| 04:49:14 | <visof> | configure: /usr/bin/ghc-pkg |
| 04:49:15 | <visof> | configure: Dependency base-any: using base-2.0 |
| 04:49:15 | <visof> | configure: Dependency unix-any: using unix-1.0 |
| 04:49:15 | <visof> | Setup.hs: cannot satisfy dependency network-any |
| 04:49:24 | <clanehin> | sjanssen: thanks, I used: waitParList s = seqList rwhnf . parMap r0 s |
| 04:49:29 | <visof> | what should i do? |
| 04:49:59 | <newsham> | is lambdabot up to date for the new library layout? |
| 04:50:39 | <newsham> | ?about |
| 04:50:39 | <lambdabot> | Unknown command, try @list |
| 04:50:43 | <newsham> | ?version |
| 04:50:43 | <lambdabot> | lambdabot 4p581, GHC 6.6 (Linux i686 2.40GHz) |
| 04:50:43 | <lambdabot> | darcs get http://code.haskell.org/lambdabot |
| 04:50:59 | <newsham> | visof: you're building with 6.8.x/ |
| 04:51:00 | <newsham> | ? |
| 04:51:25 | <visof> | no ghc 6.6.3 |
| 04:51:56 | <newsham> | hmmm.. did you install lib extras too? |
| 04:53:03 | <visof> | what should i install? |
| 04:53:12 | <visof> | newsham? |
| 04:54:45 | <newsham> | you have network-2.0 and it cant find network-any? |
| 04:57:47 | <visof> | i don't know |
| 04:58:09 | <newsham> | i dont know either |
| 04:58:17 | <visof> | hahaha |
| 04:58:25 | <visof> | anyone can help me |
| 04:58:28 | <visof> | ? |
| 04:58:58 | <sarehu> | taken out of context the last five lines are amusing |
| 04:59:19 | <monochrom> | hahahaha |
| 05:00:12 | <visof> | @seen dons |
| 05:00:12 | <lambdabot> | dons is in #xmonad and #haskell. I last heard dons speak 2h 31m 33s ago. |
| 05:08:37 | <jsnx> | @tell Cale i have another math question for you. On page 7 of Eugenia's notes, it says we have `h : (A, f) → (B, g)` such that `h ∘ f = g` -- however, I can't see how the 'signature' of h allows it to be composed with fo |
| 05:08:38 | <lambdabot> | Consider it noted. |
| 05:09:29 | <Cale> | jsnx: I'll look into it :) |
| 05:09:30 | <lambdabot> | Cale: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 05:10:17 | <jsnx> | Cale: hmmm, i couldn't tab complete your nick earlier -- thought you weren't around |
| 05:12:08 | <Cale> | jsnx: Sorry, where is it saying that? |
| 05:12:46 | <jsnx> | Cale: page 7 is about the "slice over X, |
| 05:13:02 | <Cale> | It says that f_2 h = f_1, right? |
| 05:13:13 | <jsnx> | Cale: right below that |
| 05:13:25 | <Cale> | So the definition of slice under X? |
| 05:13:29 | <jsnx> | yes |
| 05:13:36 | <jsnx> | however, they both puzzle me |
| 05:13:40 | <Cale> | And they have h f_1 = f_2 |
| 05:13:48 | <jsnx> | yes |
| 05:13:51 | <Cale> | h f_1 is h composed with f_1 |
| 05:13:58 | <Cale> | That is, h following f_1 |
| 05:14:04 | <jsnx> | yes |
| 05:14:16 | <jsnx> | but f_1 makes a Y |
| 05:14:20 | <Cale> | So f_1 takes you from X to Y_1 |
| 05:14:28 | <Cale> | and then h goes from Y_1 to Y_2 |
| 05:14:33 | <jsnx> | oh |
| 05:14:41 | <Cale> | So the composite goes from X to Y_2 |
| 05:14:47 | <Cale> | which is the same as what f_2 does |
| 05:14:57 | <jsnx> | well, h : (A, f) -> (B, g) seems to suggest that h works on tuples |
| 05:15:31 | <Cale> | Oh, right. There's a subtle identification going on here. |
| 05:16:03 | <jsnx> | Cale: is the evaluation morphism involved? |
| 05:16:21 | <Cale> | The morphisms of the slice category, going from (Y_1, f_1) to (Y_2, f_2) are the morphisms in the original category going from Y_1 to Y_2 such that the given triangle commutes. |
| 05:16:54 | <Cale> | So each arrow h is simultaneously a member of the slice category as well as the original. |
| 05:18:06 | <Cale> | (there are more arrows in the original category, since not every such h: Y_1 -> Y_2 will make the triangle commute) |
| 05:18:52 | <jsnx> | Cale: so, the signature of h is really `h : Y_1 -> Y_2` |
| 05:18:55 | <Cale> | Well, hmm... on the other hand, there are new objects in the slice category, since the objects are pairs of an object of the original category with a morphism from X |
| 05:19:03 | <Cale> | jsnx: It's both. |
| 05:19:04 | <jsnx> | right, that's what i thought |
| 05:19:16 | <jsnx> | zomg111!!!11! |
| 05:19:30 | <jsnx> | okay, so, how does that happen? |
| 05:19:41 | <Cale> | jsnx: When you define a category, you're allowed to choose explicitly what the morphisms are, and it's okay for them to be morphisms stolen from another category. |
| 05:20:07 | <jsnx> | but they can have a different type in the new category? |
| 05:20:11 | <Cale> | yeah. |
| 05:20:26 | <jsnx> | type is the wrong word though -- as is signature -- what am i supposed to call it? |
| 05:20:27 | <oerjan> | jsnx: this sounds like an example where it is actually harmful to think of arrows and objects as functions and sets |
| 05:21:11 | <jsnx> | oerjan: ah, i see |
| 05:21:22 | <jsnx> | oerjan: is there a better one you can think of? |
| 05:21:35 | <jsnx> | like forest animals or something cute like that? |
| 05:21:43 | <oerjan> | heh :D |
| 05:21:46 | <skew> | jsnx: the opposite category is a very simple case where morphisms are reused with a different signature |
| 05:21:47 | <Cale> | Sure, my group theory prof did that. |
| 05:21:49 | <oerjan> | warm fuzzy things? ;) |
| 05:22:36 | <Cale> | Just remember that given any objects X and Y of C, there is a set C(X,Y) of morphisms X -> Y. This can be any set at all. |
| 05:22:43 | <jsnx> | skew: is signature okay terminology? it makes me feel like we're discussing java... |
| 05:22:44 | <jfredett> | hmm, is there a way to generalize to only listlike monads? that is, I want to generalize to any monad with cons and empty? |
| 05:23:12 | <oerjan> | jfredett: MonadZero? |
| 05:23:28 | <jfredett> | oerjan: I smell monad transformers in my near future... :/ |
| 05:23:40 | <oerjan> | cons x y = return x `mplus` y; empty = mzero |
| 05:23:43 | <Cale> | The structure of the category actually comes from the definition of composition in the category, and not from the actual members of the morphism sets (though of course, the number of morphisms available between two objects matters, but that's all) |
| 05:24:09 | <jsnx> | Cale: this is where we left off last time, actually |
| 05:25:10 | <jfredett> | oerjan: those are part of the transformer world, correct? |
| 05:25:14 | <oerjan> | jfredett: sheesh, i meant MonadPlus |
| 05:25:22 | <jfredett> | lol, thats okay |
| 05:25:25 | <Cale> | So if you wanted, you could construct a category with just two objects, say X and Y, and the set of arrows from X to Y is the set of words defined in the Oxford English Dictionary. (and only the identities X -> X, Y -> Y, and no arrows Y -> X) |
| 05:25:31 | <oerjan> | jfredett: no, MonadPlus is in H98 |
| 05:25:48 | <oerjan> | @src MonadPlus |
| 05:25:48 | <lambdabot> | Source not found. Just what do you think you're doing Dave? |
| 05:25:52 | <Cale> | composition would of course not be all that interesting in this category, but it's a valid category |
| 05:26:08 | <jsnx> | Cale: aha -- can we come back to that in a minute? |
| 05:26:10 | <oerjan> | oh well, it's essentially just mplus and mzero |
| 05:26:12 | <Cale> | Sure |
| 05:26:12 | <jfredett> | @hoogle MonadPlus |
| 05:26:12 | <lambdabot> | Control.Monad.MonadPlus :: class Monad m => MonadPlus m |
| 05:26:20 | <jsnx> | i actually don't understand what just happened with h |
| 05:26:25 | <oerjan> | :t mplus |
| 05:26:26 | <lambdabot> | forall (m :: * -> *) a. (MonadPlus m) => m a -> m a -> m a |
| 05:26:27 | <jfredett> | ah, so its a class. hmm |
| 05:26:30 | <oerjan> | :t mzero |
| 05:26:31 | <jfredett> | okay |
| 05:26:31 | <lambdabot> | forall (m :: * -> *) a. (MonadPlus m) => m a |
| 05:26:31 | <shapr> | I want to learn a new programming language, any suggestions? |
| 05:26:40 | <jsnx> | shapr: datalog |
| 05:26:41 | <Cale> | jsnx: Okay, so let's look at the opposite category for a moment -- have you seen that construction? |
| 05:26:50 | <jsnx> | Cale: no, i have not |
| 05:26:54 | <jsnx> | ACTION googling |
| 05:26:54 | <jfredett> | shapr: Erlang is interesting,but if you want some real fun, try Puredata |
| 05:26:55 | <jfredett> | :) |
| 05:26:55 | <oerjan> | :t mconcat -- optional, has default |
| 05:26:55 | <lambdabot> | forall a. (Monoid a) => [a] -> a |
| 05:26:58 | <Cale> | jsnx: It's a simpler example to look at than the slice category, and I think it'll help. |
| 05:27:02 | <oerjan> | argh |
| 05:27:03 | <Cale> | I can define it :) |
| 05:27:08 | <jsnx> | okay |
| 05:27:13 | <oerjan> | i'm confused |
| 05:27:30 | <Cale> | Given a category C, the opposite category C^op is defined as the category whose objects are the same as those for C |
| 05:27:41 | <oerjan> | just mplus and mzero, i was confusing with Monoid |
| 05:27:48 | <jfredett> | oerjan: cool |
| 05:27:49 | <jfredett> | thanks |
| 05:27:50 | <Cale> | But the set of arrows X -> Y in C^op is exactly the set of arrows Y -> X in C. |
| 05:28:23 | <jsnx> | Cale: does that make any actual difference? |
| 05:28:27 | <jfredett> | I'm generalizing away from Set for my DAG library, and i realized I still needed list-like properties |
| 05:28:33 | <jsnx> | oh, yes it would, i guess |
| 05:28:47 | <Cale> | If f: X -> Y and g: Y -> Z, are arrows in C^op, then g . f, the composite, is defined as the arrow f . g as composed in in C |
| 05:28:52 | <Cale> | er, -in |
| 05:28:58 | <shapr> | ACTION tries puredata |
| 05:29:04 | <Cale> | See how that works? |
| 05:29:07 | <jsnx> | yes |
| 05:29:16 | <monochrom> | There will come a time when you want C^op instead of C. |
| 05:29:53 | <skew> | shapr: do you know prolog? |
| 05:29:56 | <jsnx> | so, what i do not see is how we take f from C and use it in C^op in some confusing way |
| 05:30:04 | <jsnx> | like happened with h |
| 05:30:07 | <Cale> | It's a common time saver when you're talking about functors, and you want to express the idea of a contravariant functor -- one which swaps the direction of the arrows as it goes. |
| 05:30:09 | <shapr> | skew: Nope |
| 05:30:25 | <shapr> | skew: Is gnu prolog decent? |
| 05:30:28 | <monochrom> | (Yes, I have contravariant functor in mind. :) ) |
| 05:30:40 | <Cale> | jsnx: Well, the arrow f in C has the type X -> Y, say, then in C^op, it is instead an arrow Y -> X |
| 05:30:42 | <jsnx> | shapr: check out XSB for prolog... |
| 05:31:06 | <jsnx> | shapr: it has SQL hooks, XPath hooks, crazy shit... |
| 05:31:15 | <shapr> | Sounds entertaining. |
| 05:31:20 | <Cale> | So we're reusing the arrows of our original category in our new category. |
| 05:31:22 | <jsnx> | shapr: i just installed it |
| 05:31:32 | <Cale> | But with different source and target. |
| 05:31:46 | <skew> | shapr: before that, do you know Coq? |
| 05:31:50 | <jsnx> | Cale: however, in the example on page 7, we took h, and used it to make the commutativity triangle |
| 05:32:04 | <Cale> | jsnx: right, that triangle is happening in the original category C. |
| 05:32:09 | <jsnx> | oh! |
| 05:32:14 | <jsnx> | i see |
| 05:32:51 | <Cale> | (it could perhaps be clearer on that point, but those objects are objects of C and not of X/C |
| 05:32:54 | <Cale> | ) |
| 05:33:05 | <jsnx> | so, say we have a morphism h, and we say, in my new category, it goes from (Y_1, f_1) to (Y_2, f_2) |
| 05:33:19 | <jsnx> | how do we know what actually happened to h in this case? |
| 05:33:29 | <jsnx> | would not its guts be all different in the new category? |
| 05:33:38 | <Cale> | Arrows don't have guts. |
| 05:33:52 | <Cale> | (that, I think, is exactly what is so confusing for you here) |
| 05:34:17 | <jsnx> | Cale: i thought the guts were the part with the bar arrow |-> or ↦ |
| 05:34:41 | <Cale> | Yeah, in some categories, like the category of sets, objects have elements. |
| 05:35:09 | <Cale> | But this slice category isn't really one of those. |
| 05:35:17 | <jsnx> | mmmm |
| 05:35:19 | <Cale> | Though I suppose you could treat it as such. |
| 05:35:30 | <Cale> | The guts of h would be completely unchanged. |
| 05:36:01 | <jsnx> | so, what i do not get, is: in the first category, h did something...and in the slice over, it must do something else...but only the type has changed |
| 05:36:05 | <Cale> | The elements of (A, f) would be the elements of A |
| 05:36:05 | <shapr> | skew: No, I don't know Coq, though I've heard it's nifty. |
| 05:36:23 | <shapr> | skew: How would I get started with Coq? |
| 05:36:41 | <Cale> | and the arrow h: (Y_1, f_1) -> (Y_2, f_2) would make the same assignments as the arrow h: Y_1 -> Y_2 in the original category. |
| 05:36:50 | <skew> | shapr: the book seems to be pretty good |
| 05:37:06 | <shapr> | Which book are you reading? |
| 05:37:12 | <Cale> | The arrow doesn't do something new, but its new type tells you something extra about it. |
| 05:37:15 | <skew> | shapr: I also looked at Adam Chlipala's class execercises, the official tutorial, and all the Epigram papers |
| 05:37:20 | <skew> | Coq'Art |
| 05:37:26 | <monochrom> | I learned Coq by reading the official Coq tutorial |
| 05:37:38 | <Cale> | In particular, since h: (Y_1, f_1) -> (Y_2, f_2), this means that h f_1 = f_2 |
| 05:37:38 | <jsnx> | Cale: if it has different arguments, how can it make the same assignments? |
| 05:37:56 | <jsnx> | oh, wait |
| 05:38:05 | <Cale> | jsnx: I'm saying that the underlying set of (Y_1, f_1) is the same as the underlying set of Y_1 |
| 05:38:25 | <Cale> | If you really want to be picky and talk about underlying sets. |
| 05:38:38 | <jsnx> | well, i don't even know what that means |
| 05:38:45 | <skew> | I learned some things and was confused by some other things |
| 05:38:58 | <jsnx> | i am thinking it's kind of like partial evaluation |
| 05:38:58 | <Cale> | There might be another way to assign underlying sets to the slice category, but I don't know what it would be. |
| 05:39:30 | <skew> | the book does good things warning against possible but execssively complicated ways of doing things |
| 05:39:37 | <Cale> | jsnx: Let's define a really small category, and construct a slice under an object in it. |
| 05:39:44 | <jsnx> | yes, lets |
| 05:39:52 | <jsnx> | s/lets/let's/ |
| 05:40:36 | <skew> | and also explain how to write tactics and how to do proof by reflection, both are extremely cool |
| 05:40:47 | <jsnx> | write tactics? |
| 05:40:52 | <Cale> | ACTION attempts to work out if the example he's thinking of is too simple or not. |
| 05:41:05 | <jsnx> | oh, not part of our discussion... |
| 05:41:08 | <monochrom> | proof by reflection? |
| 05:41:12 | <jsnx> | skew: sorry |
| 05:41:52 | <skew> | tactics are neat! |
| 05:42:08 | <Cale> | hmm... |
| 05:42:51 | <Cale> | okay |
| 05:43:30 | <skew> | monochrom: you define an AST for certain kinds of Coq expressions you want to reason about |
| 05:43:38 | <jsnx> | aye? |
| 05:43:56 | <Cale> | It's hard to come up with a trivial example which is also interesting :) |
| 05:43:57 | <skew> | monochrom: an eval function and convertability lets you turn a goal into some goal about the AST |
| 05:44:10 | <Cale> | So let's use the category of sets |
| 05:44:14 | <oerjan> | Cale: some actual graph? |
| 05:44:23 | <skew> | monochrom: and then you can reuse one big theorem |
| 05:44:41 | <Cale> | oerjan: yeah, that's what I was thinking, but it's tricky to come up with one with only a couple of objects where the slice is interesting |
| 05:44:49 | <skew> | monochrom: like, you can define an AST of list expressions - Leaf [a] | App AST AST | Cons a AST |
| 05:45:20 | <skew> | eval (Leaf l) = l, eval (App l r) = eval l ++ eval r, eval (Cona a r) = a:eval r |
| 05:46:33 | <skew> | then if you've got many equalities between list expressions that hold by associativity |
| 05:46:57 | <Cale> | Well, let's work with the category of sets, though this really defeats the point I was trying to make, perhaps it'll still help :) |
| 05:47:09 | <Cale> | and let X be any one-element set |
| 05:47:41 | <Cale> | So effectively, a map f: X -> Y will pick out some element of Y |
| 05:48:04 | <oerjan> | Cale: hm, what about paths between pairs of points? |
| 05:48:10 | <Cale> | and now what does it mean for that triangle to commute? |
| 05:48:28 | <skew> | rather than using lemmas like app_ass a bunch of times, you write one function that reassociates an AST, prove one theorem that evaling the reassociated AST gives the same list, and then use change to turn an equality of list expressions into an equality of eval of ASTs, and apply the big theorem |
| 05:48:39 | <Cale> | That is, for a map h: Y_1 -> Y_2 to have the property that h f_1 = f_2? |
| 05:48:42 | <jsnx> | Cale: well, hmm |
| 05:48:47 | <oerjan> | (at least that isn't a concrete category) |
| 05:48:55 | <hpaste> | (anonymous) annotated "How to optimize?" with "(no title)" at http://hpaste.org/4856#a2 |
| 05:49:04 | <jsnx> | it means that h picks x in X |
| 05:49:34 | <Cale> | Okay, let's call x the sole element of X |
| 05:49:48 | <Cale> | then h(f_1(x)) = f_2(x) |
| 05:49:53 | <jsnx> | Cale: that's what i meant |
| 05:50:07 | <jsnx> | h inverts them both |
| 05:50:16 | <Cale> | inverts? |
| 05:50:32 | <Cale> | h might do anything at all to the other points in Y_1 |
| 05:50:57 | <Cale> | but we know that it sends the element 'marked' by f_1 to the element in Y_2 which was 'marked' by f_2 |
| 05:51:02 | <jsnx> | Cale: well, it has to map them to x ϵ X |
| 05:51:20 | <jsnx> | oh wait, what? |
| 05:51:31 | <jsnx> | okay, just a minute |
| 05:51:47 | <jsnx> | okay, i missed the point |
| 05:51:50 | <Cale> | You can picture a pair (Y, f: X -> Y) as being the set Y where one of the elements has been coloured blue, so we can tell it apart from the others. |
| 05:52:08 | <jsnx> | h : X → Y |
| 05:52:11 | <jsnx> | sorry |
| 05:52:36 | <Cale> | and a morphism h:(Y,f) -> (Z,g) as being a function from Y -> Z such that the blue point in Y is sent to the blue point in Z. |
| 05:53:26 | <hpaste> | tehgeekmeister pasted "Attempting to bring state into my flowchart program." at http://hpaste.org/4866 |
| 05:54:48 | <Cale> | So the intuition, at least in most cases, is that the "image" of X in Y_1 and Y_2 under the maps f_1 and f_2, is some substructure which gets preserved by the arrows (Y_1, f_1) -> (Y_2, f_2) |
| 05:55:08 | <Cale> | But the arrows themselves you can think of as plain old arrows Y_1 -> Y_2 |
| 05:55:34 | <Cale> | Just that in order to be arrows in the slice category (Y_1, f_1) -> (Y_2, f_2), they must preserve that additional structure. |
| 05:55:37 | <jsnx> | jfredett: no, the point is profit off of people's shallow fascination |
| 05:55:39 | <jsnx> | oops |
| 05:56:52 | <Cale> | jsnx: make sense? |
| 05:56:53 | <jsnx> | Cale: so, this is different notation then a function foo : (A, B) → (C, D) |
| 05:56:56 | <jsnx> | ? |
| 05:56:59 | <Cale> | jsnx: (even if only vaguely) |
| 05:57:16 | <jsnx> | Cale: i understand your argument |
| 05:57:17 | <Cale> | um, in Haskell? |
| 05:57:21 | <jsnx> | Cale: no |
| 05:57:30 | <jsnx> | A and B and C and D are objects |
| 05:57:43 | <Cale> | Oh, in the Cartesian product category? |
| 05:58:01 | <jsnx> | Cale: yes |
| 05:58:14 | <Cale> | Where an arrow (A,B) -> (C,D) is a pair of arrows, one from A -> C, and another B -> D |
| 05:58:19 | <Cale> | that's different entirely. |
| 05:58:22 | <jsnx> | aha |
| 05:58:39 | <Cale> | But see, there we define the arrows in a new way as well. |
| 05:58:48 | <Cale> | Reusing the old arrows. |
| 05:58:59 | <jsnx> | when i saw `h : (A, f) → (B, g)` i thought it was an arrow on pairs |
| 05:59:09 | <Cale> | You mean a pair of arrows? :) |
| 05:59:22 | <jsnx> | eh? |
| 05:59:33 | <Cale> | Well, those are the same thing :) |
| 06:00:00 | <Cale> | (at least in the product category) |
| 06:00:04 | <jsnx> | Cale: aha |
| 06:00:29 | <Cale> | But f and g aren't objects, which should be the first sign that something is different. |
| 06:00:50 | <jsnx> | Cale: but `h : (A, f) → (B, g)` is not a pair of arrows |
| 06:00:57 | <Cale> | Also, note that the objects in C/X are the same as those for X/C, but the arrows between any pair are different. |
| 06:01:06 | <Cale> | No, it's just one arrow A -> B |
| 06:01:18 | <Cale> | which happens to satisfy an additional constraint |
| 06:01:22 | <jsnx> | aha! |
| 06:01:35 | <jsnx> | well it is so annoying they used tuples for that |
| 06:01:43 | <Cale> | What else would they use? |
| 06:02:31 | <Cale> | The objects of the slice under X are pairs, consisting of an object Y from C, and a morphism from X -> Y in C. |
| 06:03:36 | <Cale> | The morphisms of the slice under X in C from (Y_1, f_1) to (Y_2, f_2) are the morphisms h from Y_1 to Y_2 in C such that h f_1 = f_2 |
| 06:03:56 | <jsnx> | Cale: i'll have to think about what other notation to use |
| 06:04:02 | <jsnx> | but i understand much better now |
| 06:04:17 | <jsnx> | maybe they could have used `|` for such that, or something like that |
| 06:04:20 | <Cale> | If you want, you can tag the pairs somehow, write them differently or something, but there's not a whole lot of point to that. |
| 06:05:11 | <Cale> | So yeah, the set of morphisms from (Y_1, f_1) to (Y_2, f_2) is the set {h: Y_1 -> Y_2 in C | h f_1 = f_2} |
| 06:05:15 | <jsnx> | Cale: well, the point is, n00bs would see there was something funny happening, and not get all confused |
| 06:06:31 | <jsnx> | Cale: thank you for your time, though |
| 06:06:37 | <Cale> | No problem :) |
| 06:07:18 | <Cale> | When you're defining a category, all you have to do is define the objects, and for any pair of objects, define the morphisms, and then say how those morphisms are supposed to compose (if it's not obvious already) |
| 06:07:45 | <Cale> | and the morphisms between two objects don't have to be related to anything, they can be any set at all. |
| 06:07:56 | <Cale> | as long as you can define the composition |
| 06:08:44 | <Cale> | Here, it's somewhat obvious what the composition should be, since it's just stolen from the original category. |
| 06:09:04 | <jsnx> | in the slice case |
| 06:09:08 | <Cale> | yes |
| 06:09:35 | <Cale> | btw, the opposite category is actually defined on page 6 :) |
| 06:09:49 | <Cale> | (very briefly) |
| 06:11:27 | <jsnx> | oh, hmmmm |
| 06:13:23 | <Cale> | The idea of the opposite category is that it's just the same as the original category, with all the arrows reversed. |
| 06:13:50 | <jsnx> | oh, yes, i see it no |
| 06:14:09 | <jsnx> | s/no/know/ |
| 06:14:22 | <jsnx> | s/know/now/ |
| 06:14:29 | <jsnx> | lolz |
| 06:15:24 | <Cale> | Later, they'll define the comma category, which is a generalisation of the slice construction. |
| 06:15:45 | <Cale> | (that's on page 42) |
| 06:15:56 | <Cale> | (but it could have been on page 8 or so :) |
| 06:16:17 | <hpaste> | tehgeekmeister annotated "Attempting to bring state into my flowchart program." with "Potential solution of the type problem, but how do I recurse and thread the state at the same time?" at http://hpaste.org/4866#a1 |
| 06:16:59 | <Cale> | tehgeekmeister: don't use runStateT yet. |
| 06:17:52 | <Cale> | tehgeekmeister: or else include the extra stuff which the state is supposed to be threaded to inside the do-block inside the runStateT |
| 06:18:14 | <Cale> | (which should probably be split off into its own definition, btw) |
| 06:19:01 | <Cale> | When you use runState/runStateT, the final state is given as part of the resulting pair, but that means you'll have to thread it explicitly to whatever comes next in your computation. |
| 06:19:12 | <tehgeekmeister> | the state should be threaded right back into another call of answerLoop |
| 06:19:22 | <glguy> | case take 4 x of |
| 06:19:25 | <Cale> | So make a definition: |
| 06:19:43 | <Cale> | answerLoop = do answer <- askQuestion historyQuestion |
| 06:19:53 | <Cale> | answers <- answerLoop |
| 06:20:09 | <Cale> | return (answer:answers) |
| 06:20:30 | <tehgeekmeister> | wow, that was simple. |
| 06:20:51 | <Cale> | However, in this monad, you might have a problem with finishing :) |
| 06:21:10 | <tehgeekmeister> | yes, it was much easier when i had no state to deal with |
| 06:21:20 | <Cale> | does askQuestion indicate in any way when you're done? |
| 06:21:34 | <tehgeekmeister> | askQuestion simply asks a question and returns the response |
| 06:22:05 | <tehgeekmeister> | runQuestion asks a question, feeds it's result to the lambda of the question, and recurses to ask the next question |
| 06:22:08 | <Cale> | ah, so is there something in that response which would let you know when you should quit? |
| 06:22:25 | <Cale> | Because you'll never finish asking questions, the way I wrote that. |
| 06:22:31 | <Cale> | (and never reach that return) |
| 06:22:37 | <dmwit> | The lambda would have to know how to end, I guess. |
| 06:23:04 | <Cale> | But if you were to check 'answer' to see if it's something like "done" |
| 06:23:11 | <Cale> | then you could decide whether to loop again |
| 06:23:21 | <Cale> | also, getLine >>= return = getLine |
| 06:23:27 | <tehgeekmeister> | if instead of Just (Question,Maybe String) it returns Nothing, the loop ends in runQuestion |
| 06:24:11 | <Cale> | but askQuestion doesn't apply f x, which it probably should |
| 06:24:14 | <Cale> | er |
| 06:24:18 | <Cale> | or answerLoop? |
| 06:24:38 | <Cale> | Either way. |
| 06:24:42 | <tehgeekmeister> | yes, that's the only way it can tell which question to go to next. |
| 06:24:47 | <Cale> | right |
| 06:24:56 | <Cale> | So you want something like |
| 06:25:21 | <Cale> | askQuestion x = do putStrLn $ q x; fmap (f x) getLine |
| 06:25:53 | <Cale> | Oh, also, this will still be a type error, if you're in a state transformed monad... |
| 06:26:11 | <Cale> | But it's a valid IO computation, so you can just liftIO it when you run it. |
| 06:26:20 | <Cale> | Where's the state handled? |
| 06:26:42 | <Cale> | Also, it may be easier, since the machinery is already mostly there, to just handle the state yourself for now. |
| 06:26:53 | <Cale> | know what I mean by that? |
| 06:27:02 | <tehgeekmeister> | yes, thread the state variable manually |
| 06:27:06 | <tehgeekmeister> | i could manage that |
| 06:27:15 | <Cale> | That is, you'd have the state passed to f, and it would return a new state (assuming that's where you need it) |
| 06:27:55 | <bos> | ACTION tries to decide between a simple example for the state monad, and something more fun and meaty. |
| 06:28:26 | <bos> | i haven't got a simple example in mind, but the meaty alternative that i'm itching for is affine arithmetic. |
| 06:28:40 | <tehgeekmeister> | *googles affine arithmetic |
| 06:28:44 | <bos> | unfortunately, it's probably too meaty. |
| 06:28:59 | <tehgeekmeister> | gah! that's beyond me. |
| 06:29:04 | <tehgeekmeister> | i'm just learning linear algebra. |
| 06:29:18 | <bos> | least-squares approximations to trigonometric functions! simplified zonotypes! eep! |
| 06:29:31 | <bos> | er, zonotopes. |
| 06:29:49 | <ricky_clarkson> | Shopping is hard. Let's do maths. |
| 06:29:59 | <MyCatVerbs> | ricky_clarkson: YES. |
| 06:31:22 | <monochrom> | hehehehe |
| 06:33:45 | <tehgeekmeister> | Cale: so if instead i had lambdas of type String -> (State, Maybe Question), and a runQuestion that took both a state argument and a question argument, that'd be reasonable? |
| 06:34:14 | <zeeeee> | Cale, hi |
| 06:34:21 | <tehgeekmeister> | (where State is really just an association list or something of the sort, probably, it doesn't matter too much what.) |
| 06:35:32 | <tehgeekmeister> | bos: since you seem to be around, is there any word on real world haskell? |
| 06:35:57 | <bos> | tehgeekmeister: working hard on it |
| 06:36:18 | <tehgeekmeister> | bos: as long as it's not dead, i can be patient. |
| 07:18:59 | <dons> | ?yow |
| 07:18:59 | <lambdabot> | Those aren't WINOS -- that's my JUGGLER, my AERIALIST, my SWORD |
| 07:18:59 | <lambdabot> | SWALLOWER, and my LATEX NOVELTY SUPPLIER!! |
| 07:19:11 | <hpaste> | tehgeekmeister annotated "Attempting to bring state into my flowchart program." with "Basic, functional version with manual state threading." at http://hpaste.org/4866#a2 |
| 07:25:46 | <tehgeekmeister> | ACTION wonders if he just kinda reinvented the writer monad instead of state |
| 07:25:55 | <quicksilver> | I get my latex novelties from www.ctan.org |
| 07:26:33 | <quicksilver> | does look a bit like the writer monad, too |
| 07:26:35 | <tehgeekmeister> | ouch, i think i did. |
| 07:26:45 | <tehgeekmeister> | that's not what i wanted. |
| 07:26:47 | <tehgeekmeister> | i wanted state. |
| 07:27:12 | <tehgeekmeister> | ACTION gets back to wrok |
| 07:27:14 | <tehgeekmeister> | *work |
| 07:27:34 | <sarah> | in main where should you use let x = ... as opposed to x <- ... |
| 07:28:55 | <quicksilver> | sarah: let x = foo if foo has the type you want. x <- foo if foo is an IO thing. |
| 07:29:00 | <quicksilver> | as a general rule |
| 07:29:05 | <jsnx> | sarah: well, you *can* always use x <- |
| 07:29:17 | <jsnx> | for example `x <- return 7` |
| 07:29:51 | <sarah> | an io thing? |
| 07:29:54 | <gurughantaal> | quicksilver: what do you use to edit tex, emacs? |
| 07:30:02 | <nanothief> | sarah: eg x <- getChar |
| 07:30:07 | <sarah> | ah thx |
| 07:30:08 | <jsnx> | :t getChar |
| 07:30:11 | <lambdabot> | IO Char |
| 07:30:28 | <jsnx> | :t return 7 |
| 07:30:34 | <lambdabot> | forall t (m :: * -> *). (Num t, Monad m) => m t |
| 07:30:41 | <jsnx> | eh? |
| 07:30:58 | <jsnx> | oh, yes, that's right |
| 07:31:12 | <jsnx> | :t return (7 :: Int) |
| 07:31:13 | <lambdabot> | forall (m :: * -> *). (Monad m) => m Int |
| 07:31:17 | <ari> | :t (return 7) :: IO Int |
| 07:31:18 | <lambdabot> | IO Int |
| 07:31:24 | <sarah> | also not sure what a monad is is there an easy to understand explanation? are the different monads just different domain specific languages that let you do imperitive stuff |
| 07:31:42 | <jsnx> | sarah: i am still trying to understand monads |
| 07:31:49 | <jsnx> | after many months of reading |
| 07:31:58 | <sarah> | heh :) |
| 07:32:08 | <nanothief> | sarah: do you know unix shell scripting? |
| 07:32:17 | <sarah> | a little |
| 07:32:18 | <jsnx> | sarah: basically, monads server to *order* computations |
| 07:32:40 | <dons> | ?users |
| 07:32:40 | <lambdabot> | Maximum users seen in #haskell: 401, currently: 381 (95.0%), active: 15 (3.9%) |
| 07:33:09 | <jsnx> | > do { x <- return "foo" ; putStrLn x } |
| 07:33:11 | <lambdabot> | <IO ()> |
| 07:33:12 | <hpaste> | tehgeekmeister annotated "Attempting to bring state into my flowchart program." with "Sanity check: does this look like manual state threading to everyone else too?" at http://hpaste.org/4866#a3 |
| 07:33:32 | <jsnx> | > do { putStrLn x ; x <- return "foo" } |
| 07:33:32 | <lambdabot> | Parse error at "}" (column 37) |
| 07:33:50 | <jsnx> | > do { putStrLn x } |
| 07:33:51 | <lambdabot> | Not in scope: `x' |
| 07:34:05 | <jsnx> | > do { putStrLn x ; x <- return "foo" ; } |
| 07:34:06 | <lambdabot> | Parse error at "}" (column 39) |
| 07:34:15 | <jsnx> | why parse error? |
| 07:34:33 | <jsnx> | > do { x <- return "foo" ; putStrLn x ; y <- return "bar" } |
| 07:34:33 | <lambdabot> | Parse error at "}" (column 57) |
| 07:34:35 | <nanothief> | sarah: think of echo '3' | cat |
| 07:34:56 | <nanothief> | sarah: in haskell this would be return "3" >>= print |
| 07:35:11 | <sarah> | ah ok i think i get that |
| 07:35:22 | <nanothief> | the do notation gets rid of a lot of the >>= symbols |
| 07:35:37 | <sarah> | so >>= is sort of like a pipe? |
| 07:35:44 | <nanothief> | eg do x <- return 3 \n print x |
| 07:35:50 | <jsnx> | sarah: very much |
| 07:36:00 | <sarah> | ah cool :) |
| 07:36:26 | <nanothief> | when you get the type of an IO monad, like getChar, it will be something like IO Char |
| 07:36:47 | <nanothief> | the >>= extracts the Char from inside the monad, and passes it to the next function |
| 07:36:56 | <jsnx> | > do { x <- return "foo" } |
| 07:36:56 | <lambdabot> | Parse error at "}" (column 24) |
| 07:37:06 | <jsnx> | trippy |
| 07:37:19 | <jsnx> | > do { x <- return "foo" ; putStrLn x ; y <- return "bar" ; putStrLn y } |
| 07:37:21 | <lambdabot> | <IO ()> |
| 07:37:33 | <nanothief> | jsnx: the ; occurs at the start of the statement, not the end |
| 07:37:45 | <nanothief> | eg do { ; x <- return "foo" ; print x } |
| 07:38:00 | <jsnx> | > do { ; x <- return "foo" } |
| 07:38:01 | <lambdabot> | Parse error at "}" (column 26) |
| 07:38:13 | <jsnx> | > do {; x <- return "foo" ; putStrLn x ; y <- return "bar" ; putStrLn y } |
| 07:38:14 | <lambdabot> | <IO ()> |
| 07:38:22 | <nanothief> | jsnx: also, the last expression of a do must be an expression :P |
| 07:38:31 | <jsnx> | nanothief: right, right |
| 07:38:50 | <wolverian> | that's return "foo" >>= \x -> |
| 07:38:54 | <wolverian> | not exactly valid |
| 07:39:11 | <jsnx> | it's too bad lambdabot does not actually print |
| 07:40:32 | <jsnx> | > do {; y <- return "foo" ; putStrLn x ; x <- return "bar" ; putStrLn y } |
| 07:40:33 | <lambdabot> | Not in scope: `x' |
| 07:40:40 | <jsnx> | > do { y <- return "foo" ; putStrLn x ; x <- return "bar" ; putStrLn y } |
| 07:40:40 | <lambdabot> | Not in scope: `x' |
| 07:40:49 | <jsnx> | that does what i wanted, anyhow |
| 07:41:31 | <jsnx> | > let { a = b + 2 ; b = 7 } |
| 07:41:31 | <lambdabot> | Parse error at end of input |
| 07:41:39 | <jsnx> | >@let { a = b + 2 ; b = 7 } |
| 07:41:57 | <jsnx> | @let { a = b + 2 ; b = 7 } |
| 07:41:58 | <lambdabot> | <local>:3:0: parse error on input `{' |
| 07:42:09 | <jsnx> | > let { a = b + 2 ; b = 7 } in a |
| 07:42:09 | <lambdabot> | 9 |
| 07:42:19 | <jsnx> | bollocks |
| 07:42:23 | <sarah> | in a? |
| 07:42:34 | <jsnx> | sarah: yeah |
| 07:42:44 | <nanothief> | let sets some variables to be used in another expression |
| 07:42:44 | <jsnx> | sarah: that is a let outside of a do block |
| 07:42:54 | <jsnx> | and you can define them in any order |
| 07:43:07 | <nanothief> | eg let { a = 3 } in a * a |
| 07:43:07 | <jsnx> | notice how i had a before b, but used b in a |
| 07:43:17 | <sarah> | ah yeah knew that:) whats the "in a" do though |
| 07:43:30 | <wolverian> | sarah, the syntax is 'let <bindings> in <expression>' |
| 07:43:44 | <jsnx> | sarah: it tells you what the `let` applies to |
| 07:43:48 | <sarah> | and the expression is returned? got it ty |
| 07:44:11 | <jsnx> | sarah: well, not returned, really... |
| 07:44:51 | <jsnx> | i guess i'm just being semantically picky |
| 07:44:58 | <sarah> | yeah sorry |
| 07:45:15 | <sarah> | im from python used to its terms |
| 07:45:29 | <glguy> | ACTION is knee deep in typeclasses insanity... instance (LookupLogic (Arg r FArg a) BS.ByteString t, IsArg a, Apply b c d) => Apply (t -> b) (Arg r FArg a :> c) d where |
| 07:45:39 | <wolverian> | ouch |
| 07:45:47 | <glguy> | this ought to collapse down once the logic is finally merged though |
| 07:45:52 | <glguy> | but I'm going it piecewise |
| 07:45:54 | <tehgeekmeister> | it's essentially the same. i still think in terms of returns myself, being from python/ruby, even tho i know better. |
| 07:46:00 | <wolverian> | consider using longer type variable names :) |
| 07:46:16 | <glguy> | wolverian: job security |
| 07:46:21 | <glguy> | :-p |
| 07:46:33 | <tehgeekmeister> | glguy: you just made me feel a lot better about my n00bish monad woes, thank you. |
| 07:46:37 | <wolverian> | sure it's not just the warm fuzzy feeling it gives? ;p |
| 07:47:02 | <tehgeekmeister> | it's nice to know someone's suffering more, somewhere. |
| 07:47:04 | <Jomyoot_> | Are haskell programms cool? like we get women? |
| 07:47:27 | <wolverian> | uh.. |
| 07:49:03 | <jsnx> | Jomyoot_: no -- we respect women |
| 07:49:13 | <jsnx> | Jomyoot_: like the ones on this channel now, ass hole |
| 07:49:37 | <Lemmih> | ?faq Can Haskell get you laid? |
| 07:49:37 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 07:49:38 | <TSC> | Well, you scared him off |
| 07:49:55 | <jsnx> | TSC: he was a troll |
| 07:49:58 | <TSC> | ... temporarily |
| 07:50:22 | <jsnx> | ?faq can |
| 07:50:22 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 07:51:34 | <Jomyoot> | I convinced my girlfriend that Lisp is awesome. |
| 07:51:49 | <jsnx> | Jomyoot: lolz, then maybe that can get you laid |
| 07:51:49 | <Jomyoot> | Now I am convincing her again that Haskell is cool too |
| 07:52:26 | <jsnx> | Jomyoot: she's going to think you're unstable and unreliable -- next week it'll be Alice ML |
| 07:52:42 | <Jomyoot> | Well she is complaining that exactly |
| 07:52:49 | <glguy> | Isn't this what #haskell-blah is for almost exactly? |
| 07:52:50 | <Jomyoot> | The other day I staqrted talking about Ocaml |
| 07:53:17 | <Jomyoot> | she said she won't talk to me until i settle on a language |
| 07:53:29 | <jsnx> | Jomyoot: lolz |
| 07:53:40 | <jsnx> | glguy: yes, exactly |
| 07:53:56 | <jsnx> | Jomyoot: please join #haskell-blah |
| 07:54:59 | <Jomyoot> | what IDE or Editor has the best syntax highlighting and auto identing support for Haskell? |
| 07:55:06 | <jsnx> | ed |
| 07:55:13 | <jsnx> | ed is the standard text editor |
| 07:55:18 | <Jomyoot> | I thought Emacs was really cool how it supports Lisp with auto indenting . I just hit Tab and it's all fixed |
| 07:55:31 | <Jomyoot> | Is there such an editor for Haskell. where I hit tab and it fixes everything? |
| 07:55:37 | <TSC> | emacs? |
| 07:55:43 | <jsnx> | Jomyoot: there are emacs extensions for haskell |
| 07:55:48 | <jsnx> | or the other way around, i mean |
| 07:55:59 | <Jomyoot> | Does it auto indent too? |
| 07:56:09 | <jsnx> | Jomyoot: don't know, i use VIM |
| 07:56:13 | <TSC> | Yes |
| 07:56:14 | <Jomyoot> | does VIM auto ident? |
| 07:56:29 | <jsnx> | Jomyoot: i never use that part of it -- but yes, there are plugins for that |
| 07:56:56 | <Cale> | Jomyoot: It does auto indenting, but it's a little strange in that regard -- sometimes you have to type the start of a line before it will be able to guess where you want to start it. |
| 07:57:32 | <Jomyoot> | am i correct to say emacs has more toys than vim? |
| 07:57:37 | <jsnx> | my indentation style is so beautiful and subtle, no text editor could emulate it |
| 07:57:37 | <Cale> | (In particular, it seems to have this condition with let/in, if I'm remembering correctly.) |
| 07:57:42 | <tehgeekmeister> | TSC: is the auto indent any good for you? i'm an emacs noob, but it's nearly broken, for example in do blocks it's relatively useless. |
| 07:57:53 | <TSC> | Works for me |
| 07:57:57 | <jsnx> | Jomyoot: yes |
| 07:58:03 | <TSC> | You sometimes have to press tab more than once |
| 07:58:13 | <Cale> | Jomyoot: Yes, I believe so. Really, any editor which can convert tabs to spaces and can syntax colour your code should do. |
| 07:58:51 | <Cale> | (you really don't want any ascii tab characters ending up in your source files) |
| 07:59:05 | <jsnx> | ACTION hugs Cale |
| 07:59:26 | <Cale> | ACTION ghci jsnx |
| 08:01:32 | <jsnx> | actually, i meant self-important |
| 08:01:35 | <jsnx> | oops |
| 08:01:59 | <tehgeekmeister> | Cale: would you mind taking a look at the most recent incarnation i've hpasted to see if it looks like sane state threading? i really don't want to record another version that's not doing what i think or doing something horribly wrong. http://hpaste.org/4866#a3 |
| 08:02:34 | <jsnx> | Jomyoot: helvetica |
| 08:02:53 | <jsnx> | oops, wrong window again |
| 08:02:53 | <Cale> | tehgeekmeister: Looks okay to me :) Does it compile? |
| 08:03:11 | <tehgeekmeister> | Cale: yep, and so far it seems to do what i expect. |
| 08:03:29 | <Cale> | Yeah, I'm fairly convinced that it's correct then :) |
| 08:03:40 | <tehgeekmeister> | tehgeekmeister: just the first time i ended up making a mini writer monad on accident, and i don't like messing up my repository. |
| 08:04:00 | <tehgeekmeister> | ACTION is talking to himself. probably a sign it's time to go to bed. |
| 08:05:08 | <tehgeekmeister> | Cale: thanks for your help |
| 08:09:24 | <dons> | anyone feel up to commenting on this, http://python-tips-gw.blogspot.com/2008/01/choosing-new-language.html |
| 08:09:24 | <lambdabot> | Title: Python: Choosing a new language, http://tinyurl.com/2367qn |
| 08:09:31 | <dons> | guy wondering whether to use lisp, python or haskell. |
| 08:09:45 | <quicksilver> | Jomyoot: one side effect of semantic indentation is that editors can't autoindent perfectly. Because they can't know what you mean. |
| 08:09:57 | <quicksilver> | Jomyoot: all a good editor can do is let you choose between the sensible choices. |
| 08:10:04 | <quicksilver> | Jomyoot: emacs does OK, although it could be better. |
| 08:10:09 | <Korollary> | dons: that's from comp.lang.functional actually iirc |
| 08:11:17 | <dons> | oh, maybe. just flew by in my rss feed |
| 08:12:52 | <dons> | interesting, logging on freenode, http://blog.freenode.net/?p=68 |
| 08:12:54 | <lambdabot> | Title: staffblog » Blog Archive » More blogging about logging… |
| 08:13:18 | <glguy> | ACTION needs type level let bindings... |
| 08:13:52 | <dons> | anyone have a problem with yet more public logging of #haskell? |
| 08:14:27 | <jsnx> | dons: like, it's a negative thing? |
| 08:14:35 | <jsnx> | dons: at least they don't log #haskell-blah |
| 08:14:50 | <dons> | right. but i think #haskell people expect to be publically logged? |
| 08:14:58 | <dons> | it already is in a few places |
| 08:15:09 | <jsnx> | dons: yeah, if find it valuable |
| 08:15:17 | <nanothief> | a searchable log would be nice |
| 08:15:23 | <jsnx> | dons: i search the logs for links and stuff |
| 08:16:22 | <nanothief> | jsnx: how do you search it? |
| 08:16:54 | <dons> | ok, so these guys will be logging #haskell, with some bot, in the future, http://www.irseek.com/ |
| 08:16:54 | <lambdabot> | Title: IRSeeK.com (Beta) - The most comprehensive public-chatroom search engine on the ... |
| 08:16:56 | <jsnx> | nanothief: well, i rely on dates, actually |
| 08:17:09 | <jsnx> | which is not very flexible |
| 08:18:15 | <sjanssen> | glguy: maybe clever use of type synonyms can help? |
| 08:18:24 | <jsnx> | wow, they have a nice interface |
| 08:18:33 | <glguy> | sjanssen: unfortunately not in this case |
| 08:18:45 | <glguy> | the instance depends on all three arugments of the type: |
| 08:18:48 | <glguy> | A x y z |
| 08:20:25 | <nanothief> | jsnx: well actually searching in google with site:http://tunes.org/~nef/logs/haskell/ gives good results |
| 08:20:26 | <lambdabot> | Title: Index of /~nef/logs/haskell |
| 08:20:32 | <Tac-Tics> | Who here is a Category Theory jock? |
| 08:20:33 | <nanothief> | just thought of that |
| 08:20:48 | <jsnx> | nanothief: aren't their logs out of date? |
| 08:22:54 | <nanothief> | jsnx: they seam to be up to date |
| 08:22:56 | <glguy> | ACTION wonders if anyone else has found occasion for: |
| 08:23:07 | <glguy> | f a b `uncurry` g x y |
| 08:23:43 | <glguy> | where the last two arguments just happened to match up in the end |
| 08:24:09 | <Cale> | :t ?f ?a ?b `uncurry` ?g ?x ?y |
| 08:24:13 | <lambdabot> | forall t t1 a b c t2 t3. (?f::t -> t1 -> a -> b -> c, ?a::t, ?b::t1, ?g::t2 -> t3 -> (a, b), ?x::t2, ?y::t3) => |
| 08:25:09 | <Tac-Tics> | anyone here want to help me out with a category problem? |
| 08:27:08 | <Tac-Tics> | I'm trying to figure out whether or not I have arrow composition for the category of partial functions right or not |
| 08:27:40 | <Tac-Tics> | My new book lists sets with partial funcs as a category, but doesn't give the details or solution in the back of the book |
| 08:32:30 | <Cale> | There should be only one reasonable way to define it. |
| 08:32:41 | <Cale> | So if what you have seems reasonable, it should be right :) |
| 08:33:16 | <Tac-Tics> | Is it (f * g)(x) = f(g(x)) if g(x) is defined or undefined otherwise? |
| 08:33:40 | <Tac-Tics> | like in Maybe? |
| 08:33:50 | <Cale> | roughly, yes |
| 08:34:08 | <Tac-Tics> | roughly? is there a smoother way to do it? |
| 08:34:52 | <Cale> | If f: A -> B, and g: B -> C, then g . f is defined as the map which is defined on the subset of points x where f(x) is defined, and g(f(x)) is defined. |
| 08:35:21 | <Cale> | and (g.f)(x) = g(f(x)) |
| 08:35:23 | <Cale> | in that case |
| 08:35:50 | <glguy> | Is there any documentation on generically folding arbitrary sized tuples? (data a :> b = a :> b data () = () forexample) |
| 08:35:57 | <glguy> | sized/typed |
| 08:35:57 | <Tac-Tics> | ah, ok, so you just would avoid the "undefined" terminology and refine the subset of the domain f . g is defined on |
| 08:36:19 | <Cale> | Tac-Tics: Well, you can do it either way, but that'd be my approach. |
| 08:36:36 | <Tac-Tics> | your way is the more proper way |
| 08:36:44 | <Cale> | Tac-Tics: You can also define partial functions explicitly as sets of pairs, which is the really proper way :) |
| 08:37:32 | <quicksilver> | it's perfectly sane to treat "undefined" as a real value |
| 08:37:45 | <Cale> | Usually, when A and B are sets, a function f: A -> B is a set of pairs (a,b) with a in A, and b in B, such that for each a in A, there is exactly one b in B for which (a,b) is in f. |
| 08:37:48 | <Tac-Tics> | As a C.S. major, partial functions form the basis of all existence |
| 08:37:48 | <quicksilver> | that's just taking the 'pointed-set' interpretation of partial functions. |
| 08:38:14 | <Cale> | With partial functions, you can change 'exactly one' to 'at most one' |
| 08:38:29 | <Cale> | When (a,b) is in f, we write f(a) = b |
| 08:38:49 | <Tac-Tics> | A function is an awful specific kind of object =-) |
| 08:39:55 | <Tac-Tics> | Cool then, I'm glad I got that right |
| 08:40:12 | <Tac-Tics> | The category theory book I got looks not too painful, and I look forward to reading it |
| 08:40:24 | <Cale> | Of course, quicksilver's take is also a reasonable way to handle it. You can define a partial function f: A -> B as a function f: A -> B disjoint union {*}, where {*} just means some one element set. |
| 08:41:02 | <jsnx> | http://programming.reddit.com/info/64th1/comments/c02u9mb |
| 08:41:16 | <Cale> | Then it's easy to be explicit about how they compose. |
| 08:41:35 | <jsnx> | that link is an "explanation of monads" |
| 08:44:01 | <Tac-Tics> | why do people bother to write articles like that one above? |
| 08:44:15 | <Tac-Tics> | How to furnish language X with feature from language Y |
| 08:45:09 | <Tac-Tics> | Monads really have no place in python or any language with progn semantics and sideeffects =-/ |
| 08:45:34 | <jsnx> | because they are trapped by their conservative bosses |
| 08:45:50 | <jsnx> | so they act out by reimplementing half of common lisp, as it were |
| 08:45:56 | <Tac-Tics> | heh |
| 08:46:19 | <Tac-Tics> | ACTION has no sympathy for people who consider Python a constraining language |
| 08:46:25 | <Korollary> | Heh. progn semantics. |
| 08:46:29 | <jsnx> | Tac-Tics: why not? |
| 08:46:36 | <jsnx> | Tac-Tics: you write PHP or something? |
| 08:47:01 | <matthew-_> | morning world |
| 08:47:23 | <Korollary> | good @localtime |
| 08:47:55 | <Tac-Tics> | One of the Monad gods just shot down Pidgin =-( |
| 08:48:36 | <jsnx> | some of their comments are great: "I had monads once, but they went away after I took some sulfa drugs." |
| 08:48:38 | <Tac-Tics> | And yeah, I do PHP |
| 08:48:58 | <jsnx> | Tac-Tics: i don't consider python constraining -- just unstructured |
| 08:49:17 | <jsnx> | i want to be totally 1337 all the time |
| 08:49:32 | <Tac-Tics> | Python, like all great languages, has its glaring flaws |
| 08:49:36 | <jsnx> | i don't ever want to say the word 'superclass' again |
| 08:50:00 | <matthew-_> | jsnx: err, there are super classes in haskell ;) |
| 08:50:22 | <jsnx> | matthew-_: what i mean is, i never want to think in goofy OO ways again |
| 08:51:19 | <matthew-_> | well, it's worth knowing anyway just so you can convert people to functional |
| 08:52:17 | <matthew-_> | the last straw for me was when my final-year undergrad project (which is worth a lot of marks) started showing bugs in javac and in the sun jvm. |
| 08:52:31 | <matthew-_> | "At that point I decided I'd had enough" |
| 08:52:32 | <jsnx> | matthew-_: wow |
| 08:52:32 | <Tac-Tics> | Convert the heathen imperativists! |
| 08:52:36 | <Korollary> | That is actualy not a good reason. |
| 08:52:49 | <Korollary> | GHC has bugs, too. All software has. |
| 08:53:10 | <jsnx> | GHC has bugs? |
| 08:53:14 | <Tac-Tics> | Your Java ways can lead you only down a path to Object Oriented Sin! |
| 08:53:17 | <jsnx> | ;_; |
| 08:53:25 | <mux> | I think it would probably make more sense to implement applicative functors in python than monads |
| 08:53:28 | <jsnx> | not just sin -- hell |
| 08:53:39 | <matthew-_> | yeah, but filing GHC bugs means you get to talk to the Great Men of Haskell. Not some faceless corporation |
| 08:53:50 | <jsnx> | mux: lolz, applicative functors are not fashionable yet |
| 08:53:57 | <Tac-Tics> | Do not make a false idol out of your design patterns |
| 08:54:18 | <mux> | jsnx: yeah they're not so hype :) |
| 08:54:51 | <Tac-Tics> | Transcend into the light of the closure and the glory of the lambda |
| 08:55:02 | <mux> | lol |
| 08:55:13 | <sclv> | 2008 will be the year of Control.Applicative |
| 08:55:13 | <jsnx> | mux: *hip* |
| 08:55:28 | <jsnx> | sclv: you heard it here first |
| 08:55:33 | <sclv> | I'm so getting a <*> tatoo. |
| 08:55:38 | <mux> | lol |
| 08:55:54 | <mux> | I've been seduced by Control.Applicative too |
| 08:56:00 | <sclv> | s/tatoo/tattoo / |
| 08:56:00 | <jsnx> | i want a ∘ tattoo |
| 08:56:13 | <mux> | the paper of mcbride and patterson is nice |
| 08:57:27 | <quicksilver> | all papers by either mcbride or patterson are nice :) |
| 08:58:33 | <matthew-_> | they must have written some utter drivel at some point in their lives? Surely all of us have? |
| 08:59:40 | <jsnx> | matthew-_: they wrote it for their moms ;_ |
| 09:00:23 | <matthew-_> | Korollary: I've come across bugs in ghc. I've not come across bugs in the runtime |
| 09:00:31 | <Jomyoot> | why some language has reference implementation and some languages not |
| 09:00:32 | <matthew-_> | (yet) |
| 09:00:40 | <Jomyoot> | like Haskell does not have reference implementation |
| 09:00:43 | <Jomyoot> | whereas Ruby does |
| 09:01:38 | <jaa> | which is the reference. Rubinius? JRuby? Matz 1.8 (what JRuby and Rubinius are based on) Matz 1.9/2.0 (all his new ideas) ? Ruby has no Haskell Report |
| 09:02:25 | <sclv> | Jomyoot: a standard means it was designed, a reference implementation means it was assembled. |
| 09:02:44 | <sclv> | or accumulated, maybe. |
| 09:03:17 | <sclv> | Lots of proposed Haskell' features essentially have GHC as their reference implementation for the time being though. |
| 09:03:27 | <Jomyoot> | What is Glasglow |
| 09:03:30 | <Jomyoot> | is that a university? |
| 09:04:41 | <sclv> | @go google |
| 09:04:53 | <lambdabot> | Plugin `search' failed with: getHostByName: does not exist (no such host entry) |
| 09:05:34 | <mux> | since I learnt about applicative functors, the extension proposal about being able to write things like (<- foo) seems kinda moot |
| 09:05:52 | <mux> | since it can be written <*> foo, unless I'm missing something |
| 09:06:11 | <quicksilver> | matthew-_: I guess the haskell runtime is smaller than the java one. I've never been bitten by a bug in the ghc runtime, but they have certainly existed. |
| 09:06:31 | <sclv> | mux: you mean the patterns proposal? |
| 09:06:47 | <Korollary> | Ecmascript 4 has a reference implementation. |
| 09:07:08 | <Korollary> | I think R6RS has something like it, too. |
| 09:07:10 | <mux> | sclv: I don't remember how it was called |
| 09:08:12 | <sclv> | Korollary: I stand corrected. |
| 09:09:27 | <Tac-Tics> | What do you guys mean by reference implementation? Do you mean canonical implementation? |
| 09:10:27 | <sclv> | googling for it, it looks like ecmascript's reference implementation is in part a way to make sure the language is well formed before they finalize it? |
| 09:11:13 | <jsnx> | Tac-Tics: i think the reference implementation is "the implementation that everything else should be compatible with |
| 09:11:17 | <jsnx> | " |
| 09:11:23 | <Tac-Tics> | ah |
| 09:11:49 | <sclv> | it's pretty cool actually -- they're doing it in ML so that it's well-defined enough to serve as a simultaneous well-documented spec. |
| 09:14:49 | <Philippa> | Tac-Tics: it's that and a reference implementation is designed to be simple and understandable |
| 09:15:08 | <glguy> | Prelude Main> let xs = Just 'a' :> Just "B" :> () |
| 09:15:08 | <glguy> | xs :: Maybe Char :> (Maybe [Char] :> ()) |
| 09:15:08 | <glguy> | Prelude Main> apply (\x y -> show x ++ show y) xs |
| 09:15:08 | <glguy> | "Just 'a'Just \"B\"" |
| 09:15:19 | <glguy> | It worked... polymorphic type level list folding |
| 09:15:34 | <glguy> | instance TypeFoldF TypeApply (a -> b) a b where |
| 09:15:34 | <glguy> | typefoldf TypeApply f x = f x |
| 09:15:45 | <glguy> | and apply = typefold TypeApply |
| 09:16:06 | <Mitar> | how can I calculate new values of an array using a window moving over old array? so fmap uses only one value to replace it, i would like to go use also neighborhood elements? |
| 09:16:21 | <Mitar> | and how could i make for example a flood fill on a haskell array? |
| 09:16:33 | <sclv> | Philippa: well, not always. my initial comment was in part a reference to perl being its own reference implementation. |
| 09:17:22 | <quicksilver> | haskell has something even better than a reference implementation. It has a denotational semantics! Hmm. Onl it doesn't :( |
| 09:17:37 | <quicksilver> | But we all know what the denotational semantics is supposed to be, right? |
| 09:20:49 | <Mitar> | anyone? |
| 09:21:12 | <osfameron> | is a denotational semantics just a specification? |
| 09:21:40 | <quicksilver> | a denotational semantics could be one kind of specification |
| 09:21:41 | <Tac-Tics> | It's a specification with funky syntax |
| 09:21:59 | <quicksilver> | it wouldn't specify anything like time or space constraints though |
| 09:22:04 | <Cale> | osfameron: A specification in terms of a particular kind of mathematical object. |
| 09:22:13 | <quicksilver> | so it would be a weak specification by some CS standards |
| 09:22:21 | <Tac-Tics> | (one with funky syntax... even by math standards) |
| 09:22:45 | <osfameron> | but presumably powerful for something? |
| 09:23:23 | <quicksilver> | I don't think the syntax is really part of the definition :) |
| 09:25:32 | <Tac-Tics> | I swear, the conventional syntax for denot. semantics was invented to make the writers look smarter than they would if they used python, scheme, or an enriched lambda calculus |
| 09:26:55 | <roconnor> | Tac-Tics: are you talking about the double struck square brackets? |
| 09:28:13 | <Tac-Tics> | the brackets aren't the worst. The big thing that makes me roll my eyes is the use of the special symbols for head and tail |
| 09:28:43 | <Tac-Tics> | they look like obsoleted editor's markings from some 1800's printing press |
| 09:29:18 | <Tac-Tics> | head and tail are pure functions, why not just use h(c) and t(c)? |
| 09:30:50 | <mmmdonuts> | Er, denotational semantics predated Scheme by about 15 years. |
| 09:30:52 | <Sizu1> | anybody here has packaged a library before? |
| 09:32:41 | <Tac-Tics> | mmmdonuts: fact noted, but it's still presented more confusingly than it should be |
| 09:33:48 | <jsnx> | Sizu1: small one (cedict) |
| 09:34:05 | <jsnx> | Sizu1: how can i be of service? |
| 09:34:17 | <mux> | > getZipList $ (,) <$> ZipList [1,2,3] <*> ZipList [4,5,6] |
| 09:34:20 | <lambdabot> | [(1,4),(2,5),(3,6)] |
| 09:34:44 | <Sizu1> | jsnx: thanks. i installed my own lib using cabal, in ghci :m does autocomplete my module fine, but it wont load it. why? |
| 09:35:37 | <jsnx> | do not know |
| 09:35:41 | <jsnx> | what does it say? |
| 09:36:07 | <Sizu1> | module main:<modulename> is not loaded |
| 09:36:19 | <jsnx> | i remember vaguely that i had loading problems when i was in the project directory... |
| 09:36:50 | <Sizu1> | this is it! |
| 09:37:02 | <Sizu1> | jsnx: thanks. |
| 09:37:02 | <jsnx> | yeah, i still have those problems :) |
| 09:37:11 | <Sizu1> | but it's stupid :/ |
| 09:37:26 | <jsnx> | yeah, it is some kind of path precedence thing, i'm sure |
| 09:37:28 | <Sizu1> | thanks for your help though, i thought i had messed up my .cabal |
| 09:37:42 | <jsnx> | Sizu1: what is your library? can you tell us? |
| 09:37:56 | <Sizu1> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/i18n-0.1.2 |
| 09:37:58 | <lambdabot> | http://tinyurl.com/25bfjf |
| 09:38:32 | <jsnx> | Sizu1: wow, cool |
| 09:38:36 | <Sizu1> | i suspect haddock wont build there as hackage uses haddock-0.8 |
| 09:39:25 | <mmmdonuts> | Tac-Tics, it's just syntax. You can convert back and forth between it and code automatically. Perhaps it's still used to teach students that syntax is irrelevant. :) |
| 09:40:29 | <Tac-Tics> | Isomorphism is not equivalence |
| 09:40:53 | <Tac-Tics> | It's just so uglay |
| 09:41:00 | <lament> | they're doing it because they think of themselves as mathematicians |
| 09:41:07 | <jsnx> | lolz |
| 09:41:23 | <mmmdonuts> | Scott and Strachey developed it before there were any functional programming languages! |
| 09:41:24 | <Tac-Tics> | It's like a disguise |
| 09:41:35 | <Tac-Tics> | they take this cool as hell theory stuff |
| 09:41:44 | <Tac-Tics> | and wrap it up in rags |
| 09:41:59 | <jsnx> | Tac-Tics: good wine needs no sign |
| 09:42:08 | <Tac-Tics> | so no one knows how cool it really is unless they have friends in #haskell to urge them to read it |
| 09:42:12 | <jsnx> | they want only the discerning to seek their way |
| 09:42:23 | <lament> | Tac-Tics: h() and t() look pretty ugly to me! |
| 09:42:44 | <Tac-Tics> | lament: I agree. I was going for less ugly, but still mathy |
| 09:42:56 | <jsnx> | Tac-Tics: or maybe it just helps maintain the functional status quo |
| 09:43:00 | <lament> | this seems to be very much a matter of taste |
| 09:43:18 | <lament> | (i mean, what's prettier, not why they use those symbols) |
| 09:44:22 | <mmmdonuts> | Ah well, if Haskell and Scheme ever get *too* popular, I now know what I need to do to keep the riff-raff out! ;) |
| 09:44:36 | <jsnx> | mmmdonuts: yeah -- braces! |
| 09:45:49 | <mmmdonuts> | No, typographical characters so obscure no-one even remembers their names, if they ever had any! |
| 09:46:03 | <Tac-Tics> | Top 10 Reasons Denotational Semantics are bad 1) Not enough parenthesis. 2) no intelligent indentation. 3) no macros. 4) no for loops. 5) no OOP. 6) too many parenthesis. 7) Not enough curly braces. 8) Not Web2.0 enough. 9) No open source implementation. 10) Poor support for the OS |
| 09:46:55 | <Tac-Tics> | actually, I think I am inspired to write an OSS implementation of Denot. semantics now =-) |
| 09:47:01 | <mmmdonuts> | Tac-Tics, now match that list up with the top 10 reasons the earliest functional programming languages sucked. |
| 09:47:02 | <Sizu1> | 0) Because. |
| 09:47:07 | <Tac-Tics> | It would require Unicode source |
| 09:47:27 | <jsnx> | unicode source is cool |
| 09:47:33 | <jsnx> | as long as tabs are banned |
| 09:47:51 | <Tac-Tics> | One time I accidently inserted a Japanese full-width space into my python source |
| 09:48:06 | <jsnx> | Tac-Tics: lolz |
| 09:48:10 | <Tac-Tics> | If I didn't realize what I did right away, I would have thrown the whole thing away |
| 09:48:30 | <lament> | japanese is evil |
| 09:48:33 | <jsnx> | there are source to source transformers for writing python in chinese |
| 09:48:39 | <Tac-Tics> | _ _ _ |
| 09:48:53 | <Tac-Tics> | lament: Japanese is awesome / evil |
| 09:48:56 | <jsnx> | lament: not entirely -- there's some chinese in it |
| 09:49:18 | <Tac-Tics> | Japanese makes me thinking about writting a SOV-style programming language |
| 09:50:05 | <Tac-Tics> | where the method name comes last, after the invoking object and the parameters |
| 09:51:27 | <jsnx> | "/" s.split |
| 09:51:48 | <jsnx> | s '/' split |
| 09:52:26 | <Tac-Tics> | MySql wa "localhost" "user" "pass" ni connect |
| 09:52:42 | <jsnx> | why the wa and ni? |
| 09:52:47 | <jsnx> | japanese stuff? |
| 09:52:49 | <Tac-Tics> | yeah |
| 09:52:49 | <Sizu1> | to sound japanese |
| 09:53:08 | <lament> | jsnx: ah, true |
| 09:53:14 | <jsnx> | yeah, when chinese programs start to show up, it'll be awesome |
| 09:53:30 | <jsnx> | everything will be one or two characters |
| 09:53:35 | <Tac-Tics> | What would a SOV lambda expression look like though? |
| 09:53:45 | <jsnx> | one-liners will be way more powerful |
| 09:54:06 | <lament> | Tac-Tics: how is lambda expression syntax related to the SVO order? |
| 09:54:51 | <jsnx> | Tac-Tics: the (\ x y -> blah) part is just the object and verb |
| 09:55:01 | <jsnx> | it's already OV |
| 09:55:18 | <mathrick> | Tac-Tics: wrt actual Japanese grammar, you'd rather use ga instead of wa |
| 09:55:33 | <mathrick> | just a nitpick :) |
| 09:55:41 | <jsnx> | then you put the objects in there: 7 (\x -> 3 + x) -- 10 |
| 09:55:49 | <Tac-Tics> | mathrick: yeah, for programming you're probably right |
| 09:56:11 | <Tac-Tics> | mathrick: but it would be cool to use wa to introduce a topic, and then omit it until another topic were declared |
| 09:56:38 | <mathrick> | heh, yeah |
| 09:57:01 | <mathrick> | though it'd make interpreting the source as hard as Japanese :) |
| 09:57:07 | <Tac-Tics> | cursor wa "SELECT * FROM users" kara query |
| 09:57:07 | <Tac-Tics> | row ni fetch_row |
| 09:57:47 | <wolverian> | it's called $_ in perl |
| 09:57:49 | <mathrick> | it seems even more vile than perl contexts |
| 09:58:08 | <wolverian> | perl's contexts are not vile; they're just a subtle kind of type inference. |
| 09:59:15 | <wolverian> | (granted, you have to squint quite a bit.) |
| 09:59:19 | <jsnx> | wolverian: okay, they're not vile |
| 09:59:24 | <Mitar> | nobody care about me :-( |
| 09:59:35 | <mathrick> | they're vile in the same way Japanese contexts are |
| 09:59:48 | <wolverian> | what way is that? |
| 10:00:34 | <Lemmih> | Mitar: Compute a list and then make an array out of that list? |
| 10:00:35 | <mathrick> | sure, they let you get a lot of implicit bang for your buck, but reconstructing the original intent is made hard and error-prone |
| 10:00:36 | <Mitar> | how can I calculate new values of an array using a window moving over old array? so fmap uses only one value to replace it, i would like to go use also neighborhood elements? |
| 10:00:44 | <Mitar> | and how could i make for example a flood fill on a haskell array? |
| 10:01:04 | <jsnx> | Mitar: a flood fill is actually making it from a list |
| 10:01:17 | <jsnx> | a repeating list of all the same stuff |
| 10:01:23 | <wolverian> | mathrick, it's just polymorphism on return value. :) |
| 10:01:28 | <wolverian> | er, s/value/type/ |
| 10:01:55 | <Mitar> | jsnx, i do not understand? a repeating listo of what? |
| 10:01:59 | <jsnx> | Mitar: as for using a window, if you mean something like 'five point stencil', that's a good question -- i haven't thought about it |
| 10:02:59 | <mathrick> | wolverian: and in Japanese it's just polymorphism on meaning, doesn't mean it's easy :) |
| 10:03:11 | <jsnx> | Mitar: say you want to fill an array with zeroes |
| 10:03:36 | <mathrick> | it's useful, but can (and does) lead to expressions almost devoid of meaning yet meaning almost everything |
| 10:03:41 | <jsnx> | @let zero = repeat 0 in take 10 zero |
| 10:03:41 | <lambdabot> | Parse error |
| 10:03:46 | <wolverian> | mathrick, easy, powerful, safe; pick one :) |
| 10:04:00 | <Mitar> | no, i would like to fill for example zeros i a closed area (array is representing the picture) which have the same color |
| 10:04:04 | <Mitar> | or value |
| 10:04:06 | <jsnx> | @let { ; zero = repeat 0 } in take 10 zero |
| 10:04:07 | <lambdabot> | Parse error |
| 10:04:16 | <Tac-Tics> | Analogs to type and type safety pop up all over the place! |
| 10:04:23 | <jsnx> | @let zero = repeat 0 in zero |
| 10:04:23 | <lambdabot> | Parse error |
| 10:04:26 | <wolverian> | @let zero = repeat 0 |
| 10:04:30 | <lambdabot> | Defined. |
| 10:04:36 | <jsnx> | > let zero = repeat 0 in zero |
| 10:04:37 | <mathrick> | wolverian: perl is definitely not my kinda thing, which is why I'm not very partial to its choices in this regard |
| 10:04:38 | <lambdabot> | [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0... |
| 10:04:42 | <jsnx> | aha |
| 10:04:54 | <Tac-Tics> | perl is clearly the work of a madman |
| 10:05:07 | <jsnx> | > let zero = repeat 0 in listArray (1, 10) zero |
| 10:05:08 | <lambdabot> | array (1,10) [(1,0),(2,0),(3,0),(4,0),(5,0),(6,0),(7,0),(8,0),(9,0),(10,0)] |
| 10:05:15 | <Tac-Tics> | kinda like haskell, but a madman who isn't quite mad enough to teach himself denotational semantics |
| 10:05:23 | <wolverian> | mathrick, sure. :) |
| 10:05:27 | <jsnx> | Mitar: so, it flood fills the array with zeroes |
| 10:05:43 | <wolverian> | mathrick, the weird thing, I guess, is that haskell and perl are both my kind of thing... |
| 10:05:51 | <mathrick> | of warty but useful languages, I like Common Lisp |
| 10:05:51 | <wolverian> | Tac-Tics, perl 6 fixes that.. ;) |
| 10:06:12 | <mathrick> | wolverian: can you declare parameters other than by shift yet? :P |
| 10:06:42 | <wolverian> | mathrick, in perl 6, yes. in core perl 5, no, but there is a quite recent module on CPAN that lets you do it; how it works is pretty scary XS magic. |
| 10:07:01 | <wolverian> | http://search.cpan.org/~mschwern/Method-Signatures-0.02/lib/Method/Signatures.pm |
| 10:07:03 | <lambdabot> | Title: Method::Signatures - method declarations with prototypes and without using a sou ..., http://tinyurl.com/ywt59n |
| 10:07:16 | <wolverian> | mathrick, (well, of course perl 5 lets you say 'my ($foo, $bar) = @_;' which doesn't use shift) |
| 10:09:21 | <Sizu1> | no source filter, interesting |
| 10:10:08 | <wolverian> | yes. it requires trailing ; in the declarations, but mst is fixing Devel::Declare to fix that. it's quite insane. :) |
| 10:10:55 | <Sizu1> | thanks to never-releasing-perl6, i'm a haskeller! ;) now there's no need in perl6 for me at all unfortunately. |
| 10:11:54 | <Sizu1> | or fortunately |
| 10:11:59 | <wolverian> | never? just wait for christmas. :) |
| 10:12:15 | <Tac-Tics> | perl to haskell seems like the biggest leap one could make between languages |
| 10:12:26 | <Sizu1> | and i loved it |
| 10:12:27 | <mathrick> | wolverian: which christmas? |
| 10:12:43 | <mathrick> | also, what's so bad about source filters that it avoids them? |
| 10:13:01 | <Sizu1> | well, i knew already c/c++, java, js, and all that jazz. but perl was my fave |
| 10:13:13 | <Cale> | The day on which Perl 6 is released, whatever day that eventually happens to be, will be called "christmas". |
| 10:13:14 | <wolverian> | mathrick, they don't stack gracefully, and they can't parse perl 100% reliably, so they are brittle. |
| 10:13:15 | <Tac-Tics> | Perl has such a "do what you feel" attitude and Haskell is all about "don't fuck with it unless you have explicit authority (read: type) from the Almighty GHC" |
| 10:13:18 | <mathrick> | ACTION 'd have thought they'd be somewhat like CL macros, so generally good |
| 10:13:21 | <wolverian> | mathrick, the christmas it's ready. |
| 10:13:34 | <wolverian> | also see what Cale said. :) |
| 10:13:34 | <mathrick> | wolverian: ah, so not really like macros then |
| 10:13:44 | <mathrick> | more akin to reader macros |
| 10:13:48 | <wolverian> | mathrick, no. what Devel::Declare provides is more like macros. |
| 10:13:50 | <Cale> | otoh, isn't pugs reasonably usable already? |
| 10:14:08 | <mathrick> | wolverian: I mean source filters are not really like macros |
| 10:14:14 | <wolverian> | Cale, yes, but it's languishing, unfortunately. parrot is taking big leaps, though, now that they have NQP to implement languages in. |
| 10:14:20 | <wolverian> | mathrick, yes, me too. |
| 10:14:37 | <wolverian> | that is, my "no" was an affirmative. |
| 10:14:42 | <mathrick> | aha |
| 10:14:43 | <wolverian> | (english sucks sometimes, sorry.) |
| 10:14:55 | <wolverian> | s/english/my english/ |
| 10:14:55 | <mathrick> | s/sometimes// |
| 10:14:59 | <wolverian> | heh |
| 10:15:39 | <wolverian> | parrot even has a make perl6 target now, so you actually get a native perl6 compiler binary. :) |
| 10:17:09 | <wolverian> | anyway, sorry, this is a bit #offtopic |
| 10:17:33 | <Sizu1> | pugs is in haskell, so it's all related. perl = haskell ;P |
| 10:17:38 | <wolverian> | ;) |
| 10:18:39 | <codemac> | omg my brain just clicked on the monad thing. |
| 10:18:42 | <codemac> | thought I'd share. |
| 10:19:02 | <wolverian> | ewww, get your head off my monad |
| 10:20:10 | <Tac-Tics> | x >>= f -- Monadic Bondage! |
| 10:20:17 | <Sizu1> | do NOT touch my monad with YOUR monad! |
| 10:21:37 | <Cale> | codemac: cool :) |
| 10:21:43 | <Cale> | codemac: what did it for you? |
| 10:21:56 | <codemac> | http://programming.reddit.com/info/64th1/comments/c02u9mb << what did it for everyone else today |
| 10:21:57 | <Tac-Tics> | Do you implement the Show class? Or are you just happy to see me? |
| 10:23:01 | <Sizu1> | ah sure 'method' is a simple subroutine ending with ';' -- talking about Method::Signatures |
| 10:23:41 | <Sizu1> | why the need for xs |
| 10:24:14 | <wolverian> | Sizu1, no, it's not. |
| 10:24:22 | <wolverian> | Sizu1, you can not write 'foo (...) { ... };' without X. |
| 10:24:24 | <wolverian> | er, XS |
| 10:24:28 | <wolverian> | codemac, wow, nice post. |
| 10:25:08 | <Cale> | codemac: You might want to continue with http://haskell.org/haskellwiki/Monads_as_computation (shameless plug :) |
| 10:26:36 | <Sizu1> | wolverian: ok i see. can you use strict with it? |
| 10:26:41 | <wolverian> | Sizu1, yes. |
| 10:26:50 | <Cale> | To sleep! |
| 10:27:29 | <Tac-Tics> | Monads are Math things that let you do non-Math things |
| 10:27:41 | <quicksilver> | s/Monads/Computers/ |
| 10:28:10 | <wolverian> | s/Computers/Everything/ |
| 10:28:11 | <Tac-Tics> | quicksilver, your truth is greater |
| 10:28:23 | <quicksilver> | wolverian's truth is ungrammatical |
| 10:28:40 | <quicksilver> | Sizu1: XS gives you lisp-macro like abilities |
| 10:28:48 | <wolverian> | quicksilver's truth is true. |
| 10:28:57 | <quicksilver> | Sizu1: in particular, it lets you receive your arguments as syntax trees |
| 10:29:01 | <quicksilver> | instead of values |
| 10:29:10 | <quicksilver> | if I correctly undesrstand how Devel::Declare works. |
| 10:29:16 | <wolverian> | roughly. |
| 10:29:21 | <wolverian> | it sounds tidier than it is. |
| 10:29:45 | <therp> | quicksilver: what's XS? |
| 10:29:56 | <wolverian> | perl's C extension API |
| 10:30:45 | <therp> | 50% of the terms in that expression scare me. |
| 10:31:09 | <wolverian> | heh |
| 10:51:29 | <sarah> | what does malformed lhs to type of class declaration mean |
| 10:54:55 | <Mitar> | what I have to define to make a pair of ints an instance of Random? |
| 10:56:49 | <quicksilver> | Mitar: the most natural thing is instance (Random a,Random b) => Random (a,b) |
| 10:56:58 | <quicksilver> | Mitar: I'm not sure where there isn't a default instance along those lines. |
| 10:57:12 | <Lemmih> | Mitar: http://www.haskell.org/ghc/docs/latest/html/libraries/random/System-Random.html#t%3ARandom |
| 10:57:13 | <lambdabot> | http://tinyurl.com/3yau3k |
| 10:57:21 | <Mitar> | and deriving does not work ;-( |
| 10:57:45 | <quicksilver> | indeed, you can't derive Ranomd. |
| 10:57:52 | <quicksilver> | it's not hard to write the instance though. |
| 10:58:25 | <quicksilver> | Oh. I know why there isn't a default definition for (a,b) |
| 10:58:35 | <quicksilver> | just because it's not 100% clear what the range should mean. |
| 10:59:25 | <quicksilver> | actually I think that's a bit of ugliness in the class. |
| 11:07:49 | <Mitar> | juhej, to get a list of random pixels in a image: rands = randomRs (bounds image) (mkStdGen 42) |
| 11:08:09 | <Mitar> | (their indexes) |
| 11:18:46 | <EvilTerran> | randomR ((xlo,ylo),(xhi,yhi)) g = (randomR (xlo,xhi) g, randomR (ylo,yhi) g) -- is the only reasonable solution i can think of |
| 11:20:57 | <EvilTerran> | hm... not quite right |
| 11:21:01 | <Mitar> | no |
| 11:21:11 | <Mitar> | randomR ((lx,ly),(ux,uy)) g = ((x,y),g'') |
| 11:21:11 | <Mitar> | where (x,g') = randomR (lx,ux) g |
| 11:21:11 | <Mitar> | (y,g'') = randomR (ly,uy) g' |
| 11:21:14 | <Mitar> | i made it like this |
| 11:21:20 | <EvilTerran> | yeah, that's the one |
| 11:21:46 | <EvilTerran> | but the range isn't the problem, it's threading the generator that's a bit of a pain |
| 11:22:38 | <EvilTerran> | @unmtl State s a |
| 11:22:39 | <lambdabot> | s -> (a, s) |
| 11:22:42 | <EvilTerran> | ?type randomR |
| 11:22:57 | <lambdabot> | thread killed |
| 11:23:03 | <EvilTerran> | @type randomR |
| 11:23:04 | <lambdabot> | forall a g. (Random a, RandomGen g) => (a, a) -> g -> (a, g) |
| 11:23:39 | <EvilTerran> | hmm |
| 11:25:46 | <EvilTerran> | ?type \((xlo,ylo),(xhi,yhi)) -> runState $ liftM2 (,) (State $ randomR (xlo,xhi)) (State $ randomR (ylo,yhi)) |
| 11:25:47 | <lambdabot> | forall a s a1. (Random a, Random a1, RandomGen s) => ((a, a1), (a, a1)) -> s -> ((a, a1), s) |
| 11:26:30 | <EvilTerran> | ?pl \((lx,ly),(ux,uy)) -> ((lx,ux),(ly,uy)) |
| 11:26:30 | <lambdabot> | uncurry (uncurry (flip flip snd . (ap .) . flip flip fst . ((.) .) . (. (,)) . flip . (((.) . (,)) .) . (,))) |
| 11:26:34 | <EvilTerran> | ... |
| 11:26:55 | <Mitar> | how could i randomize a list of numbers (its order) |
| 11:27:09 | <quicksilver> | EvilTerran: MonadRandom lets you thread the generator silently |
| 11:27:30 | <EvilTerran> | ?type (fst *** fst) &&& (snd *** snd) |
| 11:27:30 | <lambdabot> | forall a b a1 b1. ((a, b), (a1, b1)) -> ((a, a1), (b, b1)) |
| 11:27:37 | <quicksilver> | doesn't particularly help with randomR though, because randomR has the type it has... |
| 11:27:50 | <quicksilver> | Mitar: google for 'haskell shuffle' |
| 11:28:10 | <EvilTerran> | quicksilver, i imagine it works much like my State one there does |
| 11:29:06 | <quicksilver> | EvilTerran: yes, it does. |
| 11:29:35 | <quicksilver> | Many interesting monads can be implemented using State. |
| 11:29:55 | <quicksilver> | however, ironically, the restricted interface can be more interesting than the general one. |
| 11:36:18 | <EvilTerran> | ACTION is reminded of "implement all these list functions using foldr" |
| 11:36:24 | <EvilTerran> | "implement all these monads using State" :P |
| 11:36:46 | <osfameron> | list functions with foldr was *hard* |
| 11:37:36 | <Mitar> | oh |
| 11:37:39 | <Mitar> | i used shuffle es = map snd $ sortBy (comparing fst) $ zip rs es |
| 11:37:46 | <Mitar> | and now i get stack overflow ... |
| 11:38:02 | <Mitar> | (on a million of elements) |
| 11:39:19 | <quicksilver> | are you compiling with -O2 ? |
| 11:40:26 | <Mitar> | yes .. |
| 11:42:49 | <Mitar> | i enlarged stack size and now it works ... |
| 11:43:02 | <Mitar> | -K200000000 |
| 11:43:07 | <Mitar> | :-) |
| 11:43:59 | <EvilTerran> | ACTION read that as -O200000000 the first time :P |
| 11:44:11 | <wy> | Has anyone looked at dependent types? |
| 11:44:17 | <quicksilver> | ACTION thinks about Mitar's sort |
| 11:44:23 | <quicksilver> | well sortBy is an in-memory sort |
| 11:44:35 | <quicksilver> | so it's only useful on "small" lists |
| 11:44:54 | <quicksilver> | I'm surprised it got stack overflow though |
| 11:44:56 | <Mitar> | if i want to have a record of all elements i have to process and to be able also to remove random other elements from this record ... |
| 11:45:02 | <Mitar> | i probably should not use lists? |
| 11:45:05 | <quicksilver> | it should only use O(log n) stack would have thought |
| 11:45:14 | <Mitar> | as I can nicelly prcess them |
| 11:45:35 | <Mitar> | but searching if the elements is there and removing it if it is, is O(n) |
| 11:45:49 | <Mitar> | what could I use as a structure? |
| 11:46:06 | <quicksilver> | Data.Set, if the elements are unique |
| 11:46:12 | <quicksilver> | Data.Seq if order is important |
| 11:46:17 | <quicksilver> | are the obvious choices |
| 11:46:28 | <Mitar> | which I will be able to easily traverse (can be randomly, it should be randomly - i am shuffling the list now) |
| 11:46:47 | <Mitar> | and easily remove also other elements while i am traversing |
| 11:47:54 | <quicksilver> | removing elements while traversing could be a job for a zipper |
| 11:48:14 | <quicksilver> | might need a little more of a picture of what you're trying to do |
| 11:49:15 | <Mitar> | i have an array representing the picture |
| 11:49:21 | <Mitar> | i would like to make an function |
| 11:49:25 | <Mitar> | whichi would take this array |
| 11:49:44 | <Mitar> | and give me as a result a list of lists of pixels which have "similar" colors |
| 11:50:00 | <Mitar> | so list of regions with similar colors on a image |
| 11:50:21 | <quicksilver> | and you want to "condense" regions as you sort through and find they're connected? |
| 11:50:29 | <Mitar> | yes |
| 11:50:35 | <Mitar> | so i start randomly somwhere |
| 11:50:49 | <Mitar> | check around it, if it is ok, i append, remove from the list i have yet to process |
| 11:50:51 | <quicksilver> | I've written code like this once |
| 11:50:57 | <quicksilver> | ACTION thinks |
| 11:51:04 | <Mitar> | if there is nothing i add to the resulting list |
| 11:51:10 | <quicksilver> | the simplest approach is linear scan |
| 11:51:11 | <Mitar> | and starts somewhere else |
| 11:51:16 | <quicksilver> | go through the whole list of regions |
| 11:51:23 | <quicksilver> | and check for overlap/adjacency |
| 11:51:45 | <Mitar> | i do not have any list of regions at the beginning |
| 11:51:53 | <quicksilver> | yes, that the empty list then :P |
| 11:52:09 | <quicksilver> | more sophisticated is some kind of 2D spatial tree |
| 11:52:18 | <quicksilver> | so you can "quickly" find nearby regions and check if they are the same colour |
| 11:53:04 | <Mitar> | i have an array to quickly check (read) values ... |
| 11:53:36 | <Mitar> | hmm, i could maybe define this as a fix point function |
| 11:53:44 | <Mitar> | have first all pixels as regions |
| 11:53:55 | <Mitar> | find two neighbourginh pixels with similar color |
| 11:53:57 | <Mitar> | combine them |
| 11:54:13 | <quicksilver> | yes |
| 11:54:14 | <Mitar> | (two neigbourghing (i cannot spell this) regions) |
| 11:54:28 | <Mitar> | but this will not be really efective |
| 11:54:30 | <Mitar> | or? |
| 11:54:40 | <quicksilver> | with laziness it might be |
| 11:54:45 | <quicksilver> | you never "really" have all pixels as regions |
| 11:54:52 | <quicksilver> | because that is lazily generated. |
| 11:55:01 | <Mitar> | hmm |
| 11:55:17 | <quicksilver> | I'd start with the simplest to understand |
| 11:55:20 | <Mitar> | still is the set best to use ... do you agree? |
| 11:55:24 | <quicksilver> | and then optimise when you find it too slow |
| 11:55:47 | <Mitar> | hmm |
| 11:55:48 | <quicksilver> | I think set could work reasonably, yes |
| 11:55:51 | <quicksilver> | Set (Set Pixel) |
| 11:55:55 | <quicksilver> | a set of sets of pixels |
| 11:56:00 | <Mitar> | yes ... |
| 11:56:22 | <quicksilver> | I like to start with a program which is "obviously" correct |
| 11:56:26 | <Mitar> | why a set of sets? |
| 11:56:31 | <quicksilver> | because it corresponds to a specification of the algorithm |
| 11:56:31 | <Mitar> | why not a set of lists? |
| 11:56:35 | <quicksilver> | you could do that, yes |
| 11:56:43 | <quicksilver> | and then optimise it only if I find it is too slow |
| 11:56:46 | <Mitar> | it is easier to append ... |
| 11:57:26 | <Mitar> | why would this be slow? |
| 11:57:26 | <Mitar> | hmm |
| 11:58:34 | <Mitar> | hmm |
| 11:59:00 | <Mitar> | i see the problem ... how can i find if two regions are close to each other |
| 11:59:45 | <Mitar> | i think i will go from oposite direction ... |
| 11:59:46 | <quicksilver> | define the 'neighbourhood set' as all pixels 1 pixel away |
| 11:59:59 | <quicksilver> | then A is next to B if A intersects with (neighbourhood B) |
| 12:00:17 | <Mitar> | but this will be so slow ... |
| 12:00:34 | <Mitar> | it will redo work all the time .. |
| 12:00:41 | <Mitar> | i will go bottom up |
| 12:00:47 | <Mitar> | go over all pixels |
| 12:01:00 | <Mitar> | and check if there are any neigbours i can combine it with |
| 12:01:06 | <Mitar> | and i will do until i can |
| 12:08:40 | <__pao__> | a newbie question... when recursive infinite list a partially evaluated... values are cached for next evaluation? |
| 12:09:19 | <Lemmih> | __pao__: Yes. |
| 12:09:26 | <__pao__> | > let l = 0 : map (+1) l |
| 12:09:26 | <lambdabot> | Parse error at end of input |
| 12:09:37 | <__pao__> | Lemmih: thanks |
| 12:10:05 | <__pao__> | > 1 |
| 12:10:08 | <lambdabot> | 1 |
| 12:10:09 | <opqdonut> | @oeis 1 1 3 |
| 12:10:09 | <lambdabot> | Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0<=k... |
| 12:10:09 | <lambdabot> | [1,1,1,1,2,1,1,3,3,1,1,4,6,4,1,1,5,10,10,5,1,1,6,15,20,15,6,1,1,7,21,35,35,21... |
| 12:10:39 | <__pao__> | > f x = x + 1 |
| 12:10:40 | <lambdabot> | Parse error at "=" (column 5) |
| 12:10:47 | <__pao__> | > let f x = x + 1 |
| 12:10:47 | <lambdabot> | Parse error at end of input |
| 12:10:59 | <__pao__> | give up :-) |
| 12:11:23 | <andun> | > let f x = x + 1 in f 1 -- __pao__ |
| 12:11:24 | <lambdabot> | 2 |
| 12:12:03 | <__pao__> | andun: only expression... no definitions .... |
| 12:12:10 | <andun> | yes |
| 12:12:14 | <opqdonut> | @def f x = x + 1 |
| 12:12:14 | <lambdabot> | Maybe you meant: bf let |
| 12:12:18 | <opqdonut> | @let f x = x + 1 |
| 12:12:21 | <lambdabot> | Defined. |
| 12:12:23 | <opqdonut> | > f 2 |
| 12:12:24 | <lambdabot> | 3 |
| 12:12:25 | <opqdonut> | :) |
| 12:12:27 | <opqdonut> | @undef f |
| 12:12:27 | <lambdabot> | Undefined. |
| 12:12:38 | <__pao__> | opqdonut: thanks :-) |
| 12:12:47 | <andun> | > let l = 1 : map (+1) l in l |
| 12:12:47 | <__pao__> | @undef |
| 12:12:54 | <lambdabot> | Undefined. |
| 12:12:56 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,... |
| 12:13:32 | <__pao__> | well... haskell and functional programming are great! let me share my newbie enthusiasm :-) |
| 12:14:17 | <__pao__> | > l |
| 12:14:18 | <lambdabot> | Not in scope: `l' |
| 12:14:35 | <__pao__> | > let l = 1 : map (+1) l in l |
| 12:14:36 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,... |
| 12:14:38 | <__pao__> | > l |
| 12:14:39 | <lambdabot> | Not in scope: `l' |
| 12:14:48 | <nanothief> | __pao__: try /query lambdabot, and you can do as much as you like without spamming the channel :) |
| 12:15:06 | <__pao__> | sorry nanothief :-) |
| 12:15:21 | <__pao__> | nanothief: I'll do as you suggest |
| 12:15:23 | <andun> | __pao__: l is only defined in the "in" block |
| 12:15:32 | <__pao__> | andun: got it |
| 12:15:51 | <__pao__> | andun: is a local binding ... local to the expression |
| 12:17:18 | <andun> | yes |
| 12:24:32 | <resiak> | Any Cabal ninjas around? With http://linkpot.net/healer/ as my hfuse.cabal, the two executables are built against the installed version of the library rather than with the version built by the same .cabal. If I replace Build-Depends with Other-Modules, building the library fails with "HFuse.hsc:79:27: error: fuse_wrappers.h: No such file or directory" (I guess it's looking in the wrong place for some reason?). I thought that the settings in ... |
| 12:24:34 | <lambdabot> | Title: darcs - hfuse |
| 12:24:38 | <resiak> | ... each section were independent, but settings in the Executable section seem to affect the building of the library. Am I doing something obvious wrong? |
| 12:28:08 | <thoughtpolice> | you can build the executables and link against the library the cabal exports, yes |
| 12:28:40 | <thoughtpolice> | i believe the way I did it was simply to add the directory pointing to your module heirarchy in the executable's "hs-source-dirs" field |
| 12:29:28 | <thoughtpolice> | i.e. if you have your executable sources in bin and the library under lib/, in the executable stanza you'd have hs-source-dirs: bin lib |
| 12:29:51 | <resiak> | along with a build-depends line, or an other-modules line? |
| 12:29:52 | <thoughtpolice> | this will cause the library to be rebuilt several times, though |
| 12:30:01 | <thoughtpolice> | no need for build-depends line |
| 12:30:01 | <resiak> | ick. |
| 12:30:06 | <thoughtpolice> | yeah |
| 12:30:16 | <thoughtpolice> | it'll be rebuilt first for the actual library that'll be registered |
| 12:30:23 | <resiak> | Executable HelloFS Main-Is: HelloFS.hs HS-Source-Dirs: . |
| 12:30:31 | <thoughtpolice> | and once for every executable that does that little trick |
| 12:30:35 | <resiak> | fails with Could not find module `HFuse': |
| 12:30:50 | <resiak> | ("." because all the source is in the root dir) |
| 12:31:12 | <resiak> | (could this be because HFuse is HFuse.hsc, not .hs ?) |
| 12:32:24 | <thoughtpolice> | that's kind of what I was thinking, it might need the hsc2hs run over it first |
| 12:32:42 | <resiak> | yeah; i would kind of expect cabal and/or ghc to deal with that |
| 12:32:44 | <resiak> | *sigh* |
| 12:33:06 | <thoughtpolice> | try running hsc2hs over it first explicitly and seeing then if the build works |
| 12:33:13 | <Taejo> | @pl \(x,y) -> (y,x) |
| 12:33:13 | <lambdabot> | uncurry (flip (,)) |
| 12:33:16 | <thoughtpolice> | or run Setup.hs build with -v3 or something |
| 12:33:20 | <thoughtpolice> | to see exactly what cabal's doing |
| 12:35:06 | <hpaste> | resiak pasted "Different build failure having manually run hsc2hs" at http://hpaste.org/4867 |
| 12:35:39 | <thoughtpolice> | hm. :/ |
| 12:35:55 | <resiak> | yeah |
| 12:36:23 | <resiak> | Oh, if I include Build-Depends: HFuse in the Executable section, the library itself is built with '-package HFuse-0.12', which seems wrong# |
| 12:37:36 | <thoughtpolice> | support for this stuff isn't first class in cabal because i think the general attitude is if you need to do this conceptually the executable and lib should be seperate anyway. worst comes to worst you might just want to put the examples under a seperate dir and have cabal build the lib, then just provide a makefile for the examples :/ |
| 12:38:05 | <resiak> | heh, i just spent a day fixing up the .cabal so that I could blow away the Makefile :) |
| 12:38:22 | <resiak> | yeah, an example/Makefile wouldn't be too horrible I guess, although it makes me sad. |
| 12:38:25 | <thoughtpolice> | besides, having it rebuild the library several times for every executable does suck, imo. |
| 12:38:43 | <resiak> | it does suck. it shouldn't be necessary. oh well |
| 12:38:49 | <thoughtpolice> | sry :( |
| 12:39:05 | <resiak> | eh, presumably it's not your fault? :) |
| 12:39:15 | <resiak> | Thanks for your help! |
| 12:39:22 | <thoughtpolice> | resiak: and out of curisotiy... is this fuse binding going to work on ghc 6.8? :) |
| 12:39:25 | <thoughtpolice> | no prob. |
| 12:40:56 | <thoughtpolice> | i've been suprised up to this point nobody's written one for more recent ghc's... last one I heard of was for 6.2 for halfs. |
| 12:40:57 | <resiak> | [This isn't a new binding; it's me working on Jérémy Bobbio's] |
| 12:41:34 | <thoughtpolice> | ah. cool beans. :) fuse is interesting stuff, bindings for haskell makes better. :) |
| 12:41:52 | <resiak> | I haven't upgraded to 6.8 yet; it's not in Ubuntu Hardy and I don't want to build it all myself or use an un-packaged binary, so |
| 12:42:54 | <resiak> | (Hrm, anyone here on a Mac feel like seeing if it builds against macfuse? :)) |
| 12:43:00 | <thoughtpolice> | ah. well when you get all that worked out give me a ring and i'd be happy to help test with 6.8 |
| 12:43:24 | <resiak> | That'd be great! |
| 12:45:42 | <thoughtpolice> | resiak: went ahead and pulled the repo. :) i can't do much work right now since I have school pretty soon here, but when I get back i'll pull any more updates and give building and testing it a whirl. |
| 12:46:00 | <resiak> | cool, thanks |
| 12:47:22 | <Mitar> | why data.set.union does not work on set of sets |
| 12:47:27 | <Mitar> | instead of list of sest |
| 12:47:32 | <Mitar> | now i cannot use it like concatMp |
| 12:47:36 | <Mitar> | concatMap |
| 12:47:48 | <Taejo> | Mitar: I have just been wondering the same thing |
| 12:52:22 | <Mitar> | what is difference between elems and toList? |
| 12:54:05 | <Mitar> | elems :: Set a -> [a] |
| 12:54:05 | <Mitar> | elems s |
| 12:54:05 | <Mitar> | = toList s |
| 12:54:06 | <Mitar> | none :-) |
| 12:56:14 | <resiak> | thoughtpolice: for when you get back, pushed! |
| 12:58:28 | <jedbrown> | ACTION thinks an `upgrade all' feature in cabal-install would be useful. |
| 13:10:54 | <opqdonut> | heh |
| 13:13:39 | <Mitar> | hmm |
| 13:13:47 | <Mitar> | why is Data.Set.intersection O(n+m)??? |
| 13:14:03 | <Mitar> | why not O(m*log(n))? |
| 13:15:25 | <cpoucet> | @src Data.Set.intersection |
| 13:15:25 | <lambdabot> | Source not found. I am sorry. |
| 13:15:38 | <quicksilver> | n+m is better than m*log(n) |
| 13:16:03 | <Mitar> | for small m? |
| 13:16:09 | <Mitar> | if i have m = 10 and n = 100000 |
| 13:16:10 | <Mitar> | ? |
| 13:16:29 | <quicksilver> | depends on the constant factors, doesn't it :P |
| 13:16:36 | <quicksilver> | O(m*log(n) could be |
| 13:16:37 | <Mitar> | sure :-) |
| 13:16:42 | <quicksilver> | 100000000000 * m * log(n) |
| 13:16:47 | <quicksilver> | while n+m is n+m |
| 13:16:48 | <quicksilver> | ACTION shrugs |
| 13:16:56 | <cpoucet> | O notation is messy |
| 13:17:04 | <quicksilver> | it's "better" in the only sense that "better" could mean. |
| 13:17:12 | <cpoucet> | Since computers are bounded, the limit to infinity is rather lame if you can have constnt factors this big |
| 13:17:27 | <cpoucet> | s/lame/moot |
| 13:17:59 | <quicksilver> | but there could be cases where the n+m algorithm is slowwer than the m*log(n) one, I agree |
| 13:18:30 | <cpoucet> | quicksilver: it depends on hwo m and n go to infinity :) |
| 13:18:38 | <cpoucet> | if n goes first, m*log(n) is better |
| 13:19:22 | <cpoucet> | draw an arc from (0,inf) to (inf,0) |
| 13:19:36 | <cpoucet> | all those points are on the infinity circle, and which direction you go defines which is better |
| 13:19:47 | <quicksilver> | I had a look at the source, but I don't understand the algorithm for intersection |
| 13:19:50 | <quicksilver> | ;) |
| 13:19:57 | <cpoucet> | link/ |
| 13:19:58 | <quicksilver> | I find the notion of a m+n algorithm for intersection surprising |
| 13:20:01 | <cpoucet> | @src Data.Set |
| 13:20:01 | <quicksilver> | but I guess they're right. |
| 13:20:01 | <lambdabot> | Source not found. My brain just exploded |
| 13:20:05 | <cpoucet> | @index Data.Set |
| 13:20:06 | <lambdabot> | bzzt |
| 13:20:06 | <quicksilver> | http://www.haskell.org/ghc/docs/latest/html/libraries/containers/src/Data-Set.html#intersection |
| 13:20:16 | <lambdabot> | Title: Haskell Code by HsColour, http://tinyurl.com/2v3nau |
| 13:23:35 | <wy> | I looked Scala just now. It seems mixins is much like type classes of haskell |
| 13:25:09 | <quicksilver> | I don't think so |
| 13:25:17 | <quicksilver> | mixins have a single definition |
| 13:25:23 | <quicksilver> | which you apply to multiple classes |
| 13:25:27 | <quicksilver> | (if I understand scala right) |
| 13:25:34 | <quicksilver> | the point of typeclasses is multiple definitions |
| 13:25:38 | <quicksilver> | different per type |
| 13:25:48 | <cpoucet> | mixins are like template classes in c++ |
| 13:25:49 | <cpoucet> | e.g. |
| 13:26:06 | <cpoucet> | typename <class Super> class Mixin : public Super { // mixin functionality }' |
| 13:26:10 | <cpoucet> | s/'/; |
| 13:26:24 | <quicksilver> | right |
| 13:26:29 | <cpoucet> | you slice a horizontal layer out of the hierarchy |
| 13:26:29 | <quicksilver> | so you write the code once, only |
| 13:26:38 | <cpoucet> | and can then reuse that :) |
| 13:26:41 | <quicksilver> | the defining feature of type classes is that you write each instance |
| 13:26:46 | <cpoucet> | we use taht technique to have a full library of memory allocators |
| 13:26:47 | <quicksilver> | it's the opposite of code-reuse |
| 13:26:50 | <quicksilver> | it's adhoc |
| 13:26:54 | <quicksilver> | it's code-rewriting :) |
| 13:27:10 | <quicksilver> | [of course, you do it to enable code-reus in other places: you factor out the adhocness] |
| 13:27:33 | <quicksilver> | [or, you do it to abuse the type system. If that's your sickness of choice] |
| 13:28:03 | <wy> | But there is default methods in type classes |
| 13:28:51 | <matthew-_> | > do { let 1 = 2; return 3 } |
| 13:28:51 | <lambdabot> | Parse error at "}" (column 26) |
| 13:28:55 | <matthew-_> | err? help? |
| 13:29:22 | <matthew-_> | ahh, the let's not being terminated? |
| 13:29:34 | <quicksilver> | > do { let {1=2} ; return 3 } |
| 13:29:36 | <lambdabot> | add an instance declaration for (Show (t1 t)) |
| 13:29:41 | <matthew-_> | super, thanks |
| 13:30:07 | <cpoucet> | > let 1 = 2 in 3 |
| 13:30:10 | <lambdabot> | 3 |
| 13:30:13 | <cpoucet> | > let 1 = 2 in 1 |
| 13:30:14 | <lambdabot> | 1 |
| 13:30:27 | <quicksilver> | I have no idea why that is legal :P |
| 13:30:30 | <cpoucet> | yeah |
| 13:30:33 | <cpoucet> | that should translate to |
| 13:30:42 | <cpoucet> | let (fromInteger 1) = (fromInteger 2) in 1? |
| 13:30:47 | <matthew-_> | it's never evaluated, surely |
| 13:30:49 | <cpoucet> | erm in (fromInteger 1) |
| 13:30:57 | <matthew-_> | > do { let {[x] = []} ; return x } :: Maybe Int |
| 13:30:58 | <cpoucet> | but what does "let 1 = 2" mean |
| 13:30:58 | <lambdabot> | Irrefutable pattern failed for pattern [x] |
| 13:31:01 | <quicksilver> | let x | fromInteger x == 1 = 2 |
| 13:31:03 | <quicksilver> | I believe |
| 13:31:07 | <matthew-_> | that's annoying - it doesn't call fail |
| 13:31:22 | <quicksilver> | matthew-_: [x] <- return [] |
| 13:31:50 | <quicksilver> | matthew-_: ugly hack but I've done it on occasion |
| 13:32:17 | <matthew-_> | I think in this case, I'm just being lazy |
| 13:32:30 | <wy> | I wonder if Scala has some advantage over haskell? |
| 13:32:36 | <cpoucet> | wy: stop comparing languages |
| 13:32:47 | <quicksilver> | wy: it's easier to type |
| 13:32:50 | <cpoucet> | one language is a hammer, the other is a screwdriver |
| 13:32:53 | <quicksilver> | 5 characters instead of 7 |
| 13:32:54 | <cpoucet> | you need more than one language |
| 13:33:01 | <wy> | No. There could be a perfect one |
| 13:33:04 | <quicksilver> | ...unless one of them is haskell. |
| 13:33:07 | <cpoucet> | No there couldn't |
| 13:33:41 | <wy> | There need be only one high leve language. Maybe it doesn't exist yet, but there should be |
| 13:33:44 | <cpoucet> | Programming is a niche activity, you have web-programming, compiler-programming, gui-programming, etc.. |
| 13:33:55 | <cpoucet> | I am -certain- some languages lend themselves better to some domains and less to others |
| 13:34:05 | <flux> | wy, would it be better than human language? |
| 13:34:07 | <cpoucet> | wy: programming languages are a pareto curve |
| 13:34:17 | <cpoucet> | well ok |
| 13:34:20 | <cpoucet> | some fall under it, like java |
| 13:34:22 | <cpoucet> | ACTION coughs |
| 13:34:50 | <wy> | Well, quicksilver said it's easier to type |
| 13:34:51 | <matthew-_> | @index MonadPlus |
| 13:34:51 | <lambdabot> | Control.Monad, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Cont, Control.Monad.Error, Control.Monad.List |
| 13:35:05 | <vincenz> | wy: that's just fascetious |
| 13:35:05 | <lambdabot> | vincenz: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 13:35:21 | <vincenz> | lambdabot: erm, I already read that one, thank oyu |
| 13:36:53 | <matthew-_> | how can you pattern match on a monadplus result if you don't know the monad? |
| 13:37:17 | <vincenz> | matthew-_: ? |
| 13:38:00 | <matthew-_> | say I've got a computation m a, but I don't know what the m is. And then if m a fails I want to do x but if m a reveals an a then I want to do y where x,y :: IO b |
| 13:38:05 | <wy> | vincenz: But may be it's also rigorous? |
| 13:38:24 | <vincenz> | wy: the proof of burden lies on you |
| 13:38:30 | <matthew-_> | I need, like, maybe for all m |
| 13:38:53 | <vincenz> | matthew-_: sounds like you want MonadError |
| 13:38:57 | <vincenz> | it has catch |
| 13:39:12 | <vincenz> | @src catch |
| 13:39:13 | <lambdabot> | catch m k = catchException m handler where handler (IOException err) = k err |
| 13:39:15 | <Philippa> | you can't do it for all possible m a, but if you're allowed a monad transformer that's different |
| 13:39:25 | <Philippa> | at least, you can't do it from outside the IO monad |
| 13:39:29 | <wy> | There could be a proof, but I need to get some motivation to do it |
| 13:39:42 | <matthew-_> | vincenz: right, that makes vast amounts of sense |
| 13:40:33 | <quicksilver> | matthew-_: that is "mplus" for many monads |
| 13:40:46 | <matthew-_> | that also makes sense |
| 13:40:49 | <quicksilver> | matthew-_: in particular, the Error monads in MonadError define mplus that way. |
| 13:41:03 | <quicksilver> | it's like catch but it doesn't actually catch the exception |
| 13:41:06 | <matthew-_> | vincenz: did you mean catch or catchError? |
| 13:41:11 | <quicksilver> | (I.e. it's "do this instead, but I don't care what went wrong") |
| 13:41:14 | <vincenz> | @src catchError |
| 13:41:15 | <lambdabot> | Source not found. Just try something else. |
| 13:41:19 | <vincenz> | matthew-_: I think catchError |
| 13:41:33 | <vincenz> | @src MonadError |
| 13:41:34 | <lambdabot> | class (Monad m) => MonadError e m | m -> e where |
| 13:41:34 | <lambdabot> | throwError :: e -> m a |
| 13:41:34 | <lambdabot> | catchError :: m a -> (e -> m a) -> m a |
| 13:41:45 | <matthew-_> | surely throwError is just fail with some extra magic? |
| 13:41:57 | <quicksilver> | do { foo <- m a; x foo } `mplus` { y } |
| 13:42:00 | <quicksilver> | erm |
| 13:42:03 | <quicksilver> | do { foo <- ma; x foo } `mplus` { y } |
| 13:42:15 | <quicksilver> | where ma :: m a, x :: a -> m b and y :: m b |
| 13:42:34 | <matthew-_> | ahh, I see. yes of course. |
| 13:42:37 | <quicksilver> | and there is a missing superfluous 'do' |
| 13:42:44 | <matthew-_> | grr, Haskell is so annoying |
| 13:42:56 | <quicksilver> | and I took the liberty of assuming you wanted to do something with the returned 'a' from the 'm a' :) |
| 13:43:03 | <matthew-_> | you learn one thing for one situation and then don't see how the same stuff applies in 100 other cases |
| 13:43:33 | <Toxaris> | matthew-_: throwError is a typeclass method, it can be whatever the instance writer want :) but in a sensible MonadError instance, fail = throwError . strMsg, so fail is just throwError with extra magic |
| 13:43:45 | <vincenz> | quicksilver: I don't see how MonadError can, since it is based on monad, not monadplus |
| 13:44:33 | <matthew-_> | so is there an isMZero ? rather like isJust ? |
| 13:44:39 | <quicksilver> | vincenz: the concrete instances do |
| 13:44:46 | <Toxaris> | matthew-_: no there is no such thing |
| 13:44:49 | <matthew-_> | ahh, but surely you could do == |
| 13:44:50 | <quicksilver> | vincenz: i.e. "Error" and "ErrorT" |
| 13:45:03 | <matthew-_> | > mzero == (fail "foo") |
| 13:45:03 | <quicksilver> | vincenz: erm. I.e. "Either String" and "ErrorT" perhaps I meant. |
| 13:45:05 | <lambdabot> | add an instance declaration for (Eq (m a)) |
| 13:45:05 | <lambdabot> | In the expression: mzero == ... |
| 13:45:12 | <matthew-_> | oh bother, that old problem... |
| 13:45:23 | <quicksilver> | matthew-_: you should never use iJust |
| 13:45:25 | <quicksilver> | isJust |
| 13:45:33 | <vincenz> | quicksilver: I see |
| 13:45:34 | <quicksilver> | by extension, you really don't want isMZero to exist |
| 13:45:35 | <quicksilver> | ;) |
| 13:45:38 | <matthew-_> | sir! yes sir! |
| 13:45:43 | <Toxaris> | matthew-_: Monad and MonadPlus are only about constructing bigger monadic values out of smaller ones, not about deconstructing them |
| 13:45:52 | <vincenz> | monads are something that need cleaning up |
| 13:46:01 | <quicksilver> | ACTION deconstructs Toxaris with a daring modernist argument. |
| 13:46:08 | <matthew-_> | yeah. I'm quite convinced that eventually, you may want to deconstruct them... |
| 13:46:29 | <matthew-_> | quicksilver: how about isNothing ;P |
| 13:46:48 | <Toxaris> | matthew-_: sure you want, but you want to deconstruct them at a point where you know which concrete type they have |
| 13:47:30 | <matthew-_> | that's annoying when writing a library - I don't want to push Maybe or Either String or ... on the user |
| 13:47:58 | <Toxaris> | matthew-_: so use MonadError |
| 13:48:12 | <quicksilver> | or MonadPlus |
| 13:48:19 | <quicksilver> | with `catchError` or `mplus` |
| 13:48:34 | <quicksilver> | if you do use MonadPlus you should specifiy to your users that you really mean the 'OrElse' type though |
| 13:48:35 | <Toxaris> | ACTION doesn't know what modernist arguments are |
| 13:48:45 | <quicksilver> | cos there are two kinds of MonadPlus |
| 13:48:53 | <quicksilver> | and if they use the other type they'll probably get rather odd behaviour. |
| 13:52:51 | <matthew-_> | yep. thanks for all the hepl |
| 13:56:25 | <matthew-_> | nah, none of this is suitable. I need to use ErrorT and runErrorT |
| 14:00:37 | <dangph> | can someone tell me what this notation means please: let x=m in n = n[x:=m] |
| 14:00:48 | <dangph> | what is the thing in the square brackets? |
| 14:01:30 | <earthy> | dangph: is that haskell? |
| 14:01:53 | <dangph> | I think so. It is from a haskell tutorial |
| 14:01:53 | <earthy> | or is it formal semantics |
| 14:02:02 | <dangph> | oh. I don't know |
| 14:02:02 | <earthy> | in the latter case it's substitution notation |
| 14:02:08 | <frobar> | dangph: prolly means "n evaluted with x taken to be m". i think they're just trying to say "let x=m in n evaluates n with m bound to x" in an unnecessarily complicated way |
| 14:02:15 | <EvilTerran> | dangph, n[x := m] means "the expression n with every free instance of the variable x replaced with the expression m" |
| 14:02:25 | <earthy> | so let x = m in n means n with m substituted for x |
| 14:02:25 | <frobar> | *with x bound to m |
| 14:02:58 | <EvilTerran> | f(x)[x := m] = f(m) |
| 14:03:18 | <EvilTerran> | sometimes you'll see [x := m] written as [x \ m] or [m / x], too |
| 14:03:52 | <EvilTerran> | (mnemonic: the one *over* the slash *over*writes the other one =] ) |
| 14:04:09 | <dangph> | oh. thanks. so it is not actual haskell syntax then? |
| 14:04:13 | <EvilTerran> | nope |
| 14:04:23 | <dangph> | cool. thanks |
| 14:04:24 | <EvilTerran> | well, it could be |
| 14:04:25 | <frobar> | nope, just people trying to explain things and failing :) |
| 14:04:29 | <EvilTerran> | but it's not in this case |
| 14:04:42 | <byorgey> | EvilTerran: nice mnemonic =) |
| 14:04:43 | <frobar> | that notation really isn't needed there, unless you've seen it before |
| 14:05:14 | <EvilTerran> | data ColonEq a b = a := b ... |
| 14:05:35 | <EvilTerran> | byorgey, yeah, i like to think so. i had all kinds of trouble remembering what went where before i thought that up |
| 14:06:12 | <byorgey> | EvilTerran: me too, which is why I like it! |
| 14:06:14 | <EvilTerran> | especially as i had one lecturer using [x\m] and one using [m/x] in different threads the same term |
| 14:06:20 | <byorgey> | yikes |
| 14:06:33 | <EvilTerran> | and one using [x |-> m], which i much prefer |
| 14:06:37 | <roconnor> | ACTION uses [x->m] |
| 14:07:04 | <pejo> | Surely |-> must be used by a minority? |
| 14:07:15 | <byorgey> | EvilTerran: indeed, that's what Pierce uses in TaPL, I much prefer it too |
| 14:07:47 | <EvilTerran> | pejo, well, in other contexts, -> is used to say "maps this set to that set", while |-> is used to describe the pointwise mapping |
| 14:07:57 | <roconnor> | I've thought about chaing the notaiton for \x.e to e[x- and notation for f t to be f>t] then putting them together yeild e[x->t] |
| 14:08:51 | <EvilTerran> | "let T : R^2 -> R^1 by (x,y) |-> 2*x + y" |
| 14:09:47 | <matthew-_> | agh, sorry I may just be being dumb here but I still can't sort this. I need to transform a monad m into IO |
| 14:09:59 | <EvilTerran> | byorgey, yeah, my Programming Languages lecturer (who chose TaPL as the course textbook) uses |->, too. |
| 14:10:23 | <Lemmih> | matthew-_: Really? |
| 14:10:37 | <EvilTerran> | my concurrency lecturer uses what the CSP spec uses, which is [x\m] IIRC |
| 14:10:45 | <Sizu1> | :t runErrorT |
| 14:10:47 | <lambdabot> | forall e (m :: * -> *) a. ErrorT e m a -> m (Either e a) |
| 14:11:15 | <Sizu1> | matthew-_: let m be IO |
| 14:11:21 | <matthew-_> | Sizu1: yep. |
| 14:11:24 | <EvilTerran> | and my Formal Program Design lecturer uses what Programming From Specifications (Morgan) uses, which is [m/x] |
| 14:11:34 | <EvilTerran> | (that's the course book for FPD) |
| 14:11:50 | <matthew-_> | I've got existing code and it's really hurting my head how to convert it to this stuff |
| 14:12:03 | <EvilTerran> | matthew-_, sorry, what do you want to do? |
| 14:12:14 | <EvilTerran> | convert some code that's in the IO monad to work in any MonadIO? |
| 14:12:52 | <Sizu1> | matthew-_: type YourMonad = ErrorT YourError IO a |
| 14:13:12 | <Sizu1> | s/YourMonad/YourMonad a/ |
| 14:13:29 | <hpaste> | matthew-_ pasted "this!" at http://hpaste.org/4868 |
| 14:13:58 | <matthew-_> | EvilTerran, Sizu1: ^^ paste |
| 14:14:30 | <matthew-_> | Sizu1: so from that I think formatter :: String -> YourMonad String ? |
| 14:16:28 | <EvilTerran> | matthew-_, so you're getting something of type m String (for some unknown m) and want to get it into an IO String? |
| 14:16:45 | <matthew-_> | yes |
| 14:19:11 | <Sizu1> | i don't know enough about monads to say if this is possible or how to do that. |
| 14:19:12 | <Sizu1> | i see only one function in the paste. how do you use it? and how do you use formatter? |
| 14:19:33 | <EvilTerran> | well, you could use catchError to get the value out, if you had a MonadError context |
| 14:19:49 | <EvilTerran> | you could use head.toList if you had a Foldable context |
| 14:19:59 | <hpaste> | matthew-_ annotated "this!" with "some additional details" at http://hpaste.org/4868#a1 |
| 14:20:17 | <matthew-_> | oh, the type there on formatter is clearly wrong ;) |
| 14:22:05 | <EvilTerran> | ?instances-importing Control.Monad.Instances MonadError |
| 14:22:09 | <lambdabot> | IOError IO, e (Either e), e (ErrorT e m), e (RWST r w s m), e (ReaderT r m), e (StateT s m), e (WriterT w m) |
| 14:22:59 | <EvilTerran> | ?instances-importing Control.Monad.Error Error |
| 14:23:00 | <lambdabot> | IOError, [Char] |
| 14:23:06 | <EvilTerran> | hm... |
| 14:23:47 | <EvilTerran> | ACTION expected there to be an instance Error () and an instance MonadError () Maybe |
| 14:24:25 | <matthew-_> | right, it's liftIO with runErrorT |
| 14:24:26 | <matthew-_> | I think |
| 14:24:56 | <EvilTerran> | if your MonadError's an application of ErrorT, yes |
| 14:27:14 | <EvilTerran> | actually, I think you need more than MonadError m => m String to get the value out |
| 14:27:24 | <matthew-_> | yeah, me too |
| 14:27:53 | <EvilTerran> | I'd suggest Foldable again, but it seems to lack instances somewhat |
| 14:29:12 | <EvilTerran> | no "instance Foldable (Either a) where fold = either mzero id" or whatever |
| 14:29:19 | <EvilTerran> | er, s/mzero/mempty/ |
| 14:29:39 | <EvilTerran> | ?instances-importing Data.Foldable Foldable |
| 14:29:40 | <lambdabot> | Maybe, [] |
| 14:29:52 | <EvilTerran> | ?src Maybe fold |
| 14:29:52 | <lambdabot> | Source not found. I've seen penguins that can type better than that. |
| 14:32:35 | <EvilTerran> | wait, can't use fold as the minimal def; instance Foldable (Either a) where foldr f e (Left _) = e; foldr f e (Right x) = x `f` e |
| 14:32:48 | <EvilTerran> | (based directly on the Maybe instance) |
| 14:33:28 | <EvilTerran> | ACTION stops babbling about Foldable now |
| 14:36:08 | <matthew-_> | you know what? After all this, I now can't see why I wanted this generalisation in the first place |
| 14:36:28 | <hpaste> | ToRA annotated "this!" with "does this example help?" at http://hpaste.org/4868#a2 |
| 14:36:35 | <matthew-_> | I've gone back to the use site and just filled it in and I can't see what was going on at all... |
| 14:36:56 | <ToRA> | does the example i've pased make things any clearer (assuming i've understood what you want to do...?) |
| 14:37:12 | <matthew-_> | yes, ToRA, that does actually help quite a lot |
| 14:38:05 | <quicksilver> | matthew-_: thinking about generalisations and abstractions is often helpful even if it turns out you don't use them |
| 14:38:16 | <quicksilver> | nothing clarifies the mind like seeing why an generalisation doesn't apply. |
| 14:39:16 | <matthew-_> | quicksilver: yeah, I'll let you know when that clarity hits ;) |
| 14:41:21 | <ToRA> | matthew-_, note that the res <- line is the same as (in this case) |
| 14:41:22 | <ToRA> | let (res2::Either String String) = foo "yo" |
| 14:41:44 | <ToRA> | since foo doesn't use IO in any way |
| 14:41:55 | <quicksilver> | because the precise reason why the generalisation isn't useful turns out to be an important observation about your specific domain. |
| 14:44:33 | <matthew-_> | ToRA: hang on. what about foo = return |
| 14:44:46 | <matthew-_> | how do you differentiate the two cases in res ? |
| 14:44:56 | <ToRA> | 1 sec, i'll updte the example |
| 14:45:54 | <matthew-_> | oh I see, you get an Either back |
| 14:45:55 | <matthew-_> | right |
| 14:47:01 | <hpaste> | ToRA annotated "this!" with "liftIO and let" at http://hpaste.org/4868#a3 |
| 14:47:59 | <ToRA> | in context of the example, you couldn't use let in the foo2 case, as Either isn't an instance of MonadIO (if that makes sense) |
| 14:51:02 | <matthew-_> | ToRA: did you check those examples actually compiled? |
| 14:51:12 | <ToRA> | yes, cos i ran them |
| 14:51:56 | <ToRA> | why? |
| 14:52:59 | <matthew-_> | I don't quite see how you've got away with such a light type sig on foo |
| 14:53:30 | <matthew-_> | I'm getting things like: Couldn't match expected type `ErrorT e IO' against inferred type `m' |
| 14:53:47 | <ToRA> | from my example? |
| 14:53:52 | <ToRA> | or from your code? |
| 14:54:02 | <matthew-_> | mine |
| 14:54:14 | <matthew-_> | but I'm using just the same constraints that you've used |
| 14:54:20 | <tibbe> | dcoutts_: ping |
| 14:54:26 | <ToRA> | foo = your formatter yeah? |
| 14:55:03 | <ToRA> | is the error coming from the <- runErrorT in sRespInCache or from formatter? |
| 14:55:09 | <hpaste> | matthew-_ annotated "this!" with "voilla" at http://hpaste.org/4868#a4 |
| 14:56:19 | <ToRA> | matthew-_ your class constraint is in the wrong place |
| 14:56:35 | <ToRA> | i guess |
| 14:56:50 | <tibbe> | anyone know how to convince firefox to show haskell files (i.e. text/x-haskell mime type) in the browser as text? |
| 14:57:02 | <matthew-_> | ToRA: that's not a compelling answer ;) |
| 14:57:18 | <ToRA> | there you're saying that the caller of sRIC will tell you what the m is |
| 14:57:32 | <ToRA> | but actually, sRIC wants to fix the m to ErrorT IO |
| 14:57:33 | <pejo> | tibbe, atleast in netscape you had a special place in the options for different mime-types and their default-actions. |
| 14:57:54 | <ToRA> | ditch the m from ProxyConfig |
| 14:57:57 | <tibbe> | pejo: you can set them in FF but not to "show in browser" or something similar |
| 14:58:00 | <ToRA> | and I think change the decl to |
| 14:58:19 | <ToRA> | , formatter :: (forall m . MonadError m) => String -> m String |
| 14:58:19 | <ToRA> | ? |
| 14:58:33 | <matthew-_> | ugh and add a dozen more language extensions... |
| 14:58:51 | <ToRA> | probably |
| 14:58:53 | <ToRA> | ;) |
| 15:02:36 | <matthew-_> | success |
| 15:02:42 | <ToRA> | \o/ |
| 15:03:21 | <matthew-_> | now, how to work out what language extensions I actually needed? |
| 15:04:14 | <byorgey> | matthew-_: guess and check? =) |
| 15:05:03 | <matthew-_> | really, wtf is the point of adding all this LANGUAGES and -X stuff if you can't actually figure out what you've used |
| 15:06:57 | <ToRA> | PolymorphicComponents and FlexibleContexts |
| 15:07:00 | <ToRA> | ? |
| 15:07:09 | <matthew-_> | nope |
| 15:07:14 | <matthew-_> | {-# LANGUAGE FlexibleContexts, Rank2Types #-} |
| 15:07:24 | <ToRA> | don't use Rank2Types |
| 15:07:35 | <ToRA> | use RankNTypes |
| 15:07:46 | <opqdonut> | :D |
| 15:07:49 | <matthew-_> | actually, this is another point. It may not be Rank2Types. It may be something that Rank2Types depends on. But again, you can't tell |
| 15:07:54 | <opqdonut> | spoken like a true mathematician |
| 15:07:55 | <resiak> | @pl \(x,y) -> (x, f y) |
| 15:07:56 | <lambdabot> | second f |
| 15:07:59 | <resiak> | :t second |
| 15:07:59 | <C-Keen> | Hi! How can I assign a hex value to a Data.ByteString ? |
| 15:08:04 | <resiak> | @ty second |
| 15:08:05 | <lambdabot> | forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a (d, b) (d, c) |
| 15:08:05 | <lambdabot> | forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a (d, b) (d, c) |
| 15:08:20 | <resiak> | @index second |
| 15:08:20 | <lambdabot> | Control.Arrow |
| 15:11:07 | <quicksilver> | C-Keen: (a) parse hex into Word8s (b) pack Word8s into bytestring |
| 15:16:15 | <FunctorSalad> | matthew-_: hmm just joined... what do you suggest? just use -fglasgow-exts? |
| 15:17:01 | <matthew-_> | well, if I don't know what I need, I tend to just ram on glasgow-exts |
| 15:17:15 | <matthew-_> | but then when I'm tidying up, I want to reduce to the minimum |
| 15:17:35 | <FunctorSalad> | is there a pragma to enable everything too? |
| 15:17:44 | <byorgey> | matthew-_: actually, one thing you can do is just disable all extensions and see what errors you get. |
| 15:17:56 | <dmhouse> | FunctorSalad: well, {-# OPTIONS_GHC -fglasgow-exts #-} |
| 15:17:58 | <byorgey> | matthew-_: often they are helpful in suggesting an option to turn off to make the error go away. |
| 15:18:04 | <FunctorSalad> | thx dmhouse |
| 15:18:19 | <byorgey> | matthew-_: e.g. "foo bar is not allowed. Enable ExtensionFooBar to allow this." |
| 15:18:39 | <matthew-_> | byorgey: yes, I've seldom seen errors that helpful |
| 15:18:47 | <matthew-_> | and there are some errors which suggest the wrong extension too. |
| 15:18:50 | <matthew-_> | super helpful |
| 15:19:17 | <Sizu1> | i've seen and used error messages like this a lot |
| 15:19:19 | <FunctorSalad> | why would you want to be parsimonious with extensions? |
| 15:19:22 | <byorgey> | maybe I've just been lucky =) |
| 15:19:30 | <byorgey> | matthew-_: what version of ghc are you using? |
| 15:20:00 | <matthew-_> | byorgey: 6.8.2 |
| 15:20:05 | <byorgey> | mm, ok |
| 15:20:29 | <ToRA> | i think if you turned on e.g. ExistentialQuantification in 6.6 you basically got -fglasgow-exts |
| 15:20:45 | <matthew-_> | oh ffs. It's just too much to ask that Network.HTTP and Network.CGI both have the same data structures for HTTP headers isn't it? |
| 15:20:58 | <matthew-_> | ACTION is getting rather bitter in his dotage |
| 15:21:08 | <quicksilver> | ACTION hands matthew-_ some slippers and a pipe |
| 15:21:31 | <Sizu1> | was actually fun for me to code, and then find out that it's not supported by haskell98. learning all kinds of cool names for my swearing lexicon |
| 15:21:53 | <Sizu1> | You ParametricTypeClass! |
| 15:22:34 | <byorgey> | UndecidableInstance! |
| 15:23:02 | <Sizu1> | You TypeSynonymInstance! |
| 15:24:05 | <C-Keen> | quicksilver: I don't understand how to construct a Word8 |
| 15:24:22 | <resiak> | -XSpoonyBard! |
| 15:24:41 | <FunctorSalad> | why does your code have to be haskell98 (sorry if this is a stupid q) |
| 15:24:44 | <FunctorSalad> | ? |
| 15:24:53 | <Sizu1> | Monoidal Functor! |
| 15:25:10 | <quicksilver> | C-Keen: fromIntegral, perhaps. it depends what you want to construct it from. |
| 15:25:30 | <pitecus> | Any idea what this is all about: ghc-6.8.1: panic! (the 'impossible' happened) |
| 15:25:30 | <pitecus> | (GHC version 6.8.1 for i386-unknown-linux): |
| 15:25:30 | <pitecus> | cat_evals |
| 15:25:30 | <pitecus> | gramlab-lib-0.2:GramLab.Data.Diff.EditTree.Split{d r1bv} |
| 15:25:30 | <pitecus> | [ix{v a289} [lid], lt{v a28a} [lid], rt{v a28b} [lid]] |
| 15:25:30 | <pitecus> | [!, !, _, _] |
| 15:25:38 | <Sizu1> | FunctorSalad: it doesn't. |
| 15:25:43 | <C-Keen> | quicksilver: Well I just need a constant of magic bytes I compare against |
| 15:25:43 | <quicksilver> | pitecus: upgrade to 6.8.2 |
| 15:25:59 | <quicksilver> | C-Keen: foo = 48 :: Word 8 |
| 15:26:08 | <quicksilver> | C-Keen: or, foo :: Word8 ; foo = 48 |
| 15:26:11 | <quicksilver> | if you prefer |
| 15:26:15 | <pitecus> | quicksilver, I upgraded to 6.8.1 like 1 month ago! |
| 15:26:17 | <C-Keen> | quicksilver: ah! thank you very much |
| 15:26:20 | <quicksilver> | without the space before the 8 ;) |
| 15:26:28 | <Sizu1> | pitecus: time to do it again ;) |
| 15:26:37 | <quicksilver> | pitecus: however, you upgraded to a version with bugs in. |
| 15:26:47 | <pitecus> | Its a huge hassle to upgrade *sigh* |
| 15:27:05 | <quicksilver> | pitecus: this leaves you with three choices : (a) don't compile the code which triggers the bugs (b) fix the bugs yourself (c) try a different version which has different bugs! |
| 15:27:11 | <quicksilver> | it's entirely up to you which you choose. |
| 15:27:35 | <pitecus> | ya i know, i know |
| 15:27:40 | <byorgey> | pitecus: option (d): if you wiggle a magnet over your hard drive in exactly the right way, it fixes the bugs in 6.8.1 without having to upgrade |
| 15:29:23 | <pitecus> | jokes aside, is it the case that this particular bug is fixed in 6.8.2, or is it just a vague possibility that it might be fixed, and after spending a few hours upgrading i still have the same problem? |
| 15:31:20 | <ToRA> | pitecus: if you can replicate the bug in a small bit of code that fits on hpaste i'll try it in 6.8.2 if you want to check |
| 15:31:50 | <ToRA> | (and because i'm curious to see code that breaks ghc) |
| 15:31:55 | <Sizu1> | i encountered a few bugs with 6.8.1 that were fixed in 6.8.2 |
| 15:32:09 | <Sizu1> | that's a no guarantee that yours will be fixed, but what alternative do you have? |
| 15:32:48 | <pitecus> | ToRA, thanks, but it'll probably take more time to try to reduce the code to a snippet than to upgrade, its a biggish project im compiling |
| 15:32:49 | <quicksilver> | pitecus: 6.8.2 is known to fix some "the impossible happened" bugs. |
| 15:32:57 | <quicksilver> | if you want to know for sure, a test case is the best way. |
| 15:33:22 | <pitecus> | quicksilver, i guess i'll give it a shot... |
| 15:34:13 | <resiak> | If I want to use (FilePath, OpenMode, OpenFileFlags) as the key for a Map, is there anything bad and wrong about inventing Ord instances for OpenMode and OpenFileFlags? |
| 15:36:07 | <Sizu1> | i don't see any. they are just values. |
| 15:36:28 | <Corun> | Heya |
| 15:36:31 | <ToRA> | probably don't even need to write your own instances, just use 6.8 standalone deriving for them? |
| 15:36:59 | <Sizu1> | can you derive twice? |
| 15:37:48 | <ToRA> | neither derive any classes already as far as i can see? |
| 15:37:50 | <resiak> | I don't have 6.8, so |
| 15:38:33 | <quicksilver> | I think you could probably go as far as to file a bug that they don't have ord instances |
| 15:38:39 | <quicksilver> | simple types like that should all have ord instance! |
| 15:39:07 | <quicksilver> | hmm |
| 15:39:12 | <quicksilver> | IOMode does have an ord instance |
| 15:39:18 | <quicksilver> | what did you mean by OpenMode? |
| 15:39:42 | <resiak> | file:///usr/share/doc/ghc6-doc/html/libraries/unix/System-Posix-IO.html#t%3AOpenMode |
| 15:40:32 | <quicksilver> | Yup. I think that's a bug in the posix package, personally. |
| 15:40:47 | <quicksilver> | resiak: but, why are you using posix? there aren't many reasons you need to. |
| 15:43:08 | <Sizu1> | yeah, this sicks! my haddock failed on hackage |
| 15:43:16 | <Sizu1> | sucks* |
| 15:43:49 | <resiak> | quicksilver: because it's what the flags to open(2) are mapped to in the existing hfuse binding; i could map them to IOMode instead; hrm |
| 15:45:08 | <resiak> | in any case, should i file the bug over on the ghc trac, or elsewhere? |
| 15:45:22 | <quicksilver> | I don't actually know. GHC trac I assume. |
| 15:45:30 | <C-Keen> | hm, how can I strip the value of a monad? hGet :: Handle -> Int -> ByteString -> IO() now how can I use the actual value since there are no functions defined for using that type? |
| 15:46:39 | <Tac-Tics> | the actual value of what exactly C-Keen? |
| 15:47:18 | <Sizu1> | C-Keen: you cannot get rid of IO, but you can use the values inside it |
| 15:47:31 | <ToRA> | that isn't the type of hGet; hGet :: Handle -> Int -> IO ByteString no? |
| 15:47:37 | <tlaboc> | :t hGet |
| 15:47:40 | <C-Keen> | Tac-Tics: I a reading some bytes with hGet f 3, say, but when I try to append this to another ByteString the compiler complains |
| 15:47:40 | <lambdabot> | Not in scope: `hGet' |
| 15:48:05 | <tlaboc> | the type is Handle -> Int -> IO ByteString |
| 15:48:11 | <Sizu1> | do { str <- hGet f 3; doStuff str } |
| 15:48:30 | <Tac-Tics> | C-Keen, the only way to extract the value is using "bind" |
| 15:48:41 | <C-Keen> | tlaboc: you are right |
| 15:48:52 | <Tac-Tics> | so using do's arrow notation as Sizu1 has above, or with >>= |
| 15:49:08 | <C-Keen> | Tac-Tics: I did buf <- B.hGet (chunksize+1) let msg = sync ( B.append bytes buf ) in |
| 15:49:09 | <tlaboc> | C-Keen: http://www.haskell.org/hoogle/ for the win |
| 15:49:10 | <lambdabot> | Title: Hoogle |
| 15:49:13 | <C-Keen> | which is wrong |
| 15:49:35 | <Tac-Tics> | can you hpaste it? |
| 15:49:37 | <Tac-Tics> | @paste |
| 15:49:38 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 15:49:55 | <resiak> | quicksilver: i think i'll stick to using posix, for closer mapping to the underlying fuse api. thanks for pointing out iomode |
| 15:50:38 | <quicksilver> | ACTION nods |
| 15:50:48 | <hpaste> | c-keen pasted "some wrong reader" at http://hpaste.org/4869 |
| 15:51:25 | <quicksilver> | C-Keen: you missd out the "f" from the hGet, surely. |
| 15:51:37 | <C-Keen> | oh boy |
| 15:52:01 | <Tac-Tics> | hehe, so close to the monads you couldn't see the trees =-) |
| 15:52:31 | <C-Keen> | true |
| 15:53:36 | <quicksilver> | type errors are useful but they take a while to learn to locate |
| 15:53:42 | <quicksilver> | they often appear to be in the wrong place |
| 15:54:25 | <C-Keen> | I hope I get the gist of this soon |
| 15:54:30 | <Tac-Tics> | currying is cool but you really can't write good error messages into a language which uses it |
| 15:54:55 | <axm> | ACTION loves glasgow-exts and some additional types when in doubt for that |
| 15:54:58 | <Sizu1> | ^ example of how not to market ;) |
| 15:58:23 | <nornagon> | uh-oh |
| 15:58:38 | <nornagon> | i think i just accidentally wrote a monad tutorial :( |
| 15:58:43 | <Tac-Tics> | haha |
| 15:58:45 | <Tac-Tics> | please link |
| 15:59:08 | <gbeshers> | Can anyone else get to darcs.haskell.org? |
| 15:59:09 | <therp> | nornagon: don't worry. that happens here all the time |
| 16:00:07 | <Igloo> | gbeshers: I can |
| 16:00:17 | <FunctorSalad> | I like the one with the monsters... |
| 16:00:31 | <nornagon> | Tac-Tics: not quite finished yet |
| 16:00:49 | <nornagon> | i still need to write the 'surprise, you just learned how monads work' bit |
| 16:01:44 | <pjd> | less monads, more functors! |
| 16:02:03 | <nornagon> | what's actually the difference? |
| 16:02:11 | <nornagon> | @src Functor |
| 16:02:11 | <lambdabot> | class Functor f where |
| 16:02:11 | <lambdabot> | fmap :: (a -> b) -> f a -> f b |
| 16:02:18 | <pjd> | @src Applicative |
| 16:02:18 | <lambdabot> | class Functor f => Applicative f where |
| 16:02:18 | <lambdabot> | pure :: a -> f a |
| 16:02:18 | <lambdabot> | (<*>) :: f (a -> b) -> f a -> f b |
| 16:02:24 | <pjd> | they're simpler and more general |
| 16:02:30 | <Sizu1> | can i clobber a package with the same version in hackage? |
| 16:02:37 | <nornagon> | @src Monad |
| 16:02:38 | <lambdabot> | class Monad m where |
| 16:02:38 | <lambdabot> | (>>=) :: forall a b. m a -> (a -> m b) -> m b |
| 16:02:38 | <lambdabot> | (>>) :: forall a b. m a -> m b -> m b |
| 16:02:38 | <lambdabot> | return :: a -> m a |
| 16:02:38 | <lambdabot> | fail :: String -> m a |
| 16:02:48 | <tlaboc> | Functors can only lead to madness :) |
| 16:02:53 | <pjd> | people should learn them before monads |
| 16:02:55 | <nornagon> | pjd: but ghc doesn't have syntactic sugar |
| 16:03:01 | <nornagon> | for functors, i mean. |
| 16:03:04 | <nornagon> | yes? |
| 16:03:30 | <Nicko> | Haskell will be a mature language when haskell programmers begin to think about solving real world problems |
| 16:03:30 | <pjd> | nornagon: many people advocate learning the syntax sugar last of all |
| 16:03:58 | <gbeshers> | Igloo: thanks, I can from work but not from home --- cox networking to blame I suspect. |
| 16:04:07 | <resiak> | pjd: FEWER monads! |
| 16:05:01 | <nornagon> | pjd: i don't think that's a useful approach, really |
| 16:05:06 | <quicksilver> | Nicko: IRC will be a mature medium when commentators begin to think about what they say before saying it. |
| 16:05:19 | <nornagon> | resiak++ |
| 16:05:22 | <Nicko> | touché |
| 16:05:25 | <Nicko> | ;) |
| 16:05:31 | <quicksilver> | Nicko: which is an un-necessarily sharp way of saying that some haskell programmers already do think about real problems ;) |
| 16:05:44 | <pjd> | resiak: no, less (focus on) monads |
| 16:05:56 | <quicksilver> | the guys over at galois, those ones at jane st capital, etc |
| 16:06:17 | <resiak> | heh, you win |
| 16:06:29 | <quicksilver> | Nicko: I think about real world problems all the time, although my dayjob prevents me from implementing them as much as I'd like :) |
| 16:06:41 | <pjd> | resiak: :) |
| 16:07:35 | <Nicko> | I´m a bit frustrated with haskell because hs-plugins does not work in windows, and I need it desperately |
| 16:07:44 | <quicksilver> | ACTION nods |
| 16:07:52 | <quicksilver> | yeah, that's annoying |
| 16:08:03 | <quicksilver> | hs-plugins was a bit of a hack, although an extraordinarly clever one |
| 16:08:15 | <quicksilver> | the new version is less of a hack, though, since it uses a more stable API |
| 16:08:23 | <quicksilver> | and hopefull it will progress to not being a hack at all soon :) |
| 16:08:33 | <Sizu1> | what do you do quicksilver? |
| 16:08:42 | <Nicko> | when is supposed to be available? |
| 16:09:11 | <quicksilver> | Nicko: sometime in the next week or three I think. I'm not sure who exactly is working on it. |
| 16:09:14 | <FunctorSalad> | "nornagon> what's actually the difference?" <-- for one thing, monads always go from one category to the same cat, functors don't have to |
| 16:09:19 | <quicksilver> | There was some discussion on the -cafe recently. |
| 16:09:23 | <resiak> | Is there any reason, other than non-spherical tuits, that GHC doesn't do shared libs on *nix? |
| 16:09:36 | <Nicko> | nice I can´t wait for it |
| 16:09:45 | <quicksilver> | resiak: yes, there was a reason but I can't remember what it was. |
| 16:09:53 | <quicksilver> | resiak: they are working on a version which does, though. |
| 16:10:06 | <quicksilver> | Sizu1: I'm a *blush* Perl programmer. |
| 16:10:22 | <resiak> | okay. it struck me that it might overlap with the kind of things hs-plugins needs |
| 16:11:01 | <Sizu1> | just general slap-things-together hackery or more solid stuff? |
| 16:11:30 | <quicksilver> | Sizu1: I like to think it's solid. |
| 16:12:00 | <Nicko> | quicksilver, by the way, i found that "eval" statements have problems if the object file is loaded trough "load" |
| 16:12:08 | <Nicko> | under ubuntu |
| 16:12:38 | <quicksilver> | Nicko: that's odd, but out of my area of expertise. dons is the real guru... |
| 16:12:46 | <Nicko> | I know |
| 16:12:50 | <quicksilver> | any hs-plugins thaumaturges around? |
| 16:17:40 | <FunctorSalad> | any guides on which GUI toolkit to use? |
| 16:18:02 | <quicksilver> | gtk2hs is popular |
| 16:18:12 | <dcoutts> | @arr! |
| 16:18:12 | <lambdabot> | Drink up, me 'earties |
| 16:18:34 | <quicksilver> | gtk2hs is mostly used by pirates |
| 16:18:40 | <FunctorSalad> | quicksilver: yes, have heard of that. wondered if there are any other options (should be rather simple, don't think I will use fancy things) |
| 16:18:42 | <C-Keen> | god if I would actually _read_ the compiler errors I would be done by now |
| 16:18:48 | <dcoutts> | which reminds me, I need to release a windows installer for gtk2hs that works with ghc-6.8.2 |
| 16:18:54 | <C-Keen> | but you get used to it pretty quick |
| 16:19:19 | <FunctorSalad> | (btw, I mean't which toolkit to *learn*) |
| 16:20:03 | <nornagon> | FunctorSalad: that makes no sense, btw. |
| 16:20:03 | <Sizu1> | what was it Fruits or something |
| 16:20:09 | <nornagon> | oh |
| 16:20:13 | <nornagon> | actually, i suppose it does |
| 16:20:13 | <mux> | ACTION can't wait to get back to home in order to reboot his cable modem and get a teste of his new connection speed (30Mb/s -> 100Mb/s) |
| 16:20:17 | <FunctorSalad> | nornagon: what? |
| 16:20:20 | <nornagon> | but i don't really understand what that's useful for |
| 16:20:27 | <nornagon> | functors vs monads |
| 16:20:35 | <Nafai> | mux: Nice upgrade! |
| 16:20:39 | <Sizu1> | grats mux |
| 16:20:40 | <nornagon> | the m -> m vs f -> f' |
| 16:20:45 | <FunctorSalad> | nornagon: in math most things aren't endofunctors |
| 16:20:53 | <nornagon> | ... what. |
| 16:21:00 | <mux> | ACTION feels like a kid waiting to open his christmas presents |
| 16:21:04 | <nornagon> | you haskellers and your scary maths talk. |
| 16:21:08 | <FunctorSalad> | nornagon: functors from a category to itself |
| 16:21:50 | <Sizu1> | remember Bill Gates once said that nobody will ever need more than 640KB memory |
| 16:22:30 | <mux> | but he didn't say that nobody will ever need 100Mb/s, did he? :-) |
| 16:22:33 | <Sizu1> | or was it 1.4MB of the floppy? same diff |
| 16:22:40 | <mux> | it was 640k RAM |
| 16:23:05 | <C-Keen> | how can I pass Arguments in ghci to main? |
| 16:23:38 | <mux> | :set args I think |
| 16:23:44 | <C-Keen> | ah |
| 16:23:58 | <quicksilver> | C-Keen: http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-commands.html |
| 16:23:59 | <lambdabot> | Title: 3.7. GHCi commands, http://tinyurl.com/ytkpuj |
| 16:24:02 | <quicksilver> | you can also use :main |
| 16:24:06 | <resiak> | @hoogle Float -> Int |
| 16:24:06 | <lambdabot> | No matches, try a more general search |
| 16:24:43 | <quicksilver> | resiak: round |
| 16:24:49 | <quicksilver> | floor, ceiling |
| 16:24:54 | <resiak> | aha! |
| 16:25:05 | <resiak> | cheers |
| 16:27:26 | <Nicko> | can anyone recommend a cheap virtual private server provider? |
| 16:28:20 | <Nicko> | sorry, wrong channel |
| 16:35:18 | <Sizu1> | quicksilver: man how can you continue with perl? i cannot code any other language since i learned hs |
| 16:38:09 | <quicksilver> | Sizu1: the money softens the blow. |
| 16:38:17 | <Sizu1> | just trying to make myself start coding perl again. |
| 16:38:25 | <pjd> | nornagon: have you looked at Control.Applicative? |
| 16:39:01 | <nornagon> | pjd: no? |
| 16:39:31 | <pjd> | there are lots of things that form applicative functors, but not monads |
| 16:39:46 | <pjd> | they lie sort of between Functor and Monad |
| 16:40:08 | <nornagon> | scary. |
| 16:40:18 | <pjd> | for example, zipping |
| 16:41:15 | <quicksilver> | there are also times when the monad structure is not needed and it's just more convenient to use applicative style |
| 16:41:21 | <quicksilver> | even though it *is* actually a monad |
| 16:41:55 | <roconnor> | ACTION agrees with quicksilver |
| 16:42:09 | <pjd> | indeed |
| 16:42:18 | <pjd> | > (+) 10 1 |
| 16:42:20 | <lambdabot> | 11 |
| 16:42:32 | <pjd> | > (+) <$> [10,20] <*> [1,2] |
| 16:42:32 | <lambdabot> | [11,12,21,22] |
| 16:43:10 | <roconnor> | ``Step functions from an applicative functor (they also from a monad, but monads are so 20th century).'' |
| 16:43:15 | <pejo> | Sizur, Haskell isn't always the right tool for the job. |
| 16:43:21 | <osfameron> | Sizu1: they are different. I enjoy programming Perl still (as I know it better than haskell, I also find it far easier in many respects). Which does't mean I wouldn't like some of haskell's niceties in Perl though... |
| 16:43:28 | <quicksilver> | pejo: HERESY! |
| 16:43:33 | <quicksilver> | ACTION builds a bonfire. |
| 16:43:57 | <roconnor> | quicksilver: I'll get the bananas and barbed wire |
| 16:44:20 | <osfameron> | marshmallows are tastier than barbed wire |
| 16:44:23 | <znutar> | write a haskell program that generates the right tool, duh |
| 16:44:24 | <quicksilver> | osfameron: s/some/all/ |
| 16:44:25 | <Sizu1> | i heard ppl say over and over that i18n is not meant for haskell |
| 16:44:35 | <Sizu1> | then i wrote it |
| 16:44:45 | <osfameron> | quicksilver: well, all of its niceties I guess :-) |
| 16:46:14 | <Sizu1> | i know perl better too. and i wrote some nice frameworks with it. i'm still too much fascinated with haskell to see any other lang |
| 16:46:21 | <pjd> | nornagon: that example above is simplistic, but it shows how you can "lift" a function application's parameters with <$> and <*> |
| 16:46:56 | <aleator> | Hi, Are there any nice string-template libraries lying around? I tried Text.HTML.Chunks but that didn't seem to work. |
| 16:47:17 | <quicksilver> | aleator: I think the answer is no. |
| 16:47:42 | <aleator> | Hmm. Sad. Could really use one. |
| 16:48:17 | <quicksilver> | ACTION half-jokingly suggests invoking Template::Toolkit via the shell. |
| 16:48:51 | <aleator> | Well. :) |
| 16:49:10 | <Sizu1> | shall we write TT combinators? heh |
| 16:49:51 | <aleator> | Is it just me, or does anyone else feel that haskell is bit hard to bend that way? |
| 16:50:16 | <Sizu1> | what do you need string templates for in particular? |
| 16:50:17 | <quicksilver> | which way? |
| 16:50:33 | <quicksilver> | I don't think you could easily write text tempaltes as a convenient DSL |
| 16:50:40 | <quicksilver> | the overhead of the haskell lexer is too high |
| 16:50:55 | <quicksilver> | but writing parsers in haskell is a doddle |
| 16:51:09 | <aleator> | quicksilver: Yeah, that was what I tried to say. |
| 16:51:10 | <quicksilver> | so a simplistic template language in the general style of TT would not be hard. |
| 16:53:22 | <aleator> | I'd think given some sort of extensible records you actually could do it dsl way as well.. |
| 16:53:47 | <`party> | :D |
| 16:53:50 | <pyx> | D |
| 16:54:35 | <`party> | anybody speake russia? |
| 16:54:38 | <Sizu1> | da |
| 16:54:40 | <pyx> | ) |
| 16:54:42 | <pyx> | ÿÿ |
| 16:54:57 | <pyx> | åñòü êòî â õàñêåëå æàðèò? ) |
| 16:55:08 | <Sizu1> | well, we can even write a TT parser and simply use the .tt's |
| 16:55:11 | <quicksilver> | this is, however an english-language channel. |
| 16:55:20 | <pyx> | ok |
| 16:55:23 | <quicksilver> | Sizu1: that would seem saner than inventing yet another syntax. |
| 16:55:38 | <Sizu1> | pyx: i cannot read your text, it's not unicode |
| 16:55:39 | <quicksilver> | Sizu1: unless of course there is something very objectional about TT syntax. |
| 16:55:45 | <Igloo> | pyx: You might want #haskell.ru, #haskell_ru or (jabber) haskell@conference.jabber.ru |
| 16:55:46 | <osfameron> | you would have to write a perl parser to implement [% perl %] tags of course... |
| 16:55:52 | <ADEpt> | Sizu1: it's russian in cp1251 |
| 16:56:07 | <`party> | haskell_ru is empty |
| 16:56:11 | <quicksilver> | osfameron: not necessarily, you could just shell them out verbatim to a perl subprocesss |
| 16:56:16 | <pyx> | ACTION slaps Igloo around a bit with a large trout |
| 16:56:18 | <Sizu1> | i will not use anyting but unicode! :D |
| 16:56:21 | <quicksilver> | osfameron: however, it would be saner not to use them :P |
| 16:56:22 | <pyx> | <Igloo> thx |
| 16:56:34 | <Igloo> | Sorry, wrong person |
| 16:56:47 | <ADEpt> | `party: jabber conf is not |
| 16:56:54 | <osfameron> | quicksilver: yeah :-) there should be a subset of TT which is language neutral, with [% perl %] blocks considered a local implementation detail |
| 16:57:01 | <Igloo> | `party: Know idea how accurate that list is, I just copied from http://www.haskell.org/haskellwiki/IRC_channel |
| 16:57:03 | <lambdabot> | Title: IRC channel - HaskellWiki |
| 16:57:40 | <osfameron> | that said, it TT's dot notation as useful a concept with haskell as it is with perl structs/objects ? |
| 16:57:44 | <quicksilver> | osfameron: s/a local.*detail/harmful/ |
| 16:58:13 | <quicksilver> | osfameron: well some kind of nested-maps-of-strings approach is quite natural for a template "stash" I would say. |
| 16:58:26 | <quicksilver> | but maybe you could think of something a bit better typed. |
| 16:58:37 | <osfameron> | quicksilver: not necessarily. It's poor style and could be better encapsulated in a plugin or object, but it can be useful for some tasks |
| 16:58:49 | <C-Keen> | hm, how can I nicely print a ByteString? I am currently unpacking it and then trying to show it but this does not match the type |
| 16:58:52 | <quicksilver> | useful and harmful are not incompatible :) |
| 16:59:06 | <dcoutts> | C-Keen: it's already an instance of Show |
| 16:59:06 | <quicksilver> | C-Keen: how would you like to print it? :) |
| 16:59:18 | <quicksilver> | C-Keen: you could just show it, it depends what kind of answer you want though. |
| 16:59:18 | <dcoutts> | or just putStr it |
| 16:59:21 | <pyx> | somebody plz help me to write one programm on haskel |
| 16:59:52 | <quicksilver> | pyx: I'm sure we're happy to help but we can't help till you ask the question :) |
| 17:00:01 | <pyx> | ok |
| 17:00:03 | <pyx> | =) |
| 17:01:11 | <`party> | he will forulate his question thirty minet :)) |
| 17:01:14 | <`party> | m |
| 17:01:49 | <ricky_clarkson> | Hang on, just scanning the lecture notes in! |
| 17:04:04 | <C-Keen> | dcoutts: quicksilver I forgot some parenthesis |
| 17:06:48 | <Sizu1> | going home. ttyalll |
| 17:07:09 | <tibbe> | dcoutts: did you ever add those monoid instances for cabal flags? |
| 17:07:31 | <dcoutts> | tibbe: yes |
| 17:07:41 | <tibbe> | dcoutts: where's the code? |
| 17:07:51 | <dcoutts> | tibbe: in the Cabal HEAD branch |
| 17:08:04 | <dcoutts> | tibbe: and I've made good use of it in cabal-install |
| 17:08:41 | <dcoutts> | so that cabal-install can combine it's own defaults and overrides from config files and command line to the configure flags to pass when building a package |
| 17:09:19 | <dcoutts> | we use the Monoid.mappend to combine/override sets of flags |
| 17:09:40 | <tibbe> | dcoutts: cool, I'll have a look |
| 17:10:09 | <dcoutts> | tibbe: you're interested in hacking on that kind of stuff? if so the next similar project is to make the config file stuff similar |
| 17:10:21 | <quicksilver> | dcoutts: don't you wish Monoid.mappend had a conventional symbolic name? |
| 17:10:22 | <quicksilver> | I do. |
| 17:10:47 | <dcoutts> | quicksilver: I don't use it that much, only in a few key places, it doesn't need to be shorter for my purposes |
| 17:10:59 | <quicksilver> | ACTION nods |
| 17:11:03 | <tibbe> | dcoutts: on an unrelated note: I'm having some problems structuring my code which runs in a ReaderT IO monad just like xmonad, it seems like I end up with liftIO everywhere, could you have a look and give some hints? it's a short piece of code in one file. |
| 17:11:10 | <dcoutts> | quicksilver: I understand the desire to rename ++ to mappend of course |
| 17:11:27 | <cinimod> | @hoogle (a -> b) -> (a,a) -> (b,b) |
| 17:11:27 | <lambdabot> | No matches, try a more general search |
| 17:11:50 | <dcoutts> | tibbe: aye, that's a common problem with monads layered on IO when you tend to do a lot of IO |
| 17:11:52 | <tibbe> | dcoutts: is it in darcs.haskell.org/cabal ? |
| 17:11:57 | <cinimod> | @hoogle (a -> b) -> (c -> d) -> (a,c) -> (b,d) |
| 17:11:59 | <lambdabot> | No matches, try a more general search |
| 17:12:00 | <dcoutts> | tibbe: yes |
| 17:12:08 | <tibbe> | dcoutts: I'll paste the code |
| 17:12:09 | <quicksilver> | cinimod: that latter one is &&& |
| 17:12:11 | <dcoutts> | tibbe: and /cabal-install |
| 17:12:11 | <tibbe> | @paste |
| 17:12:12 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 17:12:17 | <quicksilver> | cinimod: from Control.Arrow |
| 17:12:17 | <BMeph> | cinimod: That's &(&&) |
| 17:12:31 | <dcoutts> | tibbe: eg in the Cairo bindings we just suffer it and use liftIO a lot |
| 17:12:32 | <BMeph> | s/&(&&)/(&&&) |
| 17:12:33 | <cinimod> | quicksilver: how come hoogle doesn't find it? |
| 17:12:39 | <quicksilver> | cinimod: because it has a more general type |
| 17:12:46 | <quicksilver> | :t (&&&) |
| 17:12:49 | <lambdabot> | forall (a :: * -> * -> *) b c c'. (Arrow a) => a b c -> a b c' -> a b (c, c') |
| 17:12:53 | <BMeph> | The first one is join (&&&) |
| 17:13:00 | <dcoutts> | tibbe: Cabal itself will want to move to a monad layered on IO at some point |
| 17:13:02 | <dcoutts> | hia nominolo |
| 17:13:07 | <quicksilver> | oh |
| 17:13:09 | <quicksilver> | it's *** |
| 17:13:10 | <quicksilver> | not &&& |
| 17:13:11 | <hpaste> | tibbe pasted "liftIO all over the place!" at http://hpaste.org/4870 |
| 17:13:13 | <quicksilver> | I misled you! |
| 17:13:28 | <nominolo> | yo dcoutts! |
| 17:13:33 | <dcoutts> | tibbe: and we probably need several varieties of monads in Cabal some of which share the same methods/actions |
| 17:13:33 | <BMeph> | Eh, me too. |
| 17:13:37 | <dcoutts> | nominolo: good holiday? |
| 17:13:58 | <tibbe> | dcoutts: if you have a look at the code you see that most functions end up with the type ..... -> IO () while I want them to have .... -> Server () but I'm unsure how to refactor it |
| 17:14:02 | <cinimod> | :t (***) |
| 17:14:02 | <lambdabot> | forall (a :: * -> * -> *) b c b' c'. (Arrow a) => a b c -> a b' c' -> a (b, b') (c, c') |
| 17:14:17 | <nominolo> | dcoutts: yahman! |
| 17:14:27 | <BMeph> | > join (***) (^2) 3 4 |
| 17:14:28 | <lambdabot> | Couldn't match expected type `t1 -> t' |
| 17:14:32 | <dcoutts> | tibbe: so my idea was to use a number of classes which extend Monad with extra ops, then working in any monad that implements those classes can use the extra actions without liftIO |
| 17:14:34 | <waern> | hi nominolo, tibbe & dcoutts |
| 17:14:37 | <harinath> | @src Writer tell |
| 17:14:37 | <lambdabot> | Source not found. Maybe you made a typo? |
| 17:14:40 | <byorgey> | tibbe: I only see io in three places there. Hardly seems like "all over the place"... |
| 17:14:47 | <cinimod> | :i Arrow |
| 17:15:11 | <dcoutts> | tibbe: but it's not very easily extensible for arbitrary IO actions, but then for Cabal that's part of what we're trying to move away from - arbitrary IO all over the place |
| 17:15:23 | <byorgey> | cinimod: the type (Arrow a) => a b c represents a computation which takes an input of type b and outputs something of type c. |
| 17:15:26 | <dcoutts> | hia waern, good job on getting haddock-2.0 out the door |
| 17:15:31 | <tibbe> | byorgey: well, it's very coarse grained now, the environment is not even available in all functions because they run in IO () instead of Server (). I need to change that to Server () but that introduces all the liftIOs |
| 17:15:41 | <nominolo> | hi waern |
| 17:15:42 | <byorgey> | cinimod: one common instance of Arrow is, of course, (->) |
| 17:15:42 | <tibbe> | dcoutts: makes sense |
| 17:15:45 | <tibbe> | waern: hi |
| 17:15:49 | <dcoutts> | nominolo: starting to get busy yet? |
| 17:15:54 | <waern> | dcoutts: thanks, I'm looking at Cabal now |
| 17:15:55 | <byorgey> | tibbe: oh, I see what you mean. |
| 17:16:01 | <nominolo> | dcoutts: that's the plan |
| 17:16:04 | <cinimod> | byorgey: that's what I wanted to know |
| 17:16:07 | <dcoutts> | nominolo: you know I've always got plenty for you to look at ;-) |
| 17:16:28 | <tibbe> | byorgey: I want acceptConnections to be in the Server monad for example so I can access the the environment from within to e.g. grab a file handle for logging |
| 17:16:34 | <nominolo> | ACTION is already trying to catch up on all the mail |
| 17:16:39 | <pyx> | this is my problem http://slil.ru/25330287 plz help me solve it ) |
| 17:16:39 | <byorgey> | tibbe: right. |
| 17:16:40 | <lambdabot> | Title: Õðàíåíèå ôàéëà, áåñïëàòíî çàêà÷àòü è ñêà÷àòü |
| 17:17:07 | <dcoutts> | nominolo: tell me about it, go offline for 10 days and get 2000 emails |
| 17:17:15 | <BMeph> | :t uncurry (join (***)) |
| 17:17:16 | <lambdabot> | forall b c. (b -> c, (b, b)) -> (c, c) |
| 17:17:24 | <quicksilver> | *boggle* |
| 17:17:32 | <nominolo> | dcoutts: that should make about 4000 mails for me then ... |
| 17:17:45 | <tibbe> | byorgey: but if I change acceptConnections to Server () then the call to that function (from server') can't be in IO any more |
| 17:17:45 | <quicksilver> | pyx's pastebin loads some adverts for me, and the word "task5.txt" in the cetner of the page |
| 17:17:59 | <byorgey> | quicksilver: me too |
| 17:18:02 | <nominolo> | dcoutts: i'm only reading cabal-devel and libraries, for now |
| 17:18:03 | <quicksilver> | but it doesn't actually load the task |
| 17:18:06 | <quicksilver> | whatever it is |
| 17:18:30 | <quicksilver> | pyx: can you use a pastebin which works, like http://hpaste.org/ ? |
| 17:18:40 | <dcoutts> | tibbe: did you paste the whole file or is it truncated? it doesn't look like too many io's all over the place to me |
| 17:18:41 | <pyx> | 5 sec |
| 17:18:43 | <waern> | dcoutts: build-tools field is parsed with parseDependency. Should we allow non-alpha-numeric characters in package names, or should we have a separate parser for build-tools? |
| 17:19:01 | <byorgey> | dcoutts: I just asked tibbe the same question =) |
| 17:19:06 | <dcoutts> | waern: what kinds of build-tools have such crazy names? |
| 17:19:09 | <nornagon> | http://nornagon.net/exceptions.lhs <-- my monad explanation |
| 17:19:11 | <waern> | dcoutts: g++ |
| 17:19:13 | <pyx> | <quicksilver> in a 3 minutes ) |
| 17:19:18 | <dcoutts> | waern: ah yes |
| 17:19:21 | <tibbe> | dcoutts: I was a bit unclear, I'm trying to move all function to Server () to get the environment threaded through but that would introduce a lot of liftIOs |
| 17:19:38 | <tibbe> | dcoutts: it's in an intermediate state, sorry about that |
| 17:19:56 | <quicksilver> | tibbe: well, your forkIO is an extremely interesting point |
| 17:20:04 | <dcoutts> | tibbe: oh I see |
| 17:20:04 | <quicksilver> | tibbe: but, since it's read-only (ReaderT) it should be fine |
| 17:20:16 | <quicksilver> | tibbe: if it was StateT you would have some interesting things to address. |
| 17:20:27 | <tibbe> | quicksilver: ah yes :) |
| 17:20:50 | <quicksilver> | tibbe: I imagein you need to replace forkIO with forkIO . runServer conf $ |
| 17:20:50 | <dcoutts> | waern: well fair enough, add an extra parser. While you're at it, you might like to use that to parse pkg-config package names/versions like "openssl-0.9.8g" |
| 17:20:51 | <tibbe> | dcoutts: so basically every expression needs an liftIO |
| 17:20:58 | <hpaste> | pyx pasted "Expression" at http://hpaste.org/4871 |
| 17:21:04 | <quicksilver> | tibbe: where conf comes from an earlier ask |
| 17:21:14 | <waern> | dcoutts: ok, sure |
| 17:21:16 | <tibbe> | quicksilver: right |
| 17:21:31 | <byorgey> | pyx: is this an assignment? |
| 17:21:39 | <dcoutts> | waern: though those crazy pkg-config versions cannot fit into an ordinary Version type |
| 17:21:51 | <quicksilver> | tibbe: you could read my ramblins about monadic tunnelling if you want to think about the general question of callbacks and custom monads. |
| 17:21:53 | <tibbe> | quicksilver: what could be the problem if I don't (sorry, I don't see your point clearly yet) |
| 17:22:00 | <pyx> | yes |
| 17:22:03 | <waern> | dcoutts: wouldn't it be nice with package name components that can contain non-alpha-numeric characters? |
| 17:22:05 | <tibbe> | quicksilver: sure, link it |
| 17:22:07 | <pyx> | <byorgey> yes |
| 17:22:18 | <quicksilver> | @go monadic tunnelling |
| 17:22:20 | <lambdabot> | http://www.haskell.org/pipermail/haskell-cafe/2007-July/028501.html |
| 17:22:20 | <lambdabot> | Title: [Haskell-cafe] Monadic tunnelling: the art of threading one monad through anothe ... |
| 17:22:21 | <waern> | dcoutts: my-c++-parser-package-1.0.0 |
| 17:22:50 | <quicksilver> | tibbe: the basic point is that a function which accepts an action has type IO () -> IO (). If you liftIO it, that makes it IO () -> Server (). |
| 17:22:53 | <byorgey> | pyx: ok, we're happy to help, but we won't do your homework for you. Why don't you try writing some code yourself and come back if you have particular questions or problems. |
| 17:22:58 | <BMeph> | :t curry (join (***)) |
| 17:23:00 | <quicksilver> | But really you want Server () -> Server () |
| 17:23:00 | <dcoutts> | waern: perhaps, for that we should propose it on the cabal-devel and/or libraries list since it impacts more stuff, like does ghc-pkg grok names like that? |
| 17:23:00 | <lambdabot> | No instance for (Arrow (,)) |
| 17:23:00 | <lambdabot> | arising from use of `***' at <interactive>:1:12-16 |
| 17:23:00 | <lambdabot> | Possible fix: add an instance declaration for (Arrow (,)) |
| 17:23:13 | <waern> | dcoutts: right |
| 17:23:15 | <dcoutts> | waern: are file names like that portable, eg win32? |
| 17:23:22 | <byorgey> | pyx: if you really have no idea how to even start, you should probably talk to your professor. |
| 17:23:24 | <BMeph> | :t curry (join (&&&)) |
| 17:23:25 | <lambdabot> | No instance for (Arrow (,)) |
| 17:23:25 | <lambdabot> | arising from use of `&&&' at <interactive>:1:12-16 |
| 17:23:25 | <lambdabot> | Possible fix: add an instance declaration for (Arrow (,)) |
| 17:23:35 | <dcoutts> | waern: there's more to it to change package names |
| 17:23:41 | <pyx> | <byorgey> i tryed... |
| 17:23:41 | <BMeph> | :t curry . join (***) |
| 17:23:42 | <lambdabot> | forall b c. (b -> c) -> b -> b -> (c, c) |
| 17:24:02 | <waern> | dcoutts: ok, I'll just make another parser for now then |
| 17:24:06 | <byorgey> | pyx: ok, can you paste your try as well? |
| 17:24:13 | <pyx> | yes |
| 17:24:14 | <tibbe> | quicksilver: oh, I see |
| 17:24:19 | <tibbe> | quicksilver: thanks |
| 17:24:25 | <dcoutts> | waern: yep |
| 17:25:23 | <hpaste> | (anonymous) annotated "Expression" with "(no title)" at http://hpaste.org/4871#a1 |
| 17:25:39 | <pyx> | it was me =) |
| 17:32:18 | <dons> | ?users |
| 17:32:19 | <lambdabot> | Maximum users seen in #haskell: 414, currently: 414 (100.0%), active: 17 (4.1%) |
| 17:33:10 | <quicksilver> | ooh |
| 17:33:14 | <quicksilver> | local maximum |
| 17:33:18 | <quicksilver> | although two people just left |
| 17:33:26 | <quicksilver> | lambdabot: obviously doesn't sample very often |
| 17:33:33 | <hpaste> | tibbe annotated "liftIO all over the place!" with "lots of IO with type errors" at http://hpaste.org/4870#a1 |
| 17:34:48 | <quicksilver> | tibbe: you don't need to / can't put liftIO inside bracket |
| 17:35:01 | <quicksilver> | tibbe: because bracket takes IO() actions as parameters, not Serevr actions |
| 17:35:03 | <tibbe> | quicksilver: right |
| 17:35:20 | <tibbe> | so my problem is that I don't know what to do instead :) |
| 17:35:32 | <quicksilver> | leave all that stuff as io |
| 17:35:46 | <quicksilver> | and just put runServer conf in front og the bit which is really Server |
| 17:35:51 | <quicksilver> | i.e. acceptConnections |
| 17:36:09 | <hpaste> | tibbe annotated "liftIO all over the place!" with "complete errors messages" at http://hpaste.org/4870#a2 |
| 17:36:30 | <tibbe> | ok |
| 17:36:50 | <hpaste> | quicksilver annotated "liftIO all over the place!" with "server' only" at http://hpaste.org/4870#a3 |
| 17:37:02 | <quicksilver> | tibbe: I have redone "server'" so you can see what I mean. |
| 17:37:12 | <tibbe> | thanks |
| 17:37:20 | <pastorn> | how do you pronounce "()"? |
| 17:37:29 | <glguy> | unit |
| 17:37:38 | <byorgey> | pyx: ok, that's a good start |
| 17:37:40 | <quicksilver> | don't worry about having big chunks of IO in routines like that IMO. |
| 17:37:54 | <quicksilver> | it's the application logic that benefits from the custom monad. |
| 17:38:09 | <quicksilver> | pastorn: I don't very often. I sometimes say "brackets". |
| 17:38:10 | <byorgey> | pyx: first, in the definition of 'varname', Var needs to be capitalized: haskell is case-sensitive. |
| 17:38:15 | <glguy> | do io a ; io b ; io c ~> io $ do a ; b ; c |
| 17:38:26 | <quicksilver> | pastorn: some people say coin |
| 17:38:35 | <pastorn> | quicksilver: sounds better |
| 17:38:39 | <quicksilver> | pastorn: sometimes I read IO () as "IO action" |
| 17:38:49 | <byorgey> | pyx: and you need the (Var p) in parentheses: otherwise it thinks you are trying to define a function with two arguments, rather than pattern-matching on the first argument |
| 17:38:56 | <glguy> | () coin people must have a really rounded font ;) |
| 17:39:17 | <pyx> | ok |
| 17:39:36 | <tibbe> | quicksilver: I think I better understand how to do it now |
| 17:40:25 | <byorgey> | pyx: for the definition "changeToConst Sequence []", I think you are missing some arguments |
| 17:40:36 | <pyx> | <byorgey> but i don't use Varname function... |
| 17:40:37 | <byorgey> | pyx: if you don't care about them you can just put _ |
| 17:41:20 | <byorgey> | pyx: I am not sure what you mean |
| 17:41:47 | <pyx> | yes, i lost [] _ _ |
| 17:42:26 | <pyx> | but it's not mait mistake ( |
| 17:42:30 | <pyx> | main |
| 17:42:44 | <byorgey> | pyx: right. Also, the (Sequence []) should be in parentheses, just like the (Var p) above |
| 17:42:50 | <C-Keen> | hm what's the haskell way of checking for EOF when doing a hGet? |
| 17:45:04 | <byorgey> | pyx: ok, now let's look at the last definition, for changeToConst (Sequence (x:ls)). |
| 17:45:37 | <pyx> | ok |
| 17:45:38 | <byorgey> | pyx: any ideas what isn't working there? |
| 17:46:08 | <pyx> | i have mistake at ten line |
| 17:46:18 | <ddarius> | pastorn: No one will know what you are talking about if you say "IO coin" |
| 17:46:25 | <pyx> | changeToConst op@(Assigment el (Var er) ) name number = |
| 17:46:25 | <pyx> | if ((varname er)==name) |
| 17:46:45 | <pyx> | give me i 2 minutes, i'll do it ) |
| 17:46:58 | <byorgey> | ok =) |
| 17:47:33 | <byorgey> | () = "coin"? weird... =) |
| 17:48:21 | <pastorn> | heh |
| 17:48:26 | <glguy> | gio123 has quit coin |
| 17:51:15 | <tibbe> | quicksilver: I have an interesting little dilemma now, either I sprinkle liftIO all over the place or runServer once per function that doesn't use the environment. if I do the latter I might as well pass the environment manually as I have to mention it in every function call anyway |
| 17:52:03 | <alexj> | @seen lemmih |
| 17:52:03 | <lambdabot> | lemmih is in #haskell. I last heard lemmih speak 3h 41m 40s ago. |
| 17:55:22 | <hpaste> | pyx annotated "Expression" with "(no title)" at http://hpaste.org/4871#a2 |
| 17:57:06 | <byorgey> | pyx: better! =) |
| 17:58:10 | <pyx> | yeap.. ( |
| 17:59:56 | <byorgey> | pyx: ok, your definition of changeToConst is still not right. |
| 18:00:18 | <byorgey> | changeToConst returns an Operator, but you are calling ++ on the result of changeToConst, and ++ only works on lists. |
| 18:00:26 | <pyx> | i know. i need second helper function for [Operator] |
| 18:01:07 | <byorgey> | pyx: sure, that's a good idea |
| 18:01:13 | <pyx> | but Operator is Assigment Expression Expression | Sequence [Operator] , it's may be a list |
| 18:01:30 | <pyx> | i trying to do it now ) |
| 18:01:50 | <byorgey> | pyx: ok. |
| 18:06:12 | <fadec> | Anyone familiar with the Clean languge? I just skimmed a pdf intro and it looks the same as Haskell? What are the differences? |
| 18:06:35 | <ddarius> | It is much the same, but there are a lot of superficial differences. |
| 18:06:53 | <dons> | it uses uniquness typing, in particular. otherwise, its a sibling to haskell |
| 18:06:58 | <dons> | or to haskell98, anyway |
| 18:08:17 | <hpaste> | pyx annotated "Expression" with "(no title)" at http://hpaste.org/4871#a3 |
| 18:08:39 | <fadec> | The IO typse look quite a bit different. I suppose that's due to the uniqueness typing. BTW, what is uniqueness typing? |
| 18:08:56 | <pyx> | <byorgey> now i haven't idea... ( what's problem? ( |
| 18:09:30 | <ddarius> | @google clean uniqueness typing |
| 18:09:32 | <lambdabot> | http://lethevert.blogspot.com/2007/06/concurrent-clean-unique-typing.html |
| 18:09:32 | <lambdabot> | Title: lethevert should not be capitalized: Concurrent Clean: Unique Typing, Covariance ... |
| 18:10:06 | <ddarius> | Not particularly helpful. |
| 18:10:13 | <byorgey> | pyx: your types still don't match. |
| 18:11:10 | <pyx> | why |
| 18:11:37 | <byorgey> | pyx: well, there's still the ++ which is being called on Operators |
| 18:13:16 | <BMeph> | pyx: I'm just wondering, if you try to get the varname of an Expression that isn't a Var, is your program supposed to blow up? |
| 18:13:26 | <byorgey> | pyx: perhaps you want Sequence [changeToConst x name number, changeToConst' ls name number] ? |
| 18:14:08 | <pyx> | <BMeph> mybe |
| 18:14:47 | <byorgey> | BMeph: looks like pyx only uses 'varname' in places where the argument is provably a Var. |
| 18:16:05 | <byorgey> | pyx: wait... shouldn't changeToConst' return [Operator]? |
| 18:16:34 | <pyx> | no |
| 18:16:46 | <pyx> | i'm not sure |
| 18:16:56 | <fadec> | http://en.wikipedia.org/wiki/Pythagoreanism -- Scroll down. The monad symbol Pythagoreans used to denote god looks like the monad in many tutorials. |
| 18:16:56 | <lambdabot> | Title: Pythagoreanism - Wikipedia, the free encyclopedia |
| 18:17:33 | <pyx> | no it should not |
| 18:19:07 | <BMeph> | pyx: or some kind of _map_ over the Sequence list... |
| 18:19:53 | <pyx> | foldl, nice idea ) |
| 18:20:28 | <BMeph> | pyx: At least, that's what it looks like you're trying to do in that last line. |
| 18:21:43 | <BMeph> | byorgey: Duh, I just noticed the pattern at the start of the definition. ;p |
| 18:21:53 | <pyx> | i try to break the list of [Operator] and create one Operator |
| 18:21:53 | <byorgey> | BMeph: heh =) |
| 18:22:29 | <pyx> | like Sequence [Operator] |
| 18:24:30 | <BMeph> | pyx: So why not jusy say "if er == name" instead? ;) |
| 18:25:37 | <pyx> | indiferently |
| 18:40:23 | <tlaboc> | @users |
| 18:40:23 | <lambdabot> | Maximum users seen in #haskell: 418, currently: 418 (100.0%), active: 15 (3.6%) |
| 18:41:35 | <fons> | hi all |
| 18:42:08 | <fons> | I testing my code, and found a bug (a call to undefined which should not have happened) |
| 18:42:35 | <fons> | to guess where the call is actually made in my code I'm trying to use ghci's debugger |
| 18:43:08 | <fons> | but typing ":b undefined" results in "cannot set breakpoint on undefined: module GHC.Err is not interpreted |
| 18:43:08 | <fons> | " |
| 18:43:22 | <fons> | any hints? |
| 18:43:35 | <dcoutts> | fons: there's a bit in the user guide on exactly that |
| 18:43:38 | <Saizan> | there's something like -fbreak-on-exception iirc |
| 18:44:20 | <fons> | Saizan: tried that, but :back doesn't help that much (or I don't know how to use it properly) |
| 18:45:09 | <fons> | dcoutts: I've been skimming through i, I'll read it more carefully, sorry |
| 19:09:51 | <Cale> | In 2006, PC World rated the Zip drive as the 15th worst technology product of all time. However, in 2007, PC World rated the Zip drive as the 23rd best technology product of all time. Thus, we can conclude that PC World must think that there are only 37 technology products. |
| 19:10:49 | <moonlite> | :)) |
| 19:11:05 | <mrd> | maybe they are using real numbers |
| 19:11:56 | <thost> | or they just threw away all their Zip disks and forgot the pain that drove them to 2006's judgement ;) |
| 19:27:19 | <wy> | Is [] really a list? |
| 19:27:34 | <mrd> | yes |
| 19:27:45 | <mrd> | it's a constructor for list |
| 19:28:22 | <wy> | I mean the null list, not the constructor |
| 19:28:44 | <notsmack> | wy: what's the difference? |
| 19:28:49 | <mrd> | ACTION is confused too |
| 19:29:16 | <wy> | uhhh sorry. It's one of the constructors |
| 19:29:26 | <Valodim> | why do you ask? |
| 19:29:34 | <Valodim> | just try it in ghci or \bot |
| 19:30:20 | <wy> | That's just a weird question ;) |
| 19:31:00 | <wy> | Like "why is the sun round"... |
| 19:31:55 | <desegnis> | wy, I think that's somehow because of gravity |
| 19:32:03 | <desegnis> | Now, your turn. |
| 19:33:06 | <wy> | because gravity operates according a law related with Euclidean distance |
| 19:33:46 | <mrd> | ?! |
| 19:33:46 | <lambdabot> | Maybe you meant: . ? @ v |
| 19:34:07 | <mrd> | I thought the whole point of general relativity is that space is not Euclidean |
| 19:34:50 | <mrd> | i even managed to confuse lambdabot |
| 19:35:41 | <dons> | ?bot |
| 19:35:41 | <lambdabot> | :) |
| 19:35:42 | <dons> | ?uptime |
| 19:35:43 | <lambdabot> | uptime: 17h 8m 2s, longest uptime: 1m 10d 23h 44m 29s |
| 19:35:44 | <dons> | ?users |
| 19:35:44 | <lambdabot> | Maximum users seen in #haskell: 421, currently: 415 (98.6%), active: 17 (4.1%) |
| 19:36:40 | <trez> | :) |
| 19:37:26 | <wy> | the roundness of the sun isn't related with general relativity |
| 19:39:12 | <wy> | see? we have lots to talk about the basic questions ;) |
| 19:39:14 | <roconnor> | the empty list is a list and 0 is a natural number. |
| 19:39:20 | <BMeph> | wy: Is that one of your axioms of your "Theory of General Non-Relativity"> ;) |
| 19:40:48 | <Saul_> | Space not being Euclidian doesn't mean that Euclidian distance is ill-defined |
| 19:41:57 | <roconnor> | there is no metric in GR. |
| 19:42:08 | <roconnor> | there is only that pesudometric thingy |
| 19:43:45 | <roconnor> | anyhow there must be some sort of naturalality argument to be made about having empty lists |
| 19:43:49 | <Saul_> | ok, but explaining why the sun is round is best explained with it |
| 19:44:04 | <roconnor> | our lists are the initial algebra of some thingy |
| 19:44:14 | <roconnor> | involving the functio F(X) = 1 + X |
| 19:44:19 | <roconnor> | functor |
| 19:44:38 | <cinimod> | @pl \(x1,y1) (x2,y2) -> ((x1,x2),(y1,y2)) |
| 19:44:39 | <lambdabot> | uncurry (flip flip snd . (ap .) . flip flip fst . ((.) .) . (. (,)) . flip . (((.) . (,)) .) . (,)) |
| 19:44:41 | <roconnor> | if we only had non-empty lists, the whole thing would be more complicated I expect. |
| 19:47:15 | <FunctorSalad> | I guess you would need a unary operation to construct singletons |
| 19:51:44 | <roconnor> | @type ((.) .) . (. (,)) |
| 19:51:45 | <lambdabot> | forall b c a a1 b1. ((b1 -> (a1, b1)) -> b -> c) -> a1 -> (a -> b) -> a -> c |
| 19:52:11 | <FunctorSalad> | @type uncurry (((fst.fst)***(fst.snd))***((snd.fst)***(snd.snd))) |
| 19:52:12 | <lambdabot> | Couldn't match expected type `b -> c' |
| 19:52:12 | <lambdabot> | against inferred type `((a, a1), (b1, b2))' |
| 19:52:12 | <lambdabot> | In the first argument of `uncurry', namely |
| 19:52:28 | <FunctorSalad> | @type curry (((fst.fst)***(fst.snd))***((snd.fst)***(snd.snd))) |
| 19:52:29 | <lambdabot> | forall a b b1 a1 b2 a2 a3 b3 b4 a4 b5 a5. (((a, b), b1), (a2, (a1, b2))) -> (((a3, b3), b4), (a5, (a4, b5))) -> ((a, a1), (b3, b5)) |
| 19:52:38 | <FunctorSalad> | hmm... |
| 19:53:20 | <FunctorSalad> | @type (((fst.fst)***(fst.snd))***((snd.fst)***(snd.snd))) |
| 19:53:21 | <lambdabot> | forall a b b1 a1 b2 a2 a3 b3 b4 a4 b5 a5. ((((a, b), b1), (a2, (a1, b2))), (((a3, b3), b4), (a5, (a4, b5)))) -> ((a, a1), (b3, b5)) |
| 19:54:13 | <FunctorSalad> | aha |
| 19:54:28 | <FunctorSalad> | @type uncurry (((fst.fst)&&&(fst.snd))&&&((snd.fst)&&&(snd.snd))) |
| 19:54:30 | <lambdabot> | Couldn't match expected type `b -> c' |
| 19:54:30 | <lambdabot> | against inferred type `((a, a1), (b1, b2))' |
| 19:54:30 | <lambdabot> | In the first argument of `uncurry', namely |
| 19:54:36 | <FunctorSalad> | ok I give up ;) |
| 19:54:58 | <FunctorSalad> | @type curry (((fst.fst)&&&(fst.snd))&&&((snd.fst)&&&(snd.snd))) |
| 19:54:58 | <lambdabot> | forall a b a1 b1. (a, b) -> (a1, b1) -> ((a, a1), (b, b1)) |
| 19:55:02 | <FunctorSalad> | finally. |
| 19:56:17 | <gnuvince> | @type (&&&) |
| 19:56:17 | <lambdabot> | forall (a :: * -> * -> *) b c c'. (Arrow a) => a b c -> a b c' -> a b (c, c') |
| 19:56:58 | <BMeph> | FS: That one's going in my "bag-of-tricks" file. I'll likely never use it, though... |
| 19:56:58 | <FunctorSalad> | (that was @ cinimod) |
| 19:57:53 | <byorgey> | in this case, I think \x y -> ((fst x, fst y), (snd x, snd y)) is a wee bit more sane... =) |
| 19:57:59 | <FunctorSalad> | BMeph: maybe lambda should be taught to use these tuplings rather than all the flips ;) |
| 19:58:21 | <FunctorSalad> | byorgey: yeah you don't win much |
| 19:58:29 | <BMeph> | FS: One of my side projects. |
| 19:58:32 | <FunctorSalad> | but OTOH it's pretty readable |
| 19:58:35 | <byorgey> | FunctorSalad: that would be pretty nifty. I've no idea what state the @pl code is in, or how easy that would be to add... |
| 20:01:02 | <cytzol> | is there a way to specify "any instance of a class" in data, or is doing that going about things the wrong way? |
| 20:01:05 | <dcoutts> | tibbe, dons: interesting article on strings: http://weblogs.mozillazine.org/roc/archives/2008/01/string_theory.html |
| 20:01:06 | <lambdabot> | Title: Well, I'm Back: String Theory, http://tinyurl.com/yqov4d |
| 20:02:01 | <dcoutts> | we're fortunate that a functional approach to strings always involves iteration/recursion rather than indexing |
| 20:02:09 | <byorgey> | cytzol: "any instance of class Foo" is denoted (Foo a) => (type involving a) |
| 20:02:14 | <dcoutts> | and our iterators are just strings themselves, thanks to tail |
| 20:02:18 | <byorgey> | cytzol: but do you mean doing that in a data declaration? |
| 20:02:28 | <cytzol> | byorgey: yes, I do |
| 20:02:36 | <byorgey> | cytzol: putting class constraints on a data declaration is usually not really what you want |
| 20:03:04 | <byorgey> | cytzol: it's better to just put the constraint on any functions that manipulate that data structure and need the constraint |
| 20:03:20 | <dcoutts> | tibbe, dons: hence I claim that making length/index efficient is wasted effort (wasted runtime, memory and programmer effort) |
| 20:03:46 | <byorgey> | cytzol: for example, you might have data Tree a = blah, treeSize :: Tree a -> Int, but treeMin :: (Ord a) => Tree a -> a |
| 20:04:10 | <cytzol> | byorgey: do that instead of making Tree depend on Ord somehow? |
| 20:04:25 | <dobblego> | @msg dons s/correspondance/correspondence ;) http://programming.reddit.com/info/64th1/comments/c02uenu |
| 20:04:25 | <lambdabot> | Not enough privileges |
| 20:04:28 | <byorgey> | cytzol: right |
| 20:04:30 | <dobblego> | bleh |
| 20:04:45 | <dobblego> | @tell dons s/correspondance/correspondence ;) http://programming.reddit.com/info/64th1/comments/c02uenu |
| 20:04:45 | <lambdabot> | Consider it noted. |
| 20:04:57 | <byorgey> | cytzol: even if you put the Ord instance on the declaration of Tree itself, you'll still need the constraints on the Tree functions that need it anyway |
| 20:06:05 | <byorgey> | cytzol: and there may be some functions on Trees that don't require the Ord instance -- such as treeSize above -- but if you put the Ord constraint on Tree itself you won't be able to write those. |
| 20:07:27 | <cytzol> | byorgey: oh, ok. |
| 20:11:37 | <BMeph> | "Make the data smart, and the functions dumb," eh byorgey? :) |
| 20:12:36 | <byorgey> | BMeph: what's that from? |
| 20:14:03 | <BMeph> | byorgey: I think it's an ESR quote - I got it second-hand from a blog page called "Objects have not failed". Guy Steele wrote it, I think. |
| 20:14:50 | <byorgey> | BMeph: ah, I see. |
| 20:15:15 | <byorgey> | BMeph: out of context I'm not sure what it's supposed to mean, but I'm not sure that I agree =) |
| 20:17:21 | <byorgey> | hmm, after reading it a bit, maybe I do agree |
| 20:17:32 | <wy> | :t 1+2 |
| 20:17:33 | <BMeph> | byorgey: Yeah - I have the page up at home, so its not at-hand for me. I'd recommend you give it a glance, it's only a couple pages' worth of text...there you go, lol. :) |
| 20:17:35 | <lambdabot> | forall t. (Num t) => t |
| 20:18:14 | <wy> | On my ghci it shows 1+2 :: forall t. (Num t) => t |
| 20:18:21 | <byorgey> | wy: same thing. |
| 20:18:43 | <wy> | why doesn't it evaluate it |
| 20:18:48 | <byorgey> | wy: there is an implicit 'forall' on every free type variable. |
| 20:19:06 | <tibbe> | dcoutts: interesting, I'll have a look |
| 20:19:07 | <byorgey> | wy: you probably have -fglasgow-exts turned on, which (among other things) makes it print the 'foralls' explicitly |
| 20:19:32 | <wy> | byorgey: I mean it gives me the type of 1+2, but not the type of the result |
| 20:19:46 | <byorgey> | wy: that *is* the type of the result. |
| 20:20:09 | <byorgey> | wy: you mean, you want it to print '3'? |
| 20:20:24 | <wy> | yes. why doesn't it print 3? |
| 20:20:36 | <byorgey> | wy: typechecking and evaluation are two separate stages. |
| 20:20:55 | <byorgey> | wy: there are some expressions which can easily be typed but would diverge if you tried to evaluate them. |
| 20:21:10 | <BMeph> | dcoutts_: It gave me a funny idea of possibly encoding long C strings as a function that generates the characters in order. |
| 20:21:11 | <byorgey> | wy: so in general it doesn't make sense to evaluate an expression when you're just asking for the type. |
| 20:21:27 | <Saizan> | wy: to get the result omit ':t' |
| 20:21:38 | <dcoutts> | BMeph: which is of course a lazy [Char] style string |
| 20:21:56 | <dcoutts> | BMeph: or in a lazy chunked representation like lazy ByteStrings |
| 20:22:31 | <BMeph> | wy: for example, it's easy to give the type of 'repeat' used on something. Writing it out is fruitless, though. ;) |
| 20:22:41 | <byorgey> | :t repeat 3 |
| 20:22:43 | <lambdabot> | forall t. (Num t) => [t] |
| 20:22:46 | <byorgey> | > repeat 3 |
| 20:22:47 | <lambdabot> | [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3... |
| 20:23:47 | <BMeph> | byorgey: Which is the best descriptive definition of "lazy" and "eager" that I could think of. |
| 20:23:52 | <resiak> | is the ...-ing implemented as an alternative Show [a] instance, or by lazily show-ing the result? |
| 20:23:55 | <resiak> | i guess the latter. |
| 20:24:19 | <byorgey> | BMeph: it's a good example. |
| 20:24:43 | <byorgey> | resiak: actually, neither =) |
| 20:24:46 | <BMeph> | "Lazy" means "doing as much as you are asked for, without doing anything else. |
| 20:24:49 | <resiak> | heh |
| 20:24:50 | <cinimod> | FunctorSalad: I've given up with Arrow as I was ending up with things like (curry ((***) (uncurry (<+>)) (uncurry (<+>))) |
| 20:24:55 | <byorgey> | resiak: it's just that lambdabot has some wrapper code which cuts off output after a certain length |
| 20:25:12 | <resiak> | heh |
| 20:25:25 | <cinimod> | FunctorSalad: it would be hard to understand what it did in a week's time |
| 20:25:54 | <kolmodin> | can we get space usage from ghc for different data types? or is it difficult to interpret due to lazyness? |
| 20:26:04 | <byorgey> | resiak: but you could easily imagine it being done with an alternative Show instance. |
| 20:26:16 | <resiak> | byorgey: in fact, I did! :) |
| 20:26:22 | <byorgey> | hehe =) |
| 20:27:48 | <byorgey> | newtype ShowTrunc a = STrunc a ; instance (Show a) => Show (ShowTrunc a) where show (STrunc x) = take 80 (show x) -- like that, except more fancy =) |
| 20:38:44 | <waern> | dcoutts: ping |
| 20:41:23 | <roconnor> | waern: rst |
| 20:41:39 | <waern> | rst? |
| 20:41:49 | <roconnor> | tcp reset |
| 20:42:06 | <waern> | hehe ok :) |
| 20:42:15 | <roconnor> | just trying to screw with your connection to dcoutts |
| 20:45:15 | <eyeris> | If import Data.Map and use lookup, I get an ambiguous function error between Data.Map and Prelude. How can I disambiguate this? |
| 20:45:48 | <byorgey> | eyeris: either import Prelude hiding (lookup), or (probably better), import qualified Data.Map as M, then use M.lookup and so on |
| 20:48:33 | <eyeris> | hrm |
| 20:48:43 | <eyeris> | Now I get this err: Not in scope: data constructor `M.Map' |
| 20:50:02 | <byorgey> | eyeris: well, Data.Map doesn't export any data constructors, so you're probably using M.Map wrong. |
| 20:50:20 | <eyeris> | Ok |
| 20:50:23 | <byorgey> | it is a type constructor, not a data constructor |
| 20:53:03 | <__pao___> | Hi all |
| 20:53:14 | <byorgey> | hi __pao___ |
| 20:53:37 | <__pao___> | I made a question this afternoon about haskell recursive data caching... |
| 20:53:44 | <eyeris> | byorgey if I use `type MyMap = Map Int String` (which compiles fine), how do I then construct a MyMap? |
| 20:53:48 | <__pao___> | I made a simple example |
| 20:53:59 | <__pao___> | http://pastebin.com/m71267140 |
| 20:54:26 | <__pao___> | the time double if you put two putStrLn statements |
| 20:54:41 | <glguy> | eyeris: Data.Map.empty |
| 20:54:41 | <__pao___> | it seems that the info is not cached in between two calls |
| 20:54:45 | <byorgey> | eyeris: the same way you would construct a Map Int String. using functions from Data.Map like empty, singleton, fromList, and so on |
| 20:54:46 | <roconnor> | eyeris: lots of ways |
| 20:54:56 | <roconnor> | what byorgey said |
| 20:54:58 | <eyeris> | empty! Thank you! |
| 20:55:19 | <glguy> | eyeris: type synonyms are just a convenience, they don't change how you use the value |
| 20:56:05 | <byorgey> | eyeris: and of course, if you've imported Data.Map qualified as M, that should be type MyMap = M.Map Int String |
| 20:57:20 | <byorgey> | __pao___: no, it isn't. Haskell doesn't memoize the results of function calls in that way. |
| 20:57:42 | <wy> | Why isn't type defined to be a set of operations in Haskell? |
| 20:58:31 | <__pao___> | byorgey: __pao__ is there a way to explicitly request caching? is it reasonable need or is it a smell of an anti-pattern? |
| 20:59:03 | <byorgey> | __pao___: there isn't a way to request it, but there are ways to do that sort of thing yourself if you want it. |
| 20:59:44 | <glguy> | __pao___: stick with hpaste.org or other non-terrible pastebins (slow / covered in ads) |
| 20:59:57 | <byorgey> | __pao___: see http://www.haskell.org/haskellwiki/Memoization |
| 20:59:57 | <BMeph> | wy: Because that's what classes are for. ;) |
| 20:59:59 | <lambdabot> | Title: Memoization - HaskellWiki |
| 21:00:08 | <__pao___> | glguy: glguy ok, thanks for the advice |
| 21:00:25 | <desegnis> | pao, main = putStrLn s >> putStrLn s where s = show (index n l) |
| 21:00:49 | <dons> | dcoutts: how many packages on hackage depend on bytestring? :) |
| 21:00:49 | <lambdabot> | dons: You have 4 new messages. '/msg lambdabot @messages' to read them. |
| 21:01:41 | <__pao___> | byorgey: thanks! memoization was the keyword ;-) |
| 21:02:01 | <wy> | BMeph: but if types are defined to be so, we don't need classes any more |
| 21:04:42 | <resiak> | What's the standard approach for representing C enums like { a = 1, b = 2, c = 4, d = 8, ... }? An Enum instance can't be written since succ b is undefined. |
| 21:04:58 | <dons> | resiak: use #enum in hsc2hs? |
| 21:06:40 | <resiak> | dons: that doesn't produce data Foo = A | B | C..., though |
| 21:07:14 | <resiak> | Oh, but I guess I do newtype Foo = MkFoo Int; use #enum to define the constant; then don't export MkFoo |
| 21:09:25 | <Saizan> | resiak: succ is not supposed to be total, typical enums are finite |
| 21:09:50 | <FunctorSalad> | resiak: subset of {a,b,c,d,...} ;) |
| 21:10:32 | <FunctorSalad> | (actually I don't know whether sets are parametrised with a base set like that) |
| 21:10:45 | <Saizan> | end {#enum in c2hs declares Foo = A | B | C .. for you |
| 21:11:19 | <resiak> | hmm, i must be misreading the docs! |
| 21:11:50 | <Saizan> | c2hs /= hsc2hs |
| 21:12:14 | <resiak> | heh, so i'm misreading the IRC channel :) |
| 21:12:45 | <thoughtpolice> | resiak: hey. pulled your patches from the new hfuse repo, seems to build fine on ghc 6.8. however when running the HelloFS example (i.e. ./HelloFS /tmp/ex) and after running an ls, apparently the function for directory listings isn't implemented |
| 21:12:58 | <thoughtpolice> | or is that just something you're working on? |
| 21:14:02 | <resiak> | yeah, the directory stuff doesn't work. i'm working on it, bit by bit :) |
| 21:14:14 | <resiak> | thanks for trying it with 6.8 :) |
| 21:14:15 | <Botje> | resiak: psst, the next one is a zero. |
| 21:14:31 | <resiak> | Botje: ? |
| 21:14:35 | <Botje> | "bit by bit" |
| 21:14:44 | <Botje> | i'll get me coat. |
| 21:14:50 | <resiak> | ACTION covers Botje in bees. |
| 21:14:56 | <thoughtpolice> | resiak: built completely fine, no errors or anything. i think for the most part you'll be fine in that respect, although i'll keep periodically pulling/building to test it and give you any feedback. :) |
| 21:25:19 | <bringert__> | When do you want the next Hackathon? Register your preferences on http://www.haskell.org/haskellwiki/Hac_2008/Dates |
| 21:25:24 | <lambdabot> | Title: Hac 2008/Dates - HaskellWiki |
| 21:25:44 | <dons> | bringert__: do you have the hackathon darcs repo url? |
| 21:25:51 | <tehgeekmeister> | where does ghc search when attempting to import a module? i've defined a module and now need to use it in another file, in another directory |
| 21:25:52 | <dons> | it has all the past registration and other info |
| 21:26:02 | <bringert__> | dons: nope |
| 21:26:32 | <bringert> | dons: could you e-mail it to me? |
| 21:26:38 | <dons> | will do. |
| 21:29:46 | <waern> | dcoutts: I've sent a patch to cabal-devel |
| 21:30:11 | <waern> | dcoutts: I didn't do anything to pkg-config parsing, since I wasn't sure how you wanted that done |
| 21:31:02 | <thoughtpolice> | tehgeekmeister: it searches in a directory heirarchy fashion, i.e. if you have something like Language.XXX.Compiler, it'll look under Language/XXX/ for the Compiler module. |
| 21:31:15 | <ndm> | having just strayed into another IRC channel to ask a question, i think i've been completely spoiled by this one... |
| 21:31:32 | <Nafai> | ndm: No kidding! |
| 21:31:40 | <tehgeekmeister> | ndm: i know i have. |
| 21:32:42 | <ndm> | has anyone spotted that Test.QuickCheck lacks any haddock comments? |
| 21:32:49 | <ndm> | that seems like something someone should fix up |
| 21:34:44 | <bringert> | ndm: QuickCheck 2 fixes that, afair |
| 21:34:55 | <DRMacIver> | Hm |
| 21:35:07 | <ndm> | bringert: should I (as a user) be on QuickCheck 1 or QuickCheck 2 ? |
| 21:35:11 | <DRMacIver> | I wonder why the brainfuck interpreter in literate haskell post that has just cropped up doesn't use a zipper. |
| 21:35:32 | <bringert> | ndm: QuickCheck 2 is better, but not released yet |
| 21:35:45 | <ndm> | bringert: ok, so stick with 1 for the moment |
| 21:35:50 | <DRMacIver> | Given that it's currently operating by indexing into a linked list. |
| 21:35:54 | <ndm> | sounds like Hoogle 4 :) |
| 21:35:56 | <bringert> | yeah, probably the safest bet |
| 21:36:56 | <DRMacIver> | Ah, it got improved later. :) |
| 21:40:11 | <kolmodin> | bringert: I added myself to the organisers, and to the date list |
| 21:43:31 | <bringert> | kolmodin: great! |
| 21:44:15 | <bringert> | kolmodin: s/has/have/ :-) |
| 21:45:33 | <kolmodin> | ah crap :) |
| 21:46:07 | <kolmodin> | I've fried my brain today. worked (C#!), and then bicycled around gbg to look at three apartments |
| 21:46:24 | <shachaf> | ACTION actually does sometimes pronounce "::" as "colon colon"... |
| 21:46:52 | <wolverian> | all these colons on my screen, argh |
| 21:46:53 | <shachaf> | But then, a lot of my pronunciations are odd. |
| 21:47:00 | <Zao> | SPJ's talk about xmonad made me pronounce mkFoo as "muck Foo" |
| 21:47:02 | <kolmodin> | shachaf: that has a nice touch to it :D |
| 21:47:16 | <wolverian> | Zao, yeah, that was weird. |
| 21:47:40 | <bringert> | kolmodin: C#? new job? |
| 21:48:18 | <kolmodin> | bringert: same old job |
| 21:49:37 | <kolmodin> | I could move from java, luckely |
| 21:49:58 | <kolmodin> | C# 3.5 has a few FP like features |
| 21:50:22 | <kolmodin> | so it's not compleeeetely crap |
| 21:51:57 | <ndm> | kolmodin: bolted on in a slightly haphazard way, from what i saw - there are quite a few corner cases |
| 21:53:20 | <kolmodin> | ndm: indeed there are. I hit a few already the first day and was quite disappointed |
| 21:54:24 | <kolmodin> | and most new things only work in local scope (inside functions), nothing can be made into public API |
| 21:55:27 | <kolmodin> | like the tupelish things they've introduced, anonymous classes |
| 21:56:02 | <bringert> | kolmodin: couldn't you use F#? |
| 21:56:34 | <kolmodin> | bringert: it all comes down to who is going to maintain it |
| 21:56:55 | <kolmodin> | bringert: and currently we don't have anyone that's even had a serious look at FP |
| 21:58:22 | <bringert> | kolmodin: "The third worry of the pointy-haired boss, the difficulty of hiring programmers, I think is a red herring. How many hackers do you need to hire, after all? Surely by now we all know that software is best developed by teams of less than ten people. And you shouldn't have trouble hiring hackers on that scale for any language anyone has ever heard of. If you can't find ten Lisp hackers, then your company is probably based in the |
| 21:58:23 | <kolmodin> | but I'm convincing them one by one :D |
| 21:58:30 | <bringert> | kolmodin: from http://www.paulgraham.com/icad.html |
| 21:58:31 | <lambdabot> | Title: Revenge of the Nerds |
| 21:58:56 | <gwern> | is it true that it's no longer necessary to add -02 to one's .cabals because cabal turns on optimizations by default? |
| 21:59:08 | <bringert> | I think that once Microsoft start marketing F# seriously, there will be a lot of hype around FP |
| 21:59:24 | <kolmodin> | bringert: thanks! |
| 21:59:40 | <kolmodin> | bringert: indeed, I think so too. people listen to them |
| 21:59:56 | <shachaf> | gwern: Try compiling with -v to test it, I guess? |
| 22:00:07 | <bringert> | and they will come up with lots of exaggerated marketing fluff to make FP sound even better than it is |
| 22:00:46 | <DRMacIver> | bringert: That will be nice. :) |
| 22:02:48 | <kolmodin> | haha :) |
| 22:02:52 | <kolmodin> | like they do about OO? |
| 22:02:57 | <kolmodin> | ;) |
| 22:04:01 | <dons> | this is quite relevant to haskell. http://www.stsc.hill.af.mil/CrossTalk/2008/01/0801DewarSchonberg.html |
| 22:04:02 | <lambdabot> | Title: STSC CrossTalk - Computer Science Education: Where Are the Software Engineers of ..., http://tinyurl.com/25atps |
| 22:04:07 | <dibblego> | ?kind [] |
| 22:04:09 | <lambdabot> | * -> * |
| 22:04:16 | <dons> | "It is our view that Computer Science (CS) education is neglecting basic skills, in particular in the areas of programming and formal methods." |
| 22:04:42 | <dons> | "Students need to be exposed to the tools to construct large-scale reliable programs, as we discussed at the start of this article. Topics of relevance are studying formal specification methods and formal proof methodologies, as well as gaining an understanding of how high-reliability code is certified in the real world" |
| 22:06:07 | <kolmodin> | right. I think far to many in my old CS class couldn't write a linked list properly |
| 22:06:16 | <dons> | dibblego: reminds me of stuff you complain about |
| 22:06:22 | <dons> | kolmodin: mm |
| 22:06:27 | <ndm> | bringert: citing Paul Graham is never a good idea, since he's opionionated and wrong as often as he is right |
| 22:06:35 | <dibblego> | dons, what do I complain about? |
| 22:06:48 | <kolmodin> | ndm: so you just have to pick the pieces you like :) |
| 22:06:56 | <bringert> | ndm: well, that depends on whether the person you are citing him too knows that :-) |
| 22:06:57 | <dons> | dibblego: the dumbing down of undergrads caused by java :) |
| 22:07:18 | <dibblego> | dons, ah right; yes, it's a sad phenomenon |
| 22:07:37 | <bringert> | good night |
| 22:07:41 | <ndm> | but the article suggests that if you taught Ada then you'd have less problems |
| 22:07:52 | <ndm> | i know for a fact that Ada does not help undergrads learn to program |
| 22:07:57 | <dons> | yeah, there are other approaches to high assurance and reliability |
| 22:08:07 | <ndm> | York is going to convert from Ada -> Java next year, and it is definately a good idea |
| 22:08:10 | <dons> | its also funny how they cite lisp as important for teaching referential transparency :) |
| 22:08:26 | <dons> | ndm, only 10 years after everyone else, eh? :) |
| 22:08:27 | <kolmodin> | that's a nice article, it's on my TOREAD list |
| 22:08:43 | <dons> | unsw switched to java in 98, and ditched by 04, iirc |
| 22:09:12 | <dons> | but they also used haskell for a decade to teach the newbies,so maybe its a funny place |
| 22:09:17 | <pejo> | dons, Paul Graham cites lisp as important all the time. Nothing new there. |
| 22:09:31 | <kolmodin> | dons: so what have they used since 04? |
| 22:09:35 | <dons> | pejo: oh, this isn't PG |
| 22:09:53 | <pejo> | Oh, sorry. Mixing up debates. |
| 22:10:03 | <ndm> | dons: York teaches Scheme as the first language, Java will be the second - so we aren't a java school by that metric |
| 22:10:03 | <dons> | kolmodin: haskell, C, java for some data structure stuff. hmm, not sure what they're doing these days. the haskell has been pushed into the grad courses |
| 22:10:25 | <vincenz> | kthxbye |
| 22:11:18 | <vincenz> | I think Scheme is a good intro languag, you can explore a lot of ideas without getting stuck in syntax |
| 22:11:28 | <vincenz> | Haskell is a nice follow up :) |
| 22:11:41 | <vincenz> | but it's easier to explore fp vs oop in scheme |
| 22:11:44 | <vincenz> | with a set of macros |
| 22:11:47 | <vincenz> | or a lambda and a cse |
| 22:12:05 | <vincenz> | s/cse/case |
| 22:12:44 | <kolmodin> | we start with (at least 5 years ago) with haskell for 8 weeks, then java 8 weeks. than you can more or less pick whatever you'd like in the courses, if it's not anything special |
| 22:13:00 | <kolmodin> | and by we I mean CS at Chalmers |
| 22:13:15 | <waern> | kolmodin: now they even have Haskell in the data structures course |
| 22:13:25 | <dons> | awesome |
| 22:13:44 | <pejo> | waern, depends on who is teaching it, I presume? |
| 22:13:52 | <dons> | purely functional data's in C# now, and generics in Java, so they're going to need the foundations from somewhere |
| 22:14:31 | <waern> | pejo: I don't know, I just heard that they used Haskell and Java in the data structures course this year. I suppose they look at data structures from both an imperative and functional point of view |
| 22:14:36 | <ndm> | they say in that article that PRAXIS can't recruit enough graduates - which wasn't true 4 years ago, as I applied and they said they had no vacancies |
| 22:15:05 | <kolmodin> | waern: that's nice! |
| 22:15:09 | <ndm> | they also say people should study floating point, while i think floating point should be dumped entirely |
| 22:15:43 | <tlaboc> | you mean like IEEE floating-point specifications? |
| 22:16:10 | <wy> | I'm thinking about the question, is there really a need for dependent types? |
| 22:16:21 | <tlaboc> | is that actually complex/important enough to need "studied"? |
| 22:17:02 | <kolmodin> | good night everyone! |
| 22:17:55 | <wy> | ndm: Then what do you use? |
| 22:18:12 | <dons> | night kolmodin |
| 22:18:47 | <byorgey> | tlaboc: well, it's certainly *complex* enough... |
| 22:18:58 | <wy> | waern: It will be interesting how imperitive data structures can be interpreted by functional ones |
| 22:18:59 | <pejo> | tlaboc, fp is a can of worms. |
| 22:19:37 | <wy> | byorgey: because you lose precesions? |
| 22:19:40 | <tlaboc> | hahaha, thats true i suppose, but ive never heard anyone speak of "studying" it, like you would study a language or something |
| 22:20:14 | <wy> | tlaboc: We studied it for a semester in numerical analysis ;-) Lots about roundoff errors... |
| 22:20:27 | <wy> | matrix condition numbers... |
| 22:20:47 | <tlaboc> | wy: details like that are disgusting :) |
| 22:21:06 | <MyCatVerbs> | @hoogle Handle -> IO [Word8] |
| 22:21:07 | <lambdabot> | No matches, try a more general search |
| 22:21:26 | <wy> | tlaboc: but you have to face it because we never have accurate real numbers |
| 22:21:43 | <tlaboc> | wy: fixed point! |
| 22:22:10 | <tlaboc> | wy: also, casual disregard for errors |
| 22:22:50 | <wy> | Where can I discuss about dependent types? |
| 22:23:27 | <tlaboc> | what do you mean by dependent types? |
| 22:23:48 | <wy> | tlaboc: I mean by what it normally means... I don't know! |
| 22:24:05 | <tlaboc> | wy: sorry, its just that i'm not familiar with the term |
| 22:24:09 | <wy> | It probably means types that depend on values |
| 22:24:24 | <tlaboc> | wy: im looking it up :) http://en.wikipedia.org/wiki/Dependent_types |
| 22:24:30 | <pejo> | wy, there's people here who use Coq, Epigram, etc. |
| 22:24:40 | <pejo> | wy, here as in #Haskell. |
| 22:24:47 | <BMeph> | See y'all in an hour - time to leave work. :) |
| 22:28:56 | <wy> | I tried to remove classes from the language and unify classes and types, but there is something seemingly wrong with my theory |
| 22:30:25 | <dcoutts> | waern: thanks |
| 22:31:15 | <dcoutts> | dons: not sure how many, we should make those kind of stats available on the hackage website |
| 22:31:38 | <dcoutts> | @seen waern |
| 22:31:38 | <lambdabot> | waern is in #ghc and #haskell. I last heard waern speak 17m 6s ago. |
| 22:31:41 | <dcoutts> | @seen dons |
| 22:31:42 | <lambdabot> | dons is in #xmonad and #haskell. I last heard dons speak 13m 29s ago. |
| 22:32:23 | <dcoutts> | dons: people have suggested (and I think it's a good idea) using stats like that for a "hackage rank" to get some idea of what the important/popular packages are |
| 22:32:56 | <dcoutts> | a combination of download/build stats and number of packages depending directly (or indirectly) on a package |
| 22:32:56 | <dons> | yeah, i'm going to write a script to compute the most popular core and non-core libraries |
| 22:33:23 | <dcoutts> | dons: if you can integrate in the hackage-scripts repo that'd be even more useful |
| 22:33:28 | <waern> | dcoutts: pong |
| 22:33:43 | <dons> | currently i think Data.Binary is the most popular non-extra lib library (with 16 users), while the top 10 looks like, |
| 22:33:46 | <dons> | array: 197 |
| 22:33:48 | <dons> | old-locale: 156 |
| 22:33:48 | <dcoutts> | waern: I've not looked at the patch yes |
| 22:33:51 | <dons> | old-time: 150 |
| 22:33:53 | <dons> | mtl: 144 |
| 22:33:56 | <dons> | filepath: 134 |
| 22:33:58 | <dons> | directory: 134 |
| 22:34:01 | <dons> | unix: 121 |
| 22:34:03 | <dons> | containers: 120 |
| 22:34:07 | <dons> | random: 108 |
| 22:34:08 | <dons> | process: 105 |
| 22:34:11 | <dons> | haskell98: 91 |
| 22:34:13 | <dons> | bytestring: 88 |
| 22:34:16 | <dons> | parsec: 88 |
| 22:34:18 | <dons> | network: 58 |
| 22:34:21 | <dons> | pretty: 45 |
| 22:34:23 | <dons> | regex-base: 38 |
| 22:34:26 | <dons> | QuickCheck: 30 |
| 22:34:27 | <dons> | utf8-string is also pretty popular |
| 22:34:29 | <dons> | and some core libs aren't used at all, e.g. html has 1 user.. |
| 22:34:34 | <Igloo> | dons: Where are these numbers from? |
| 22:34:43 | <dons> | Igloo: the hackage required-by search field. |
| 22:34:50 | <dons> | i'll script it up to extract the full list |
| 22:35:10 | <Igloo> | What, you mean we have 197 packages that use array? Does that include multiple versions of each package? |
| 22:35:22 | <dons> | i believe so. |
| 22:35:28 | <dons> | so if one library has 20 versions, that counts for 20 hits |
| 22:35:40 | <dcoutts> | dons: so the question is, what'd be the most useful way to present that kind of information... |
| 22:35:43 | <dons> | i've only toyed with the results. i should be able to produce more accurate info |
| 22:35:53 | <Igloo> | Ah, OK. That's more plausible then |
| 22:35:56 | <dons> | we can also combinme them with the webserver logs |
| 22:36:03 | <dons> | which i'm sure we can get access to |
| 22:36:20 | <dcoutts> | dons: eg, looking at a single package it might be interesting to see the reverse deps and the "hackage rank" but a single page listing by rank would also be very useful |
| 22:36:54 | <dcoutts> | dons: yes, we should be able to get web server logs, though it might be a little ad-hoc |
| 22:37:11 | <dcoutts> | dons: there's a hackage bug open on this issue iirc |
| 22:37:26 | <dons> | yeah, some things like 'xmonad' have only a couple of deps, but i bet a lot of hits on the webserver |
| 22:37:38 | <dons> | then core things like mtl, lots of deps, but few hits, since they're packaged |
| 22:37:53 | <dcoutts> | dons: right, we want deps and download and then some combined rank |
| 22:38:08 | <dons> | yep |
| 22:38:27 | <dcoutts> | dons: we want people to be able to compare DB libs or xml parsing libs for example |
| 22:38:40 | <dcoutts> | to see if one is "standard" and another experimental |
| 22:38:48 | <dons> | haxml is more popular than libxml, fwiw |
| 22:38:54 | <dons> | but none are widely used |
| 22:39:38 | <dcoutts> | http://hackage.haskell.org/trac/hackage/ticket/183 |
| 22:39:38 | <lambdabot> | Title: #183 (Provide "library-rank" in hackage) - Hackage - Trac |
| 22:39:38 | <dons> | mm |
| 22:39:39 | <dons> | ok, i can probably knock off that ticket |
| 22:39:43 | <dons> | i've done a bit of hackage scraping recently |
| 22:39:49 | <dcoutts> | great |
| 22:39:53 | <dcoutts> | it needs some love |
| 22:40:22 | <dcoutts> | dons: I know very little about the design or structure of the hackage-scripts code |
| 22:40:50 | <dcoutts> | it's going to get more and more important as we want to add more and more features |
| 22:41:09 | <dcoutts> | dons: so feel free to refactor and improve the organisation / design etc |
| 22:41:52 | <dons> | yep |
| 22:41:55 | <dcoutts> | dons: oh, and the other similar feature request that covers is: |
| 22:41:55 | <dcoutts> | http://hackage.haskell.org/trac/hackage/ticket/162 |
| 22:41:57 | <lambdabot> | Title: #162 (show how often a package has been viewed or downloaded) - Hackage - Trac |
| 22:42:03 | <dons> | ah ha |
| 22:43:05 | <dcoutts> | dons: and once we add support for repo links in .cabal files we'll want to implement #58 or something simpler like just providing links and darcs-graph style stats |
| 22:43:44 | <doserj> | the upload date would already be helpful |
| 22:43:53 | <dcoutts> | yes, that too |
| 22:44:13 | <dons> | right. then we can duplicate ohloh, http://www.ohloh.net/projects/6869/analyses/latest/contributors |
| 22:44:13 | <lambdabot> | Title: xmonad Contributors - Ohloh |
| 22:44:24 | <dcoutts> | dons: it's related to the download and dep rank since another indication people would like is project activity which we can measure by uploads and also by darcs changes |
| 22:44:34 | <dons> | right. |
| 22:45:13 | <dcoutts> | dons: I'd love to see a darcs-graph annotated with lines marked with release number |
| 22:45:44 | <dcoutts> | dons: there's probably enough info to fill a whole page for each package |
| 22:46:17 | <dcoutts> | dons: eventually we'll want to link this into hoogle to use to help order package search results |
| 22:46:56 | <dcoutts> | dons: conal has a rather persuasive argument (imho) that the right interface to hackage is a google style search |
| 22:47:07 | <dons> | i'd like to generate something like the ohloh stats from darcs-graph. so pie graphs of contributors, releases, etc. |
| 22:47:20 | <dcoutts> | that'd be great |
| 22:47:25 | <dons> | comment/code ratio. hpc coverage data ... |
| 22:47:33 | <dcoutts> | there's loads of stuff yes |
| 22:48:06 | <dcoutts> | probably easiest to develop it as a second page for each project, linked from the primary page |
| 22:48:16 | <dons> | we didn't have hackage this time last year |
| 22:48:31 | <dons> | so in the next 12 months we should be able to do a few things |
| 22:48:48 | <dcoutts> | dons: you can see why I worry slightly about the design/structure of the hackage server |
| 22:49:00 | <dcoutts> | it could get complex, so needs to be designed carefully |
| 22:49:10 | <dcoutts> | eg consider separating aspects |
| 22:49:40 | <dcoutts> | like the package repository/archive bit should be possible to deploy on it's own without needing the upload or web UI views |
| 22:50:01 | <dcoutts> | lots of these stats etc would be useful to have in machine and human readable formats etc |
| 22:50:13 | <dcoutts> | in otherwords it's a whole complex web app |
| 22:50:27 | <dons> | yeah |
| 22:51:11 | <dcoutts> | dons: I was idly wondering if HApps might be a good platform for it |
| 22:52:04 | <dcoutts> | dons: we'll also want email support some day, eg to send reports to maintainers |
| 22:52:09 | <gwern> | hm. so it would appear cabal does turn on -O2 by default |
| 22:52:27 | <dcoutts> | gwern: no, only -O, use configure --disable-optimization |
| 22:52:43 | <dons> | well, fastcgi might be ok too |
| 22:52:52 | <dons> | fastcgi and a bit of javascript |
| 22:53:09 | <gwern> | dcoutts: are you sure? I did a configure and build with -02 in the cabal, then edited -o2 out of the cabal, reconfigured and rebuilt - and the build didn't compile anything |
| 22:53:27 | <dcoutts> | dons: there is some serialisation necessary for managing the archive and index correctly |
| 22:54:00 | <dcoutts> | gwern: it does not track changes to compile flags |
| 22:54:43 | <dcoutts> | gwern: by default cabal gets ghc to use -O and as I said, you can configure it to use no optimisation |
| 22:54:49 | <gwern> | oh. |
| 22:55:02 | <dcoutts> | you'd have to clean though if you'd already built with -O and wanted to rebuild with -O0 |
| 22:55:34 | <dcoutts> | dons: fastcgi would be basically the same as what we have now with cgi, it's just a performance thing |
| 22:55:41 | <dons> | yep. |
| 22:55:51 | <dcoutts> | dons: it's mutable state management that's the tricky bit |
| 22:55:59 | <dons> | yeah. |
| 22:56:10 | <dcoutts> | the package archive and any cached data, like logs, stats, etc etc |
| 22:56:19 | <Saizan> | is there any easy way to query ghc or ghc-pkg about which package a module is in? |
| 22:56:38 | <dcoutts> | dons: which is why HApps is potentially attractive since it has some approaches to those issues |
| 22:56:56 | <dons> | that's true. it would make the state handling simpler |
| 22:57:03 | <dcoutts> | Saizan: not at the moment, no. I think it might appear in a later ghc |
| 22:57:37 | <dcoutts> | dons: otherwise I'm not sure how to handle concurrent uploads, or page views that come just as the index is being updated or whatever |
| 22:58:04 | <prb> | dcoutts: You can disintermediate the state from the client using, e.g., a Chan. |
| 22:58:31 | <prb> | dcoutts: Single-thread the updates, fork the IO, etc. |
| 22:59:19 | <dibblego> | @ in defense of scala |
| 22:59:22 | <dibblego> | @go in defense of scala |
| 22:59:27 | <lambdabot> | http://rickyclarkson.blogspot.com/2008/01/in-defence-of-0l-in-scala.html |
| 22:59:27 | <lambdabot> | Title: Ricky's technical blog: In Defence of (0/:l)(_+_) in Scala |
| 22:59:37 | <dcoutts> | prb: doing that from within a cgi script is a bit hard, it's ok if you have a long running server process like HApps |
| 23:00:14 | <prb> | dcoutts: Right; that's the benefit of FastCGI. Properly configured, you can have a single server process that stays alive. |
| 23:00:27 | <dcoutts> | Oh, I didn't know that |
| 23:01:38 | <dcoutts> | dons: there's certainly an advantage to being able to use any old http web server for the package archive, but then the order of file actions is important to get a consistent view |
| 23:02:22 | <dcoutts> | dons: probably so long as updating the index is atomic it's all ok, and that's possible using the rename trick |
| 23:17:43 | <matthew-_> | any experience with getting ghc to make static executables? |
| 23:17:58 | <matthew-_> | I'm using -static -optc-static -optl-static and I get link errors with pthreads |
| 23:18:10 | <matthew-_> | (.text+0x124): undefined reference to `pthread_once' |
| 23:18:15 | <matthew-_> | /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/librt.a(timer_create.o): In function `timer_create': |
| 23:18:18 | <matthew-_> | that kinda thing |
| 23:18:34 | <Igloo> | Does -lpthread fix it? |
| 23:19:52 | <dons> | that looks like a bsd-related unix pthreads failure? :) |
| 23:20:18 | <matthew-_> | debian linux |
| 23:20:24 | <lambdabot> | no you didn't! |
| 23:21:06 | <matthew-_> | Dynamic linker error message was: |
| 23:21:06 | <matthew-_> | /usr/lib/libpthread.so: invalid ELF header |
| 23:21:12 | <matthew-_> | (with -lpthread) |
| 23:21:25 | <matthew-_> | but that shot out as soon as ghc hit the bit of code using TH |
| 23:21:51 | <matthew-_> | Loading package base ... linking ... done. |
| 23:21:51 | <matthew-_> | Loading object (dynamic) pthread ... failed. |
| 23:21:54 | <matthew-_> | is how it went |
| 23:22:06 | <matthew-_> | (sorry for the Îflood) |
| 23:22:13 | <matthew-_> | õflood, rather |
| 23:22:18 | <matthew-_> | oh sod that... |
| 23:22:37 | <EvilTerran> | Iflood? oflood? |
| 23:22:55 | <frobar> | iFlood.. must be some apple thing |
| 23:23:05 | <matthew-_> | τflood |
| 23:23:10 | <Saizan> | a bathtub? |
| 23:23:11 | <matthew-_> | no, it was meant to be mu |
| 23:23:16 | <matthew-_> | I'll be quite now... |
| 23:23:28 | <Saizan> | quiet? :D |
| 23:24:12 | <jfredett> | in fst $ (f *** g) i want to make g evaluate, even though I don't want to look at it. (for instance, say I want to have gen_graph = fst $ ("Printed Graph Output" *** generate_graph) graphdata |
| 23:24:28 | <jfredett> | generate_graph won't get evaluated as is, so I want to make that application strict |
| 23:24:33 | <jfredett> | but I'm not sure how. |
| 23:24:52 | <EvilTerran> | ...why do you want to evaluate it? |
| 23:25:02 | <jfredett> | it evaluates to IO (), with side effects |
| 23:25:17 | <jfredett> | it generates a graphViz image |
| 23:25:17 | <jfredett> | :) |
| 23:25:42 | <jfredett> | I've been experimenting with interesting show functions, :) |
| 23:25:59 | <EvilTerran> | what type is f? |
| 23:26:27 | <jfredett> | f is a -> String, g is a -> IO (), basicly |
| 23:27:07 | <matthew-_> | no, even capturing the ld command and adding -lpthread to it directly doesn't help |
| 23:27:21 | <dcoutts> | the order can be important |
| 23:27:27 | <matthew-_> | I'm still left with /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/librt.a(timer_routines.o): In function `__start_helper_thread': (.text+0xd4): undefined reference to `pthread_atfork' |
| 23:27:42 | <matthew-_> | yeah, it makes no difference if I add it after the -static |
| 23:27:56 | <jfredett> | EvilTerran: basicly, I'm trying to make the Show function do double duty, by printing out a text version of the graph, for immediate viewing, and a graphviz version, for use later |
| 23:27:56 | <dcoutts> | matthew-_: so try putting it at the beginning and at the end of the list of ld -l flags |
| 23:27:58 | <matthew-_> | and if I add it before, it reduces the number of errors, but doesn't eliminate them |
| 23:28:04 | <trontonic> | Are there any good programs with gui that are written in Haskell? |
| 23:28:10 | <dcoutts> | matthew-_: it's the order relative to other -l flags that's important |
| 23:28:18 | <jfredett> | i think that I should just need to use strict apply, but I was wondering if there was a better way |
| 23:28:31 | <jfredett> | $! or some such, as I recall |
| 23:29:11 | <matthew-_> | dcoutts: woot! |
| 23:29:44 | <matthew-_> | the only problem is that the resulting file doesn't exist |
| 23:30:20 | <matthew-_> | file says it's dynamically linked, but running ldd on it says file not found! |
| 23:30:25 | <EvilTerran> | jfredett, does "fst $ (f *** g)" have an IO type overall? |
| 23:30:39 | <idnar> | :t fst $ (?f *** ?g) |
| 23:30:41 | <lambdabot> | No instance for (Arrow (,)) |
| 23:30:41 | <jfredett> | no, it would have a String type, |
| 23:30:41 | <lambdabot> | arising from use of `***' at <interactive>:1:7-15 |
| 23:30:41 | <lambdabot> | Possible fix: add an instance declaration for (Arrow (,)) |
| 23:30:53 | <matthew-_> | I do have this warning though, left from ld: (.text+0xe4): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking |
| 23:31:00 | <Saizan> | jfredett: so you want unsafePerformIO? |
| 23:31:11 | <EvilTerran> | Saizan, that i doubt |
| 23:31:16 | <jfredett> | Saizan: do I? I'm not sure. |
| 23:31:21 | <EvilTerran> | jfredett, this is somewhat an abuse of Show |
| 23:31:27 | <dcoutts> | matthew-_: the .so file is not on the dynamic lib search path |
| 23:31:28 | <jfredett> | EvilTerran: thats the point |
| 23:31:29 | <jfredett> | :) |
| 23:31:42 | <EvilTerran> | you're not allowed side-effects in code with no IO type... |
| 23:32:09 | <jfredett> | thats the rule, yes, but I want to see if I can get around it, :) |
| 23:32:40 | <Saizan> | well, to get around it you've to give up proper sequencing of effects via unsafePerformIO |
| 23:32:55 | <jfredett> | ok |
| 23:33:18 | <Saizan> | but why desing your app like that? |
| 23:33:24 | <jfredett> | Saizan: because I can |
| 23:33:27 | <jfredett> | its just a hack |
| 23:33:28 | <jfredett> | :) |
| 23:33:41 | <Saizan> | heretic! |
| 23:33:48 | <jfredett> | Saizan: I prefer visionary |
| 23:33:49 | <jfredett> | :) |
| 23:33:57 | <Saizan> | you'll get in trouble. |
| 23:34:07 | <jfredett> | with whom? the haskell pope? |
| 23:34:12 | <matthew-_> | dcoutts: ok, maybe I'm going about this the wrong way. All I want is to generate a binary that does not depend on libgmp as on the target machine, that's not installed. |
| 23:34:15 | <EvilTerran> | jfredett, just use IO! |
| 23:34:27 | <jfredett> | is SPJ going to come in his SPJ-mobile and smack me with his Haskell-pope hat? |
| 23:34:31 | <matthew-_> | dcoutts: is there a way of telling ld to just statically link against certain libraries? |
| 23:34:38 | <EvilTerran> | jfredett, yes |
| 23:34:42 | <jfredett> | because that would be seriously cool |
| 23:34:53 | <Saizan> | jfredett: no, with "oh, why it didn't print it? why it did print it NOW? etc.." |
| 23:34:58 | <dcoutts> | matthew-_: there probably is, but I'm not sure how, check the ld man page and/or google |
| 23:35:03 | <EvilTerran> | actually, he's going to drive up in his IO-mobile, pull you in, and give you a beating that way |
| 23:35:21 | <EvilTerran> | and then you'll be stuck there forever, 'cos you can't escape IO |
| 23:35:29 | <jfredett> | Saizan: it does print it, it just does other stuff first, I think I can dodge the IO bit w/ arrows |
| 23:35:30 | <ddarius> | By "you'll get in trouble" Saizan meant "you'll regret it" |
| 23:35:30 | <jfredett> | :) |
| 23:35:45 | <byorgey> | @smack jfredett with a Haskell-pope hat |
| 23:35:45 | <lambdabot> | Unknown command, try @list |
| 23:35:50 | <jfredett> | ddarius: why would I regret it, if it works, its a cool hack |
| 23:35:55 | <byorgey> | @slap jfredett with a Haskell-pope hat |
| 23:35:56 | <lambdabot> | ACTION hits jfredett with a Haskell-pope hat with an assortment of kitchen utensils |
| 23:35:59 | <jfredett> | if it doesn't, it was a cool Idea |
| 23:36:12 | <byorgey> | wow, nice hat! =D |
| 23:36:15 | <jfredett> | lol |
| 23:37:48 | <matthew-_> | agh, ps isn't reporting the whole command line... |
| 23:39:01 | <kmcallister> | ps axww |
| 23:40:30 | <matthew-_> | agh, who decided a 4kB limit on command line length was a good idea?! |
| 23:41:30 | <EvilTerran> | ... |
| 23:41:36 | <matthew-_> | hee hee hee -pgml echo |
| 23:42:14 | <matthew-_> | kmcallister: no, I don't think the kernel stores more than 4kb - certainly ps axww doesn't give more than 4kB of cammand line for me |
| 23:42:26 | <kmcallister> | ah |
| 23:42:44 | <vincenz> | 4kb commandline ?!? |
| 23:43:15 | <kmcallister> | yeah, i run into this issue when manipulating large dirs of video frames, with xargs or similar |
| 23:44:00 | <vincenz> | o.O |
| 23:44:40 | <byorgey> | ACTION boggles |
| 23:44:47 | <koala_man> | my max command line length is 128kb |
| 23:45:09 | <dcoutts> | matthew-_: different kernels have different limits, some are configurable. eg most linuxes allow 128k and Windows allows 32k |
| 23:45:12 | <matthew-_> | yeah, the average ghc call to ld |
| 23:45:12 | <MarcWeber> | On the cabal-devel mailinglist there is a therad about a -framework flag when linking.. I've never seen it. Do you know where I can look it up ? Does it belong to ld or gcc ? |
| 23:45:27 | <dcoutts> | MarcWeber: gcc (possible ld too) |
| 23:45:33 | <dcoutts> | MarcWeber: but only on OS X |
| 23:45:33 | <matthew-_> | it's in ld and it's for macs |
| 23:46:04 | <matthew-_> | dcoutts: ahh, interesting. is it a syslimit? |
| 23:46:17 | <matthew-_> | (in linux) |
| 23:46:48 | <dcoutts> | matthew-_: dunno actually, I know there was recently a patch to lift the limit and (shock horror) dynamically allocate |
| 23:47:13 | <matthew-_> | gosh, that can't have gone down well. Think of the performance... |
| 23:48:18 | <shachaf> | xmonad passes state on the command line on restart. |
| 23:48:34 | <shachaf> | That's always made me slightly nervous, though it seems to work so far. |
| 23:49:21 | <Saizan> | it's not so critical :) |
| 23:49:22 | <dcoutts> | I guess if it's ever a problem it can pipe it over |
| 23:49:44 | <MarcWeber> | dcoutts: Ah . Thanks. Don't have OSX. That's why I haven't found it. |
| 23:49:54 | <dcoutts> | MarcWeber: aye :-) |
| 23:50:25 | <dcoutts> | MarcWeber: linux tends seems to have standardised on pkg-config for a similar purpose |
Back to channel and daily index: content-negotiated html turtle