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:08 | <Pseudonym> | wli: And hbc was written in...? |
| 00:00:18 | <SamB_XP> | well, I probably would write a stupid one if Language.C existed |
| 00:00:39 | <n00b> | so what was the first compiler ??? |
| 00:00:42 | <Pseudonym> | ?foldoc Miracula |
| 00:00:44 | <lambdabot> | *** "miracula" foldoc "The Free On-line Dictionary of Computing (27 SEP 03)" |
| 00:00:44 | <lambdabot> | Miracula |
| 00:00:44 | <lambdabot> | |
| 00:00:44 | <lambdabot> | An implementation of a subset of {Miranda} by Stefan Kahrs |
| 00:00:44 | <lambdabot> | <smk@ed.ac.uk>, LFCS, no modules or files. Can be |
| 00:00:46 | <lambdabot> | [3 @more lines] |
| 00:00:46 | <n00b> | written in??? |
| 00:00:48 | <Pseudonym> | n00b: FLOW_MATIC |
| 00:00:53 | <Pseudonym> | And it was written in assembler. |
| 00:01:06 | <Pseudonym> | FLOW-MATIC, with a hyphen. |
| 00:01:11 | <Olathe> | Assembler is written in letters. |
| 00:01:14 | <omnId> | And assemblers were written by twiddling machine addresses. |
| 00:01:19 | <Olathe> | So is Haskell. |
| 00:01:30 | <Pseudonym> | Although interpreters are very old. |
| 00:01:40 | <Pseudonym> | CSIRAC had a high-level language interpreter in 1950. |
| 00:01:40 | <omnId> | And the green grass grows all around all around. |
| 00:02:02 | <Pseudonym> | I got that first-hand from someone who worked on it. |
| 00:02:17 | <n00b> | so are new features implemented in the old compiler if they have never been implemented before ??/ |
| 00:02:22 | <wli> | wikipedia documents the language as INTERPROGRAM |
| 00:02:42 | <Pseudonym> | n00b: New features are bootstrapped from old features. |
| 00:02:54 | <mauke> | @go "trusting trust" |
| 00:02:55 | <n00b> | ok |
| 00:02:57 | <Pseudonym> | You don't need type families to write a Haskell compiler. |
| 00:02:58 | <lambdabot> | http://www.acm.org/classics/oct95/ |
| 00:02:58 | <lambdabot> | Title: TOC |
| 00:03:06 | <Pseudonym> | ?foldoc Orwell |
| 00:03:07 | <lambdabot> | *** "orwell" foldoc "The Free On-line Dictionary of Computing (27 SEP 03)" |
| 00:03:07 | <lambdabot> | Orwell |
| 00:03:07 | <lambdabot> | |
| 00:03:07 | <lambdabot> | Lazy functional language, Miranda-like. List comprehensions |
| 00:03:07 | <lambdabot> | and pattern matching. "Introduction to Orwell 5.00", |
| 00:03:09 | <lambdabot> | P.L. Wadler et al, Programming Research Group, Oxford U, 1988. |
| 00:03:10 | <wli> | And describes it as a sort of precursor of BASIC or otherwise similar to early forms of BASIC. |
| 00:03:11 | <lambdabot> | |
| 00:03:16 | <n00b> | weird but i understand |
| 00:03:33 | <Olathe> | O-o |
| 00:03:49 | <mauke> | http://cm.bell-labs.com/who/ken/trust.html |
| 00:03:51 | <n00b> | i see it is like writing functions in haskell then implementing in Prelude |
| 00:03:52 | <lambdabot> | Title: ACM Classic: Reflections on Trusting Trust |
| 00:03:53 | <Olathe> | @foldoc foldoc |
| 00:03:53 | <lambdabot> | Error: connect: does not exist (No route to host) |
| 00:03:56 | <n00b> | right ??? |
| 00:04:36 | <Pseudonym> | OK, I tell a lie. INTERPROGRAM comes from 1960. |
| 00:04:41 | <Pseudonym> | http://www.csse.unimelb.edu.au/dept/about/csirac/emulator.html <- Emulator |
| 00:04:49 | <Olathe> | # Liar ! # |
| 00:05:39 | <EvilTerran> | @yow |
| 00:05:40 | <lambdabot> | I've got an IDEA!! Why don't I STARE at you so HARD, you forget your |
| 00:05:40 | <lambdabot> | SOCIAL SECURITY NUMBER!! |
| 00:06:09 | <wli> | Fortran (1954) is usually described as the first full-fledged programming language in various senses. |
| 00:07:08 | <wli> | Grace Hopper's A-1 (1951), for example, was more akin to what people would call a macroassembler, and much the same held for other early languages predating Fortran AIUI. |
| 00:07:18 | <mauke> | Plankalkül ftw |
| 00:07:35 | <n00b> | so how was the first programming language implemented / written |
| 00:08:07 | <lament> | on paper |
| 00:08:13 | <n00b> | you know what, let's just drop this subject |
| 00:08:30 | <n00b> | but how was it implemented on the computer |
| 00:08:31 | <puusorsa> | punchcards for teh win! |
| 00:08:31 | <EvilTerran> | in ada lovelace's head! |
| 00:08:31 | <wli> | Plankalkul never went anywhere, though. |
| 00:08:49 | <puusorsa> | n00b, punching holes in paper cards probably |
| 00:08:51 | <Pseudonym> | n00b: Programmers used to enter programs via switches. |
| 00:08:57 | <wli> | http://en.wikipedia.org/wiki/Timeline_of_programming_languages |
| 00:08:58 | <lambdabot> | Title: Timeline of programming languages - Wikipedia, the free encyclopedia |
| 00:08:58 | <Pseudonym> | Writing directly to memory. |
| 00:09:05 | <Pseudonym> | Before that, it was plugboards. |
| 00:09:06 | <Olathe> | Rewiring circuits is better. |
| 00:09:12 | <Philippa> | right, the lowest level languages are just wired into the hardware |
| 00:09:17 | <Olathe> | Plugboards is for wimpy men ! |
| 00:09:38 | <n00b> | i se4e |
| 00:09:43 | <Olathe> | Real mean assemble special-purpose computers from spare parts ! |
| 00:09:49 | <Philippa> | yeah yeah yeah, when I were a lass every time we found a bug we had to rebuild the whole damn stone circle and wait another millennium! |
| 00:09:52 | <n00b> | thanks for the history lesson |
| 00:10:03 | <augustss> | n00b: hand translated to machine code, then entered with switches/buttons |
| 00:10:08 | <EvilTerran> | hehe |
| 00:10:10 | <lament> | Philippa: and execute the QA! |
| 00:10:12 | <scook0__> | Olathe: reusing existing else's spare parts? weak! ;) |
| 00:10:17 | <Olathe> | Heheh |
| 00:10:23 | <n00b> | you guys are better than any book |
| 00:10:24 | <EvilTerran> | @quote Philippa yeah yeah yeah, when I were a lass every time we found a bug we had to rebuild the whole damn stone circle and wait another millennium! |
| 00:10:25 | <lambdabot> | No quotes match. |
| 00:10:28 | <augustss> | n00b: that's what I did when I built my first computer |
| 00:10:31 | <EvilTerran> | @remember Philippa yeah yeah yeah, when I were a lass every time we found a bug we had to rebuild the whole damn stone circle and wait another millennium! |
| 00:10:31 | <lambdabot> | It is stored. |
| 00:10:34 | <wli> | The story appears to be complex. |
| 00:10:47 | <puusorsa> | oh damn |
| 00:10:50 | <LoganCapaldo> | it is stored? |
| 00:10:53 | <puusorsa> | i really think i'm in love |
| 00:10:55 | <LoganCapaldo> | nicee |
| 00:11:01 | <EvilTerran> | wli, i likewise get the impression that it's partly imaginary... ;) |
| 00:11:21 | <n00b> | @quite augustss that must have been difficult |
| 00:11:21 | <lambdabot> | Maybe you meant: quit quote |
| 00:11:28 | <n00b> | @quote augustss that must have been difficult |
| 00:11:28 | <lambdabot> | No quotes match. It can only be attributed to human error. |
| 00:11:43 | <Olathe> | @. vixen quit |
| 00:11:43 | <lambdabot> | Plugin `compose' failed with: Privledged commands cannot be composed |
| 00:11:45 | <augustss> | n00b: redious |
| 00:11:56 | <augustss> | noob: tedious, even |
| 00:12:18 | <n00b> | you can write a GUI in asm |
| 00:12:21 | <n00b> | ?? |
| 00:12:25 | <Pseudonym> | People have. |
| 00:12:25 | <augustss> | It got easier after I had a monitor and assembler burnt into EEPROM |
| 00:12:29 | <Pseudonym> | GEOS |
| 00:12:33 | <EvilTerran> | compilers do |
| 00:12:41 | <augustss> | Who wants a GUI? |
| 00:12:48 | <n00b> | ok\ |
| 00:12:49 | <lament> | i do! |
| 00:12:52 | <wli> | Not really. There's a lot of reality here. The "concept" bits mean "failed attempt" or "attempt begun" depending on whether "implementation" appears later. |
| 00:12:56 | <Philippa> | they're nice for arranging where all the text goes |
| 00:12:58 | <Pseudonym> | http://en.wikipedia.org/wiki/GEOS_(8-bit_operating_system) |
| 00:13:05 | <n00b> | blank screen was your friend |
| 00:13:51 | <n00b> | is there a emacs version that runs in terminal mode |
| 00:14:01 | <lament> | it's called... "emacs"? |
| 00:14:16 | <n00b> | I have a computer but i want to try using it without gui |
| 00:14:19 | <puusorsa> | n00b, are you serious or just trolling |
| 00:14:21 | <puusorsa> | emacs -nw |
| 00:14:33 | <puusorsa> | try man emacs |
| 00:14:42 | <lament> | also, GUI is nice because otherwise it's hard to show pictures/movies |
| 00:14:56 | <qwr> | n00b: or screen + vim |
| 00:14:58 | <augustss> | pictures? movies? |
| 00:14:59 | <glguy> | and its good that you have a computer or emacs use would be hard |
| 00:15:01 | <lament> | youtube, for example, would not work well without GUI |
| 00:15:20 | <augustss> | computers are for programming, not playing with ;) |
| 00:15:23 | <n00b> | i want to take away the GUI so i can concentrate more on my school work |
| 00:15:23 | <fons> | n00b, just type "emacs -nw" in a terminal |
| 00:15:34 | <puusorsa> | like i said.. |
| 00:15:35 | <lament> | just don't run X |
| 00:15:37 | <n00b> | i don't like vim |
| 00:15:46 | <lament> | then the command is just "emacs" |
| 00:16:01 | <n00b> | the only command i know for vim is :qa! |
| 00:16:12 | <lament> | oh no |
| 00:16:17 | <LoganCapaldo> | programming is definitely playing |
| 00:16:18 | <lament> | turns out vim was glguy's favourite editor! |
| 00:16:20 | <Philippa> | augustss: false dichotomy |
| 00:16:40 | <augustss> | LoganCapaldo, Philippa: I know :) |
| 00:16:44 | <SamB_XP> | augustss: please explain to me the difference between the too |
| 00:16:45 | <SamB_XP> | er. |
| 00:16:45 | <fons> | oh C'mon |
| 00:16:46 | <SamB_XP> | tow |
| 00:16:48 | <SamB_XP> | two |
| 00:16:50 | <SamB_XP> | to |
| 00:16:57 | <Philippa> | SamB_XP: one is a subset of the other |
| 00:17:08 | <SamB_XP> | I think that's incorrecxt |
| 00:17:21 | <augustss> | extended subset |
| 00:17:26 | <SamB_XP> | wli: what do you think? |
| 00:23:24 | <glguy> | :oS |
| 00:23:38 | <glguy> | I guess the ban stays |
| 00:23:59 | <joed> | That many pm |
| 00:24:28 | <EvilTerran> | ... i'm confused. why the ban? |
| 00:24:50 | <puusorsa> | "ignorance can be cured, stupidity is for life" ? |
| 00:25:01 | <glguy> | I read the /lastlog n00b |
| 00:25:10 | <lament> | i'm even more confused, why the unban followed by the ban? |
| 00:25:19 | <glguy> | I usually /kn |
| 00:25:31 | <glguy> | which sets a temp ban with the idea that the person moves on |
| 00:25:37 | <glguy> | so the list don't just fill up |
| 00:25:59 | <EvilTerran> | ACTION also reads said /lastlog |
| 00:26:06 | <EvilTerran> | ... yeah. i can see where you're coming from. |
| 00:26:53 | <lament> | is it because of the multiple question marks??? |
| 00:27:07 | <glguy> | even if he wasn't just trying to be a pest he isn't going to be up to programming competence for another decade |
| 00:27:07 | <n00b> | why did i get kick out |
| 00:27:17 | <TSC> | There's your answer! |
| 00:27:28 | <sorear> | EvilTerran: #haskell is different because we ban annoying people in addition to malicious ones |
| 00:27:51 | <LoganCapaldo> | the iron fist in the velvet glove |
| 00:27:55 | <lament> | sorear: that's not what i heard shapr say. |
| 00:28:05 | <sorear> | makes the place a LOT nicer than most other channels, if you're one of the people who stays |
| 00:28:10 | <glguy> | ?users |
| 00:28:11 | <lambdabot> | Maximum users seen in #haskell: 420, currently: 389 (92.6%), active: 21 (5.4%) |
| 00:28:15 | <glguy> | of which there are many |
| 00:28:20 | <Philippa> | lament: it's a valid approximation |
| 00:28:23 | <EvilTerran> | lambdabot, what did shapr say? |
| 00:28:45 | <LoganCapaldo> | lambdabot's AI isn't _that_ strong |
| 00:28:45 | <lambdabot> | No idea, sorry. |
| 00:29:13 | <Philippa> | n00b: evading bans is a bad idea, and in some countries arguably constitutes a criminal offence. Go away. |
| 00:29:36 | <Pseudonym> | If the ban comes off by itself, it's probably not criminal. |
| 00:29:40 | <Pseudonym> | Just sayin'. |
| 00:29:57 | <mauke> | glguy: +b *!i=41b708c2@gateway/web/cgi-irc/* |
| 00:30:04 | <lament> | EvilTerran: i suppose he did say something like that, except that you'd have to be really annoying |
| 00:30:04 | <glguy> | kk |
| 00:30:04 | <Pseudonym> | Right, I see. |
| 00:30:29 | <mauke> | cool |
| 00:30:37 | <mauke> | hmm, let's see ... |
| 00:30:48 | <mauke> | glguy: +o mauke |
| 00:31:16 | <mauke> | you're doing it wrong! |
| 00:31:26 | <glguy> | oh, I must have remapped the keyboard wrong :-/ |
| 00:31:37 | <mauke> | this exploit sucks. I want my money back. |
| 00:32:39 | <glguy> | sorear: I don't know if your statement for for or against me removing him, but I don't think he constitutes a positive addition to the channel |
| 00:32:46 | <Pseudonym> | Did anyone give n00b a warning before banning, BTW? |
| 00:32:48 | <glguy> | s/for for/was for |
| 00:32:55 | <Pseudonym> | Just asking. |
| 00:33:52 | <sorear> | glguy: I was trying to defend you. |
| 00:33:55 | <glguy> | ah, ok |
| 00:34:31 | <glguy> | anyway, if someone else wants to remove the ban they can, I don't feel that strongly about it. I just didn't think he was fitting in so well, so to speak.. |
| 00:35:00 | <Pseudonym> | Sure, I'm not saying it was a bad decision. |
| 00:35:00 | <Olathe> | I ignored him a few days ago. |
| 00:35:14 | <Pseudonym> | It's just that whenever a decision like this is made, it's good to sit down and think about future implications. |
| 00:35:14 | <lament> | I'll at least ask shapr what he thinks, if nobody gets there first |
| 00:35:32 | <glguy> | dons is the one to ask |
| 00:35:38 | <glguy> | I think that shapr handed the channel along |
| 00:35:42 | <Pseudonym> | shapr vs dons deathmatch! |
| 00:35:45 | <lament> | possibly, but shapr seems nicer :) |
| 00:35:53 | <Pseudonym> | dons doesn't bite, AFAIK |
| 00:35:54 | <puusorsa> | then ask dons |
| 00:36:53 | <ac> | glguy: what does your 'gl' stand for? |
| 00:37:04 | <glguy> | originally "gamma lambda" |
| 00:37:13 | <Philippa> | it's probably a good rule to warn before banning unless you've got very good grounds for immediately removing someone from a chan |
| 00:37:19 | <Pseudonym> | Yeah. |
| 00:37:29 | <Pseudonym> | A spammer, for example. |
| 00:37:48 | <Pseudonym> | Anyway, something to think about. |
| 00:37:50 | <Philippa> | assuming the spam wasn't reasonably on-topic, in which case a warning's appropriate |
| 00:38:00 | <glguy> | I know at least one of you has +o, feel free to talk it over with n00b and see if he wants to behave and then unban if he does |
| 00:38:16 | <Philippa> | I mean... Jon Harrop doesn't quite warrant kickbanning on sight |
| 00:38:17 | <Pseudonym> | ACTION isn't going to bother, but thanks for the offer :-) |
| 00:38:28 | <glguy> | qwe1234 does |
| 00:38:28 | <Pseudonym> | Yeah, or keal. |
| 00:38:33 | <Pseudonym> | keal was amusing |
| 00:38:39 | <EvilTerran> | @keal |
| 00:38:39 | <lambdabot> | when i put what i dat recoved from that tile into a ti92. the damn thing blew up |
| 00:38:50 | <Philippa> | has qwe1234 shown up here before? |
| 00:38:58 | <Pseudonym> | Oh yes. |
| 00:38:59 | <glguy> | only people pretending to be him |
| 00:39:02 | <Pseudonym> | Oh, right. |
| 00:39:09 | <Pseudonym> | ACTION thought it was him |
| 00:39:10 | <lament> | @qwe1234 |
| 00:39:11 | <lambdabot> | Unknown command, try @list |
| 00:39:11 | <glguy> | which is grounds enough, imho |
| 00:39:31 | <glguy> | I want a record of my kicking him in the logs, I don't care who it actually is |
| 00:39:42 | <lament> | oh, heh, i just realized qwe1234 is really easy to type on a qwerty keyboard |
| 00:39:44 | <EvilTerran> | who is qwe1234? |
| 00:39:48 | <Philippa> | I'd probably be inclined to leave that ban nick-specific, mind |
| 00:39:52 | <glguy> | a reddit troll |
| 00:39:58 | <EvilTerran> | ah |
| 00:39:58 | <glguy> | Philippa: sure |
| 00:41:01 | <glguy> | Philippa: oh, I wasn't proposing a ban :) |
| 00:41:03 | <glguy> | Philippa: just a kick |
| 00:41:18 | <qwe1234> | Just checking. |
| 00:41:25 | <glguy> | I'm not that fast |
| 00:41:34 | <Philippa> | should've scripted it, then |
| 00:41:35 | <Pseudonym> | ha! |
| 00:41:38 | <glguy> | yeah :( |
| 00:41:38 | <Pseudonym> | Yeah. |
| 00:41:52 | <glguy> | damn, that's the 3rd time its been pulled out from under me |
| 00:42:04 | <lament> | we could play "whack-a-mole", with different people changing their nick to qwe1234 and back and glguy trying to ban them. |
| 00:42:15 | <Pseudonym> | He'd just write a script, then. |
| 00:42:22 | <lament> | Objective: to get 388 points. |
| 00:42:31 | <Pseudonym> | lambdabot could record the scores. |
| 00:42:35 | <mauke> | @karma qwe1234 |
| 00:42:35 | <lambdabot> | qwe1234 has a karma of 0 |
| 00:42:40 | <Pseudonym> | Surely it would be whack-a-troll. |
| 00:42:46 | <ivanm> | @doc Data.Complex |
| 00:42:46 | <lambdabot> | http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Complex.html |
| 00:44:18 | <EvilTerran> | wow, something on-topic. how rare. |
| 00:44:23 | <ivanm> | lol |
| 00:44:25 | <glguy> | yw |
| 00:44:32 | <Pseudonym> | Oh, maths question. |
| 00:44:32 | <ivanm> | I'm sorry, I'll say something irrelevant |
| 00:44:40 | <Pseudonym> | Does anyone know why it's called "evaluation at infinity"? |
| 00:44:44 | <Pseudonym> | That's poetic licence, right? |
| 00:44:58 | <EvilTerran> | > (sort "irrelevant", sort "evilterran") |
| 00:45:00 | <lambdabot> | ("aeeilnrrtv","aeeilnrrtv") |
| 00:45:10 | <ivanm> | lol |
| 00:45:20 | <ivanm> | so EvilTerran == irrelevant? :p |
| 00:45:24 | <Pseudonym> | pi_inf(p) == p(infnity) / infinity^deg(p) |
| 00:45:27 | <Pseudonym> | More or less. |
| 00:46:02 | <monochrom> | Yay! Haskell Quaterly News! |
| 00:46:16 | <EvilTerran> | ivanm, indeed; i used Irrelevant as a nickname before i used EvilTerran as such, but Irrelevant was taken on freenode |
| 00:46:21 | <lament> | Pseudonym: it evaluates at infinity |
| 00:46:27 | <ivanm> | EvilTerran: ahhh |
| 00:46:37 | <ivanm> | monochrom: sure you mean the Haskell _Weekly_ News! |
| 00:46:48 | <Pseudonym> | lament: ? |
| 00:46:48 | <idnar> | hahaha |
| 00:46:55 | <ivanm> | despite the fact that dons seems to use a different definition of "week" from the rest of us? |
| 00:47:14 | <monochrom> | Yeah, his week is our quarter. :) |
| 00:47:22 | <Runaro_BRS> | "Fortnightly news" |
| 00:47:27 | <LoganCapaldo> | a week is about a quarter |
| 00:47:30 | <ivanm> | "Random interval" news |
| 00:47:33 | <idnar> | a quarter of what? |
| 00:47:36 | <LoganCapaldo> | (of a month) |
| 00:47:37 | <ivanm> | a month |
| 00:47:40 | <Olathe> | The Haskell Periodic News |
| 00:47:43 | <SamB_XP> | an apple |
| 00:47:51 | <ivanm> | Olathe: with a varying period! |
| 00:47:53 | <monochrom> | "Dons sees a quarter as a week, a week as a random number of weeks." |
| 00:48:00 | <lament> | Pseudonym: Do you mean the evaluation at infinity of a polynomial? |
| 00:48:05 | <Pseudonym> | Yes. |
| 00:48:09 | <ivanm> | monochrom: a week as a random number of weeks? :s |
| 00:48:11 | <Olathe> | The Haskell Intermittent News ? |
| 00:48:12 | <TomMD> | That lazyness is just rubbing off on him. |
| 00:48:20 | <ivanm> | so x = a * xs ? |
| 00:48:26 | <Pseudonym> | It's obviously not just p(infinity) |
| 00:48:29 | <glguy> | dons manages to keep pretty busy |
| 00:48:40 | <ivanm> | glguy: sure, make up excuses for him! |
| 00:48:42 | <Pseudonym> | But it's kind of p(infinity) / infinity^degree(p) |
| 00:48:52 | <TomMD> | glguy: Oh, I'm sure. Just have to throw the word 'lazy' in once a day. |
| 00:48:53 | <Runaro_BRS> | The Haskell non-time-indexed news. |
| 00:49:06 | <ivanm> | the Haskell "Whenever dons feels like it" news |
| 00:49:16 | <lament> | Pseudonym: hm what the hell is that |
| 00:49:33 | <EvilTerran> | dons has to unsafeInterleaveIO it with the rest of his work, so it tends to happen at unexpected times |
| 00:49:38 | <SamB_XP> | the haskell semi-whenever news |
| 00:49:41 | <EvilTerran> | (and usually later than you intended ;] ) |
| 00:49:41 | <monochrom> | Dons probably spends his clock and runs a garbage collector once in a while. :) |
| 00:49:52 | <monochrom> | s/spends/suspends/ |
| 00:49:56 | <Pseudonym> | lament: The evaluation at infinity of a polynomial is essentially the leading coefficient, IIRC. |
| 00:49:58 | <TomMD> | Where did unsafeInterleaveIO go though? It moved with the new bytestring library! |
| 00:50:11 | <SamB_XP> | TomMD: nonsense |
| 00:50:19 | <SamB_XP> | @hoogle unsafeInterleaveIO |
| 00:50:20 | <lambdabot> | System.IO.Unsafe.unsafeInterleaveIO :: IO a -> IO a |
| 00:50:44 | <TomMD> | Was it always there and I am just losing my mind? |
| 00:50:56 | <lament> | Pseudonym: so it's 1 for both x and x^2? I've never heard of this thing |
| 00:50:57 | <SamB_XP> | well, it may or may not have undergone movement |
| 00:51:03 | <TomMD> | What was the 'unsafe' that they made for ByteString? |
| 00:51:38 | <SamB_XP> | TomMD: perhaps you are thinking of the blackhole/greyhole versions? |
| 00:51:54 | <SamB_XP> | or whatever I mean |
| 00:52:04 | <SamB_XP> | the non-dupable ones, anyway |
| 00:52:16 | <Pseudonym> | lament: Yes, I believe. |
| 00:52:47 | <ivanm> | without causing offence, I'd like to get back on topic for a bit here :p |
| 00:52:48 | <Pseudonym> | Obviously p(infinity) is going to be either infinity or -infinity for any real polynomial. |
| 00:52:49 | <ivanm> | is that OK? |
| 00:52:52 | <TomMD> | SamB_XP: I am thinking of 'inlinePerformIO' which is poorly named / unsafe. |
| 00:53:01 | <Pseudonym> | ivanm: That's cool. :-) |
| 00:53:07 | <ivanm> | *phew* |
| 00:53:14 | <Pseudonym> | ACTION is actually asking this question because of a Haskell problem. |
| 00:53:19 | <Pseudonym> | So it's kind of on-topic. |
| 00:53:25 | <ivanm> | I meant the news discussion |
| 00:53:27 | <ivanm> | ;-) |
| 00:53:49 | <TomMD> | actually, if compiler /= ghc then inlinePerformIO = unsafePerformIO |
| 00:53:53 | <lament> | Pseudonym: is it related to the residue? |
| 00:54:04 | <lament> | Pseudonym: that's what it looks like |
| 00:54:54 | <ivanm> | OK, so I've representing a 2D area using a 2D array... and I want a function that - relative to (0,0) - lists all the indices around element in compass order, starting with (-1,1) for the NW corner |
| 00:54:56 | <Pseudonym> | Yeah, and it's also related to the order function. |
| 00:55:00 | <SamB_XP> | wow this code is scary: http://www.haskell.org/pipermail/haskell-cafe/2007-March/023592.html |
| 00:55:01 | <lambdabot> | Title: [Haskell-cafe] Does inlinePerformIO = unsafePerformIO . unsafeInterleaveIO seman ..., http://tinyurl.com/2nug2x |
| 00:55:12 | <Pseudonym> | It's also defined on rational polynomials which don't have a pole at infinity |
| 00:55:17 | <ivanm> | atm, I've hardcoded in "[(-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)]", but I'd like to have a generating function if possible |
| 00:55:20 | <ivanm> | any ideas? |
| 00:55:30 | <lament> | Pseudonym: surely it's not called "evaluation", though? |
| 00:55:57 | <Pseudonym> | It's called the "value at infinity" or "evaluation at infinity". |
| 00:56:47 | <Pseudonym> | > [ (dx,dy) | dx <- [-1..1], dy <- [-1..1], dx /= 0 || dy /= 0 ] |
| 00:56:55 | <lambdabot> | [(-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] |
| 00:57:11 | <Pseudonym> | It's not necessarily that much shorter, though. |
| 00:57:13 | <lament> | Pseudonym: seems very odd, why treat infinity as special |
| 00:57:15 | <EvilTerran> | (dx,dy) /= (0,0), if you prefer |
| 00:57:33 | <lament> | i don't think it's general-purpose terminology |
| 00:57:49 | <Pseudonym> | lament: It's not p(infinity). |
| 00:58:00 | <Pseudonym> | It has a notation more pile \pi_{\infinity}(p) |
| 00:58:03 | <Pseudonym> | more like |
| 00:58:33 | <ivanm> | Pseudonym: whoops, that's not what I wanted... that's when I sorted it :s |
| 00:58:38 | <lament> | and the pi is called "evaluation"? |
| 00:58:56 | <ivanm> | "[(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1),(-1,0)]" <-- this is what it should be |
| 00:59:05 | <Pseudonym> | Here's the definition from the book I'm reading: |
| 00:59:29 | <ivanm> | however, the only way I can think of generating these values in that order is by using trig, which involves rounding, etc. to get the Ints |
| 00:59:44 | <Pseudonym> | We define the "value at \infinity" to be the map \pi_{\infinity} : O_\infinity -> F given by: |
| 00:59:45 | <Pseudonym> | etc etc |
| 01:00:23 | <lament> | what's the book on? |
| 01:00:44 | <Pseudonym> | http://books.google.com.au/books?id=8SAaSd89sSkC&dq=bronstein+symbolic+integration&pg=PP1&ots=QUrJSzlMLB&sig=Q0eCkb94pbikYth6pIeyKXzq5uQ&prev=http://www.google.com.au/search%3Fsource%3Dig%26hl%3Den%26rlz%3D%26q%3Dbronstein%2Bsymbolic%2Bintegration%26btnG%3DGoogle%2BSearch%26meta%3D&sa=X&oi=print&ct=title&cad=one-book-with-thumbnail |
| 01:00:46 | <lambdabot> | Title: Symbolic Integration I ... - Google Book Search, http://tinyurl.com/24x25s |
| 01:00:51 | <Pseudonym> | It's that one. |
| 01:00:54 | <Pseudonym> | Let me find the page. |
| 01:01:19 | <Pseudonym> | Ah, if you search for "value at" and select page 117. |
| 01:01:24 | <lament> | symbolic integration... |
| 01:01:26 | <ivanm> | Pseudonym: couldn't you find a longer url? :p |
| 01:01:36 | <Pseudonym> | ivanm: No, sadly. |
| 01:01:41 | <lament> | then it's probably just some shortcut to make things easier |
| 01:01:41 | <ivanm> | :( |
| 01:02:09 | <Pseudonym> | The tinyurl is good. |
| 01:02:15 | <lament> | made up by engineers :) |
| 01:02:27 | <ivanm> | @slap engineers for ruining all our fun |
| 01:02:27 | <lambdabot> | ACTION pushes engineers for ruining all our fun from his chair |
| 01:02:38 | <ivanm> | is it just me, or is lambdabot inherently sexist? |
| 01:02:39 | <glguy> | whoa, lambdabot is male |
| 01:02:45 | <EvilTerran> | what?! |
| 01:02:49 | <ivanm> | i.e. she thinks only males deserve to be @slapped |
| 01:02:57 | <glguy> | nono, that means that lambdabot is male |
| 01:03:16 | <ivanm> | to me it sound like that lambdabot is pushing the slappee from their chair |
| 01:03:25 | <Pseudonym> | Yes. |
| 01:03:33 | <Pseudonym> | But it means that if lambdabot slaps a female... |
| 01:03:40 | <glguy> | while sitting in a chair, lambdabot is slapping |
| 01:03:42 | <monochrom> | @slap Philippa |
| 01:03:42 | <lambdabot> | ACTION pokes Philippa in the eye |
| 01:03:43 | <glguy> | err, pushing |
| 01:03:43 | <ivanm> | no, it means that lambdabot won't slap females |
| 01:03:59 | <lament> | @slap females |
| 01:03:59 | <lambdabot> | ACTION will count to five... |
| 01:04:01 | <monochrom> | But Philippa is female. |
| 01:04:15 | <Pseudonym> | > [1..5] |
| 01:04:16 | <lambdabot> | [1,2,3,4,5] |
| 01:04:20 | <ivanm> | lol |
| 01:04:27 | <lament> | lambdabot: now what? |
| 01:04:29 | <Pseudonym> | Oh, hang on. |
| 01:04:34 | <Pseudonym> | Counting begins at zero. |
| 01:04:36 | <Pseudonym> | > [0..5] |
| 01:04:38 | <lambdabot> | [0,1,2,3,4,5] |
| 01:04:42 | <lament> | @slap females |
| 01:04:42 | <lambdabot> | ACTION clobbers females with an untyped language |
| 01:04:43 | <Pseudonym> | Phil Wadler says so, so it must be true. |
| 01:05:05 | <sjanssen> | @remember Pseudonym Phil Wadler says so, so it must be true. |
| 01:05:05 | <lambdabot> | Good to know. |
| 01:05:08 | <lament> | Pseudonym: counting also ends at the number one less than specified |
| 01:05:29 | <Pseudonym> | ?go "proof by eminent authority" |
| 01:05:30 | <lambdabot> | http://www.maths.uwa.edu.au/~berwin/humour/invalid.proofs.html |
| 01:05:30 | <lambdabot> | Title: Invalid techniques of proof |
| 01:05:33 | <ivanm> | every CS student knows that there are only two numbers that matter! |
| 01:05:46 | <lament> | > let countTo x = [0..(x-1)] in countTo 5 |
| 01:05:47 | <ivanm> | i.e. 0 and 1 |
| 01:05:47 | <lambdabot> | [0,1,2,3,4] |
| 01:05:57 | <lament> | ivanm: what about 69? |
| 01:05:58 | <Pseudonym> | All numbers matter, duh. There's a simple proof by induction. |
| 01:06:06 | <ivanm> | lambdabot: but then you're not counting "to" 5, you're only counting "up to" 5 |
| 01:06:24 | <ivanm> | lament: seriously, how many CS students are likely to have experienced that? :p |
| 01:06:37 | <lament> | Pseudonym: surely that only works for countably many numbers? |
| 01:06:45 | <ivanm> | Pseudonym: I beg to differ... only computable numbers matter! |
| 01:06:54 | <lament> | still countably many |
| 01:07:36 | <Pseudonym> | Good point, yes. |
| 01:07:40 | <Pseudonym> | All natural numbers matter. |
| 01:08:14 | <Pseudonym> | Clearly zero matters. |
| 01:08:32 | <Pseudonym> | Now, let n > 0 be the smallest number which doesn't matter. |
| 01:08:57 | <Pseudonym> | n, being the smallest irrelevant number, is important to this proogf. |
| 01:08:59 | <Pseudonym> | proof |
| 01:09:01 | <Pseudonym> | Therefore, it matters. |
| 01:09:10 | <lament> | this argument is very easily extended to computable numbers as well |
| 01:09:15 | <Pseudonym> | It follows, by contradiction, that all natural numbers matter. |
| 01:09:16 | <Pseudonym> | Yes. |
| 01:09:28 | <Pseudonym> | By Goedel numbering. |
| 01:09:30 | <ivanm> | which is what I said... only computable numbers matter |
| 01:09:44 | <ivanm> | so pi, e, sqrt 7, etc. all matter |
| 01:09:55 | <ivanm> | but a random real with random digits doesn't |
| 01:10:24 | <lament> | a good argument for that is "well, if you think this number matters, why don't you show it to me" |
| 01:10:49 | <Pseudonym> | Oh, man. |
| 01:11:01 | <Pseudonym> | The two main proof techniques in modern cryptography: |
| 01:11:11 | <Pseudonym> | 1. Proof by demonstrating equivalence to a problem thought to be hard. |
| 01:11:18 | <Pseudonym> | 2. Proof by unclaimed monetary reward. |
| 01:11:24 | <ivanm> | lol |
| 01:11:47 | <ivanm> | in terms of proof that that technique is good? |
| 01:12:13 | <Pseudonym> | Given that a "real" proof is impossible, I guess it's as good as any. |
| 01:12:41 | <ivanm> | *nod* |
| 01:12:53 | <Philippa> | 2. has to be large enough to exceed the value of just keeping it to yourself, mind |
| 01:12:55 | <ivanm> | proof in crypto = absence of inverse proof in rest of maths |
| 01:13:24 | <Philippa> | there's something of a history of the spooks finding something first and never telling anyone |
| 01:13:24 | <ivanm> | Pseudonym: I like the "Proof by Recess" |
| 01:13:29 | <Pseudonym> | The invisible hand of the market says it's true! |
| 01:13:34 | <Philippa> | the British discovery of RSA, for example |
| 01:13:35 | <ivanm> | can anyone say "NSA" ? |
| 01:13:40 | <ivanm> | true |
| 01:13:55 | <Pseudonym> | Yeah. |
| 01:14:05 | <Pseudonym> | And differential cryptanalysis, too. |
| 01:14:37 | <ivanm> | ACTION goes to uni |
| 01:14:56 | <ivanm> | and I learnt my lesson... no trying to truncate it using a hyphen and greater-than sign |
| 01:15:03 | <ivanm> | @slap pedantic haskellers |
| 01:15:03 | <lambdabot> | ACTION hits pedantic haskellers with an assortment of kitchen utensils |
| 01:15:29 | <ivanm> | mrsolo was _that_scared by lambdabot that both his nicks quit? :o |
| 01:15:45 | <lament> | does that really count as "solo"? |
| 01:16:20 | <Olathe> | The first one is solo. The second one is a fill-in-the-blank puzzle. |
| 01:16:20 | <monochrom> | heehee |
| 01:20:29 | <newsham> | phila: reference to brits discovering rsa |
| 01:21:36 | <newsham> | nevermind, wikipedia |
| 01:22:21 | <lament> | all i can think of is Solon, an ancient greek politician |
| 01:22:25 | <lament> | as in mrsolon |
| 01:23:30 | <fons> | All Haskell type constructors are left-associative except (->) ? |
| 01:23:49 | <EvilTerran> | fons, in haskell98, i think so |
| 01:24:03 | <EvilTerran> | actually, in haskell98, no others are infix |
| 01:24:41 | <EvilTerran> | in ghc, though, they can be named in infix/infixl/infixr declerations |
| 01:26:12 | <fons> | The thing is, I'm parsing types with template haskell and .. |
| 01:26:24 | <fons> | (Int -> Bool) is represented as |
| 01:26:32 | <fons> | AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Bool) |
| 01:26:41 | <fons> | while (Int,Bool) is |
| 01:26:49 | <fons> | AppT (AppT (TupleT 2) (ConT GHC.Base.Int)) (ConT GHC.Base.Bool) |
| 01:27:03 | <EvilTerran> | that should deal with the fixities automatically; doesn't it give you a tree-like structure with everything worked out? |
| 01:27:37 | <fons> | yep, but in Bool -> Int the first type you have access to in the tree is Int |
| 01:27:46 | <fons> | sorry |
| 01:27:53 | <fons> | yep, but in Bool -> Int the first type you have access to in the tree is Bool |
| 01:28:24 | <fons> | whereas in (Bool, Int) you first access Int, and then Bool |
| 01:29:21 | <monochrom> | Your examples above show that the only difference is ArrowT vs (TupleT 2). |
| 01:29:40 | <EvilTerran> | they look the same way round to me |
| 01:30:11 | <fons> | Either Bool Int |
| 01:30:19 | <fons> | AppT (AppT (ConT Data.Either.Either) (ConT GHC.Base.Bool)) (ConT GHC.Base.Int) |
| 01:30:26 | <fons> | You have access to Int first |
| 01:30:44 | <EvilTerran> | you keep swapping Bool and Int around |
| 01:30:58 | <monochrom> | You yourself are switching between Int->Bool and Bool->Int too. Could you fix all your typos first? |
| 01:31:09 | <fons> | ops hold on |
| 01:31:17 | <fons> | let me post it again |
| 01:31:42 | <EvilTerran> | this will have nothing to do with fixity, anyway |
| 01:31:50 | <fons> | ok, Bool -> Int |
| 01:31:55 | <EvilTerran> | a -> b will be resolved as if it were (->) a b |
| 01:32:04 | <fons> | AppT (AppT ArrowT (ConT GHC.Base.Bool)) (ConT GHC.Base.Int) |
| 01:32:24 | <EvilTerran> | (a,b) as if it were (,) a b |
| 01:32:27 | <EvilTerran> | Either a b as itself |
| 01:32:32 | <fons> | AppT (AppT (TupleT 2) (ConT GHC.Base.Bool)) (ConT GHC.Base.Int) |
| 01:32:57 | <fons> | that's (Bool,Int) |
| 01:33:12 | <EvilTerran> | apart from "ArrowT" vs "(TupleT 2)", they're the same. so what? |
| 01:33:47 | <fons> | I'm trying to understand why is Arrow treated differently |
| 01:34:04 | <EvilTerran> | how is it treated differently? |
| 01:34:08 | <EvilTerran> | they're the same! |
| 01:34:33 | <fons> | hold on |
| 01:34:34 | <monochrom> | Bool sits in the same position in both trees. Int sits in the same position in both trees. What were you saying again? |
| 01:35:07 | <fons> | uhm ok |
| 01:35:09 | <monochrom> | In five minutes you'll be saying, "I swear I saw it did the wrong thing! But I can't reproduce it now!", I prophesize. |
| 01:35:18 | <fons> | I've just been stupid |
| 01:35:27 | <fons> | ;) |
| 01:35:50 | <fons> | the problem comes when chaining (->) |
| 01:35:51 | <EvilTerran> | the only possible confusion i can fathom would be the difference between a -> b -> c (= (->) a ((->) b c))) and a `Either` b `Either` c (= Either (Either a b) c) |
| 01:36:08 | <fons> | that's it EvilTerran |
| 01:36:42 | <EvilTerran> | (as things default to infixl unless you say otherwise) |
| 01:36:47 | <monochrom> | a->(b->c) and Either a (Either b c) will look alike. |
| 01:37:36 | <fons> | yes, but the base of my problem was comparing (a,b,c) and a -> b -> c |
| 01:37:41 | <fons> | which of course are not the same |
| 01:38:07 | <fons> | I was just comparing different things |
| 01:39:55 | <fons> | thanks guys, it's late (and I was being stupid, no excuses ;)) |
| 01:58:13 | <thoseion> | hey folks, just starting out with haskell/functional prog and wondering if someone could help with a Q? |
| 01:58:31 | <Cale> | thoseion: sure |
| 01:58:46 | <thoseion> | thanks!.. |
| 01:59:02 | <Cale> | dons: Hey, any idea what could cause "Plugin `eval' failed with: IRCRaised Data.ByteString.last: empty ByteString" when using @let (in my own bot) |
| 01:59:19 | <Cale> | (or anyone else who works on lambdabot for that matter :) |
| 01:59:19 | <sorear> | thoseion: It helps alot if you ask. :P |
| 01:59:21 | <LoganCapaldo> | Cale: welcome to the club! Nice to see you here |
| 01:59:25 | <thoseion> | I'm trying to take in a list of boolean values and return true if exactly one is true and fase otherwise |
| 01:59:34 | <sorear> | Cale: upgrade regex-* |
| 01:59:36 | <LoganCapaldo> | dons said something about regex |
| 01:59:37 | <Cale> | ah |
| 01:59:41 | <Cale> | okay cool |
| 01:59:42 | <sorear> | Cale: there's an egregious bug |
| 01:59:54 | <gwern> | 'I heard GHC 13 will spawn millions of parallel universes in order to find the optimal compilation by brute force.' <-- well, y'see it lazily generates them, sorts them, and takes the head... |
| 02:00:11 | <thoseion> | so I guess essentially an xor |
| 02:00:24 | <sorear> | > ((==[True]) . filter id) [False, False, False, False] |
| 02:00:28 | <sorear> | > ((==[True]) . filter id) [False, False, True, False] |
| 02:00:33 | <sorear> | > ((==[True]) . filter id) [False, True, True, False] |
| 02:00:35 | <lambdabot> | False |
| 02:00:35 | <lambdabot> | True |
| 02:00:35 | <Pseudonym> | gwern: Right, so it actually does a finite amount of work. |
| 02:00:36 | <lambdabot> | False |
| 02:00:59 | <lament> | so if the current universe is not the optimal one, it terminates? |
| 02:01:08 | <lament> | something could go terribly, terribly wrong |
| 02:01:36 | <Cale> | thoseion: well, sort of, but not quite the usual generalisation of xor, since that would give you the parity |
| 02:02:25 | <Cale> | thoseion: sorear gave a suitable solution -- filter the list using the identity function to remove all the False elements, and then check if the list is equal to [True] |
| 02:02:26 | <gwern> | lament: by the anthropic principle, we'd never realize any such termination. so the only observers would be in an optimal universe. (We can't lose!) |
| 02:03:45 | <lament> | i think that's called quantum immortality, not anthropic principle, and if i believed in it i would have killed myself a long time ago. |
| 02:03:45 | <thoseion> | Cale/sorear - thanks I'll look into that and give it a go although I've not used filters at all yet |
| 02:04:18 | <Cale> | thoseion: (filter p xs) just forms the list of elements of xs for which p gives True |
| 02:04:27 | <Cale> | > filter even [1..10] |
| 02:04:28 | <lambdabot> | [2,4,6,8,10] |
| 02:04:45 | <Cale> | filter isVowel "Hello there!" |
| 02:04:50 | <Cale> | > filter isVowel "Hello there!" |
| 02:04:50 | <lambdabot> | Not in scope: `isVowel' |
| 02:04:53 | <Cale> | err... |
| 02:05:00 | <thoseion> | I was attempting something like: onetrue (x:xs) = (x || onetrue xs) && not (x && onetrue xs) |
| 02:05:00 | <Cale> | > filter isAlpha "Hello there!" |
| 02:05:01 | <lambdabot> | "Hellothere" |
| 02:05:14 | <gwern> | lament: no, you would have *not* killed yourself. that's the whole point... |
| 02:05:16 | <Cale> | > filter (`elem` "aeiou") "Hello there!" |
| 02:05:17 | <lambdabot> | "eoee" |
| 02:05:17 | <thoseion> | but of course doesnt work the way I want it to ;p |
| 02:05:46 | <lament> | gwern: i suppose it must be true, then :) |
| 02:06:17 | <Cale> | thoseion: well, if you wrote a function to determine if all the elements are False, then that would be useful |
| 02:06:32 | <Cale> | (along with recursion of a similar sort) |
| 02:06:54 | <gwern> | lament: it is unfalsifiable!!111! kekeke |
| 02:07:00 | <Cale> | You'd walk along until you found a True, then check that all the rest were False |
| 02:07:09 | <Cale> | oneTrue [] = False |
| 02:07:20 | <Cale> | oneTrue (False:xs) = oneTrue xs |
| 02:07:31 | <Cale> | oneTrue (True:xs) = allFalse xs |
| 02:08:06 | <omnId> | allFalse = all not |
| 02:08:14 | <thoseion> | ah ok |
| 02:08:33 | <TomMD> | Hope no one minds my reasking: Anyone know of HFUSE users other than Halfs? |
| 02:09:10 | <Cale> | btw, there's an annoying bug in cabal-install. It refuses to download and set up a new package if you already have an older version installed. |
| 02:11:18 | <lament> | gwern: watch this! *bang* |
| 02:11:59 | <LoganCapaldo> | > (== 1) . foldl ((+) . fromEnum)) 0 [False, False] |
| 02:11:59 | <lambdabot> | Unbalanced parentheses |
| 02:12:07 | <LoganCapaldo> | > (== 1) . foldl ((+) . fromEnum) 0 [False, False] |
| 02:12:08 | <lambdabot> | Couldn't match expected type `Int' against inferred type `Bool' |
| 02:12:25 | <LoganCapaldo> | > (== 1) . foldr ((+) . fromEnum) 0 [False, False] |
| 02:12:26 | <lambdabot> | Couldn't match expected type `a -> b' against inferred type `Int' |
| 02:12:32 | <LoganCapaldo> | boo |
| 02:12:33 | <omnId> | > (== 1) . foldl ((+) . fromEnum) 0 $ [False, False] |
| 02:12:33 | <lambdabot> | Couldn't match expected type `Int' against inferred type `Bool' |
| 02:12:52 | <twanvl> | > (== 1) . sum . map fromEnum $ [False, False] |
| 02:12:57 | <lambdabot> | False |
| 02:13:04 | <LoganCapaldo> | but I didn't want to map sum |
| 02:13:42 | <Cale> | It's the misused . |
| 02:13:50 | <Cale> | > (== 1) . foldr ((+) . fromEnum) 0 $ [False, False] |
| 02:13:52 | <lambdabot> | False |
| 02:13:59 | <Cale> | > (== 1) . foldr ((+) . fromEnum) 0 $ [False, False, True] |
| 02:14:00 | <lambdabot> | True |
| 02:14:04 | <Cale> | > (== 1) . foldr ((+) . fromEnum) 0 $ [False, False, True, True] |
| 02:14:05 | <lambdabot> | False |
| 02:14:16 | <thoseion> | thankyou Cale - works a treat! |
| 02:14:38 | <Cale> | > sum . map fromEnum is more readable, I think |
| 02:14:39 | <lambdabot> | parse error on input `,' |
| 02:14:52 | <LoganCapaldo> | > probablu |
| 02:14:53 | <lambdabot> | Not in scope: `probablu' |
| 02:14:55 | <LoganCapaldo> | err |
| 02:14:57 | <LoganCapaldo> | probaby |
| 02:15:02 | <LoganCapaldo> | probably |
| 02:15:04 | <thoseion> | I'm sure I'll be visiting here often in the future :D |
| 02:15:27 | <jaj> | ?karma lambdabot |
| 02:15:27 | <lambdabot> | lambdabot has a karma of 49 |
| 02:16:47 | <Cale> | thoseion: Yeah, ask lots of questions :) |
| 02:17:03 | <LoganCapaldo> | > (== 1) . length . filter id $ [True, True, False] |
| 02:17:05 | <lambdabot> | False |
| 02:17:10 | <LoganCapaldo> | > (== 1) . length . filter id $ [True, False] |
| 02:17:11 | <lambdabot> | True |
| 02:17:57 | <LoganCapaldo> | o' course that's just the [True]== son but dumber |
| 02:18:06 | <LoganCapaldo> | s/son/solution/ |
| 02:18:15 | <Cale> | s'on, heh |
| 02:20:23 | <user317> | is there a program argument parser somewhere? |
| 02:21:47 | <Cale> | http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html |
| 02:21:50 | <lambdabot> | http://tinyurl.com/yyvufm |
| 02:22:05 | <Cale> | Something like that? |
| 02:22:19 | <user317> | perfect, thanks Cale |
| 02:24:05 | <monochrom> | Oh! It's in base. No wonder I can't find it on hackage. :) |
| 02:24:36 | <ddarius> | I'm glad that lament guy is gone. |
| 02:25:52 | <monochrom> | Why? |
| 02:26:37 | <sorear> | Lament is gone?! |
| 02:26:44 | <omnId> | <!lament> gwern: watch this! *bang* |
| 02:26:47 | <omnId> | killed himself. |
| 02:26:57 | <omnId> | :'( |
| 02:27:39 | <omnId> | something about quantum physics... |
| 02:28:07 | <Korollary> | ? |
| 02:28:45 | <omnId> | it was ten minutes ago, scoll up :P |
| 02:29:25 | <monochrom> | He sacrificed his life for physics? :) |
| 02:29:41 | <omnId> | poor bastard. |
| 02:29:48 | <Korollary> | poor physics |
| 02:29:57 | <monochrom> | hehe |
| 02:30:34 | <LoganCapaldo> | may physics have mercy on your sole |
| 02:30:51 | <TomMD> | If we are going to personify physics then I'll tell you that he is the most snide and tricky bastard I know. |
| 02:31:28 | <Cale> | hmmm |
| 02:31:40 | <Korollary> | MD's don't do much physics anyway |
| 02:31:44 | <Cale> | Still not working, despite that I've upgraded regex-compat/etc. |
| 02:32:23 | <TomMD> | Korollary: LOL, I don't intend to mislead, but 'Tom' was taken when I signed up and my initials are 'TMD'... so... no PhD. |
| 02:32:28 | <salierix> | I'm trying to learn haskell but I really don't like this lazy aspect to the language. |
| 02:32:43 | <LoganCapaldo> | I don't know that other MDs have phds either |
| 02:32:59 | <Cale> | salierix: what don't you like about it? |
| 02:33:01 | <LoganCapaldo> | salierix: are you a workaholic? |
| 02:33:10 | <Korollary> | There are MD/PhD's. It takes a long time to get both degrees. |
| 02:33:14 | <ddarius> | salierix: So learn a different language. |
| 02:33:18 | <Cale> | salierix: If you want, I can do a little overview of how lazy evaluation works. |
| 02:33:21 | <TomMD> | LoganCapaldo: I was always under the impression it is a medical equiv to PhD. You get my point at any rate. |
| 02:33:32 | <salierix> | It makes reasoning about another person's code difficult. |
| 02:33:35 | <omnId> | double, double, toil and trouble |
| 02:33:37 | <Cale> | salierix: oh? |
| 02:33:46 | <Cale> | salierix: why is that? |
| 02:33:52 | <ddarius> | salierix: Actually, quite the opposite until you get to performance. |
| 02:33:59 | <omnId> | fire burn and Caledron bubble |
| 02:34:00 | <chessguy_> | macbeth? |
| 02:34:09 | <Cale> | and even when you do get to performance, it's not *that* bad |
| 02:34:09 | <salierix> | ddarius, what do you mean? |
| 02:34:49 | <Cale> | salierix: One thing you should notice is that if a function terminates under strict evaluation, then it terminates under lazy evaluation and produces the same result. |
| 02:34:53 | <Korollary> | salierix: You said you were trying to learn haskell. You can't really reason about code until you finished learning. |
| 02:34:53 | <ddarius> | salierix: The full beta rule holds for call-by-name/need, but not for call-by-value. I.e. equational reasoning holds even stronger in Haskell because it is lazy. |
| 02:36:19 | <monochrom> | I believe lazy evaluation is perceived to be difficult because "woah! take 5 [1..] works?! My brain has exploded!" |
| 02:37:19 | <Cale> | salierix: If you want, I can show you how it works, it's actually quite simple. |
| 02:37:40 | <TomMD> | monochrom: I disagree. Lazy annoys me sometimes because of silly things like: |
| 02:37:40 | <TomMD> | handle <- openFile "blah" "r" |
| 02:37:40 | <TomMD> | let hash = sha1file handle |
| 02:37:40 | <TomMD> | closeFile handle |
| 02:37:40 | <TomMD> | putStrLn $ show hash |
| 02:37:54 | <TomMD> | That won't work too well *sigh* |
| 02:37:55 | <salierix> | I'm also having trouble dealing with mutable state... I'm so used to being able to mutate things. |
| 02:38:01 | <LoganCapaldo> | wel lazy + sideeffects is bound to wreak havoc |
| 02:38:37 | <TomMD> | err... sorry... that example is rather bad... I should have expanded sha1file as: sha1 `liftM` hGetContents |
| 02:38:42 | <sorear> | TomMD: if you call fclose() twice in C, you break things. What makes you think it's different in Haskell? |
| 02:38:56 | <astrolabe> | salierix: It is difficult to get the hang of, but worth it in my opinion. |
| 02:38:59 | <sorear> | TomMD: Remember that hGetContents closes the file. |
| 02:39:02 | <ddarius> | lazy and IO are far from a match made in Heaven. |
| 02:39:43 | <Cale> | salierix: yeah, so there's a little bit of strangeness there, but one thing you should learn early on is how to use lists like you would loops |
| 02:39:46 | <sjanssen> | I'd say they're a match made far from Heaven |
| 02:39:48 | <Korollary> | salierix: Yes, it takes practice and getting used to. But once you get the hang of it, it's almost second nature. |
| 02:39:53 | <monochrom> | Yes, TomMD, but I'm talking about beginners who are still looking at the pure fragment, no IO yet. |
| 02:40:14 | <Cale> | salierix: A list is kind of like a loop waiting to happen. |
| 02:40:23 | <TomMD> | sorear: All I am saying in this example is, if you open a file, let hash = sha1 handle then close, depending on how the code was written, that 'let hash = ' was lazy and won't get the hash before the file closes. |
| 02:40:45 | <sorear> | TomMD: Why are you closing the file TWICE? |
| 02:40:52 | <salierix> | Can I write the performance critical part of my program in C and just call it from haskell? |
| 02:40:55 | <omnId> | salierix: I think you'll find that, though you're used to mutating things, immutable data structures are far more capable than you might realize. |
| 02:40:59 | <sorear> | salierix: Absolutely. |
| 02:41:01 | <sorear> | @where ffi |
| 02:41:01 | <lambdabot> | http://www.cse.unsw.edu.au/~chak/haskell/ffi/ |
| 02:41:18 | <sorear> | Haskell has one of the best C interfaces in existance. |
| 02:41:39 | <sorear> | Only C++ does a better job. |
| 02:41:43 | <TomMD> | sorear: Let us drop that IRC code bug, I've stated the lazy-can-cause-confusion comment I desired. Just one of those things that can confuse the uneducated (or the tired, etc). |
| 02:42:00 | <monochrom> | Remember C has the best C interface! |
| 02:42:23 | <LoganCapaldo> | I'm with monochrom on this one |
| 02:42:36 | <Korollary> | What's wrong with C++'s C interface? |
| 02:42:50 | <monochrom> | Nothing wrong, if you ask me. |
| 02:42:56 | <Pseudonym> | Korollary: It doesn't play nicely with its C++ interface. |
| 02:43:18 | <Pseudonym> | 1. extern "C" |
| 02:43:23 | <Korollary> | Pseudonym: That wasn't a requirement (nor is it met by C of course) |
| 02:43:25 | <Pseudonym> | 2. C APIs are often not const-correct. |
| 02:43:30 | <salierix> | omnId, What about large arrays? Copying them each time a change is made would be horrible. |
| 02:43:48 | <monochrom> | Arrays are overrated. |
| 02:43:49 | <Pseudonym> | Those are the two main issues that have bugged me. |
| 02:44:19 | <Pseudonym> | Oh, things have improved a bit since STL vectors mandated that they are layout-equivalent to C arrays. |
| 02:44:33 | <sorear> | salierix: 90% of array uses are monolithic constructions, like 'all the elements of a[] multiplied by 2' |
| 02:44:58 | <sorear> | salierix: the remaining 10% can use the (ugly, but workable) STArrays |
| 02:44:58 | <omnId> | salierix: don't use arrays. You usually don't need them. If you do, Haskell has mutable arrays. |
| 02:45:07 | <TomMD> | Curiously, does anyone else see FFI overuse as a potential for dependency bloat and portability issues? |
| 02:45:13 | <Philippa> | sorear: don't forget the ones that're really implementing another structure |
| 02:45:21 | <monochrom> | For the odd case when you really need an array, i.e., linear algebra, there is a mutable array. |
| 02:45:37 | <sorear> | TomMD: No. C is vastyl more portable than Haskell. Besides, Cabal can handle C+haskell just fine. |
| 02:45:42 | <LoganCapaldo> | Philippa: please don't remind anyone of those |
| 02:45:53 | <monochrom> | The other day I was saying the same thing Philippa is now saying. |
| 02:47:43 | <monochrom> | For a long time, imperative languages provide arrays and nothing else. So programmers encoded, repeat encoded, everything into arrays. You want a list? It's an array. You want a set? It's an array. To the point they can't cope when real list libraries and real set libraries come about. |
| 02:48:06 | <Philippa> | sorear: easy to say if you don't use windows, there're still often lib portability and ease of building issues there |
| 02:48:21 | <sorear> | Philippa: even with cabal? |
| 02:48:31 | <Philippa> | I didn't have much luck with yi |
| 02:48:33 | <TomMD> | sorear: I do see it as an issue. This is talking less about technological 'can' and more about simplicity in an enterprise environment. A simple example would be someone deploying an app needing crypto. That would probably be done with SSL bindings. Suddenly all the windows machines have a new requirement and things have bloated. Also, I don't think any of or FPGA loving friends want openssl on the FPGA ;-). But I recognize I am in |
| 02:48:36 | <astrolabe> | Haskell arrays are pretty useful I find, even with lists available. |
| 02:48:56 | <Philippa> | I should check out an SDL binding at some point, I imagine cabal makes that sort of thing a lot easier |
| 02:49:31 | <Philippa> | TomMD: so don't use that lib in your enterprise |
| 02:49:35 | <salierix> | What's cabal? |
| 02:49:55 | <Philippa> | it's a tool for installing libraries and applications written in Haskell |
| 02:50:03 | <salierix> | Oh. |
| 02:50:16 | <astrolabe> | I seem to have just managed to install hxt on my home machine, but when I try it on my work machine, the 'runhaskell install' stage grumbles about 'LICENCE' :( |
| 02:50:25 | <Korollary> | also for building |
| 02:50:39 | <Philippa> | sorear: additionally, there's a risk of packages becoming a semi-standard answer to a problem when they require an external lib not available on windows |
| 02:50:41 | <TomMD> | Philippa: Precisely. A Haskell app that has an internal routine or two instead of an entire external library dependency is a win. |
| 02:51:15 | <Philippa> | however, having that external library available is also a win for the community as a whole |
| 02:51:17 | <allbery_b> | salierix: cabal is likethe local side of CPAN, but for Haskell. (Hackage is the remote half.) |
| 02:51:30 | <Philippa> | not all of us are in an enterprise situation, not all of us can reinvent every wheel |
| 02:51:42 | <Korollary> | Enterprises don't reinvent wheels either |
| 02:51:55 | <allbery_b> | as yet they're not entirely hooked together although you can find two tools that are evolving into doing so (cabal-install and cabal-setup) on hackage |
| 02:52:08 | <allbery_b> | (hackage == hackage.haskell.org) |
| 02:52:24 | <Philippa> | Korollary: SAP configs? :-) |
| 02:52:32 | <TomMD> | I am talking more about 'Haskell community reinventing wheels' and producing native modules. This, in comparison with excessive FFI. |
| 02:52:56 | <salierix> | Is the ghc garbage collector reference count based? |
| 02:53:03 | <LoganCapaldo> | dear god no |
| 02:53:21 | <Philippa> | TomMD: it happens for some things and not others |
| 02:53:27 | <omnId> | It's a copy collector, but I know little of GC. |
| 02:53:27 | <sjanssen> | TomMD: you have to consider manpower too |
| 02:53:37 | <LoganCapaldo> | sorear knows what it is |
| 02:53:48 | <LoganCapaldo> | I know sorear knows because I asked about it before |
| 02:53:50 | <monochrom> | Dear God, reference counting is kid's toy garbage collection. |
| 02:53:51 | <Philippa> | the likelihood of a reimplementation depends on a number of things, including the amount of effort involved in doing it right and the potential gain... |
| 02:53:52 | <LoganCapaldo> | and he answered |
| 02:53:53 | <TomMD> | sjanssen: On that note - you're still graduating on time, right? ;-) |
| 02:54:16 | <Philippa> | salierix: no, it's a proper GHC. We've got too much recursion going on for refcounting |
| 02:54:21 | <Philippa> | er, it's a proper GC even |
| 02:54:23 | <sjanssen> | TomMD: there are so many developer-hours available for Haskell library hacking. Usually, I'd prefer that the hacker writes a small binding to C and writes more libraries :) |
| 02:54:33 | <sjanssen> | TomMD: after this summer |
| 02:55:22 | <Philippa> | OTOH, it's a good thing that we're not stuck with lex/yacc clones for parsing |
| 02:55:45 | <omnId> | ACTION <3 Parsec |
| 02:55:57 | <sorear> | ACTION finds the mere notion of GHC using reference counts quite annoying. |
| 02:56:02 | <TomMD> | Yes, your previous response 'it happens for some things and not others' is really where we should be, I think. |
| 02:56:05 | <sorear> | s/annoying/insulting |
| 02:56:42 | <salierix> | My excuse is that I'm completely ignorant of such things, sorry :P |
| 02:56:46 | <omnId> | sorear: you mustn't take things too personally, a person doesn't know until they find out. |
| 02:57:06 | <Philippa> | for salierix's information: |
| 02:57:13 | <Philippa> | One day a student came to Moon and said: I understand how to make a better garbage collector. We must keep a reference count of the pointers to each cons. |
| 02:57:15 | <Philippa> | Moon patiently told the student the following story: |
| 02:57:21 | <Philippa> | One day a student came to Moon and said: I understand how to make a better garbage collector... |
| 02:58:01 | <TomMD> | I could put that into a list... of coarse it would be infinite. Looks like I know what language I'll use. |
| 02:58:19 | <ddarius> | reference counting is how you get incrementality |
| 02:58:48 | <monochrom> | Why was the person called Moon? :) |
| 02:58:58 | <lament> | it's a historical figure |
| 02:59:12 | <gwern> | most of the ai koans were based on real incidents |
| 02:59:18 | <lament> | just like most real koans |
| 02:59:21 | <Philippa> | "David Moon wrote much of Lisp Machine Lisp", to quote the page |
| 02:59:26 | <gwern> | for example, the checkers one is taken almost straight from Levy's ''hackers'' |
| 02:59:59 | <ddarius> | monochrom: You didn't immediately know it was David Moon?! |
| 03:00:05 | <monochrom> | No. |
| 03:00:14 | <LoganCapaldo> | I thought it was the moon |
| 03:00:20 | <gwern> | myself, I like the powercycling one best |
| 03:00:20 | <LoganCapaldo> | that woud've been cooler |
| 03:00:40 | <omnId> | lament: aren't you dead? |
| 03:00:52 | <ddarius> | Anyway, I need to switch back to Linux. |
| 03:01:15 | <lament> | omnId: in that universe, yes. |
| 03:01:16 | <TomMD> | from? |
| 03:02:20 | <Philippa> | salierix: was the koan suitably enlightening? |
| 03:03:43 | <salierix> | Well... |
| 03:09:49 | <monochrom> | Haskell makes you think and go "hmm". :) |
| 03:10:17 | <lament> | much unlike matlab |
| 03:10:30 | <lament> | which makes you close your ears with your fingers and SCREAM |
| 03:10:34 | <allbery_b> | matlab just makes you want to rip your brain out |
| 03:11:08 | <lament> | nah, you probably won't even feel that |
| 03:17:39 | <wli> | ACTION wonders how to cross-build for Windows. |
| 03:30:13 | <astrolabe> | Does anyone know who 'bitwize' on reddit is? |
| 03:30:56 | <ddarius> | @seen bitwize |
| 03:30:56 | <lambdabot> | I saw bitwize leaving #haskell 1m 22d 13h 47m 20s ago, and . |
| 03:31:53 | <astrolabe> | ooh thanks. |
| 03:50:23 | <omnId> | @quote |
| 03:50:24 | <lambdabot> | z0d says: What was the stereo quote? |
| 04:03:41 | <glguy> | bos: you about? |
| 04:03:45 | <runar> | Xmonad ftw! |
| 04:04:36 | <sorear> | @users |
| 04:04:36 | <lambdabot> | Maximum users seen in #haskell: 420, currently: 377 (89.8%), active: 9 (2.4%) |
| 04:04:36 | <runar> | but... can't... stop... tweaking |
| 04:04:51 | <kilimanjaro> | runar, I just set up xmonad today as well :) |
| 04:05:01 | <sorear> | wow, #xmonad has grown a lot since... uh... this isn't #xmonad |
| 04:05:02 | <wifs> | strangely, I was just browsing xmonad.org |
| 04:05:02 | <runar> | great minds, and all that |
| 04:06:21 | <sorear> | @users |
| 04:06:21 | <lambdabot> | Maximum users seen in #haskell: 420, currently: 376 (89.5%), active: 11 (2.9%) |
| 04:06:27 | <sorear> | oh right |
| 04:06:32 | <sorear> | I just checked |
| 04:06:57 | <runar> | @users xmonad |
| 04:06:57 | <lambdabot> | Maximum users seen in xmonad: 1, currently: 0 (0.0%), active: 0 (NaN%) |
| 04:07:06 | <runar> | @users #xmonad |
| 04:07:06 | <lambdabot> | Maximum users seen in #xmonad: 82, currently: 64 (78.0%), active: 8 (12.5%) |
| 04:07:10 | <runar> | there we go |
| 04:40:18 | <bos> | glguy: yep |
| 04:44:57 | <bos> | @seen glguy |
| 04:44:57 | <lambdabot> | glguy is in #haskell and #xmonad. I last heard glguy speak 41m 15s ago. |
| 05:14:36 | <vBergmann> | what am i doing wrong in this statement? |
| 05:14:53 | <vBergmann> | [ (x,y) | x <- [1..a], y <- [1..b] ] where b = 7, a =6 |
| 05:15:05 | <Korollary> | the comma |
| 05:15:19 | <Korollary> | b=7, |
| 05:15:22 | <vBergmann> | what is an alternative? |
| 05:15:43 | <Korollary> | you can use layout or semicolon |
| 05:16:04 | <vBergmann> | ah works great now thanks |
| 06:02:32 | <bos> | @seen dons |
| 06:02:32 | <lambdabot> | dons is in #xmonad and #haskell. I last heard dons speak 6h 37m 17s ago. |
| 06:08:03 | <kolmodin> | nice HWN |
| 06:13:03 | <vBergmann> | i'm using pattern matching as one of my base cases (a leaf node) in a Quad Tree i'm writing. I want to throw an error if the user enters a negative number (basically no negative dimensions) but right now i am matching to any number. Is it possible to "restrict" my matches to numbers greater than or equal to zero? |
| 06:13:30 | <vBergmann> | or perhaps detect when a match is greater than zero and write a useful error message |
| 06:13:54 | <sorear> | vBergmann: guards |
| 06:13:57 | <vBergmann> | i can post the code if this doesn't make much sense |
| 06:15:05 | <glguy> | vBergmann: did sorear's answer make sense? |
| 06:15:22 | <vBergmann> | i've used guards to catch errors later on in the code (general case) but the problem is that if i'm entering into the base case right away i don't nkow how to write useful error messages |
| 06:15:42 | <glguy> | ?src take |
| 06:15:42 | <lambdabot> | take n _ | n <= 0 = [] |
| 06:15:42 | <lambdabot> | take _ [] = [] |
| 06:15:42 | <lambdabot> | take n (x:xs) = x : take (n-1) xs |
| 06:16:03 | <Korollary> | You can restrict your matches, but you may also have to deal with bad input. |
| 06:16:17 | <vBergmann> | i'll paste the code |
| 06:16:46 | <glguy> | 18 hours, 45 minutes, 45 seconds till OS 1.5 |
| 06:16:57 | <hpaste> | vbergmann pasted "error messages for base case" at http://hpaste.org/3477 |
| 06:17:04 | <glguy> | whose going to the release party‽ |
| 06:17:25 | <sorear> | what OS? |
| 06:17:30 | <Korollary> | leopard I guess |
| 06:17:42 | <glguy> | on, OS X*.5 |
| 06:17:49 | <glguy> | oh* |
| 06:18:01 | <glguy> | Ah, good old typos in the typo correction |
| 06:18:33 | <glguy> | who's* |
| 06:18:34 | <glguy> | :) |
| 06:19:02 | <vBergmann> | so the problem is basically i have used guards to catch errors but if i go right into the base case if it's possible to return a value and print an error message |
| 06:19:14 | <vBergmann> | it's seems like i can only do one or the other |
| 06:19:28 | <vBergmann> | how can i restrict my matches? |
| 06:19:44 | <glguy> | You could return an: Either String Char |
| 06:19:54 | <glguy> | if one of the results is an error message |
| 06:21:02 | <vBergmann> | oh ok that seems pretty simple |
| 06:21:15 | <vBergmann> | not sure why i didn't think of that >< |
| 06:21:49 | <glguy> | why does a function "getPixel" return a Char though? |
| 06:22:31 | <vBergmann> | this is an quad tree that holds ascii characters |
| 06:22:56 | <vBergmann> | it's an assignment and i think it's to keep things simple |
| 06:26:57 | <quicksilver> | ASCII art ftw! |
| 06:27:14 | <quicksilver> | ACTION fondly remembers the ascii-art SDL drivers and ascii quake |
| 06:27:49 | <glguy> | libaa and libcaca? |
| 06:29:07 | <quicksilver> | http://webpages.mr.net/bobz/ttyquake/ss/ |
| 06:29:08 | <lambdabot> | Title: Textmode Quake Screenshots |
| 06:34:13 | <vBergmann> | lol apparently there's text mode unreal tournament as well |
| 06:34:20 | <vBergmann> | http://offload2.icculus.org/~chunky/ut/aaut/scrshots/1.png |
| 06:35:51 | <OceanSpray> | Oh you crazy ass kids today with your fancy graphics! |
| 06:36:36 | <LeCamarade> | So ... I get MD5 from the crypto package _only_? |
| 06:36:45 | <LeCamarade> | @hoogle md5 |
| 06:36:46 | <lambdabot> | No matches found |
| 06:36:57 | <LeCamarade> | @hoogle MD5 |
| 06:36:57 | <lambdabot> | No matches found |
| 06:37:04 | <LeCamarade> | ,,|,, |
| 06:57:41 | <hoelzro> | hello fellow Haskellers! |
| 06:58:00 | <hoelzro> | is there a Haskell implementation that can be embedded into a C application? |
| 06:58:17 | <KatieHuber> | what's wrong with GHC? |
| 06:58:26 | <hoelzro> | nothing |
| 06:58:43 | <KatieHuber> | I mean, you can call C from GHC-compiled Haskell, and vice versa |
| 06:58:43 | <hoelzro> | but I'd like to write a plugin for Pidgin that allows a user to write a plugin in haskell |
| 06:58:49 | <hoelzro> | really? |
| 06:58:51 | <hoelzro> | cool |
| 06:58:58 | <hoelzro> | learning something new everyday |
| 06:59:13 | <KatieHuber> | Not sure whether it needs control of main() though, which'd be a downer |
| 06:59:29 | <wli> | I'm mostly clueless as to how to compile Haskell on Windows. |
| 06:59:31 | <hoelzro> | I'm not sure |
| 06:59:42 | <KatieHuber> | oh, and GHCi is a library too, so you could allow interpeted haskell plug-ins |
| 06:59:42 | <hoelzro> | Windows is irrelevant to me =D |
| 07:00:17 | <wli> | Mostly to me, too, but I've got some cellular modem card that's bloze-only. |
| 07:00:34 | <Cale> | Subtext is getting pretty cool. |
| 07:00:40 | <hoelzro> | ACTION pats wli on the shoulder. |
| 07:01:18 | <ac> | Cale: do you know the author of Subtext? Which Subtext are you speaking of, BTW? |
| 07:01:28 | <Cale> | http://subtextual.org/subtext2.html |
| 07:01:29 | <lambdabot> | Title: Created with Camtasia Studio 5 |
| 07:02:13 | <hoelzro> | KatieHuber: where would I find info on calling haskell from C |
| 07:02:14 | <hoelzro> | ? |
| 07:02:48 | <ac> | Cale: I've been keeping an eye on that project |
| 07:03:53 | <hoelzro> | nvm, I found something |
| 07:04:03 | <hoelzro> | thanks for all the help everyone! |
| 07:04:11 | <LeCamarade> | ?where ffi |
| 07:04:11 | <lambdabot> | http://www.cse.unsw.edu.au/~chak/haskell/ffi/ |
| 07:04:24 | <LeCamarade> | Oh, he's gone. |
| 07:04:50 | <LeCamarade> | @tell hoelzro You wanted info on how to call C from Haskell: http://www.cse.unsw.edu.au/~chak/haskell/ffi/ |
| 07:04:50 | <lambdabot> | Consider it noted. |
| 07:06:14 | <wli> | I only "care" about bloze in the sense that if I don't come up with some use for it, it's useless. |
| 07:06:27 | <quicksilver> | how disappointing |
| 07:06:30 | <Cale> | bloze? |
| 07:06:35 | <wli> | Windows |
| 07:06:50 | <quicksilver> | my nice little dual monoid strcuture for animatons has turned itself into (yet another) monad |
| 07:07:33 | <arcatan> | hmmmph |
| 07:08:02 | <LeCamarade> | ?where hunit |
| 07:08:03 | <lambdabot> | http://hunit.sourceforge.net/ |
| 07:08:18 | <arcatan> | wrong abstractions... |
| 07:11:04 | <goalieca> | @src product |
| 07:11:04 | <lambdabot> | product = foldl (*) 1 |
| 07:11:14 | <goalieca> | of course |
| 07:11:22 | <goalieca> | i win :-) |
| 07:11:22 | <takamura> | hi |
| 07:11:36 | <LeCamarade> | takamura: Hi. |
| 07:16:28 | <LeCamarade> | Gusts! Crypto has SHA512? Bon. |
| 07:17:03 | <LeCamarade> | Although the build coughs way too many errors. |
| 07:23:32 | <raxas> | quicksilver: please can you show us your cute animation monad so we could admire your ingenuity? |
| 07:24:07 | <wli> | I just want to try out some GUI stuff and all my *NIX boxen are headless. |
| 07:24:55 | <hpaste> | quicksilver pasted "animation monad" at http://hpaste.org/3479 |
| 07:25:09 | <quicksilver> | raxas: there you are, although I still haven't forgiven it for turning out to be a mond |
| 07:25:24 | <quicksilver> | I wonder why foldl (>>=) doesn't have a name |
| 07:25:28 | <quicksilver> | it strickes me as useful |
| 07:36:10 | <phlpp> | hi |
| 07:36:15 | <Pseudonym> | :t foldl (>>=) |
| 07:36:16 | <lambdabot> | forall (m :: * -> *) b. (Monad m) => m b -> [b -> m b] -> m b |
| 07:42:19 | <sjanssen> | quicksilver: foldr (>>=) has a space leak in most monads |
| 07:42:24 | <sjanssen> | s/foldr/foldl |
| 07:44:24 | <sjanssen> | @type flip $ foldr (\m ms x -> m x >>= ms) return |
| 07:44:25 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => a -> [a -> m a] -> m a |
| 07:48:35 | <raxas> | quicksilver: very interesting. I like the parallel animation combinator |
| 07:48:50 | <phlpp> | @type flip |
| 07:48:52 | <lambdabot> | forall a b c. (a -> b -> c) -> b -> a -> c |
| 07:55:04 | <quicksilver> | sjanssen: I'm not sure I care. I'm not planning to fold together millions of actions :) |
| 07:55:30 | <quicksilver> | sjanssen: was your point that foldr (=<<) is better, though? |
| 07:56:16 | <sjanssen> | foldr (=<<) isn't so great either |
| 07:56:22 | <quicksilver> | ACTION nods |
| 07:56:27 | <quicksilver> | I didn't think it would be better |
| 07:56:33 | <quicksilver> | and it does things backwards, too :) |
| 07:56:51 | <quicksilver> | anyhow I'l talking about folding together lists of 10, 15, 100 actins |
| 07:56:56 | <quicksilver> | I doubt the space leak matters much |
| 07:57:48 | <quicksilver> | raxas: yes, well I had the parallel combinator first |
| 07:58:04 | <quicksilver> | raxas: it was just <|> and <-> effectively two pseudo-monoids |
| 07:58:10 | <quicksilver> | (the identity wasn't quite an identity) |
| 07:58:24 | <quicksilver> | but then I discovered that I did actually need to thread return values, sometimes, so it became a monad after all |
| 08:00:11 | <dmwit> | @vixen I know this is sort of silly. |
| 08:00:11 | <lambdabot> | Plugin `vixen' failed with: getRandItem: empty list |
| 08:03:29 | <quicksilver> | dons++ # HWN! |
| 08:06:34 | <quicksilver> | hmm that subtextual thing looks interesting, but I have not time to watch it properly now |
| 08:07:33 | <LeCamarade> | Is there a module that maps the POSIX things to the Win32 versions? |
| 08:08:11 | <LeCamarade> | Like a fork(3) call that does the Win32 equivalent? |
| 08:08:31 | <sjanssen> | LeCamarade: not exactly |
| 08:08:47 | <sjanssen> | LeCamarade: there are cross platform APIs like System.Process |
| 08:08:47 | <quicksilver> | LeCamarade: there are lowest-common-denominator modules which work on both |
| 08:08:54 | <quicksilver> | LeCamarade: but they may not do what you need :) |
| 08:09:08 | <LeCamarade> | Hmm. |
| 08:09:09 | <quicksilver> | i.e they are actually probably somewhat lower than the true l.c.d. |
| 08:09:24 | <quicksilver> | "very low common denominator" ? |
| 08:09:35 | <LeCamarade> | Plus I know some abstractions would leak ... |
| 08:09:56 | <LeCamarade> | But how do I compile a same file for POSIX and Win32? No #define, as it is ... |
| 08:10:14 | <quicksilver> | use CPP or something similar |
| 08:10:29 | <quicksilver> | or use a higher level library which was itself compiled using CPP :P |
| 08:10:36 | <raxas> | quicksilver: I think your concept of animation is worth for complete decouple from GL, so it could be used for GUIs also |
| 08:11:04 | <vegai> | ACTION tries to desperately see what the small text in Hwn-cover.png reads |
| 08:11:29 | <quicksilver> | raxas: the coupling to openGL is entirely trivial |
| 08:11:34 | <LeCamarade> | Preprocessor is evil. :o) But still. |
| 08:11:42 | <quicksilver> | raxas: just my choice to use 'GLdouble' as a 'time variable' |
| 08:11:51 | <quicksilver> | raxas: other than that, the code is graphics layer independent |
| 08:11:52 | <wli> | I'm just lost for the moment wrt. how to build Haskell apps on Windows. |
| 08:12:13 | <vegai> | hmm, could libmpd be easily included in xmobar...? |
| 08:12:18 | <sjanssen> | wli: ghc --make? |
| 08:12:22 | <quicksilver> | wli: simple three step algorithm |
| 08:12:27 | <vegai> | I currently have a c-program that I call every second... that's a bit wasteful |
| 08:12:35 | <quicksilver> | wli: (1) find ndm (2) ask ndm to build your app (3) hope he has time. |
| 08:14:28 | <wli> | Well, if ghc --make works I just need to figure out how to do that in Windows. |
| 08:14:40 | <sjanssen> | vegai: that should be pretty easy, assuming libmpd's API is nice |
| 08:15:09 | <earthy> | wli: doing ghc --make in windows is as simple as navigating to the right directory in cmd.exe and typing it in |
| 08:15:44 | <earthy> | (and doing cabal installs is almost as easy) |
| 08:15:59 | <earthy> | ofcourse, you could go for VSHaskell... but that's pushing it imho |
| 08:16:20 | <wli> | It doesn't seem to have a good idea of where paths are, and I've not worked out how to save one. |
| 08:19:05 | <wli> | But I think I can work around it once I find the ghc binary. |
| 08:22:56 | <wli> | earthy: That's pretty good news. |
| 08:23:19 | <earthy> | hm. must be some of that way-old dos knowledge still lingering around, but, um, %PATH% should give you your path, right? :) |
| 08:24:12 | <wli> | I see something. |
| 08:24:26 | <wli> | ghc is actually in my path. |
| 08:43:15 | <hpaste> | iesahin pasted "basic IO problem" at http://hpaste.org/3480 |
| 08:44:21 | <iesahin> | hello all, a newbie here :) |
| 08:45:08 | <iesahin> | i'm trying to understand how to use IO with non-IO for the file I just pasted |
| 08:45:13 | <quicksilver> | iesahin: what seems to be the problem? |
| 08:45:20 | <iesahin> | it gives following |
| 08:45:27 | <iesahin> | /home/iesahin/Research/Current/program/CaseLibrary.lhs:241:64: |
| 08:45:28 | <iesahin> | Couldn't match expected type `Case' against inferred type `IO Case' |
| 08:45:28 | <iesahin> | Expected type: [Case] |
| 08:45:28 | <iesahin> | Inferred type: [IO Case] |
| 08:45:30 | <iesahin> | In the second argument of `($)', namely |
| 08:45:34 | <iesahin> | `map buildCaseFromFile initialCaseList' |
| 08:45:37 | <iesahin> | In a 'do' expression: |
| 08:45:40 | <iesahin> | records <- (indexify (Map.empty)) |
| 08:45:43 | <iesahin> | $ (map buildCaseFromFile initialCaseList) |
| 08:45:46 | <iesahin> | Failed, modules loaded: Infon, SITARUtils. |
| 08:45:59 | <iesahin> | in the last function, buildInitialCaseLibrary |
| 08:46:07 | <quicksilver> | iesahin: in future put the error in hpaste too, if it's more than a couple of lines |
| 08:46:17 | <quicksilver> | iesahin: anyhow, the problem lies with your use of 'map' |
| 08:46:18 | <iesahin> | ok |
| 08:46:24 | <quicksilver> | iesahin: since buildCaseFromFile is in the IO monad |
| 08:46:32 | <quicksilver> | iesahin: you want to use mapM |
| 08:46:35 | <quicksilver> | :t mapM |
| 08:46:37 | <lambdabot> | forall a (m :: * -> *) b. (Monad m) => (a -> m b) -> [a] -> m [b] |
| 08:46:53 | <iesahin> | oh |
| 08:46:59 | <quicksilver> | iesahin: mapM buildCaseFromFile initialCaseList will have type 'IO [Case]\ |
| 08:47:16 | <quicksilver> | iesahin: then you want to change that $ to a `liftM` |
| 08:47:30 | <quicksilver> | liftM is the way to apply a pure function (indexify) to a monadic value |
| 08:47:34 | <quicksilver> | putting it all together, it is |
| 08:47:49 | <quicksilver> | records <- indexify (Map.empty) `liftM` mapM buildCaseFromFile initialCaseList |
| 08:48:45 | <iesahin> | liftM in which module? |
| 08:49:26 | <iesahin> | let me find myself, thanks quicksilver, i couldn't find this myself, thank you very much |
| 08:49:35 | <iesahin> | :) |
| 08:50:54 | <aleator> | Hey, is there example of using IconView in gtk2hs anywhere? |
| 08:51:36 | <dcoutts> | aleator: I don't think there is actually, if you'd like to contribute one that'd be great. |
| 08:51:56 | <quicksilver> | iesahin: Control.Monad |
| 08:52:08 | <quicksilver> | @index liftM |
| 08:52:08 | <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 |
| 08:52:15 | <quicksilver> | iesahin: lambdabot knows many things :) |
| 08:52:56 | <quicksilver> | iesahin: if you choose to import Control.Applicative, you can actually write `liftM` as <$>. Which looks nicely 'like but slifhtly different' to the $ you had before |
| 08:53:52 | <aleator> | dcoutts: If I manage to make one, I'll contribute. How do I set the pixbuf column with Graphics.UI.Gtk.ModelView? |
| 08:53:55 | <iesahin> | quicksilver: lambdabot knows, but i don't :) |
| 08:56:10 | <dcoutts> | aleator: iconViewSetPixbufSource |
| 08:56:20 | <iesahin> | quicksilver: it worked, thanks a lot |
| 08:56:52 | <aleator> | dcoutts: Oh. I see. Didn't find that in the api doc. |
| 08:57:06 | <dcoutts> | aleator: so you have to set the IconView's model and then use iconViewSetPixbufSource suppling an extractor function that gets Pixbufs from the model |
| 08:57:48 | <dcoutts> | aleator: ah, seems that's only in the darcs version, not in 0.9.12 |
| 08:58:03 | <aleator> | Ok.. I thought I was blind. |
| 08:58:11 | <dcoutts> | no :-) |
| 08:58:12 | <aleator> | So, darcs version it is then.. |
| 08:59:14 | <aleator> | dcoutts: I think that is enough for some example, I'll get back to you when I get something working. |
| 08:59:30 | <dcoutts> | aleator: ok great |
| 09:16:14 | <roconnor> | is a -> b -> m c isomorphic to a -> m (b -> m c) ? |
| 09:17:29 | <wolverian> | I wish hackage had the haddock docs too. they tell so much mor about a package than a simple description |
| 09:18:52 | <aleator> | Could not find module `Distribution.Simple.Program' ? while installing happy. |
| 09:20:10 | <aleator> | ah.. old version |
| 09:25:19 | <EvilTerran> | ?quote |
| 09:25:19 | <lambdabot> | Plugin `quote' failed with: getRandItem: empty list |
| 09:25:27 | <EvilTerran> | -.- |
| 09:26:04 | <astrolabe> | roconnor: It seems like it to me, but I'm not positive. |
| 09:26:48 | <Cale> | Not quite, I don't think. |
| 09:27:57 | <Cale> | You can turn one into the other, but the composition of the obvious maps doesn't seem to be the identity |
| 09:28:10 | <Cale> | a -> m (b -> m c) is conceptually "larger" |
| 09:29:34 | <aleator> | Is happy supposed to build with cabal-1.1.6.2? |
| 09:30:03 | <mux> | http://xkcd.com/303/ |
| 09:30:04 | <lambdabot> | Title: xkcd - A webcomic of romance, sarcasm, math, and language - By Randall Munroe |
| 09:30:41 | <mux> | ACTION note it's hard to use the "compiling" excuse at work for him, since he's doing perl |
| 09:34:22 | <Taejo> | mux, I prefer it to Wednesday's, but I still think xkcd was better when he worked at Nasa |
| 09:35:16 | <hpaste> | Cale pasted "not quite an isomorphism" at http://hpaste.org/3481 |
| 09:35:40 | <osfameron> | mux: you could be running your test suite :-) |
| 09:37:16 | <mux> | osfameron: *nods* |
| 09:38:08 | <Cale> | Kind of like a closure operator of sorts. |
| 09:39:55 | <Cale> | Under a funny ordering where one value is considered larger than another if it has the same effects, but they happen later. |
| 09:40:58 | <quicksilver> | Cale: they're isomorphic if the intention is that you supply 'a' and 'b' at the same time |
| 09:41:33 | <quicksilver> | maybe that's a silly way of putting it |
| 09:41:41 | <Capso> | Any Haskell Web Servers out there? |
| 09:41:57 | <Capso> | Or implementations of Haskell for Apache? |
| 09:42:16 | <Capso> | I know HWS... but is there any other that is more preferred by you guys? |
| 09:42:28 | <quicksilver> | haskell-for-apache most people use fastcgi |
| 09:42:32 | <Cale> | well, and you only intend to use the returned function once |
| 09:42:32 | <quicksilver> | seems like the sensible choice |
| 09:43:04 | <quicksilver> | Cale: yes, if you supply a and b "at the same time" then you don't save the intermediate value. But yes. :) |
| 09:43:18 | <hpaste> | Cale annotated "not quite an isomorphism" with "additional examples" at http://hpaste.org/3481#a1 |
| 09:43:19 | <quicksilver> | Cale: hAppS also embeds its own HTTP server I believe |
| 09:43:50 | <quicksilver> | Capso: that was for you :P |
| 09:44:04 | <Cale> | hmm... |
| 09:44:11 | <quicksilver> | Cale: I think they might be isomorphic if you restrict to Applicative |
| 09:44:21 | <quicksilver> | Cale: because Applicative has this normal-form theorem |
| 09:44:52 | <Cale> | Capso: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hxweb-0.1 maybe? |
| 09:44:54 | <lambdabot> | http://tinyurl.com/33x9ha |
| 09:45:10 | <Cale> | http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Web -- there's not enough here at the moment ;) |
| 09:45:36 | <Cale> | You can write CGI programs fairly easily using the Network.CGI library. |
| 09:46:00 | <Cale> | http://haskell.org/haskellwiki/Applications_and_libraries/Web_programming -- there's a good deal more web stuff listed here |
| 09:46:02 | <lambdabot> | Title: Applications and libraries/Web programming - HaskellWiki, http://tinyurl.com/253xhy |
| 09:46:11 | <roconnor> | Cale: I was expecting reasoning with monad laws :) |
| 09:46:12 | <Capso> | Cale: I didn't really want to use *CGI. |
| 09:46:33 | <Capso> | Cale: I find it more secure to either have a dedicated Apache module, or to just use a backend webserver. |
| 09:46:42 | <Cale> | roconnor: I suppose I haven't shown that an isomorphism doesn't exist. |
| 09:47:02 | <Cale> | roconnor: However, the example provided is sort of convincing that they're not the same thing. |
| 09:47:33 | <Cale> | Capso: more secure? |
| 09:48:04 | <roconnor> | really? I'm not convinced. I figure what is going on is some sort of effect of GHCi not perfectly respecting the semantics of IO. |
| 09:48:12 | <roconnor> | but that is just a gues |
| 09:48:22 | <Cale> | roconnor: Well, with a -> m (b -> m c) |
| 09:48:58 | <Cale> | you have a function which returns an action which you can run (just once), and get a function which you can use a bunch of times thereafter, with later effects |
| 09:49:01 | <roconnor> | Cale: oh I see your other example |
| 09:49:26 | <roconnor> | I missed the double a in the first part of your second example |
| 09:49:31 | <Cale> | Yeah |
| 09:49:33 | <Capso> | Cale: Than FastCGI, yes. |
| 09:49:34 | <roconnor> | yeah, that is pretty convincing |
| 09:49:48 | <Cale> | roconnor: It's basically the same issue as m (m a) not being isomorphic to m a |
| 09:49:53 | <Capso> | Cale: Is there anything particularly wrong with, or bad about, HWS? |
| 09:50:18 | <Cale> | I don't know anything about HWS |
| 09:50:29 | <Cale> | It's kind of old though |
| 09:50:43 | <roconnor> | Cale: hmm. I sort of was reasoning that a -> m (b -> m c) would be the natural way of writing a curried function in the Kleisli catagory. |
| 09:50:48 | <matthew-_> | is there a nice curses binding for haskell? |
| 09:51:13 | <Cale> | roconnor: Well, of course, when you curry, there's potential for side effects after each parameter then. |
| 09:51:53 | <Cale> | whereas the "uncurried" form only allows for side effects to all happen at once when all the parameters are finally supplied |
| 09:51:54 | <roconnor> | but a curried function ought t be isomorphic to (a,b) -> m c shouldn't it? |
| 09:52:40 | <quicksilver> | Capso: people thing writing a web server is pretty easy |
| 09:52:46 | <Cale> | So I suppose that in the Kleisli category, currying/uncurrying isn't quite an isomorphism. |
| 09:52:54 | <quicksilver> | Capso: they are quite horrendously mistaken |
| 09:53:03 | <roconnor> | that strikes me as very odd |
| 09:53:07 | <quicksilver> | Capso: writing a webserver is phenonmenally fiddly and quite dull |
| 09:53:34 | <roconnor> | Cale: Are Kleisli categories not CCC? |
| 09:53:38 | <quicksilver> | Capso: it's better to use the work produced by the apache project than re-write :) |
| 09:53:43 | <Cale> | hmm... |
| 09:53:46 | <Botje> | I wrote a tiny webserver in haskell |
| 09:53:48 | <Botje> | 200 lines :) |
| 09:54:02 | <quicksilver> | the isomorphism between a -> b -> m c and (a,b) -> m c is a true isomorphism |
| 09:54:06 | <quicksilver> | (modulo bottoms) |
| 09:54:08 | <Capso> | quicksilver: Generalised 'solutions' tend to be worse. |
| 09:54:21 | <quicksilver> | the isomorphism only falls down when you pull the m further back along the chain |
| 09:54:22 | <Capso> | quicksilver: When it comes to efficiency and security. |
| 09:54:41 | <quicksilver> | Capso: quite true, but the apache project has a pretty good reputation for both those things. |
| 09:54:42 | <Cale> | Yeah, maybe we're just misjudging what the exponential object is |
| 09:55:09 | <quicksilver> | I'd wager that if you write your own CGI implementaiton (for your own web server) you'd introduce security issues |
| 09:55:09 | <Cale> | Of course it ought to be c^b = (b -> m c) |
| 09:55:13 | <quicksilver> | it's not easy to get that right :) |
| 09:55:18 | <Cale> | So yeah, that makes sense then :) |
| 09:55:21 | <roconnor> | Cale: so you think Kleisli categories outght to be CCC? I really wasn't sure |
| 09:55:35 | <Cale> | Yeah, it seems like they should be... |
| 09:55:57 | <roconnor> | and we want (c^b)^a isomorphic to (c^(b*a)) right? |
| 09:56:06 | <roconnor> | hence my confusion |
| 09:56:14 | <roconnor> | I hate it when my intuition leads me astry |
| 09:56:24 | <roconnor> | It means there is something I don't understand |
| 09:56:33 | <roconnor> | or worse, something that I wrongly understand |
| 09:56:35 | <Capso> | quicksilver: With multiple users to support, FastCGI implementation tends to be horrendous on all aspects. |
| 09:56:54 | <Cale> | We want a -> c^b to be isomorphic to (a,b) -> c |
| 09:57:29 | <roconnor> | and b -> c isomorphic to 1 -> c^b ? |
| 09:57:35 | <Cale> | Hehe, did you put that citation needed into wikipedia? |
| 09:57:37 | <roconnor> | oh |
| 09:57:53 | <roconnor> | 1 -> c^b isn't quite the same as c^b is it? |
| 09:57:54 | <Cale> | http://en.wikipedia.org/wiki/Cartesian_closed_category#Equational_theory -- hehe, check out the last equation |
| 09:57:56 | <lambdabot> | http://tinyurl.com/28sgjw |
| 09:58:46 | <roconnor> | citation needed! |
| 09:59:00 | <Cale> | Yeah, I think someone else had some doubts :) |
| 09:59:33 | <roconnor> | ACTION grabs a random catagory theory book |
| 09:59:41 | <Capso> | Cale: Do you use Haskell on your wiki? |
| 09:59:52 | <Cale> | Capso: no, it's a mediawiki |
| 10:00:05 | <Cale> | Capso: I have Haskell syntax highlighting though :) |
| 10:00:55 | <Cale> | Hmm, we have that X x 1 is isomorphic to X |
| 10:01:43 | <roconnor> | my book says Hom(a,c^b) isomorphic to Hom(a*b,c) |
| 10:01:47 | <Cale> | So if that's the case, then X -> Y is isomorphic to 1 x X -> Y, which is isomorphic to 1 -> Y^X |
| 10:02:16 | <Cale> | But 1 -> Y^X isn't necessarily quite the same thing Y^X |
| 10:02:29 | <Cale> | as* |
| 10:03:01 | <Cale> | Yeah, your book's isomorphism is all I think we get |
| 10:03:14 | <roconnor> | a -> m b needs to be isomorphic to () -> m (b^a) |
| 10:03:29 | <quicksilver> | erm 1 -> Y^X is a homset, clearly that's not the same as Y^X which is an obejct |
| 10:03:40 | <quicksilver> | do you perhaps mean (Y^X)^1 ? |
| 10:03:53 | <Cale> | well, right |
| 10:04:02 | <Cale> | They're not even the same kind of thing :) |
| 10:04:35 | <quicksilver> | X^1 is isomorphic to X in all CCCes, certainly |
| 10:04:41 | <Cale> | But in, say, Set, Y^X is "morally" the same thing as X -> Y |
| 10:04:55 | <Cale> | As it is in Hask |
| 10:05:07 | <quicksilver> | of course, but when try to reason carefully about Kleisli categories you have to be precise |
| 10:05:15 | <Cale> | But apparently not in CCC's in general. |
| 10:05:17 | <roconnor> | does this mean that a -> b is the exponential object rather than a -> m b? |
| 10:05:21 | <quicksilver> | or you'll get vconfused between arrows in one cat and arrows in the other |
| 10:05:51 | <Cale> | The Kleisli category has the same objects as the original, but different arrows. |
| 10:06:02 | <roconnor> | is () -> m (a -> b) isomorphic to a -> m b ... probably not. |
| 10:06:10 | <Cale> | no |
| 10:06:27 | <quicksilver> | definitely not |
| 10:06:33 | <roconnor> | well then, I shall head off to lunch, still puzzled. |
| 10:06:36 | <quicksilver> | :) |
| 10:06:59 | <quicksilver> | I think you need two different arrow symbols to express this comfortably in IRC |
| 10:07:00 | <Cale> | Well, I think Y^X consists of the arrows X -> MY |
| 10:07:07 | <Cale> | (in the original category) |
| 10:07:26 | <Cale> | Or the arrows X -> Y in the Kleisli category |
| 10:07:42 | <quicksilver> | and then, Y^1 is arrows () -> M Y |
| 10:07:56 | <quicksilver> | which is isomorphic to M Y *but* NOT to Y |
| 10:07:57 | <quicksilver> | :) |
| 10:08:56 | <Cale> | Okay, hmm. I thought I'd sorted this out, but it's still kind of strange. :) |
| 10:09:05 | <quicksilver> | which leads me to think that that is the wrong exponential |
| 10:09:28 | <Cale> | Maybe there really isn't a proper exponential. |
| 10:09:30 | <quicksilver> | I think the exponential must be 'normal arrow objects' not 'kleisli arrow object' |
| 10:10:00 | <Cale> | still... |
| 10:10:31 | <quicksilver> | then hom(a,c^b) is hom (a,(b->c)) which is a -> m (b -> c) |
| 10:10:52 | <quicksilver> | and we claim that corresponds to (a,b) -> m c |
| 10:11:28 | <Cale> | which is a lie, isn't it? |
| 10:11:36 | <quicksilver> | there's certaily a bijection |
| 10:11:43 | <quicksilver> | you showed it wasn't an isomorphism |
| 10:11:48 | <quicksilver> | but of course it doesn't have to be |
| 10:11:52 | <quicksilver> | it just has to be a natural bijection |
| 10:11:54 | <Cale> | It's not a bijection even, is it? |
| 10:12:03 | <Cale> | err... |
| 10:12:25 | <Cale> | Well, it'll be natural if we can write it in Haskell with a polymorphic type. We don't have to worry about that :) |
| 10:12:41 | <Cale> | But hmm |
| 10:13:16 | <quicksilver> | I'm surprised that google can't tell me if kleisli of CCC is CCC |
| 10:13:27 | <quicksilver> | I'm sure it's really obvious to anyone who knows |
| 10:14:42 | <wli> | ACTION goes about a GUI hello world. |
| 10:15:02 | <wli> | In the 14 years I've been programming I've never touched a GUI before. |
| 10:15:33 | <Cale> | quicksilver: that's no fun |
| 10:15:42 | <quicksilver> | :) |
| 10:16:07 | <quicksilver> | I note that 'isomorphism' between homsets doesn't mean anything anyway |
| 10:16:08 | <Cale> | ((a,b) -> m c) -> (a -> m (b -> c)) |
| 10:16:13 | <Cale> | no, it does |
| 10:16:14 | <quicksilver> | homsets don't have any structure |
| 10:16:19 | <quicksilver> | they're just sets... |
| 10:16:19 | <Cale> | yes they do |
| 10:16:26 | <Cale> | Hom is a bifunctor |
| 10:16:36 | <quicksilver> | yes, that's the naturality part |
| 10:16:42 | <quicksilver> | a particular homset is structureless though |
| 10:17:04 | <quicksilver> | it's just that taken as a whole, they line up like neat little soldiers |
| 10:17:04 | <Cale> | I wouldn't say that. |
| 10:17:53 | <Cale> | ((a,b) -> m c) -> (a -> m (b -> c)) -- is it even possible to write a function of this type? |
| 10:18:21 | <Cale> | We need monad-djinn :) |
| 10:19:02 | <Cale> | @djinn Monad m => ((a,b) -> m c) -> (a -> m (b -> c)) |
| 10:19:02 | <lambdabot> | Cannot parse command |
| 10:19:16 | <Cale> | @djinn (Monad m) => ((a,b) -> m c) -> (a -> m (b -> c)) |
| 10:19:29 | <quicksilver> | no, I don't believe there is |
| 10:19:34 | <quicksilver> | I think I was mistaken :) |
| 10:20:02 | <Cale> | I'm starting to think it's not really a CCC |
| 10:20:04 | <quicksilver> | you can't apply the action on the left until you get A and B |
| 10:20:13 | <Cale> | right |
| 10:20:18 | <quicksilver> | but the result you want to give causes its effects before getting B |
| 10:20:39 | <quicksilver> | so I think that convinces me it's not CCC with the 'normal' exponential |
| 10:20:57 | <quicksilver> | and I previously convinced myself it's not CCC with the 'kleisli exponential' |
| 10:21:07 | <quicksilver> | simply because M Y is not isomrophic to Y |
| 10:22:06 | <Cale> | Hang on, does the Kleisli category even have products? |
| 10:22:15 | <quicksilver> | according to Taylor, if C is symmetric monoidal closed, then the *co*-Kleisli is CCC |
| 10:23:05 | <Cale> | There's only one natural object to assign to X x Y in the Kleisli category, as far as I can imagine |
| 10:23:11 | <Cale> | and yet |
| 10:23:39 | <Cale> | If you have Kleisli arrows Y -> X1 and Y -> X2 |
| 10:23:50 | <Cale> | There's supposed to be a *unique* map Y -> X1 x X2 |
| 10:23:53 | <quicksilver> | the obvious choice for projections is return .fst and return . snd, I suppose |
| 10:24:19 | <Cale> | (call it f) such that f . pi_1 = f_1 and f . pi_2 = f_2 |
| 10:24:25 | <Cale> | But that's totally false |
| 10:24:44 | <Cale> | Because there's at least two choices for that map. |
| 10:25:03 | <Cale> | You can do the effects in either order. |
| 10:25:38 | <Cale> | Or only half of the effects |
| 10:25:44 | <quicksilver> | looks like you couldn't get a symettric product |
| 10:25:46 | <Cale> | but you can't get the composites to work out |
| 10:25:54 | <quicksilver> | you could get an asymmetric pseudo-product that way |
| 10:26:11 | <Cale> | You're supposed to have f . pi_1 = f_1 |
| 10:26:13 | <quicksilver> | "carry out all effects, left-to-right" |
| 10:26:21 | <quicksilver> | oh yes hmm |
| 10:26:26 | <Cale> | But f_2's effects would have to be carried out by f |
| 10:26:28 | <quicksilver> | it needs to forget the effects you didn't choose |
| 10:26:31 | <Cale> | yeah |
| 10:26:35 | <quicksilver> | I agree, that doesn't sound possible |
| 10:26:51 | <Cale> | So products don't even exist. |
| 10:27:02 | <Cale> | Is there a terminal object? |
| 10:27:18 | <Cale> | No! |
| 10:27:35 | <Cale> | (In general, at least) |
| 10:28:00 | <Cale> | For example, with IO. Its Kleisli category can't have a terminal object. |
| 10:28:18 | <aleator> | How am I supposed to compile happy? Old cabal, darcs cabal or maul the happy Setup.lhs? |
| 10:28:33 | <Cale> | Because you can always print out one of two different things, so there's at least two distinct maps going to any object. |
| 10:29:39 | <Cale> | aleator: I've been taking the approach of using cabal install and hoping for the best |
| 10:30:15 | <Cale> | (though cabal-install has at least one very annoying bug) |
| 10:30:32 | <aleator> | it fails with cannot find 'Distribution.Simple.Program'. |
| 10:31:16 | <Cale> | That's not listed in the GHC docs, so maybe it's new |
| 10:31:46 | <Cale> | http://www.haskell.org/cabal/release/rc/doc/API/Cabal/Distribution-Simple-Program.html -- it is listed here though |
| 10:31:48 | <lambdabot> | http://tinyurl.com/2w4t24 |
| 10:31:59 | <aleator> | So I get to build myself a new cabal as well? |
| 10:32:30 | <Cale> | It appears to only occur in that rc branch... |
| 10:32:33 | <sjanssen> | aleator: or use an older version of happy |
| 10:32:51 | <Cale> | er, oh |
| 10:32:54 | <Cale> | It's also in 1.2.1 |
| 10:33:05 | <Cale> | and 1.2.0 |
| 10:33:22 | <Cale> | But not 1.1.6.2 |
| 10:33:37 | <aleator> | yep. new cabal it is then.. |
| 10:33:49 | <Cale> | quicksilver: so that's kind of embarassing :) |
| 10:35:08 | <Cale> | roconnor: In the general case, the Kleisli category will fail all three of the properties to be a CCC. |
| 10:35:56 | <Cale> | roconnor: (check out the Kleisli category for IO or State Bool, say) |
| 10:36:05 | <quicksilver> | Cale: ok, well I think that makes sense at least |
| 10:36:09 | <quicksilver> | Cale: why did we want it to be CCC? |
| 10:36:20 | <EvilTerran> | CCC? |
| 10:36:21 | <Cale> | Because we wanted to talk about currying |
| 10:36:24 | <SamB_XP> | a CCC? |
| 10:36:28 | <SamB_XP> | credit card company? |
| 10:36:32 | <Cale> | Cartesian closed category |
| 10:36:41 | <Cale> | Currying only makes sense in CCC's. |
| 10:36:53 | <SamB_XP> | ahhh |
| 10:36:56 | <SamB_XP> | more Cs! |
| 10:37:00 | <quicksilver> | ah yes, I remember |
| 10:37:19 | <quicksilver> | yeah, I agree with teh conclusion. currying make no sense in general monads |
| 10:37:20 | <SamB_XP> | that's more Cs than my old school |
| 10:41:56 | <EvilTerran> | ACTION was thinking "christchurch college"... |
| 10:42:26 | <quicksilver> | there is something called 'Cambridge College Cambridge' |
| 10:42:35 | <quicksilver> | it is, however, not one of the colleges of the main university :) |
| 10:46:01 | <EvilTerran> | there seems to be no christchurch college cambridge, unfortunately. i was hoping there'd be a CCCC |
| 10:49:23 | <aleator> | Gah! "Preprocessing executables for happy-1.17... Setup.lhs: The program happy is required but it could not be found" |
| 10:57:52 | <dcoutts> | aleator: you didn't do clean before building did you? |
| 10:59:03 | <aleator> | dcoutts: I need to do that with just opened tar of the sources? |
| 10:59:08 | <dcoutts> | JaffaCake: it seems people are running into problems even though they did not clean. I'm not sure why yet. |
| 10:59:29 | <dcoutts> | aleator: no, it should just work, but cleaning first might make it go wrong. |
| 10:59:41 | <aleator> | Well, didn't clean, does not work even with cleaning. |
| 11:00:08 | <JaffaCake> | hmm, let me try that again here |
| 11:00:09 | <JaffaCake> | aleator: you definitely have dist/build/Parser.hs? |
| 11:00:10 | <dcoutts> | ACTION deletes happy and tries |
| 11:00:56 | <aleator> | JaffaCake: no.. |
| 11:01:08 | <JaffaCake> | in the tarball, that file should be there |
| 11:01:18 | <dcoutts> | JaffaCake: it wants dist/build/happy/happy-tmp/Parser.hs I think |
| 11:01:44 | <dcoutts> | executables and libs have different build dirs |
| 11:01:56 | <JaffaCake> | why's that? it didn't here |
| 11:02:10 | <dcoutts> | JaffaCake: using recent Cabal ? |
| 11:02:23 | <aleator> | JaffaCake: Ah, now I have. I cleaned when dcoutts mentioned that. |
| 11:02:37 | <JaffaCake> | dcoutts: yes |
| 11:02:46 | <JaffaCake> | well, a couple of weeks or so old |
| 11:03:05 | <dcoutts> | there was a bug a while ago where we were putting exe's generated files in the wrong place |
| 11:04:05 | <dcoutts> | JaffaCake: so when I move the files to dist/build/happy/happy-tmp/ then it works |
| 11:04:45 | <dcoutts> | which makes sense since that is where it would put generated files for an executable |
| 11:04:50 | <aleator> | dcoutts: Ah! Thanks. Now it builds. |
| 11:05:12 | <dcoutts> | JaffaCake: I'd forgotten exactly where they go |
| 11:05:30 | <JaffaCake> | hmm, maybe the Cabal I was using had that bug, then |
| 11:06:24 | <JaffaCake> | I'll fix the tarball and upload a new one |
| 11:08:51 | <dcoutts> | and at some point Cabal will catch up and put generated-shipped files in the right place in the tarball |
| 11:37:52 | <Igloo> | dons: publish.hs works for me with the 6.8 branch |
| 12:02:38 | <vincenz> | hallo |
| 12:16:08 | <aleator> | dcoutts, jaffacake: Alex has the same problem as happy. |
| 12:16:52 | <JaffaCake> | aleator: I haven't uploaded a new Alex version yet |
| 12:17:08 | <aleator> | Ok. Just making sure you know. |
| 12:17:27 | <JaffaCake> | thanks - I'll try to get to it soon |
| 12:29:54 | <aleator> | gtk2hs is not yielding to my efforts: http://pastebin.com/d79e5eef9 |
| 12:30:15 | <ddarius> | aleator: Perhaps you should get it drunk first. |
| 12:30:46 | <dcoutts_> | aleator: hmm |
| 12:30:48 | <aleator> | ddarius: Doesn't work with girls so probably doesn't either with computers. |
| 12:32:17 | <dcoutts_> | aleator: ok, gimme a sec. I'll tell you when to pull. |
| 12:32:28 | <aleator> | dcoutts: Ah cool! |
| 12:33:06 | <aleator> | dcoutts: Seems that you should be packaged with each gtk2hs distribution :) |
| 12:33:15 | <dcoutts_> | heh |
| 12:33:41 | <waern> | hehe :) |
| 12:34:09 | <waern> | the day dcoutts can package himself, Cabal has become the ultimate build system |
| 12:43:00 | <vincenz> | augustss: ping |
| 12:43:11 | <roconnor> | vincenz: ack |
| 12:43:16 | <vincenz> | roconnor: wrong person? |
| 12:43:22 | <roconnor> | ACTION man-in-the-middles |
| 12:43:28 | <vincenz> | roconnor: oh, ask him why he sent me that email? |
| 12:43:34 | <vincenz> | It was a bit out of the blue. |
| 12:43:39 | <roconnor> | :) |
| 12:43:51 | <nopoints> | hello roconnor :) |
| 12:44:22 | <roconnor> | nopoints: Did you get your package to install locally? |
| 12:44:36 | <nopoints> | no I am here to ask about that |
| 12:45:18 | <nopoints> | ./Setup.hs configure --user --prefix=`pwd` doesn't work for installing pointfree |
| 12:45:48 | <nopoints> | (or for installing lambdabot) |
| 12:46:11 | <vincenz> | roconnor: oh you're Eve? I thought you were a valid man-in-the-middle |
| 12:46:46 | <nopoints> | has anybody installed lambdabot locally? |
| 12:47:17 | <roconnor> | vincenz: um... he says that he sent the mail by mistake. |
| 12:47:20 | <vincenz> | ah ok |
| 12:47:27 | <vincenz> | roconnor: that clears up confusions :) |
| 12:47:32 | <roconnor> | vincenz: btw, I'm just making up the response |
| 12:47:33 | <vincenz> | well thanks for the raytracer :) |
| 12:47:36 | <roconnor> | I really have noidea |
| 12:47:39 | <vincenz> | roconnor: damn you |
| 12:48:07 | <vincenz> | ACTION spams roconnor with papers about c-types |
| 12:50:29 | <ZsoL> | hi |
| 12:52:08 | <roconnor> | @seen dons |
| 12:52:09 | <lambdabot> | dons is in #xmonad and #haskell. I last heard dons speak 13h 26m 53s ago. |
| 12:55:28 | <MyCatSchemes> | foldM_ can eat an infinite list, right? |
| 12:55:37 | <vincenz> | yes |
| 12:56:32 | <roconnor> | nopoints: I thought you were just going to install the pointless package. |
| 12:57:59 | <nopoints> | roconnor: it is called pointfree http://hackage.haskell.org/cgi-bin/hackage-scripts/package/pointfree-1.0.1 |
| 12:58:01 | <MyCatSchemes> | vincenz: danke. It was the "foldM is analogous to foldl", and since foldl can't touch infinite lists, that would be a bummer. |
| 12:58:02 | <lambdabot> | http://tinyurl.com/362ljm |
| 12:58:38 | <MyCatSchemes> | nopoints: it may be *called* pointfree, but everyone knows that what it really *is* is pointless. :) |
| 12:59:47 | <nopoints> | yes it is callled pointless when it is part of lambdabot |
| 13:00:14 | <ddarius> | :t foldl |
| 13:00:16 | <lambdabot> | forall a b. (a -> b -> a) -> a -> [b] -> a |
| 13:00:16 | <ddarius> | :t foldM |
| 13:00:18 | <lambdabot> | forall a b (m :: * -> *). (Monad m) => (a -> b -> m a) -> a -> [b] -> m a |
| 13:00:37 | <ddarius> | It is analogous to foldl, but you can, for example, "throw an exception". |
| 13:07:32 | <nopoints> | > pl \hs \n -> liftM (map Data.ByteString.length) (sequence $ map (\h->Data.ByteString.hGet h n) hs) |
| 13:07:32 | <lambdabot> | Parse error at "\hs" (column 5) |
| 13:08:24 | <Saizan_> | @pl \hs n -> liftM (map Data.ByteString.length) (sequence $ map (\h->Data.ByteString.hGet h n) hs) |
| 13:08:24 | <lambdabot> | ((fmap (map Data . ByteString . length) . sequence) .) . flip (map . (((Data . ByteString) .) .) . flip hGet) |
| 13:08:33 | <Saizan_> | lol |
| 13:08:50 | <Saizan_> | @pl \hs n -> liftM (map length) (sequence $ map (\h-> hGet h n) hs) |
| 13:08:51 | <lambdabot> | ((fmap (map length) . sequence) .) . flip (map . flip hGet) |
| 13:08:52 | <nopoints> | thanks Saizan_, I have never used lambdabot before |
| 13:11:07 | <vincenz> | ACTION groans at subtext |
| 13:11:54 | <ddarius> | Seems like an appropriate response. |
| 13:12:24 | <vincenz> | he's so overfocused on syntax |
| 13:12:36 | <vincenz> | and IDE |
| 13:12:45 | <vincenz> | "look you can google your code, look you can see your expressions nicely" |
| 13:13:02 | <vincenz> | ACTION bets it's insane to use on anything bigger than fibonacci |
| 13:13:09 | <vincenz> | I've seen an earlier version of it, it was insane |
| 13:13:25 | <matthew_-> | where's the monadic fibonacci code? |
| 13:13:45 | <osfameron> | @index unfoldr |
| 13:13:45 | <vincenz> | and seriously, how often do you deal with that many conditions |
| 13:13:46 | <lambdabot> | Data.List |
| 13:15:33 | <vincenz> | haha |
| 13:15:35 | <shapr> | @yow |
| 13:15:35 | <lambdabot> | Plugin `quote' failed with: getRandItem: empty list |
| 13:15:41 | <vincenz> | 'real programs have much hairier conditionals' |
| 13:15:45 | <vincenz> | no git, they have harier cflow |
| 13:15:45 | <shapr> | aww |
| 13:16:58 | <perspectival> | gwern: hello? |
| 13:40:39 | <roconnor> | @hoogle a -> a |
| 13:40:41 | <lambdabot> | Prelude.id :: a -> a |
| 13:40:41 | <lambdabot> | Control.Monad.Error.throwError :: MonadError e m => e -> m a |
| 13:40:41 | <lambdabot> | Control.Monad.State.put :: MonadState s m => s -> m () |
| 13:40:46 | <roconnor> | @hoogle sequence |
| 13:40:47 | <lambdabot> | Prelude.sequence :: Monad m => [m a] -> m [a] |
| 13:40:47 | <lambdabot> | Prelude.sequence_ :: Monad m => [m a] -> m () |
| 13:40:47 | <lambdabot> | Language.Haskell.TH.Syntax.sequenceQ :: [Q a] -> Q [a] |
| 13:41:24 | <roconnor> | throwError is near the top of my list when I think of a -> a :P |
| 13:41:56 | <nopoints> | @hoogle hGet |
| 13:41:57 | <lambdabot> | IO.hGetBuffering :: Handle -> IO BufferMode |
| 13:41:57 | <lambdabot> | IO.hGetChar :: Handle -> IO Char |
| 13:41:57 | <lambdabot> | IO.hGetContents :: Handle -> IO String |
| 13:42:31 | <nopoints> | so he doesn't search Data.Bytestring? |
| 13:42:45 | <quicksilver> | well you only see the first three hits |
| 13:42:49 | <quicksilver> | @hoogle chunks |
| 13:42:49 | <lambdabot> | No matches found |
| 13:42:57 | <quicksilver> | but, it looks like not |
| 13:43:07 | <quicksilver> | @hoogle fromChunks |
| 13:43:08 | <lambdabot> | No matches found |
| 13:43:58 | <nopoints> | @hoogle Handle -> Int -> IO ByteString |
| 13:43:59 | <lambdabot> | No matches, try a more general search |
| 13:46:06 | <nopoints> | @hoogle hGetNonBlocking |
| 13:46:06 | <lambdabot> | No matches found |
| 14:24:35 | <dcoutts_> | aleator: darce pull |
| 14:24:58 | <dcoutts_> | aleator: you'll also want to ./configure --disable-gstreamer as that bit is not compiling atm. |
| 14:25:32 | <MyCatSchemes> | *darcs |
| 14:25:45 | <MyCatSchemes> | (I know it's obvious but it's not nice to confuse people.) |
| 14:26:07 | <profmakx> | OMG! darce the new haskell RCS? |
| 14:26:12 | <profmakx> | *duq* |
| 14:27:40 | <ricky_clarkson> | Halp, I can't build darce on Windows. |
| 14:27:59 | <profmakx> | hm. i still cant build ghc on freebsd :( |
| 14:28:28 | <arcatan> | I can't build houses |
| 14:30:40 | <MyCatSchemes> | I can't build programs that work. |
| 14:30:46 | <Zao> | profmakx: 6.6.1 built fine out of ports the other day here, what's wrong? |
| 14:31:15 | <profmakx> | Zao, amd64, FreeBSD7 :) |
| 14:31:43 | <Zao> | Ah, on the wild side. i386, 6.2-REL here :) |
| 14:31:48 | <Zao> | I like my binary nvidia blobs. |
| 14:34:51 | <profmakx> | well... i played with the thought of going back to 6.2-release |
| 14:35:04 | <jedbrown> | Is it okay to have an instance of Num where ``_ * _ = undefined'' or is this bad? |
| 14:35:05 | <profmakx> | i386 |
| 14:35:09 | <profmakx> | but then again |
| 14:35:20 | <pgavin> | dcoutts: what's not compiling in gstreamer? |
| 14:35:20 | <lambdabot> | pgavin: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 14:36:26 | <dcoutts_> | pgavin: lemme check again... |
| 14:36:45 | <pgavin> | k |
| 14:37:16 | <dcoutts_> | pgavin: I was having problems applying all your patches |
| 14:37:17 | <dcoutts_> | some did not apply |
| 14:37:26 | <pgavin> | ok |
| 14:37:42 | <pgavin> | lemme see what you've got in the repo already |
| 14:37:53 | <dcoutts_> | but that might have been because I had some patches from you from earlier which you ended up not using |
| 14:38:06 | <dcoutts_> | so I unrecorded all the extra patches I had |
| 14:38:13 | <dcoutts_> | and applied your cumulative patch again |
| 14:38:25 | <dcoutts_> | I'm trying with that and I'll see if I can push without conflicts |
| 14:38:26 | <pgavin> | dcoutts_: |
| 14:38:38 | <pgavin> | dcoutts_: ok |
| 14:38:57 | <pgavin> | dcoutts_: I just got a macbook so I'm trying to get gtk2hs compiling on it |
| 14:39:49 | <dcoutts_> | ah nice |
| 14:40:10 | <pgavin> | it took me a bit just to get ghc to compile |
| 14:40:58 | <pgavin> | dcoutts: oh, I saw your message on the cabal list |
| 14:41:12 | <quicksilver> | pgavin: a bit being 'port install ghc' ? |
| 14:41:14 | <pgavin> | dcoutts_: about deps |
| 14:41:17 | <quicksilver> | pgavin: or you chose a different path? |
| 14:41:34 | <pgavin> | quicksilver: well, I'm using fink |
| 14:41:47 | <quicksilver> | I use fink and macports :P |
| 14:41:48 | <pgavin> | quicksilver: and I wanted ghc 6.8 |
| 14:41:52 | <quicksilver> | but I don't use fink for ghc |
| 14:41:55 | <quicksilver> | ah well, that's fair enough |
| 14:42:11 | <pgavin> | quicksilver: I used fink's ghc to bootstrap |
| 14:42:18 | <dcoutts_> | pgavin: yes, so we looked at your dep code at the hackathon. kolmodin studied it for some time and could not understand it or debug it :-( |
| 14:42:29 | <pgavin> | dcoutts_: lol |
| 14:42:34 | <dcoutts_> | pgavin: we need something that's comprehensible as well as something that works |
| 14:42:35 | <pgavin> | dcoutts_: is it that bad? |
| 14:42:49 | <pgavin> | dcoutts_: I'm not the best at documenting I suppose |
| 14:43:01 | <dcoutts_> | pgavin: apparently it worked first time, but doing a re-build did not work properly |
| 14:43:07 | <pgavin> | dcoutts_: hmm |
| 14:43:27 | <dcoutts_> | pgavin: I don't think it's that. The issue is cleanly separating things and being able to specify and test a design. |
| 14:43:29 | <pgavin> | dcoutts_: yeah, it's still a bit buggy |
| 14:43:45 | <pgavin> | dcoutts_: right |
| 14:44:01 | <dcoutts_> | pgavin: being able to write a QC specifications of what make should actually do is pretty important |
| 14:44:16 | <pgavin> | dcoutts_: good point |
| 14:44:52 | <pgavin> | dcoutts_: It's more important to me that cabal has some kind of dependency system than that it has *my* dependency system |
| 14:45:50 | <dcoutts_> | pgavin: we'd love to have your contributions |
| 14:46:20 | <pgavin> | dcoutts_: sure, if there's anything you have in mind thaqt I can do |
| 14:46:24 | <dcoutts_> | pgavin: perhaps you can help us with specification / unit tests or torture tests |
| 14:46:30 | <pgavin> | sure |
| 14:46:47 | <dcoutts_> | pgavin: tricky examples that we need to get right, and ways of checking we're doing those examples correctly |
| 14:47:01 | <dcoutts_> | pgavin: eg search path shadowing bugs, they're nice |
| 14:47:33 | <pgavin> | dcoutts_: ok, maybe like a test suite of example cabal packages |
| 14:48:03 | <dcoutts_> | pgavin: have you looked at the code I posted |
| 14:48:26 | <pgavin> | I scanned it |
| 14:49:07 | <dcoutts_> | pgavin: I was hoping we'd be able to express most of the tricky cases in that pure framework |
| 14:49:18 | <dcoutts_> | it being pure makes it much easier to automate tests |
| 14:49:39 | <pgavin> | ok, gotcha |
| 14:49:40 | <dcoutts_> | as we get more info on the internals, and we can use QC |
| 14:49:58 | <dcoutts_> | pgavin: try the trace stuff, it's really cute |
| 14:50:26 | <dcoutts_> | pgavin: we get the full history of the build process in terms of the primitive actions like reading & writing files |
| 14:50:40 | <dcoutts_> | pgavin: if we need more actions recorded in the trace we can do that, eg running programs |
| 14:51:04 | <pgavin> | dcoutts_: I saw that, its pretty cool |
| 14:51:05 | <quicksilver> | dcoutts_: that sounds intriguingly clever? |
| 14:51:18 | <quicksilver> | dcoutts_: are you autogenerating dependencies based on system traces? |
| 14:51:50 | <dcoutts_> | quicksilver: no, generating traces from simulations of build processes |
| 14:51:51 | <dcoutts_> | http://www.haskell.org/pipermail/cabal-devel/2007-October/001297.html |
| 14:51:54 | <lambdabot> | Title: proptotype of make style dep stuff, http://tinyurl.com/2odhmr |
| 14:51:58 | <pgavin> | dcoutts_: and write out those straight line build scripts you were talking about before |
| 14:52:39 | <dcoutts_> | pgavin: I'd not thought of that. I was more thinking that the traces are the right thing to be making specifications about. |
| 14:52:54 | <pgavin> | dcoutts_: ah, ok |
| 14:52:58 | <dcoutts_> | pgavin: I mean, how exactly do we specify make? |
| 14:53:10 | <dcoutts_> | what does it do? how do we see what it does? |
| 14:53:21 | <dcoutts_> | how do we know it's doing the right thing |
| 14:53:23 | <pgavin> | dcoutts_: by the resulting commands that are executed? |
| 14:53:40 | <dcoutts_> | yes, and the order and stuff like that |
| 14:54:00 | <dcoutts_> | and possibly the state of the system at various intermediate stages |
| 14:54:13 | <pgavin> | dcoutts_: the idea to parameterize the monad is really great |
| 14:54:24 | <dcoutts_> | it's pretty cunning, not my idea I think |
| 14:54:41 | <dcoutts_> | I think it was nominolo's idea, or maybe kolmodin |
| 14:54:47 | <dcoutts_> | but it is a good idea I think |
| 14:55:01 | <pgavin> | dcoutts_: for testing it's perfect |
| 14:55:17 | <nominolo> | i wanted easy testing of this stuff |
| 14:55:25 | <dcoutts_> | and it allows optimising, since the monad can carry caches etc |
| 14:55:28 | <nominolo> | the Cabal test suite is terrible to maintain |
| 14:55:34 | <dcoutts_> | heh, yeah. |
| 14:55:45 | <dcoutts_> | note how we don't maintain it |
| 14:55:49 | <pgavin> | lol |
| 14:56:06 | <nominolo> | yeah, we don't even try ... |
| 14:56:26 | <dcoutts_> | quicksilver: mind you you could get a similar trace from a real build, using strace on the processes. You could find out what files they read and check your deps are correct. |
| 14:56:35 | <pgavin> | @type (<?>) |
| 14:56:37 | <lambdabot> | Not in scope: `<?>' |
| 14:56:48 | <quicksilver> | dcoutts_: yes, it would be very similar |
| 14:56:57 | <pgavin> | @hoogle <?> |
| 14:56:57 | <lambdabot> | Text.ParserCombinators.Parsec.Prim.(<?>) :: GenParser tok st a -> String -> GenParser tok st a |
| 14:56:59 | <quicksilver> | dcoutts_: someone did something rather like that for debian, years ago |
| 14:57:11 | <dcoutts_> | quicksilver: it might allow us to check our QC specs on real builds |
| 14:57:26 | <dcoutts_> | quicksilver: it'd be a pretty heavy weight but possibly very effective QA tool |
| 14:57:59 | <quicksilver> | ACTION nods |
| 14:58:16 | <quicksilver> | the only really reliable way to check your deps are right is to build test in a sandbox |
| 14:58:22 | <quicksilver> | which is what debian does anyway |
| 14:58:31 | <quicksilver> | not for that reason; it does that for cross-compilation |
| 14:58:40 | <quicksilver> | but the side-effect is that the build deps get checked |
| 14:59:14 | <mrd> | @seen augustss |
| 14:59:14 | <lambdabot> | augustss is in #haskell. I don't know when augustss last spoke. |
| 14:59:43 | <pgavin> | dcoutts_: ok, well I gotta go for now, I'll play with the code some when I get a chance |
| 14:59:55 | <dcoutts_> | pgavin: ok, see you |
| 15:02:52 | <mrd> | @tell augustss another small error: snd = \a:*.\b:*.\p:(Pair a b).split a b b (\x:a.\y:b.y) p -- rather than "split a b a" |
| 15:02:52 | <lambdabot> | Consider it noted. |
| 15:03:36 | <sebell> | Hmm. Can I use groups/registers with Text.Regex.Posix? I'd like to get a list of all groups in the match |
| 15:13:42 | <quicksilver> | sebell: yes |
| 15:13:49 | <quicksilver> | sebell: it's all overloaded into the return type |
| 15:14:00 | <quicksilver> | sebell: accept some suitably sick looking return type and you get all the groups |
| 15:14:47 | <sebell> | quicksilver: Ah I see that in RegexContext. Thanks! |
| 15:19:00 | <quicksilver> | actually I think it's suddenly dawned on me what my *real* objection to regexes overloading is |
| 15:19:09 | <quicksilver> | it's not the horrendous numbers of overloads |
| 15:19:19 | <quicksilver> | it's the way it overloads innocent looking types like lists of tuples |
| 15:19:24 | <quicksilver> | would be much nicer with named types |
| 15:19:36 | <quicksilver> | I must tell ChrisK (?) if I ever see him again |
| 15:19:52 | <shapr> | @seen TuringTest |
| 15:19:52 | <lambdabot> | Last time I saw TuringTest was when I left ##logic, #darcs, #gentoo-haskell, #ghc, #haskell, #haskell-blah, #haskell-overflow, #haskell-soc, #jtiger, #parrot, #perl6, #scala, #scannedinavian, # |
| 15:19:52 | <lambdabot> | unicycling and #xmonad 6d 23h 6m 3s ago, and . |
| 15:20:41 | <bos> | @seen glguy |
| 15:20:42 | <lambdabot> | I saw glguy leaving #haskell and #xmonad 5h 20m 23s ago, and . |
| 15:20:52 | <quicksilver> | (foo =~ bar) :: ListOfAllGroups |
| 15:21:02 | <quicksilver> | sort of thing |
| 15:21:05 | <quicksilver> | would be much nicer |
| 15:21:40 | <roconnor> | > ln 100 |
| 15:21:41 | <lambdabot> | Not in scope: `ln' |
| 15:21:46 | <roconnor> | > log 100 |
| 15:21:48 | <lambdabot> | 4.605170185988092 |
| 15:22:22 | <sebell> | quicksilver: It looks like I have to use MatchResult or MatchText -- both are kindof ugly. |
| 15:23:33 | <byorgey> | @src unfoldr |
| 15:23:33 | <lambdabot> | unfoldr f b = case f b of |
| 15:23:33 | <lambdabot> | Just (a,new_b) -> a : unfoldr f new_b |
| 15:23:33 | <lambdabot> | Nothing -> [] |
| 15:24:22 | <luqui> | @t unfoldr |
| 15:24:22 | <lambdabot> | Maybe you meant: tell temp thank you thanks thx time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ? @ ft v |
| 15:24:28 | <luqui> | :t unfoldr |
| 15:24:29 | <lambdabot> | forall b a. (b -> Maybe (a, b)) -> b -> [a] |
| 15:24:41 | <quicksilver> | sebell: matchResult is most general |
| 15:24:51 | <luqui> | could have sworn it didn't mention maybe... |
| 15:25:07 | <quicksilver> | sebell: otherwise there is the (String,String,String,[String]) form |
| 15:26:12 | <mcp_> | | (head e == last e) = istPal(e) <-- Is the code i currently have. I'd like to print e to stdout. How can i add a print statement (without getting syntax errors) |
| 15:26:40 | <quicksilver> | mcp_: short answer you cant, this is a pure language |
| 15:26:49 | <quicksilver> | mcp_: however there is something called Debug.Trace which cheats |
| 15:27:11 | <quicksilver> | even then you may not find the results as you expect, due to laziness |
| 15:27:11 | <mcp_> | quicksilver, can u tell me how that would work? |
| 15:27:29 | <sebell> | quicksilver: That's ok -- now how to determine what RegexContext a b (b, b, b, [b]) is supposed to mean without you telling me? ;) |
| 15:27:32 | <mcp_> | quicksilver, wrong oder of outputs is no problem for me |
| 15:27:33 | <quicksilver> | :t Debug.Trace.trace |
| 15:27:34 | <lambdabot> | forall a. String -> a -> a |
| 15:27:58 | <quicksilver> | mcp_: trace ("Hello I am here " ++ show e) istPal(e) |
| 15:31:24 | <mcp_> | quicksilver, i get "undefine variable trace". So I tried "import Debug" but that didnt work either. |
| 15:31:31 | <quicksilver> | mcp_: import Debug.Trace |
| 15:31:56 | <mcp_> | quicksilver, stupid me, works now, thanks |
| 15:32:01 | <quicksilver> | oh, I bracketted it wrong of course |
| 15:32:08 | <quicksilver> | mcp_: trace ("Hello I am here " ++ show e) (istPal e) |
| 15:32:13 | <quicksilver> | would be more likely to work :) |
| 15:34:17 | <dcoutts> | yo SyntaxNinja |
| 15:34:22 | <SyntaxNinja> | y0 |
| 15:34:26 | <dcoutts> | :-) |
| 15:35:09 | <dcoutts> | SyntaxNinja: we've finally started looking at doing dep analysis in Cabal |
| 15:35:36 | <cizra> | I bet there's a function in haskell that produces every possible pair out of a list. Is that true? |
| 15:35:55 | <dcoutts> | SyntaxNinja: I sent a overly long code walk through to cabal-devel this morning with code from nominolo, kolmodin and me. |
| 15:35:58 | <kpreid> | > liftM2 (,) [1,2,3] "abc" |
| 15:36:03 | <lambdabot> | [(1,'a'),(1,'b'),(1,'c'),(2,'a'),(2,'b'),(2,'c'),(3,'a'),(3,'b'),(3,'c')] |
| 15:36:23 | <kpreid> | > let l = [1,2,3] in liftM2 (,) l l |
| 15:36:24 | <lambdabot> | [(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)] |
| 15:36:35 | <kpreid> | > join (liftM2 (,)) [1,2,3] |
| 15:36:36 | <lambdabot> | [(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)] |
| 15:36:43 | <cizra> | ahha! |
| 15:36:52 | <dcoutts> | ACTION prefers (\xs -> (,) <$> xs <*> xs) |
| 15:37:20 | <cizra> | Thank you very much. |
| 15:37:23 | <kpreid> | @type <*> |
| 15:37:24 | <lambdabot> | parse error on input `<*>' |
| 15:37:26 | <allbery_b> | liftA2? |
| 15:37:27 | <kpreid> | @type (<*>) |
| 15:37:28 | <lambdabot> | forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b |
| 15:37:33 | <kpreid> | ah, ap |
| 15:38:06 | <sebell> | quicksilver: Hmm.. I have to add a type annotation even when matching (_,_,_,g) = s =~ pat |
| 15:38:16 | <luqui> | @type <$> |
| 15:38:17 | <lambdabot> | parse error on input `<$>' |
| 15:38:22 | <luqui> | @type (<$>) |
| 15:38:23 | <lambdabot> | forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b |
| 15:38:23 | <luqui> | duh |
| 15:38:53 | <quicksilver> | sebell: yeah, the instance selection isn't that clever |
| 15:39:06 | <sebell> | :( |
| 15:39:12 | <quicksilver> | kpreid: <$> is fmap and <*> is ap |
| 15:39:40 | <dcoutts> | well, for a monad they are |
| 15:39:45 | <quicksilver> | right |
| 15:39:45 | <kpreid> | I figured, just from the usage pattern |
| 15:40:05 | <dcoutts> | but there are types that are instances of Applicative which are not in the Monad class |
| 15:53:15 | <MyCatSchemes> | :t forkIO |
| 15:53:17 | <lambdabot> | Not in scope: `forkIO' |
| 15:54:37 | <darrint> | Need help with stupid math question. (Not my homework, I swear.) m log (base x) m = n, I want to solve that for x, the log base. |
| 15:54:59 | <Botje> | have you tried #math ? |
| 15:55:09 | <darrint> | Botje: No. I will. Thanks. |
| 15:55:20 | <cizra> | darrint: hey |
| 15:55:25 | <Botje> | that said |
| 15:55:35 | <cizra> | darrint: You can stick that first m into the logarithm argument |
| 15:55:41 | <Botje> | log_x m = log m / log x |
| 15:55:42 | <cizra> | log_x m^m = n |
| 15:55:45 | <darrint> | ah. |
| 15:55:51 | <cizra> | m^m = x * n |
| 15:56:14 | <mrd> | x^n |
| 15:56:41 | <cizra> | oh, yes, sorry |
| 15:56:48 | <mrd> | root(n,m^m) = x |
| 15:56:55 | <darrint> | so x is nth root of m^m? Bizarre! |
| 15:57:06 | <cizra> | Not at all. Figure out what logarithm really means. |
| 15:57:08 | <Botje> | m&ms? I could go for some. |
| 15:57:18 | <cizra> | By the way, I've got a stupid math question also. |
| 15:57:31 | <cizra> | (It's my homework, I swear) -- how do I take abs of a number? |
| 15:57:41 | <darrint> | Thanks. I knew I'd find help here. :-) |
| 15:57:45 | <cizra> | absolute value, I mean. What's the Haskell way to do this? |
| 15:57:50 | <ZsoL> | abs |
| 15:57:51 | <mrd> | abs isn't it |
| 15:57:53 | <mrd> | @hoogle abs |
| 15:57:54 | <lambdabot> | Prelude.abs :: Num a => a -> a |
| 15:57:54 | <lambdabot> | System.IO.AbsoluteSeek :: SeekMode |
| 15:57:54 | <lambdabot> | Language.Haskell.Syntax.HsEAbs :: HsQName -> HsExportSpec |
| 15:57:58 | <Botje> | sure it is |
| 15:58:06 | <cizra> | Oh my. Too intuitive to be true. |
| 15:58:14 | <MyCatSchemes> | Gah. My program dies with no output whenever I try hPutStrLn into a Handle from a process opened with System.Process.runInteractiveCommand. |
| 15:58:43 | <MyCatSchemes> | Is the System.Process module horribly buggy, or am I doing something horribly wrong? |
| 15:58:55 | <Botje> | whichever it is, at least it's horrible. |
| 15:59:03 | <allbery_b> | sounds like the command you ran didn't actually run and haskell got SIGPIPEd |
| 15:59:46 | <cizra> | Uh.. about those join and liftM2, they are in some library I must import, right? |
| 15:59:54 | <allbery_b> | Control.Monad |
| 15:59:59 | <allbery_b> | @index liftM2 |
| 15:59:59 | <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 |
| 16:00:03 | <cizra> | OK, thanks. |
| 16:00:11 | <MyCatSchemes> | allbery_b: yay, pinned it. runInteractiveProcess is failing. |
| 16:00:21 | <allbery_b> | you may want Control.Monad.Reader instead for the definition of (->) r |
| 16:00:33 | <MyCatSchemes> | Er, runInteractiveCommand. Hmmm. |
| 16:00:41 | <allbery_b> | (since many interesting uses of liftM2 use the function monad) |
| 16:01:34 | <MyCatSchemes> | ACTION wonders what the heck exit code 13 indicates in this case. Oh, bother. |
| 16:01:47 | <quicksilver> | unlucky for some |
| 16:02:00 | <quicksilver> | full moon obstructing electron flow |
| 16:02:04 | <quicksilver> | south bridge overheating |
| 16:02:36 | <MyCatSchemes> | quicksilver: east bridge collapsed. |
| 16:02:46 | <allbery_b> | MyCatSchemes: it confirms my suspicion: program died on SIGPIPE |
| 16:02:57 | <MyCatSchemes> | quicksilver: PEBCAK, probably, since I did write most of the programs being called out to here. |
| 16:03:15 | <allbery_b> | (basically, nuked by the OS for writing on a closed pipe) |
| 16:04:13 | <MyCatSchemes> | Prelude.head: empty list. |
| 16:04:26 | <MyCatSchemes> | Huh. That's weird, since that list was produced by hGetContents. |
| 16:05:23 | <luqui> | good ol' evil hGetContents |
| 16:06:50 | <cizra> | I wrote a function that takes a (possibly empty) list that contains some pairs, and returns an integer. I can't figure out how to write a signature declaration for it. Help? |
| 16:07:23 | <Botje> | have you tried asking your haskell interpreter? |
| 16:07:29 | <cizra> | uh.. |
| 16:07:29 | <cizra> | no |
| 16:07:31 | <cizra> | How to do this? |
| 16:07:35 | <Botje> | :t function |
| 16:07:42 | <lambdabot> | Not in scope: `function' |
| 16:07:44 | <luqui> | haha |
| 16:07:49 | <Botje> | I know. shut up, \bot |
| 16:08:41 | <cizra> | Parse error on : |
| 16:08:42 | <quicksilver> | cizra: Botje means, you don't need to write the signature declaration. If you miss it out, haskell will infer the type and then you can ask the interpreter. |
| 16:08:50 | <MyCatSchemes> | ...huh. Weird. |
| 16:08:56 | <Botje> | cizra: what interpreter? |
| 16:09:03 | <cizra> | ghc and ghci, both |
| 16:09:03 | <quicksilver> | cizra: ghci says 'parse error on :' ? |
| 16:09:07 | <cizra> | main = print $ :t sumItUp |
| 16:09:11 | <Botje> | cizra: no no |
| 16:09:16 | <Botje> | cizra: ghci yourfile.hs |
| 16:09:29 | <Botje> | then enter :t sumItUp there |
| 16:09:34 | <allbery_b> | the :-commands are handed by the ghci toplevel prompt |
| 16:09:38 | <allbery_b> | they're not Haskell code |
| 16:09:41 | <cizra> | \o/ |
| 16:10:07 | <cizra> | OK, that works. What is Num? |
| 16:10:12 | <phlpp> | heja |
| 16:10:15 | <phlpp> | :-) |
| 16:10:25 | <cizra> | sumItUp :: (Num b) => [(b, b)] -> b |
| 16:10:32 | <allbery_b> | Num is a typeclass |
| 16:10:43 | <cizra> | OK, sorta like Integer, Integral and the like. |
| 16:10:44 | <allbery_b> | it's the most general class describing numbers |
| 16:10:52 | <luqui> | it means "b is some kind of numeric type" roughly. b could be Integer, Double, ... |
| 16:11:00 | <cizra> | Secondly, what is =>? I've only seen -> in function declarations so far. |
| 16:11:11 | <ddarius> | class Thing a where {} |
| 16:11:12 | <allbery_b> | Integer is a concrete type for arbitrary precision integers; Integral is a typeclass for integral values (Int, Integer, the Word* types, etc.) |
| 16:11:22 | <allbery_b> | => is a typeclass constraint |
| 16:11:32 | <cizra> | OK |
| 16:11:44 | <phlpp> | byorgey: your southpark char looks like how i'd you expect you in real life :D |
| 16:11:45 | <ddarius> | Better: class Type a where {} |
| 16:11:55 | <allbery_b> | (Num b) => [(b,b)] -> b basically says any type b as long as it is a member of typeclass Num |
| 16:11:58 | <quicksilver> | cizra: you can ignore the bit before the =>, at a first glance |
| 16:12:03 | <cizra> | OK |
| 16:12:04 | <phlpp> | arr, forget about one of that yous |
| 16:12:07 | <quicksilver> | cizra: so the type is [(b,b)] -> b |
| 16:12:17 | <quicksilver> | cizra: but then ther eis an aditional restriction on b |
| 16:12:24 | <cizra> | *nod* but with the added constraint that b is numeric. |
| 16:12:26 | <quicksilver> | cizra: so it's not "Any type b" but "Any type b which is a number" |
| 16:12:28 | <quicksilver> | exactly |
| 16:12:29 | <cizra> | Clear as soapy water. |
| 16:12:38 | <SyntaxNinja> | dcoutts: cool. do you want me to check it out? |
| 16:12:40 | <quicksilver> | don't get it in your eyes. |
| 16:13:38 | <dcoutts> | SyntaxNinja: sure, if you have time to read it through and think about it a bit and comment that'd be much appreciated |
| 16:13:59 | <MyCatSchemes> | quicksilver: there has *got* to be a Sexy Losers reference hiding there somewhere. |
| 16:14:50 | <SyntaxNinja> | dcoutts: cool. |
| 16:20:03 | <cizra> | http://pastie.caboo.se/111213 -- Haskell error messages are still somewhat cryptic.. |
| 16:20:05 | <lambdabot> | Title: #111213 - Pastie |
| 16:21:17 | <luqui> | cizra, they stay that way... usually I just look at the line number |
| 16:21:43 | <luqui> | (if I _really_ think about it sometimes I can figure out what it's whining about) |
| 16:21:58 | <cizra> | It probably thinks that I'm misusing that join. |
| 16:22:26 | <cizra> | Frankly, I don't know even what it's supposed to do. http://www.haskell.org/onlinelibrary/monad.html this place isn't very helpful. Is there a good reference available somewhere? |
| 16:22:27 | <lambdabot> | Title: The Haskell 98 Library Report: Monad Utilities |
| 16:22:36 | <kpreid> | cizra: I'd recommend not using join |
| 16:23:01 | <cizra> | kpreid: You're welcome to suggest something that 1) works, 2) is simple enough for me to understand. |
| 16:23:02 | <kpreid> | cizra: the *reason* that doesn't work is you haven't imported Control.Monad.Reader. but don't do that. |
| 16:23:10 | <kpreid> | just use the second of my examples :) |
| 16:23:27 | <kpreid> | liftM2 (,) lst lst |
| 16:24:03 | <luqui> | or heaven forbid something concrete like [ (a,b) | a <- lst, b <- list ] |
| 16:24:13 | <cizra> | Oh! |
| 16:27:11 | <cizra> | How do you debug Haskell code? I get wrong answers, although I suppose that most of my code is correct. |
| 16:27:32 | <kpreid> | well, there's Debug.Trace |
| 16:27:36 | <madnificent> | cizra: you can just call every function you care about from ghci too.... |
| 16:27:50 | <kpreid> | also, make sure it's broken up into bits you can usefully test |
| 16:27:53 | <kpreid> | then test them |
| 16:28:00 | <dcoutts> | and ghc-6.8.1 includes a debugger |
| 16:28:05 | <kpreid> | either poke at them from ghci, or use a test tool, e.g. QuickCheck |
| 16:28:16 | <madnificent> | cizra: or you could write unit tests ^_^ |
| 16:28:19 | <cizra> | ACTION tries ghci |
| 16:28:53 | <madnificent> | cizra: I only used ghci, it might not be there if you're using another implementation ^_^ |
| 16:29:49 | <cizra> | I'm using GHC. |
| 16:31:07 | <wsdo_okadr> | if I have a CFG |
| 16:31:46 | <luqui> | if I want to keep track of a "seen" set (for a graph traversal), what's the best way to do that |
| 16:31:49 | <luqui> | Data.Map inside ST? |
| 16:32:16 | <luqui> | I'm not sure about how lazy I want such a thing... |
| 16:33:58 | <luqui> | or is there a better way to go about graph traversals altogether? |
| 16:34:21 | <cizra> | Okie, now that I have those permutations, I wish to filter out those pairs that consist of identical members. filter looks like the right choice. I should write something like "filter (fst FOO == snd FOO) myList", right? But what's that FOO I should supply in? |
| 16:34:28 | <luqui> | (I don't think fgl does what I want tho...) |
| 16:35:04 | <dcoutts> | luqui: you can use a Data.Map without ST, but it costs log n for a lookup or to mark |
| 16:35:05 | <luqui> | cizra, the parameter to the lambda: filter (\x -> fst x ... |
| 16:35:22 | <cizra> | Ow, lambda. I fear that word, I fear everything unknown.. |
| 16:35:30 | <dcoutts> | luqui: inside ST you could use an STUArray of Bools which gives you O(1) mark and test |
| 16:35:41 | <nopoints> | @pl \h xss -> sequence $ map sequence (map (map (hGet h)) xss) |
| 16:35:41 | <lambdabot> | ((sequence . map sequence) .) . map . map . hGet |
| 16:35:51 | <luqui> | yum... I wonder if my problem maps into a space that small |
| 16:35:53 | <dcoutts> | luqui: if your graph nodes are dense integers of course |
| 16:36:38 | <dcoutts> | luqui: I usually find I have to keep bi-directional maps between graph node ids and their real names, which are often strings. |
| 16:37:09 | <luqui> | pairs of (concievably long) lists of bools... |
| 16:37:37 | <luqui> | hmm... kinda sounds like hashing to me actually |
| 16:41:45 | <cizra> | OK, about those permutations again: [(a, b) | a <- lst, b <- lst] -- this makes all possible pairs of elements of lst. But how to ensure that it doesn't create pairs different only by the placement of the elements? Like.. the list [2, 3] should have only one pair, [(2, 3)] and not [(2, 3), (3, 2)] |
| 16:41:56 | <cizra> | I'm still hazy about [(a, b) | <- stuff. |
| 16:43:18 | <dcoutts> | cizra: then you'll have to filter out the ones that are swapped or change the way you generate them |
| 16:43:19 | <EvilTerran> | as you've written it there, you'll get every arrangement of (one item from lst in a) and (one item from lst in b) |
| 16:43:46 | <EvilTerran> | the cartesian product, if you're familiar with the term. iirc, it's called an outer join in databases. |
| 16:44:14 | <exDM69> | haskell never stops to amaze me |
| 16:44:18 | <exDM69> | ACTION is a C++ coder |
| 16:44:55 | <quicksilver> | cizra: for example a <- lst, b <- (lst \\ [a]) |
| 16:45:07 | <quicksilver> | cizra: that ensures you don't pick the 'same' a |
| 16:45:09 | <cizra> | Hmm.. lst without [a]? |
| 16:45:14 | <quicksilver> | right |
| 16:45:15 | <EvilTerran> | > (\lst -> [(a,b) | (a:as) <- tails lst, b <- as]) [1..6] |
| 16:45:16 | <lambdabot> | [(1,2),(1,3),(1,4),(1,5),(1,6),(2,3),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6),(4,... |
| 16:45:24 | <quicksilver> | of course, it doesn't help if there is more than one of the same in the list |
| 16:45:28 | <quicksilver> | depends what you actually one |
| 16:45:33 | <EvilTerran> | in that formulation, b will always be taken from after a in the list |
| 16:45:34 | <quicksilver> | > [1,2,3] \\ [2] |
| 16:45:35 | <lambdabot> | [1,3] |
| 16:45:42 | <quicksilver> | > [1,2,3,4,2,4,2] \\ [2] |
| 16:45:43 | <lambdabot> | [1,3,4,2,4,2] |
| 16:46:03 | <EvilTerran> | so, if your list starts out with no duplicates, you won't get any duplicate pairs |
| 16:46:06 | <cizra> | kodune1.hs:26:62: Not in scope: \' |
| 16:46:10 | <cizra> | \\, actually |
| 16:46:27 | <EvilTerran> | you won't get (2,2), say, either, though |
| 16:46:34 | <cizra> | I don't want it. |
| 16:46:48 | <quicksilver> | cizra: import Data.List to get \\ |
| 16:46:54 | <cizra> | Thanks. |
| 16:47:02 | <quicksilver> | @index (\\) |
| 16:47:02 | <lambdabot> | bzzt |
| 16:47:04 | <desegnis> | > let lst = [1..3] in [ (a,b) | a <- lst, b <- lst, a <= b ] -- Numbers have an order defined, so ... |
| 16:47:06 | <lambdabot> | [(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)] |
| 16:47:22 | <allbery_b> | hm, @index needs to be insultized :> |
| 16:51:51 | <cinimod> | I've generated a C program and now I want to compile and run it. Any ideas on how to do this via Haskell? |
| 16:52:50 | <EvilTerran> | ACTION puts "write a modular C compilation system in haskell" on his big list of things to never get round to doing |
| 16:52:55 | <quicksilver> | cinimod: http://haskell.org/ghc/docs/latest/html/libraries/base/System-Process.html |
| 16:52:57 | <lambdabot> | http://tinyurl.com/lw4ug |
| 16:53:20 | <quicksilver> | cinimod: presumably, runCommand "gcc -o foo foo.c" |
| 16:53:54 | <cinimod> | quicksilver: almost but that's what I need - thanks |
| 16:55:56 | <cizra> | let lst = [4, 2] in [(a, b) | a <- lst, b <- (lst \\ [a])] |
| 16:55:58 | <cizra> | > let lst = [4, 2] in [(a, b) | a <- lst, b <- (lst \\ [a])] |
| 16:56:06 | <cizra> | lambdabot: *nudge* |
| 16:56:10 | <lambdabot> | [(4,2),(2,4)] |
| 16:56:10 | <chessguy> | @bot |
| 16:56:11 | <lambdabot> | :) |
| 16:56:34 | <cizra> | quicksilver: Here's a proof that your suggestion doesn't work. |
| 16:58:48 | <quicksilver> | cizra: ah, well, I misread your question :) |
| 16:58:57 | <quicksilver> | cizra: I thought you jsut wanted to exclude (2,2) :) |
| 16:59:11 | <quicksilver> | if you want to exclude all such things I suggest that ordering is the best option |
| 16:59:26 | <quicksilver> | one way or another |
| 17:00:10 | <EvilTerran> | nub $ sort $ [ (a,b) | a <- lst, b <- lst ] --? |
| 17:00:15 | <cizra> | Uh, actually, theoretically the list might have multiple equal values. In this case, ordering-uniqueizing would destroy them. |
| 17:00:23 | <roconnor> | > log pi |
| 17:00:25 | <lambdabot> | 1.1447298858494002 |
| 17:00:54 | <quicksilver> | > let {perms [] = [[]]; perms (x:xs) = perms xs ++ map (x:) (perms xs)} in perms [1,2,4] |
| 17:00:56 | <lambdabot> | [[],[4],[2],[2,4],[1],[1,4],[1,2],[1,2,4]] |
| 17:01:05 | <desegnis> | EvilTerran: You mean either (nub) or (map head . group . sort), I s'pose |
| 17:01:08 | <cizra> | (\lst -> [(a,b) | (a:as) <- tails lst, b <- as]) lst -- this works \o/ |
| 17:01:29 | <cizra> | I'm not exactly sure what it does, but it does it well. |
| 17:01:35 | <EvilTerran> | desegnis, what? |
| 17:01:41 | <EvilTerran> | yes. quite. |
| 17:01:52 | <EvilTerran> | never mind. |
| 17:01:59 | <quicksilver> | cizra: possibly my version is 'clearer' although it's not very fast |
| 17:02:00 | <desegnis> | fine :) |
| 17:02:02 | <EvilTerran> | > tails [1..5] |
| 17:02:03 | <lambdabot> | [[1,2,3,4,5],[2,3,4,5],[3,4,5],[4,5],[5],[]] |
| 17:02:05 | <Cale> | cizra: It picks all pairs (a,b) of elements of the list where a occurs before b in the list |
| 17:02:23 | <EvilTerran> | > [a | (a:as) <- tails [1..5]] |
| 17:02:24 | <lambdabot> | [1,2,3,4,5] |
| 17:02:30 | <cizra> | Cale: Just what I needed to do, by definition. However, how does it work? /me ponders |
| 17:03:02 | <cizra> | > [a | a < [1..5]] |
| 17:03:03 | <lambdabot> | Not in scope: `a' |
| 17:03:04 | <quicksilver> | @tell Cale my former phd supervisor replied and confirmed that we're absolutely right. He did think he remembers that the Kleisli over a symettric monoidal category can be monoidal, if the monad itself respects the tensor. |
| 17:03:04 | <lambdabot> | Consider it noted. |
| 17:03:09 | <EvilTerran> | if it helps, it desugars to approximately |
| 17:03:14 | <Cale> | Well, first it picks a nonempty tail of the list, deciding that a is the first element of that. Then it picks b from the rest of that tail. |
| 17:03:14 | <lambdabot> | Cale: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 17:03:23 | <quicksilver> | ACTION laughs |
| 17:03:31 | <quicksilver> | speak of the devil |
| 17:04:01 | <EvilTerran> | er, never mind. the desugaring's messy. |
| 17:06:19 | <Cale> | cizra: does that make sense? |
| 17:06:29 | <cizra> | Sorta. |
| 17:06:34 | <cizra> | Well, yes, actually |
| 17:06:37 | <Cale> | > [(a,as) | (a:as) <- tails [1..3]] |
| 17:06:39 | <lambdabot> | [(1,[2,3]),(2,[3]),(3,[])] |
| 17:06:54 | <cizra> | .. except the lambda thing, which I'm unfamiliar with. |
| 17:06:54 | <Cale> | > [(a,as,b) | (a:as) <- tails [1..3], b <- as] |
| 17:06:56 | <lambdabot> | [(1,[2,3],2),(1,[2,3],3),(2,[3],3)] |
| 17:07:06 | <Cale> | > [(a,b) | (a:as) <- tails [1..3], b <- as] |
| 17:07:08 | <lambdabot> | [(1,2),(1,3),(2,3)] |
| 17:07:19 | <Cale> | Oh, the lambda's not much |
| 17:07:40 | <Cale> | (\x -> ...) is the function which takes x as a parameter and returns ... |
| 17:08:04 | <cizra> | That's all? |
| 17:08:10 | <Cale> | yep |
| 17:08:25 | <cizra> | Uh.. What's the simplest way you can use this? |
| 17:08:36 | <cizra> | A newbie example for easier comprehension |
| 17:09:18 | <Cale> | > (\x -> x^2 + 1) 5 |
| 17:09:20 | <lambdabot> | 26 |
| 17:09:33 | <Cale> | > (\x -> x^2 + 1) 10 |
| 17:09:35 | <lambdabot> | 101 |
| 17:09:42 | <Cale> | > map (\x -> x^2 + 1) [1..10] |
| 17:09:43 | <lambdabot> | [2,5,10,17,26,37,50,65,82,101] |
| 17:09:45 | <cizra> | Oh, so it turns a bunch of code into an operator, sorta like |
| 17:09:55 | <Cale> | an anonymous function |
| 17:09:59 | <quicksilver> | > [ x^2 + 1 | x <- [1..10]] |
| 17:10:00 | <lambdabot> | [2,5,10,17,26,37,50,65,82,101] |
| 17:10:08 | <cizra> | Nifty... |
| 17:10:10 | <quicksilver> | ^^ the connection between lambdas and list notation |
| 17:11:22 | <Cale> | There are a *lot* of places in functional programming where defining a named function separately is just way too heavy syntactically. |
| 17:11:43 | <Cale> | and you just want to be able to specify something in-place |
| 17:12:08 | <Cale> | In your case though, I probably would just name the function though. |
| 17:12:39 | <cizra> | Nah, it'll do when I understand it. |
| 17:13:17 | <Cale> | (or if I was only going to use that in one place, I'd likely unwrap the lambda) |
| 17:13:35 | <cizra> | "unwrap?" |
| 17:13:44 | <Cale> | (\xs -> [(a,b) | (a:as) <- tails xs, b <- as]) lst |
| 17:13:47 | <Cale> | is the same as |
| 17:13:55 | <Cale> | [(a,b) | (a:as) <- tails lst, b <- as] |
| 17:14:05 | <Cale> | (by definition) |
| 17:14:05 | <cizra> | umm.. yes, I see |
| 17:14:24 | <quicksilver> | just as you'd never write (\x -> x + 1) y |
| 17:14:29 | <quicksilver> | you'd just write y + 1 |
| 17:14:33 | <cizra> | yesyes, I see. |
| 17:16:04 | <Cale> | If lst is something complicated though, you still may want to define it in a let, so that the memory usage will be the same as with the function |
| 17:16:14 | <Cale> | let lst = ... in [(a,b) | (a:as) <- tails lst, b <- as] |
| 17:16:29 | <Cale> | well, here it can't make a difference |
| 17:16:39 | <Cale> | But it could if lst occurred multiple times |
| 17:16:53 | <Cale> | (and was not just a variable) |
| 17:17:50 | <cizra> | No, it's fine when unwrapped. It is an easy function. |
| 17:18:50 | <cizra> | What I'm really worried about is that altogether I see the fun of list manipulations etc, I really can't see why I should prefer Haskell over, say, Ruby or something in real world. |
| 17:19:08 | <Cale> | Yeah, I'm just awkwardly trying to say that when a parameter to a lambda (or any other function) is duplicated in the body, it's still only computed once, even though it's computed after the function is applied. |
| 17:19:45 | <Cale> | Well, that'll come with time, I suppose :) |
| 17:19:50 | <cizra> | lazy evaluation FTW |
| 17:23:15 | <Cale> | > mapM (\x -> [1..x]) [2,3,4] |
| 17:23:17 | <lambdabot> | [[1,1,1],[1,1,2],[1,1,3],[1,1,4],[1,2,1],[1,2,2],[1,2,3],[1,2,4],[1,3,1],[1,... |
| 17:24:07 | <Cale> | > length . mapM (\x -> [1..x]) $ [2,3,4] |
| 17:24:08 | <lambdabot> | 24 |
| 17:24:09 | <EvilTerran> | cizra, the type system is a pretty big selling point |
| 17:24:14 | <Cale> | > 2 * 3 * 4 |
| 17:24:16 | <lambdabot> | 24 |
| 17:24:20 | <Cale> | Yeah, hehe |
| 17:24:31 | <cizra> | Huh? It looks just like object-oriented inheritance to me. |
| 17:24:34 | <Cale> | That would be one major issue for me |
| 17:24:36 | <cizra> | Nothing spectacular nor innovative. |
| 17:24:43 | <EvilTerran> | oh, heavens no! |
| 17:24:53 | <Cale> | cizra: No, it's very different from that. |
| 17:25:00 | <cizra> | Always ready to admit my mistakes. What's the difference? |
| 17:25:11 | <EvilTerran> | regardless, i meant type inference more than anything |
| 17:25:33 | <Cale> | And we don't even really have anything like inheritance. |
| 17:25:35 | <EvilTerran> | although that requires a good arrangements of types underneath to be really useful |
| 17:26:17 | <EvilTerran> | analogies could be drawn between haskell's "class"es and, say, Java's "interfaces" |
| 17:26:26 | <Cale> | The closest thing is perhaps the ability to constrain classes such that if you want to write an instance of one, you must write an instance of the other. |
| 17:26:41 | <EvilTerran> | and likewise haskell's "instance"s and java's "class ... implements" |
| 17:26:42 | <Cale> | EvilTerran: kind of weak analogies, really :) |
| 17:26:53 | <cizra> | Uh.. OK |
| 17:27:06 | <EvilTerran> | Cale, well... it's the best analogy to OO I can think of |
| 17:27:10 | <Cale> | yeah |
| 17:27:17 | <Cale> | cizra: We don't really use subtype polymorphism |
| 17:27:30 | <Cale> | cizra: Instead we use something called parametric polymorphism |
| 17:27:34 | <cizra> | Eek |
| 17:27:39 | <Cale> | length :: [a] -> Int |
| 17:28:03 | <cizra> | I'm tired and it'll be pretty useless to tell me about new stuff now.. |
| 17:28:03 | <Cale> | length takes a list whose values are of any type a, and returns an Int |
| 17:28:10 | <EvilTerran> | however, there's a load of stuff that comes much more easily in our type system than in standard OO; Cale's example there, for instance, either requires unsafe casting or generics |
| 17:28:54 | <EvilTerran> | well, that in particular wouldn't, but having a type-agnostic linked-list class would |
| 17:29:02 | <EvilTerran> | in general |
| 17:29:08 | <mrd> | and java generics are retarded and will probably require unsafe casting anyhow |
| 17:29:30 | <Cale> | cizra: Suffice it to say that our type system is completely upside down and backwards from your typical OO language's, and that it's probably a good thing ;) |
| 17:29:50 | <mrd> | upside down and backwards from an upside down and backwards OO language is a good thing |
| 17:30:04 | <mrd> | straight up and forwards |
| 17:30:22 | <cizra> | Okie |
| 17:31:16 | <Cale> | The type inference is one major difference, when you're talking about ease of use |
| 17:32:12 | <EvilTerran> | inference is brilliant; that's why C# stole it |
| 17:32:21 | <Cale> | In OO languages, they tend to force you to make a decision between explicitly stating every one of your types in a verbose mess to get some static guarantees, or not specifying much of anything and having no compile-time guarantees at all. |
| 17:32:51 | <ricky_clarkson> | Every language uses stuff from other languages, stealing seems to have inappropriate negative connotations. |
| 17:33:04 | <ricky_clarkson> | Cale: See Scala. |
| 17:33:05 | <EvilTerran> | ah, it was only meant in jest |
| 17:33:05 | <Cale> | C# stole it somewhat, but I think there are fundamental limitations on how far it can be taken in a language with subtype polymorphism |
| 17:34:02 | <EvilTerran> | Cale, indeed. such as that you can't say "var foo = new Bar" if you want foo to have a type superclassing Bar, i believe |
| 17:34:24 | <Cale> | That makes sense |
| 17:34:27 | <EvilTerran> | although it may be able to infer that a superclass is necessary based on behaviour elsewhere |
| 17:34:35 | <ricky_clarkson> | EvilTerran: Why would you care whether foo was of type Bar or a supertype thereof? |
| 17:34:47 | <mrd> | unique typing goes all to hell with subtypes |
| 17:35:07 | <EvilTerran> | or indeed it might be able to pick the biggest superclass based on which members you've used |
| 17:35:26 | <EvilTerran> | I don't know. this is idle speculation. |
| 17:35:51 | <Cale> | I seem to recall there are some cases where it becomes computationally intractable. |
| 17:36:17 | <Cale> | (like, not impossible, just horribly complex) |
| 17:36:19 | <mrd> | parametric polymorphism is much cooler, anyhow, because while at the same time as giving you more flexibility, it also allows you to limit what kind of programs can possibly satisfy the type |
| 17:36:29 | <cizra> | OK, here's a question about a special case: isOrderedBy checks if the list is ordered by this function. |
| 17:36:32 | <cizra> | isOrderedBy func [] = True |
| 17:36:38 | <cizra> | (by definition of the task, this must be so) |
| 17:36:42 | <Cale> | sure |
| 17:36:55 | <cizra> | However, when compiling isOrderedBy (<5) [], Haskell complains. |
| 17:37:09 | <EvilTerran> | how many parameters does func take? |
| 17:37:13 | <cizra> | > let isOrderedBy func [] = True in isOrderedBy (<5) [] |
| 17:37:13 | <EvilTerran> | how many does (<5) take? |
| 17:37:15 | <lambdabot> | True |
| 17:37:25 | <cizra> | EvilTerran: Just one, I suppose? |
| 17:37:36 | <Cale> | You probably want func to take two parameters |
| 17:37:37 | <cizra> | Hmm, lambdabot likes it... |
| 17:37:39 | <EvilTerran> | how can you check for ordering with only one parameter to your function? |
| 17:37:39 | <mrd> | shouldn't the 'func' be a -> a -> Order |
| 17:37:52 | <mrd> | @hoogle Order |
| 17:37:53 | <lambdabot> | Prelude.Ordering :: data Ordering |
| 17:37:53 | <lambdabot> | Distribution.GetOpt.RequireOrder :: ArgOrder a |
| 17:37:53 | <lambdabot> | Distribution.GetOpt.ReturnInOrder :: (String -> a) -> ArgOrder a |
| 17:37:56 | <EvilTerran> | mrd, or a -> a -> Bool, if it's just a (<=) parallel |
| 17:37:57 | <mrd> | Ordering |
| 17:38:00 | <cizra> | Well, (<5) is an one-parameter function. |
| 17:38:05 | <mrd> | well, fix it =) |
| 17:38:24 | <mrd> | what does it mean to say "list is ordered by (<5)?" |
| 17:38:29 | <EvilTerran> | cizra, does it make sense to call (<5) an ordering? |
| 17:38:31 | <Cale> | cizra: What does it mean for a list to be ordered by (<5)... damn you |
| 17:38:40 | <mrd> | we've gone beyond stereo |
| 17:38:41 | <cizra> | nope |
| 17:38:44 | <mrd> | surround sound |
| 17:38:45 | <byorgey> | > let isOrderedBy func [] = True in isOrderedBy [1,2,3] [] |
| 17:38:46 | <lambdabot> | True |
| 17:38:46 | <cizra> | Actually, I'm confused. |
| 17:38:57 | <mrd> | or is it just a fugue |
| 17:39:02 | <opqdonut> | :D |
| 17:39:05 | <byorgey> | if that's the only definition you give for isOrderedBy, the 'func' parameter just gets ignored. |
| 17:39:40 | <Cale> | Presumably in the non-base-case, you'll want to use func to compare pairs of adjacent elements of the list |
| 17:39:58 | <Cale> | So it shouldn't be a one-parameter function |
| 17:40:24 | <cizra> | *sigh* my mistake |
| 17:40:33 | <cizra> | The function must look like this: |
| 17:40:34 | <cizra> | isOrderedBy :: (a -> a -> Bool) -> [a] -> Bool |
| 17:40:38 | <Cale> | right |
| 17:40:44 | <cizra> | And yes, it's a two-parameter function. |
| 17:40:46 | <EvilTerran> | > zipWith (<=) =<< drop 1 $ [1,2,3,4,3,3,2,5] |
| 17:40:48 | <lambdabot> | [False,False,False,True,True,True,False] |
| 17:40:51 | <Cale> | so (<5) is not an appropriate first parameter, but you could pass (<) |
| 17:40:58 | <cizra> | yes, that was my bad. |
| 17:41:05 | <EvilTerran> | <.< >.> |
| 17:41:15 | <Cale> | ap (zipWith (<=)) (drop 1) [1,2,3,4,3,3,2,5] |
| 17:41:17 | <Cale> | > ap (zipWith (<=)) (drop 1) [1,2,3,4,3,3,2,5] |
| 17:41:19 | <lambdabot> | [True,True,True,False,True,False,True] |
| 17:41:22 | <mrd> | > let 1 <.< 2 = True in 1 <.< 2 |
| 17:41:24 | <lambdabot> | True |
| 17:41:30 | <Cale> | > ap (zipWith (>)) (drop 1) [1,2,3,4,3,3,2,5] |
| 17:41:31 | <lambdabot> | [False,False,False,True,False,True,False] |
| 17:42:17 | <byorgey> | > length . filter id $ ap (zipWith (>)) (drop 1) [1,2,3,4,3,3,2,5] |
| 17:42:19 | <lambdabot> | 2 |
| 17:42:24 | <Cale> | > ap (zipWith (>=)) (drop 1) [1,2,3,4,3,3,2,5] |
| 17:42:25 | <lambdabot> | [False,False,False,True,True,True,False] |
| 17:42:28 | <Cale> | aha |
| 17:42:45 | <Cale> | or just and |
| 17:42:52 | <Cale> | > and . ap (zipWith (>=)) (drop 1) $ [1,2,3,4,3,3,2,5] |
| 17:42:53 | <lambdabot> | False |
| 17:43:04 | <Cale> | > and . ap (zipWith (>=)) (drop 1) $ [1,2,3,4,4,5] |
| 17:43:05 | <lambdabot> | False |
| 17:43:08 | <byorgey> | Cale: but that discards information =) |
| 17:43:31 | <Cale> | > and . ap (zipWith (>=)) (drop 1) $ [4,3,3,2,2,1] |
| 17:43:32 | <lambdabot> | True |
| 17:43:38 | <EvilTerran> | ?type (<*) |
| 17:43:40 | <lambdabot> | forall (f :: * -> *) a b. (Applicative f) => f a -> f b -> f a |
| 17:43:44 | <byorgey> | nice |
| 17:43:49 | <EvilTerran> | hm |
| 17:43:54 | <EvilTerran> | ?docs Control.Applicative |
| 17:43:55 | <lambdabot> | Control.Applicative not available |
| 17:44:02 | <Cale> | haha |
| 17:44:24 | <byorgey> | EvilTerran: whatcha looking for? |
| 17:44:33 | <EvilTerran> | jus' thinking |
| 17:44:49 | <byorgey> | hm, I suppose that's allowed =) |
| 17:45:00 | <EvilTerran> | ?type ap |
| 17:45:02 | <lambdabot> | forall (m :: * -> *) a b. (Monad m) => m (a -> b) -> m a -> m b |
| 17:45:47 | <Cale> | > and . zipWith (>=) <*> drop 1 $ [4,3,3,2,2,1] |
| 17:45:48 | <lambdabot> | Couldn't match expected type `[Bool]' |
| 17:45:56 | <EvilTerran> | ah. that's the one. ap = (<*>). |
| 17:46:10 | <Cale> | > and . (zipWith (>=) <*> drop 1) $ [4,3,3,2,2,1] |
| 17:46:11 | <lambdabot> | True |
| 17:46:25 | <EvilTerran> | *doh* of course it does, i should've remembered that from the Applicative paper |
| 17:46:28 | <Cale> | Rrright |
| 17:47:01 | <cizra> | http://pastie.caboo.se/111213 -- Why does this neat simple little piece of code not work? |
| 17:47:03 | <lambdabot> | Title: #111213 - Pastie |
| 17:48:46 | <byorgey> | yeesh |
| 17:48:59 | <byorgey> | is it because of the empty list? |
| 17:49:08 | <cizra> | yep |
| 17:49:29 | <byorgey> | does it work if you do isOrderedBy (<) [1,2,3]? |
| 17:49:52 | <cizra> | Yes. Well, I didn't paste the other pattern-matchings, but it generally works. |
| 17:50:02 | <byorgey> | yeah, that's a subtle problem. |
| 17:50:31 | <byorgey> | the empty list has type [a], where a could be anything, and it can't prove that a is in the Ord class (as is required to use <). |
| 17:50:45 | <byorgey> | of course, you and I both know that it doesn't matter since there's nothing to compare, but... |
| 17:50:56 | <cizra> | well, yeah |
| 17:50:56 | <byorgey> | you can fix it by giving [] an explicit type |
| 17:51:10 | <byorgey> | i.e. isOrderedBy (<) ([] :: [Int]), for example |
| 17:51:36 | <cizra> | Can I somehow do this in the function declaration? |
| 17:51:52 | <cizra> | Force the argument to be of [Int] type |
| 17:52:08 | <Cale> | yeah |
| 17:52:14 | <byorgey> | well, if you want, you could make isOrderedBy of type (Int -> Int -> Bool) -> [Int] -> Bool |
| 17:52:18 | <EvilTerran> | it'd kinda defeat the object of your nice polymorphic function, though |
| 17:52:22 | <byorgey> | but in practice it shouldn't really be necessary. |
| 17:52:39 | <byorgey> | in practice you probably won't ever apply isOrderedBy explicitly to []. |
| 17:52:40 | <Botje> | cizra: you can write the sig yourself and restrict it |
| 17:52:48 | <EvilTerran> | ACTION wonders if he can work the monomorphism restriction into this somewhere |
| 17:53:12 | <Botje> | cookies? |
| 17:53:26 | <Cale> | cizra: I agree with byorgey. If you ever do apply it to an empty list, it'll most likely be an empty list whose type is known |
| 17:53:29 | <cizra> | Myeah. I've the type declaration supplied to me, so it won't work either. Well, I'll just accept the sad truth that it won't work on empty lists. |
| 17:53:37 | <Cale> | It will, in general |
| 17:53:41 | <byorgey> | cizra: no, it works fine on empty lists. |
| 17:54:23 | <EvilTerran> | usually the type of the list will be concrete enough for that to not be a problem, in practice |
| 17:54:44 | <EvilTerran> | you'll never actually need to type "isOrderedBy (<) []", 'cos you know what the answer is ;) |
| 17:55:03 | <cizra> | yep |
| 17:55:15 | <Cale> | however, if you apply it to another list, which just happens to be empty, you must know what the type of that list is |
| 17:55:42 | <cizra> | Okie, another question. |
| 17:55:47 | <cizra> | > True && False |
| 17:55:59 | <lambdabot> | False |
| 17:56:23 | <Cale> | btw, did everyone see that new subtext demo? |
| 17:56:37 | <bakert> | is there any way to get the name of a record field? |
| 17:56:46 | <byorgey> | Cale: no, what's that? |
| 17:56:52 | <bakert> | A { b :: String } |
| 17:56:54 | <Cale> | http://subtextual.org/subtext2.html |
| 17:56:54 | <bakert> | I want "b" |
| 17:56:54 | <lambdabot> | Title: Created with Camtasia Studio 5 |
| 17:57:00 | <byorgey> | bakert: given what? |
| 17:57:00 | <dmwit> | bakert: Not really. |
| 17:57:01 | <Nafai> | Cale: Yeah, it was interesting...not sure how I feel about it yet |
| 17:57:08 | <bakert> | byorgey: given the record |
| 17:57:12 | <bakert> | a record |
| 17:57:31 | <byorgey> | bakert: well, if it derives Show, you could show it and then parse the result... |
| 17:57:33 | <Cale> | Well, it's a neat way to visualise a functional language :) |
| 17:57:34 | <byorgey> | kind of ugly though =) |
| 17:57:34 | <desegnis> | bakert: A record can have multiple fields |
| 17:57:52 | <bakert> | desegnis: that was my simple example :) |
| 17:58:19 | <bakert> | records are just atrocious really, aren't they? i need to get more functional in my thinking. good articles/bools? |
| 17:58:24 | <bakert> | s/bools/books/g |
| 17:58:34 | <dmwit> | bakert: Given the entire record, or the value of "b" only? |
| 17:58:58 | <bakert> | dmwit: given a record with whatever value in b. can i get "b" without horrible parsing-show contortions? |
| 17:59:11 | <bakert> | perhaps i should implement show on the record somehow |
| 17:59:11 | <desegnis> | bakert: And if you know the record's type, you (the programmer) know the fields anyway. And if you don't know the precise type, you don't even know whether you have a record |
| 17:59:23 | <dmwit> | i.e. if data R = A {b :: String}; getRecordName :: {- ??? -} |
| 17:59:43 | <bakert> | OK, so say I have a record that is like this: |
| 17:59:54 | <bakert> | X { a :: Int, b :: Int, c :: Int } |
| 17:59:56 | <byorgey> | cizra: what was your other question? |
| 18:00:00 | <bakert> | and i want to know all those fields that are > 16 |
| 18:00:05 | <bakert> | how would i do that? |
| 18:00:10 | <cizra> | byorgey: Why the hell doesn't my line nr 10 work |
| 18:00:34 | <cizra> | isOrderedBy func lst = (func (lst !! 0) (lst !! 1)) && (isOrderedBy (tail (tail lst))) |
| 18:01:09 | <oerjan> | bakert: in that case you can map ($ r) [a,b,c] since they are all the same type |
| 18:01:14 | <dmwit> | bakert: [["a"]|a > 10] ++ [["b"]|b > 10] ++ [["c"]|c > 10] |
| 18:01:15 | <Cale> | cizra: That misses every other pair |
| 18:01:27 | <Cale> | cizra: also, use pattern matching ;) |
| 18:01:31 | <cizra> | oh! |
| 18:01:44 | <cizra> | Cale: Hmm? Pattern matching? How? |
| 18:02:08 | <Cale> | isOrderedBy f (x:y:xs) = f x y && isOrderedBy f (y:xs) |
| 18:02:09 | <cizra> | You mean, (a:b:remainder)? |
| 18:02:33 | <Nafai> | Cale: In a way, it seemed like the fibonacci example he gave showed the equivalent of requiring (what's the term?) exhaustive pattern matching, right? |
| 18:02:46 | <byorgey> | pattern matching lets you destructure the list right up front so you don't need all that !! 0, !! 1, tail tail stuff =) |
| 18:02:51 | <Nafai> | Cale: Where it would show when certain cases weren't covered? |
| 18:02:51 | <cizra> | \o/ |
| 18:02:58 | <Cale> | Nafai: well, at least it will warn you |
| 18:03:16 | <Cale> | Nafai: with a nice big red column :) |
| 18:03:35 | <Nafai> | Right |
| 18:04:34 | <dmwit> | oerjan: Something like this? filter snd . zip ["a", "b", "c"] . map ((>16) . ($ r)) $ [a, b, c] -- ewww, not that my solution was better |
| 18:04:51 | <dmwit> | oh no |
| 18:05:46 | <oerjan> | you could actually do filter ((>16) .($r)) [a, b, c] |
| 18:05:59 | <dmwit> | Yes, but that wouldn't give the names of the records. |
| 18:06:02 | <dmwit> | Only the values. |
| 18:06:05 | <oerjan> | indeed |
| 18:06:06 | <dmwit> | Unless that's what he wanted? |
| 18:06:08 | <bakert> | mm |
| 18:06:26 | <bakert> | there are 13 of them you see (not three) so i was trying to avoid typing all the names |
| 18:06:32 | <bakert> | but maybe i should just use a Map or something |
| 18:06:37 | <dmwit> | yeah |
| 18:06:46 | <oerjan> | however, those values could at least be used on other records of the same type |
| 18:06:48 | <dmwit> | If you really need the names of the records (why?), then maybe a Map is better. |
| 18:06:56 | <oerjan> | except not for pattern matching |
| 18:07:11 | <bakert> | although that gives me problems elsewhere that my records with functional references solve |
| 18:07:13 | <bakert> | :( |
| 18:07:32 | <dmwit> | So, what is the motivation behind this question? |
| 18:07:36 | <bakert> | dmwit: i just need the names for a string representation of remarkable attributes. these things are notable about this object |
| 18:08:01 | <bakert> | ACTION notes my giveaway use of the word object |
| 18:08:15 | <bakert> | ACTION needs to think functionally, somehow |
| 18:08:25 | <blsecres> | is there a way to pass flags to ld via cabal? I'm running into issues building X11 |
| 18:08:33 | <augustss> | yo |
| 18:08:33 | <lambdabot> | augustss: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 18:08:57 | <dmwit> | bakert: How about this: |
| 18:09:31 | <dmwit> | bakert: never mind |
| 18:09:33 | <dmwit> | =/ |
| 18:09:34 | <bakert> | :) |
| 18:11:36 | <vincenz> | augustss: ping |
| 18:11:45 | <augustss> | Hi |
| 18:11:51 | <vincenz> | the email? |
| 18:11:56 | <vincenz> | Was that accidental? |
| 18:12:06 | <augustss> | Wrong vincent :) |
| 18:12:12 | <vincenz> | Ok :) |
| 18:12:49 | <roconnor> | wow, I was right! |
| 18:13:02 | <vincenz> | augustss: roconnor was pretending to speak for you |
| 18:13:09 | <vincenz> | augustss: I would crucify him |
| 18:13:17 | <vincenz> | The biblical way |
| 18:13:22 | <roconnor> | I guess I make a pretty fair augustss imposter. |
| 18:13:25 | <augustss> | as long as he speaks the truth I don't have a problem with it |
| 18:13:36 | <vincenz> | roconnor: you're an augustss-oracle? |
| 18:13:41 | <roconnor> | yep |
| 18:13:49 | <dmwit> | He speaks the truth, never fronts one bit! He and DJ So-Sincere don't quit! |
| 18:13:52 | <dmwit> | wikka wikka |
| 18:13:55 | <vincenz> | roconnor: should publish a paper with your markov model |
| 18:14:21 | <augustss> | it's all in his brain |
| 18:15:09 | <vincenz> | roconnor: sacrifice your brain in the name of science |
| 18:15:25 | <augustss> | I should have suspected something as we stared each other down over a beer. (One beer, mine, if I remember right.) |
| 18:15:39 | <vincenz> | Fighting over the last beer? |
| 18:16:05 | <augustss> | last beer in germany? I don't think so! |
| 18:16:25 | <vincenz> | augustss: you were at icfp? |
| 18:16:29 | <vincenz> | augustss: should've stuck around for hac :) |
| 18:16:48 | <augustss> | well, i had a plane to catch to new york on saturday. from london |
| 18:16:52 | <vincenz> | ah |
| 18:16:55 | <roconnor> | I absorbed augustss mind |
| 18:17:23 | <augustss> | stored it in a constructive real, no doubt |
| 18:17:37 | <roconnor> | :) |
| 18:17:44 | <vincenz> | better than a destructive imaginary |
| 18:18:54 | <hpaste> | Julien Oster pasted "permtree2.hs" at http://hpaste.org/3484 |
| 18:21:37 | <excitingjelly> | hello |
| 18:21:44 | <excitingjelly> | can you delete something from hpaste? |
| 18:21:46 | <vincenz> | augustss: what are the major additions w.r.t. your f-omega implementation (besides more base types) that GHC has? |
| 18:22:25 | <excitingjelly> | i'd like to resubmit it with a fixed comment because I screwed it up |
| 18:22:48 | <excitingjelly> | http://hpaste.org/3484 |
| 18:23:17 | <excitingjelly> | (the comment should read "printing out a subdirectory only if its mode differs from its parent's mode") |
| 18:23:40 | <dons> | there's no need to delete it, is there? |
| 18:23:57 | <dons> | we like our variables, and pastebins, to be immutable :) |
| 18:24:10 | <excitingjelly> | well, people could think I suck at writing english (yes, I know I'm extreme 8) ) |
| 18:24:37 | <vincenz> | dons: you mean monoidal, with only an append operation :) |
| 18:26:03 | <yeoh> | @type map |
| 18:26:05 | <lambdabot> | forall a b. (a -> b) -> [a] -> [b] |
| 18:26:06 | <hpaste> | Julien Oster pasted "permtree2.hs" at http://hpaste.org/3485 |
| 18:26:09 | <dmwit> | excitingjelly: You could annotate it. |
| 18:26:22 | <excitingjelly> | dmwit, hmm. yes, I'll do that. thanks. |
| 18:26:33 | <hoelzro> | when I export a Haskell function via the FFI, and I call it from C, what object files do I need to link to when I call gcc? |
| 18:26:33 | <lambdabot> | hoelzro: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 18:26:56 | <dons> | hoelzro: check the ffi guide, ghc will generate some .h files and .c files to link against |
| 18:27:27 | <hpaste> | Julien Oster annotated "permtree2.hs" with "permtree2.hs" at http://hpaste.org/3484#a1 |
| 18:27:49 | <hoelzro> | I checked, and linked against the stubs, but I have a bunch of unresolved symbols like base... and stg... |
| 18:28:40 | <yeoh> | Does any monad-fu know of a shorter way of expressing this: m >>= return . f |
| 18:28:49 | <dmwit> | liftM/fmap |
| 18:29:18 | <dons> | ?pl m >>= return . f |
| 18:29:18 | <lambdabot> | f `fmap` m |
| 18:29:29 | <dons> | <$> is also an optoin |
| 18:29:37 | <dons> | :t toUpper `fmap` getChar |
| 18:29:38 | <lambdabot> | IO Char |
| 18:29:44 | <dons> | :t toUpper <$> getChar |
| 18:29:46 | <lambdabot> | IO Char |
| 18:29:57 | <dons> | :t getChar >>= return . toUpper |
| 18:29:58 | <roconnor> | :t toUpper `liftM` getChar |
| 18:29:58 | <lambdabot> | IO Char |
| 18:29:59 | <lambdabot> | IO Char |
| 18:30:57 | <yeoh> | hmm, obviously so in hindsight |
| 18:31:08 | <yeoh> | thx everyone |
| 18:31:14 | <byorgey> | yeoh: that's ok, it always is =) |
| 18:41:10 | <Cale> | grr |
| 18:41:30 | <Cale> | hoelzro left before I could answer |
| 18:41:59 | <byorgey> | =( |
| 18:42:45 | <Cale> | Oh, dons answered him, I missed that. |
| 18:43:20 | <araujo> | http://www.cs.nott.ac.uk/~wss/repos/IOSpec/www/unsafe.jpg |
| 18:43:32 | <Cale> | Isn't the real answer (at least for convenience's sake), just to compile your C program with ghc? |
| 18:44:11 | <dmwit> | araujo: hehe |
| 18:44:47 | <dmwit> | Oh noes, arcanux.org is down! |
| 18:44:53 | <dmwit> | Where will I get my lambdacats fix? |
| 18:45:19 | <Cale> | http://cale.yi.org/autoshare/coequaliser.jpg |
| 18:46:56 | <dmwit> | HaskellWiki is on the first page of results for a Google Image search. =P |
| 18:50:34 | <roconnor> | what's the relationship between epigram and simple easy!? |
| 18:51:17 | <Cale> | They're both dependently typed? |
| 18:52:51 | <roconnor> | but they aren't the same? |
| 18:52:58 | <roconnor> | epigram 2 core and simple easy! |
| 18:55:00 | <Cale> | I don't know. |
| 19:29:55 | <augustss> | roconnor: I think epigram core is more complex. isn't it based on OTT? |
| 20:10:08 | <hpaste> | sebell pasted "'do' notation woes" at http://hpaste.org/3486 |
| 20:11:07 | <conal> | sebell: "data" is a keyword |
| 20:11:16 | <sebell> | Of course it is. |
| 20:11:22 | <sebell> | Thanks :) |
| 20:11:38 | <conal> | :) it only occurred to me because hpaste colored it. |
| 20:12:03 | <sebell> | It did indeed! |
| 20:13:17 | <Cale> | Kind of odd that it would give that particular error message, actually. |
| 20:13:41 | <conal> | yeah -- pretty obscure. must be an inner logic. |
| 20:13:43 | <sebell> | I can't say that I wasn't confused by it... |
| 20:14:10 | <Cale> | That's a worse kind of syntax error than the usual sort which triggers that message. |
| 20:14:23 | <conal> | oh -- the "data" declaration was taken to end the "do", in order to parse. |
| 20:14:24 | <byorgey> | you'd think it would give some sort of parse error or something. |
| 20:15:41 | <Cale> | Yeah, I would have thought layout would have ended up making that do { ... ; data <- ... ; ... } |
| 20:16:10 | <Cale> | But I suppose that it makes it into do { ... ls <- ... } data <- mapM ... |
| 20:16:39 | <oerjan> | Cale: it inserts }'s by the parse-error rule |
| 20:17:17 | <oerjan> | but it could have done better given that data cannot work even after that |
| 20:17:40 | <omnId> | It could be helpful if, when the parse-error-insertion rule *itself* causes a parse error, it'd tell you. |
| 20:18:02 | <oerjan> | since a ; is needed before data - but perhaps ghc relaxes that? |
| 20:18:38 | <omnId> | oerjan: hm? ; before data? |
| 20:18:54 | <oerjan> | omnId: a layout newline is equivalent to ; |
| 20:19:03 | <oerjan> | if at the same indentation |
| 20:19:17 | <omnId> | oerjan: you're talking about the ; seperating toplevel decls? |
| 20:19:23 | <oerjan> | yep |
| 20:19:30 | <TomMD> | Does GHC6.8 remove the readline4.3 requirement? |
| 20:20:23 | <sebell> | TomMD: 6.6.1 doesn't require readline, nor readline4 AFAIK -- at least my build doesn't use either. |
| 20:20:29 | <sjanssen> | TomMD: readline is still used |
| 20:20:40 | <sebell> | And I've built it against readline5 also |
| 20:21:50 | <exDM69> | you might be able to disable readline with a compile time flag? |
| 20:22:02 | <exDM69> | IMO readline is good |
| 20:22:05 | <TomMD> | I was just curious if I would need to install the compat library. |
| 20:23:04 | <viklund> | I'm going through the all_about_monads document, can someone explain what the pipe here means: |
| 20:23:08 | <viklund> | class (Monad m) => MonadError e m | m -> e where |
| 20:23:49 | <sjanssen> | viklund: it's called a functional dependency |
| 20:24:26 | <dmwit> | It means that the type "m" must completely determine the type "e". |
| 20:24:56 | <viklund> | ahh, ok, that makes it a bit clearer at least. Thanks |
| 20:24:59 | <dmwit> | So you couldn't have both "instance MonadError Foo Bar" and "instance MonadError Baz Bar". |
| 20:25:32 | <viklund> | aha |
| 20:25:43 | <omnId> | maybe one of the instances of MonadError could help: instance MonadError String (Either String) where ... |
| 20:25:58 | <omnId> | (not quite it, I think instead of String it's Error a => a |
| 20:26:43 | <omnId> | given that instance, you couldn't have an instance MonadError AnyOtherType (Either String) |
| 20:27:30 | <fox86> | how big can i make an Integer or an Int? or a Double? can i check from ghci? |
| 20:27:41 | <omnId> | This helps inference. If the inferencer can infer the Either String part, it knows there's only one other type that can fit into the 'e' variable. |
| 20:27:44 | <roconnor> | > maxBound :: Int |
| 20:27:46 | <lambdabot> | 2147483647 |
| 20:27:50 | <roconnor> | > maxBound :: Double |
| 20:27:51 | <omnId> | fox86: Integers are unbounded |
| 20:27:51 | <lambdabot> | add an instance declaration for (Bounded Double) |
| 20:27:52 | <lambdabot> | In the expression: max... |
| 20:27:56 | <roconnor> | :( |
| 20:28:04 | <viklund> | hmm, I think I might understand a bit more now, for a while at least ;) |
| 20:28:09 | <oerjan> | > product [1..10000] |
| 20:28:11 | <lambdabot> | 2846259680917054518906413212119868890148051401702799230794179994274411340003... |
| 20:28:16 | <viklund> | thanks again |
| 20:28:53 | <omnId> | thus it's read that "'m' (uniquely) determines 'e'" |
| 20:28:55 | <fox86> | roconnor: thank you |
| 20:28:58 | <dmwit> | > 10e30 |
| 20:29:00 | <lambdabot> | 1.0e31 |
| 20:29:04 | <dmwit> | > 10e300 |
| 20:29:06 | <lambdabot> | 1.0e301 |
| 20:29:13 | <dmwit> | > 10e3000 |
| 20:29:16 | <lambdabot> | ghc: failed with error code 9 |
| 20:29:24 | <newsham> | (last $ show $ product [1..2342349325324]) == '0' |
| 20:29:38 | <dmwit> | True |
| 20:29:57 | <Cale> | dmwit: Very large floating point constants use lots of memory to evaluate at compile time, due to their meaning. |
| 20:30:20 | <Cale> | they're fromRational (something derived from what you typed) |
| 20:30:26 | <dmwit> | Cale: Please tell me that doesn't become (fromInteger 1000....). |
| 20:30:29 | <dmwit> | ouch |
| 20:30:41 | <Cale> | This is because they're polymorphic |
| 20:30:59 | <Cale> | (at least initially) |
| 20:31:15 | <byorgey> | > 10 ** 3000 |
| 20:31:16 | <dmwit> | At first blow, I would consider that a wart. |
| 20:31:16 | <lambdabot> | Infinity |
| 20:31:22 | <dmwit> | I understand the reasoning, though. |
| 20:31:45 | <Cale> | At least you'll never actually want a Double constant that large, because it's Infinity anyway |
| 20:32:05 | <dmwit> | Yeah, I was trying to find maxBound :: Double. |
| 20:32:14 | <Cale> | > maxBound :: Double |
| 20:32:15 | <lambdabot> | add an instance declaration for (Bounded Double) |
| 20:32:15 | <lambdabot> | In the expression: max... |
| 20:32:19 | <Cale> | hehe :) |
| 20:32:33 | <roconnor> | I guess the problem with a bounded Double would be that infinity is larger |
| 20:32:38 | <oerjan> | > floor (1/0) |
| 20:32:40 | <dmwit> | yeah |
| 20:32:40 | <lambdabot> | 1797693134862315907729305190789024733617976978942306572734300811577326758055... |
| 20:32:54 | <dmwit> | oerjan++ |
| 20:33:00 | <Cale> | ahaha |
| 20:33:10 | <dmwit> | > fromInteger (floor (1/0)) :: Double |
| 20:33:11 | <lambdabot> | Infinity |
| 20:33:39 | <Cale> | > log (fromIntegral (floor (1/0) `div` 2)) |
| 20:33:40 | <lambdabot> | 709.0895657128241 |
| 20:33:54 | <dmwit> | > length . show . floor $ (1/0) |
| 20:33:54 | <Cale> | > log (fromIntegral (floor (1/0) `div` 2)) / log 10 |
| 20:33:55 | <lambdabot> | 309 |
| 20:33:56 | <lambdabot> | 307.95368556425274 |
| 20:34:18 | <Cale> | > 10**307 |
| 20:34:19 | <lambdabot> | 1.0e307 |
| 20:34:20 | <dmwit> | > 1e309 |
| 20:34:21 | <Cale> | > 10**308 |
| 20:34:23 | <lambdabot> | 1.0e308 |
| 20:34:23 | <lambdabot> | Infinity |
| 20:34:27 | <sorear> | IF we could assume instances obey the laws, we could turn 1.0e100000 into (fromRational (1%1) * (fromRational (10%1) ^^ 100000)) |
| 20:34:45 | <oerjan> | > (2**1023, 2**1024) |
| 20:34:47 | <lambdabot> | (8.98846567431158e307,Infinity) |
| 20:35:04 | <dmwit> | aha |
| 20:35:09 | <dmwit> | 10 bits for the exponent, then? |
| 20:35:32 | <dmwit> | I guess there's probably a spec somewhere I should just go read. |
| 20:36:10 | <viklund> | is this "type ParseMonad = Either ParseError" the same thing as "type ParseMonad a = Either ParseError a"? |
| 20:36:24 | <omnId> | viklund: yes |
| 20:36:36 | <viklund> | omnId: thx, it's getting ever clearer... |
| 20:36:36 | <sjanssen> | though the former requires an extension |
| 20:36:45 | <oerjan> | > floatRange 1.0 |
| 20:36:47 | <lambdabot> | (-1021,1024) |
| 20:37:30 | <dmwit> | > floatRange undefined |
| 20:37:31 | <lambdabot> | (-1021,1024) |
| 20:38:39 | <dmwit> | Oh, it needs "undefined" to tell what the type is? |
| 20:38:43 | <dmwit> | sneaky |
| 20:38:50 | <viklund> | and then when you use "ParseMonad Integer" it gets bound, right |
| 20:39:00 | <sjanssen> | dmwit: it just needs any inhabitant of that type |
| 20:39:02 | <oerjan> | viklund: actually not quite because only the first allows you to pass ParseMonad to a monad transformer, i think (because type synonyms must be fully applied) |
| 20:39:07 | <viklund> | so it's not really "ParseMonad a", it's more like a curried type? |
| 20:39:09 | <dmwit> | sjanssen: Sorry, yeah, that's what I meant. |
| 20:39:34 | <omnId> | viklund: yep, simple beta subtitution (of types!) |
| 20:39:40 | <viklund> | cool! |
| 20:42:29 | <Cale> | Yeah, it's nice to be able to put it that way, because ParseMonad *is* the actual monad. |
| 20:46:30 | <viklund> | I find it hard to understand single lines of code in haskell, most programming languages I've come across so far it's generally pretty easy to grok the meaning of stuff |
| 20:46:58 | <viklund> | but on the other hand I feel extremely happy every time I understood something in haskell |
| 20:47:09 | <viklund> | that has never happened before either... |
| 20:47:46 | <viklund> | I've had some gentle introductions to lisp and prolog but nothing like in haskell |
| 20:48:05 | <viklund> | it's better than drugs! |
| 20:48:13 | <dons> | :) |
| 20:48:17 | <byorgey> | yes, Haskell tends to have that effect =) |
| 20:48:22 | <byorgey> | glad you're enjoying it! |
| 20:48:37 | <dons> | there's no superficial clutter |
| 20:48:39 | <ricky_clarkson> | Point-free seems to go in slowly. |
| 20:48:39 | <viklund> | a few days ago I entertained my self with ghci writing stuff like: |
| 20:48:50 | <dons> | so you get at the core of programming immediately, rather than wasting time reading for loops |
| 20:49:10 | <viklund> | > [3,2] >>= \x -> [x,x+2] |
| 20:49:22 | <lambdabot> | [3,5,2,4] |
| 20:49:29 | <dons> | right, all depends on what >>= means :) |
| 20:49:41 | <byorgey> | hehe, yes, the list monad is quite entertaining |
| 20:49:41 | <ricky_clarkson> | @pl \x -> [x,x+2] |
| 20:49:41 | <lambdabot> | ap (:) (return . (2 +)) |
| 20:49:44 | <dons> | concatMap (\x -> [x,x+2]) [3,2] |
| 20:49:49 | <dons> | > concatMap (\x -> [x,x+2]) [3,2] |
| 20:49:50 | <lambdabot> | [3,5,2,4] |
| 20:50:02 | <Japsu> | http://hpaste.org/3467 <-- NFA using list monad |
| 20:50:11 | <dons> | > \x -> [x,x+2] `concatMap` [3,2] |
| 20:50:12 | <lambdabot> | Couldn't match expected type `a -> [b]' |
| 20:50:15 | <Saizan_> | > [id,(+2)] `ap` [3,2] |
| 20:50:16 | <lambdabot> | [3,2,5,4] |
| 20:50:19 | <dons> | heh |
| 20:50:30 | <Saizan_> | modulo order :) |
| 20:50:30 | <ricky_clarkson> | nice |
| 20:51:09 | <viklund> | fascinating... |
| 20:52:02 | <oerjan> | > [3,2] >>= sequence [id,(+2)] |
| 20:52:04 | <lambdabot> | [3,5,2,4] |
| 20:52:21 | <oerjan> | *cackle* |
| 20:52:42 | <omnId> | no fair using ((->) r)! |
| 20:53:07 | <oerjan> | but using just one monad is so boring ;) |
| 20:53:12 | <wli> | Arrow stuff on (->) is useful, too. |
| 20:53:48 | <oerjan> | > liftM2 (+) [3,2] [0,2] |
| 20:53:50 | <lambdabot> | [3,5,2,4] |
| 20:56:10 | <byorgey> | > map (id &&& (+2)) [3,2] |
| 20:56:13 | <lambdabot> | [(3,5),(2,4)] |
| 20:58:01 | <byorgey> | > map (id &&& (+2)) [3,2] >>= liftM2 (:) fst (return . snd) -- how's this for gratuitous? |
| 20:58:03 | <lambdabot> | [3,5,2,4] |
| 20:58:11 | <Japsu> | urgh |
| 20:58:33 | <omnId> | liftM2 (:) fst (return . snd) (x,y) = [x,y] |
| 20:58:48 | <dmwit> | ?pl \xs -> map (id &&& (+2)) xs >>= liftM2 (:) fst (return . snd) |
| 20:58:49 | <lambdabot> | (liftM2 (:) fst (return . snd) =<<) . map (id &&& (2 +)) |
| 20:58:56 | <omnId> | ACTION prefers (\(x,y)->[x,y]) -- :P |
| 20:59:09 | <byorgey> | well, so do I of course, I was just being silly =) |
| 20:59:32 | <dmwit> | > (liftM2 (:) fst (return . snd) =<<) . map (id &&& (2+)) $ [3, 2] |
| 20:59:33 | <lambdabot> | [3,5,2,4] |
| 21:00:42 | <wli> | ACTION prefers [x + y | x <- [3, 2], y <- [0, 2]] |
| 21:01:43 | <omnId> | > do x <- [3, 2]; y <- [0, 2]; return (x + y) |
| 21:01:45 | <lambdabot> | [3,5,2,4] |
| 21:02:55 | <Saizan_> | ?type let foo m x = m x >> return x |
| 21:02:56 | <lambdabot> | <command line>: |
| 21:02:56 | <lambdabot> | Could not find module `L': |
| 21:02:56 | <lambdabot> | Use -v to see a list of the files searched for. |
| 21:03:00 | <Saizan_> | ?type let foo m x = m x >> return x in foo |
| 21:03:01 | <lambdabot> | forall b (m :: * -> *) a. (Monad m) => (b -> m a) -> b -> m b |
| 21:03:52 | <omnId> | s/m/k/g to fit convention |
| 21:04:31 | <Saizan_> | k? |
| 21:04:42 | <omnId> | (a -> m b) is a Kleisli |
| 21:04:45 | <viklund> | ACTION wonders if anyone is sane |
| 21:04:59 | <byorgey> | oh, THAT'S why it's k!! |
| 21:05:04 | <byorgey> | viklund: define sane. |
| 21:05:06 | <wli> | viklund: [x + y | x <- [3, 2], y <- [0, 2]] is sane. |
| 21:05:20 | <Capso> | Set conditionals? |
| 21:05:25 | <Capso> | Like... real Math? |
| 21:05:34 | <Saizan_> | omnId: ah, k makes me think of a continuation :) |
| 21:05:35 | <byorgey> | Capso: yup =) |
| 21:05:37 | <jleedev> | > [y x | x <- [3,2], y <- [id, (+2)]] |
| 21:05:38 | <lambdabot> | [3,5,2,4] |
| 21:05:46 | <Capso> | byorgey: I might love this language. :) |
| 21:05:47 | <omnId> | > runKleisli $ Kleisli (\x -> [x, x+2]) >>> Kleisli (\y -> [y, y*3]) $ 1 |
| 21:05:48 | <lambdabot> | Couldn't match expected type `a -> c' |
| 21:06:07 | <omnId> | > runKleisli (Kleisli (\x -> [x, x+2]) >>> Kleisli (\y -> [y, y*3])) 1 |
| 21:06:08 | <lambdabot> | [1,3,3,9] |
| 21:06:24 | <byorgey> | > [ (a,b,c) | a <- [1..100], b <- [a..100], c <- [b..100], a^2 + b^2 == c^2 ] |
| 21:06:25 | <lambdabot> | [(3,4,5),(5,12,13),(6,8,10),(7,24,25),(8,15,17),(9,12,15),(9,40,41),(10,24,2... |
| 21:06:29 | <omnId> | ACTION was channeling Cale for a second there |
| 21:06:32 | <byorgey> | Capso: ^^^ =) |
| 21:06:43 | <viklund> | heh |
| 21:07:08 | <omnId> | @src Kleisli (>>>) |
| 21:07:08 | <lambdabot> | Plugin `source' failed with: getRandItem: empty list |
| 21:07:15 | <omnId> | :( |
| 21:07:21 | <byorgey> | @src Arrow Kleisli |
| 21:07:21 | <lambdabot> | Plugin `source' failed with: getRandItem: empty list |
| 21:07:27 | <dmwit> | ?src map |
| 21:07:28 | <lambdabot> | map _ [] = [] |
| 21:07:28 | <lambdabot> | map f (x:xs) = f x : map f xs |
| 21:07:42 | <Capso> | byorgey: Hehe, that's awesome. |
| 21:07:43 | <dmwit> | Okay, so it only complains when it can't find the source. |
| 21:07:43 | <omnId> | Kleisli f >>> Kleisli g = Kleisli (\x -> f x >>= g) |
| 21:07:47 | <exDM69> | if I have a list of things, is there a simple way of making all possible combinations of those? |
| 21:08:12 | <omnId> | exDM69: the powerset? |
| 21:08:17 | <Capso> | > (foldl (.) id [\x -> x*k | k <- [1..n]]) 1 |
| 21:08:18 | <lambdabot> | Not in scope: `n' |
| 21:08:22 | <twanvl> | > filterM (const [True,False]) [1,2,3] |
| 21:08:23 | <lambdabot> | [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]] |
| 21:08:29 | <omnId> | or all the permutation? |
| 21:08:34 | <omnId> | -s. |
| 21:09:02 | <exDM69> | let's say I have [1,2,3] and I want [[1], [1,2], [1,3], [1,2,3], [2], [2, 3], [3]] |
| 21:09:19 | <ddarius> | exDM69: What about [] ? |
| 21:09:22 | <byorgey> | exDM69: twanvl illustrated that above. |
| 21:10:04 | <exDM69> | ddarius: [] doesn't matter, I don't want it but I can handle it |
| 21:10:11 | <byorgey> | easy enough to remove with \\ []. |
| 21:10:12 | <exDM69> | byorgey: oh, I see |
| 21:10:32 | <exDM69> | twanvl: can you explain how that works? (I'm a newbie) |
| 21:10:49 | <byorgey> | exDM69: how much do you know about monads? |
| 21:10:56 | <byorgey> | the list monad, in particular |
| 21:10:59 | <exDM69> | byorgey: very little |
| 21:11:11 | <byorgey> | exDM69: well, perhaps you should just accept it as magic for now =) |
| 21:11:22 | <exDM69> | sigh |
| 21:11:27 | <byorgey> | exDM69: but if you want, I wrote a blog post explaining that very code a while ago |
| 21:11:30 | <oerjan> | > filterM (const [False,True]) [1,2,3] |
| 21:11:30 | <exDM69> | what's filterM? |
| 21:11:32 | <lambdabot> | [[],[3],[2],[2,3],[1],[1,3],[1,2],[1,2,3]] |
| 21:11:42 | <exDM69> | byorgey: I'd love to see it |
| 21:11:48 | <byorgey> | @go filterM code from types |
| 21:11:53 | <lambdabot> | http://byorgey.wordpress.com/2007/06/26/deducing-code-from-types-filterm/ |
| 21:11:53 | <lambdabot> | Title: Deducing code from types: filterM « blog :: Brent -> [String] |
| 21:12:06 | <Saizan_> | > let pset [] = [[]]; pset (x:xs) = map (x:) (pset xs) ++ (pset xs) in pset [1,2,3] |
| 21:12:07 | <lambdabot> | [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]] |
| 21:12:16 | <jleedev> | http://community.livejournal.com/evan_tech/220036.html |
| 21:12:17 | <lambdabot> | Title: evan_tech -- powerset |
| 21:12:28 | <omnId> | @source Control.Monad |
| 21:12:28 | <lambdabot> | http://darcs.haskell.org/packages/base/Control/Monad.hs |
| 21:12:32 | <Saizan_> | easier to understand, maybe? ^^^ |
| 21:13:01 | <byorgey> | exDM69: filterM is similar to filter, but monadic. |
| 21:13:20 | <exDM69> | byorgey: I don't understand monads |
| 21:13:23 | <exDM69> | but I'd like to |
| 21:13:29 | <Capso> | byorgey: Are all sets ordered, or is there an inherent distinction, by Haskell, of Sets and PoSets? |
| 21:13:43 | <byorgey> | exDM69: essentially, the 'const [True, False]' says to both include and not include each element |
| 21:13:53 | <omnId> | filterM _ [] = return [] |
| 21:13:53 | <byorgey> | exDM69: the list monad takes care of listing all the possibilities. |
| 21:13:58 | <omnId> | filterM p (x:xs) = do |
| 21:13:58 | <omnId> | flg <- p x |
| 21:13:58 | <omnId> | ys <- filterM p xs |
| 21:13:58 | <omnId> | return (if flg then x:ys else ys) |
| 21:14:00 | <exDM69> | byorgey: I somewhat understand the "real world example" in YAHT |
| 21:14:20 | <omnId> | you can think of an inserted concatMap between each line of a list monad do block. |
| 21:14:42 | <byorgey> | exDM69: don't worry, you'll get there. try reading Cale's "monads as computation" tutorial, perhaps? |
| 21:14:42 | <dmwit> | Wow, WASH sucks it hard at concurrent connections. |
| 21:14:50 | <ddarius> | Capso: They aren't sets, they are lists. |
| 21:14:53 | <dmwit> | 650 seconds to serve 100 simultaneous connections. |
| 21:15:02 | <byorgey> | Capso: well, the [ foo | blah ] notation you saw are really list comprehensions. |
| 21:15:05 | <exDM69> | byorgey: I was thinking about writing a card game |
| 21:15:10 | <dmwit> | (of an essentially static page) |
| 21:15:13 | <Cale> | Oh, someone asking about monads? |
| 21:15:16 | <byorgey> | Capso: so they are ordered. |
| 21:15:20 | <exDM69> | byorgey: would it be a good idea to write the deck module as a monad |
| 21:15:24 | <exDM69> | Cale: yes, I was |
| 21:15:30 | <omnId> | Cale: powerset via filterM |
| 21:15:34 | <Cale> | ah |
| 21:15:35 | <Cale> | okay |
| 21:15:38 | <byorgey> | exDM69: I don't think that's necessary. |
| 21:15:39 | <Capso> | byorgey: Ah, OK. |
| 21:15:58 | <Cale> | exDM69: Do you understand it now or would you like my take on it? |
| 21:15:59 | <byorgey> | Capso: there is Data.Set if you want actual sets (i.e. no duplicates). |
| 21:16:25 | <Capso> | byorgey: All right. :) |
| 21:16:32 | <Cale> | Unfortunately there's no Data.Poset |
| 21:16:39 | <Cale> | That would be cool though. |
| 21:17:00 | <byorgey> | Cale: hmm... what would such a module do? |
| 21:17:02 | <Capso> | Cale: Is Data.Set just a restriction on the lists? |
| 21:17:11 | <Capso> | byorgey: Partially Ordered Sets. |
| 21:17:14 | <Cale> | Capso: No, it maintains binary balanced trees |
| 21:17:34 | <byorgey> | Capso: right, I know what a poset is, just wondering what an equivalent Haskell formulation might look like. |
| 21:17:43 | <Capso> | Oh, OK. |
| 21:17:53 | <Cale> | Capso: and elements of Sets are required to have an ordering defined on them |
| 21:18:05 | <ddarius> | class POrd a where comparing' :: a -> a -> Maybe Ordering |
| 21:18:06 | <Cale> | (otherwise there's no way to maintain the data structure) |
| 21:18:18 | <byorgey> | ddarius: makes sense. |
| 21:18:32 | <Cale> | well, that would be a global partial ordering on the type |
| 21:19:19 | <Cale> | Ideally, a Poset data structure would be like a Data.Set together with ordering information for the members |
| 21:20:08 | <Capso> | Cale: In which topic in mathematics, do Sequences belong? |
| 21:20:14 | <byorgey> | wouldn't you want something like (POrd a) => Data.Set a? |
| 21:20:35 | <byorgey> | if it was just a Set with ordering information, it would be hard to enforce the fact that it defined a partial ordering. |
| 21:20:40 | <Cale> | Capso: analysis? |
| 21:20:53 | <Cale> | They're used all over the place. |
| 21:21:21 | <byorgey> | also, if you mean integer sequences, perhaps number theory or combinatorics? |
| 21:21:25 | <Capso> | Cale: Why not some part of Set Theory or the like? |
| 21:21:43 | <Capso> | They are so similar... |
| 21:21:49 | <astrolabe> | Does anyone here have the power to edit pages on http://hackage.haskell.org? |
| 21:22:02 | <Cale> | Well, okay |
| 21:22:14 | <Cale> | sequences are just functions from the natural numbers (to some set) |
| 21:23:06 | <Cale> | They're not typically studied in and of themselves. Usually you're interested in the sequences of values in a particular set, and usually that set has some additional structure. |
| 21:23:08 | <calvins> | Does anybody know what happened with the google soc project relating to bytestring-enabling parsec? |
| 21:23:34 | <pitecus> | Is there some way of including a large literal multiline string in Haskell source? |
| 21:23:39 | <astrolabe> | calvins: was that the one that philippa and xerox were doing? |
| 21:23:44 | <calvins> | yes |
| 21:23:53 | <byorgey> | ACTION `ap` "volleyball game" |
| 21:24:00 | <calvins> | i'm having trouble finding information about it |
| 21:24:28 | <wli> | viklund: Also try let perms [] = [[]] ; perms (x:xs) = let allInsert [] = [[x]] ; allInsert (y:ys) = (x:y:ys) : map (y:) (allInsert ys) in concatMap allInsert $ perms xs in perms [1,2,3] :: [[Integer]] |
| 21:24:45 | <astrolabe> | @seen philippa |
| 21:24:45 | <lambdabot> | philippa is in #scannedinavian, #haskell-soc, #haskell-overflow, #haskell-blah and #haskell. I don't know when philippa last spoke. |
| 21:25:24 | <Capso> | Cale: Ah, I see. |
| 21:25:31 | <astrolabe> | calvins: I got the impression it was going quite well at the time of anglo-haskell |
| 21:25:52 | <calvins> | astrolabe: hmm, that's good news |
| 21:26:16 | <Cale> | Capso: For example, topological structure, so that you can talk about whether the sequence converges, or metric/uniform structure, so you can talk about whether the sequence is Cauchy. |
| 21:26:26 | <calvins> | i was expecting bad news (like darcs conflict bug) since I couldn't find much about it... |
| 21:26:33 | <ddarius> | What?! If we go to ordered linear logic then sequences will become just as relevant as sets. |
| 21:26:58 | <Cale> | Except that nobody uses ordered linear logic except logicians. |
| 21:27:36 | <ddarius> | My impression is that even logicians don't use ordered linear logic. It's mostly computer scientists. |
| 21:27:49 | <Capso> | I would sure like to know WTF it is. :) |
| 21:28:02 | <ddarius> | Capso: Do you know what linear logic is? |
| 21:28:05 | <pitecus> | So no multiline strings? |
| 21:28:16 | <Capso> | Oh, wow... |
| 21:28:19 | <bos> | pitecus: sort of |
| 21:28:25 | <Capso> | Google for the term, and it's *all* programming and applications. |
| 21:28:34 | <Cale> | pitecus: I'd usually use unlines, applied to a list |
| 21:28:36 | <bos> | pitecus: start a string with a double quote, end a line with a backslash |
| 21:28:43 | <Cale> | pitecus: Or you can use string gaps |
| 21:28:59 | <Cale> | bos: You also have to start the next line with a backslash |
| 21:29:01 | <bos> | pitecus: then start the next line with a backslash, and on and on until the last line ends with a double quote |
| 21:29:05 | <Cale> | right |
| 21:29:08 | <bos> | Cale: i can only type so fast :-) |
| 21:29:10 | <pitecus> | Cale, string gaps? |
| 21:29:17 | <bos> | pitecus: what i just said |
| 21:29:20 | <Cale> | also, if you want the newlines, then you'll need to include them specifically |
| 21:29:24 | <pitecus> | OK bos |
| 21:29:25 | <twanvl> | > "string\ \gap" |
| 21:29:26 | <bos> | right |
| 21:29:27 | <lambdabot> | "stringgap" |
| 21:29:33 | <Capso> | ddarius: Ah, no. |
| 21:29:59 | <pitecus> | So basically no |
| 21:30:01 | <ddarius> | Capso: Do you know what the logic rules of contraction and weakening are? |
| 21:32:38 | <omnId> | > "string gap \n\ \with newline" |
| 21:32:39 | <lambdabot> | "string gap \nwith newline" |
| 21:32:46 | <Capso> | ddarius: Nope, not read up on these things yet. Any suggested material? :) |
| 21:34:01 | <Cale> | pitecus: unlines works well |
| 21:34:14 | <Cale> | unlines ["This is the first line.", |
| 21:34:22 | <Cale> | "This is the second line."] |
| 21:34:57 | <ddarius> | Hmm. "Fac-simile of original preprint (Oct. 1990) never published, a pure waste of paper !" |
| 21:35:04 | <pitecus> | Cale, its a whole file of data, not just a few lines, its a bit of a hassle to have to put it ina list of strings |
| 21:35:29 | <Cale> | pitecus: You could put it in a separate file and load it. |
| 21:35:58 | <pitecus> | That means being in IO |
| 21:36:20 | <Cale> | Well, you are in IO in main. You can then pass the String down to whatever it is that needs it. |
| 21:36:41 | <ddarius> | Capso: I haven't read these, but they're probably good. |
| 21:36:44 | <ddarius> | http://iml.univ-mrs.fr/~girard/coursang/coursang.html |
| 21:36:45 | <lambdabot> | Title: The Blind Spot |
| 21:37:06 | <ddarius> | Beyond that, there are these http://iml.univ-mrs.fr/~girard/Articles.html of which I have read some. |
| 21:37:07 | <lambdabot> | Title: Articles Jean-Yves Girard |
| 21:37:27 | <pitecus> | Cale thats what I'm trying to avoid, having to change a lot of functions to take an additional argument |
| 21:38:25 | <Capso> | ddarius: Cool, thanks. |
| 21:38:45 | <Cale> | Well, you can do some awful hack like unsafePerformIO (readFile "..."), I suppose. |
| 21:39:08 | <Cale> | http://iml.univ-mrs.fr/~girard/0.pdf.gz is awesome, btw |
| 21:39:12 | <omnId> | pitecus: if you're only putting it in a file out of convenience, and you could see yourself putting it as a toplevel string variable in your code, then the unsafePerformIO could be justified. |
| 21:39:46 | <pitecus> | omnId, I was thinking along those lines... |
| 21:40:02 | <Cale> | What is this file? |
| 21:40:15 | <pitecus> | Its some lexicon data |
| 21:40:28 | <dmwit> | LexiconData.hs ;-) |
| 21:40:36 | <pitecus> | yep |
| 21:40:44 | <Cale> | Doesn't it make sense to have that be a parameter? |
| 21:42:00 | <pitecus> | It would be OK but its just inconvenient to have to pass it down thru all the functions to the ones that are going to use it |
| 21:42:13 | <dmwit> | suck it up |
| 21:42:19 | <dmwit> | just my 2c |
| 21:42:55 | <Cale> | It also makes it somewhat clearer that those functions actually do depend on it. |
| 21:43:23 | <Cale> | If the lexicon data ever changes, you know which functions then could have their results change. |
| 21:43:54 | <pitecus> | I guess |
| 21:43:58 | <omnId> | pitecus: presumably you'd have one function that takes it as a parameter and itself calls smaller functions which do a part of the job. In that case, the smaller functions could be in the where clause of the larger and inherit the data via scoping. |
| 21:44:24 | <Cale> | That's also possible |
| 21:44:35 | <omnId> | f data = foo bar baz where foo x y = ...; bar = ...; baz = ... |
| 21:44:46 | <omnId> | er, data's a keyword, though :) |
| 21:44:49 | <Cale> | hehe |
| 21:44:53 | <Cale> | twice in one day |
| 21:44:55 | <omnId> | s/data/dat/ |
| 21:45:05 | <omnId> | then dat is visible in the defs of foo bar and baz |
| 21:46:42 | <Cale> | ACTION flips through Locus Solum |
| 21:46:47 | <omnId> | if these smaller functions aren't used anywhere, it makes sense to limit their scope, anyway |
| 21:46:50 | <Cale> | It's so ridiculous :) |
| 21:46:53 | <omnId> | elsewhere* rather |
| 21:49:58 | <Cale> | http://iml.univ-mrs.fr/~girard/0.pdf.gz -- it's a tour-de-force, I'm telling you! |
| 21:51:06 | <pitecus> | yep I knew about lexical scoping. The functions are defined in several modules tho, so its not really too doable |
| 21:51:34 | <wli> | ACTION mutters something about parametrized modules. |
| 21:52:29 | <Cale> | You could use implicit parameters too. |
| 21:52:32 | <wli> | (pitecus' case is one of the times I'd use them) |
| 21:53:51 | <pitecus> | In that case I only need to change all the function signatures, which is bit less of a hassle but still |
| 21:54:09 | <Cale> | hmm... |
| 21:54:11 | <omnId> | let f x = x + ?y in (let ?y = 2 in f 3) |
| 21:54:15 | <omnId> | > let f x = x + ?y in (let ?y = 2 in f 3) |
| 21:54:15 | <lambdabot> | Parse error at "?y" (column 15) |
| 21:54:30 | <mauke> | :t let f x = x + ?y in (let ?y = 2 in f 3) |
| 21:54:33 | <lambdabot> | forall t. (Num t) => t |
| 21:54:51 | <Cale> | :t let f x = x + ?y in (let ?y = 2 in (f 3)^2) |
| 21:54:52 | <lambdabot> | forall t. (Num t) => t |
| 21:55:00 | <Cale> | see, you don't have to change them all |
| 21:55:20 | <Cale> | (^) doesn't know about the implicit parameter of course, that's what makes it implicit |
| 21:55:46 | <Cale> | You just have to change the type signatures of the functions which use the implicit parameter |
| 21:56:13 | <omnId> | I dunno, implicit params make me feel icky. :) |
| 21:56:27 | <Cale> | Yeah, it's basically the reader monad with Haskell syntax. |
| 21:58:26 | <pitecus> | OK Cale that sounds a bit better |
| 22:08:35 | <wli> | Interesting. ghci doesn't like let ?y :: Integer = 2 in ... (where it does like let x :: Integer = 2 in ...) |
| 22:13:48 | <augustss> | omnId: implicit params are icky |
| 22:14:38 | <wli> | This weekend I'm going to try to write an interpreter for a toy language and add modules to it. |
| 22:15:46 | <newsham> | wli: have you tried playing with any OS concepts in haskell? |
| 22:16:26 | <wli> | newsham: Not entirely sure what would qualify as that. I've done statistics collection and analysis in Haskell. |
| 22:16:53 | <wli> | newsham: (Easily doable in e.g. perl or shell scripts also but I despise perl.) |
| 22:17:29 | <newsham> | wli: you're the kernel hacker, right? |
| 22:17:39 | <wli> | Yeah. |
| 22:17:40 | <newsham> | or am i confusing you with someone else |
| 22:18:03 | <wli> | I'm the guy in MAINTAINERS, kernel/profile.c, kernel/wait.c, kernel/pid.c, etc. |
| 22:18:19 | <newsham> | there's several things I've seen recently using haskell for OS stuff.. like House, SeL4, l4verified, zipper fs, etc |
| 22:18:33 | <augustss> | wli: for some unnamed OS :) |
| 22:18:46 | <wli> | augustss: Linux |
| 22:19:03 | <augustss> | wli: I suspected as much. |
| 22:19:14 | <augustss> | kernel hacking is fun |
| 22:19:17 | <newsham> | the zipperfs is kinda amusing because its a tiny multitasking filesystem in about 1kloc. not using any thread runtime or anything liek that (although they do use sockets from the runtime) |
| 22:19:19 | <wli> | cpumask_t, pgcl, highpmd, hugetlbfs, sparc32, etc. |
| 22:20:03 | <wli> | (I'm clearly resting on my laurels here to some notable extent.) |
| 22:20:49 | <augustss> | wli: I used to do a lot of OS hacking |
| 22:21:14 | <wli> | augustss: Nice. Which kernel(s)? |
| 22:21:20 | <augustss> | NetBSD |
| 22:21:35 | <augustss> | and some generic driver stuff at work |
| 22:21:58 | <augustss> | I wrote almost all the USB driver code that *BSD uses |
| 22:21:59 | <wli> | augustss: Lots of architecture support there. Lots of fun. |
| 22:22:25 | <newsham> | no plan9 kernel hackers here? ;-) |
| 22:23:15 | <wli> | I used to think I'd want to hammer out my own kernel from scratch at some point. Then I burned out and got other things to do with my spare time. |
| 22:24:54 | <wli> | I hammered out something but it wasn't functional [sic] enough to be interesting. |
| 22:27:50 | <wli> | The concept was dull anyhow. Coremaplessness, range-based memory management at all levels, interrupt model of programming, then fight all that sucking in C and generally being a PITA to work with. |
| 22:29:07 | <wli> | It wasn't even far enough along to have an idea of what the vfs should look like. |
| 22:31:15 | <wli> | Haskell wouldn't have been a good FP lang for it. Something strict and non-GC'd (possibly sacrificing higher-order functions for such) might have flown. Most extant langs, no. Cyclone might've been appropriate. |
| 22:31:17 | <newsham> | i like designs without fs in kernel |
| 22:32:00 | <wli> | newsham: It all sounds clean until you try to handle memory exhaustion. |
| 22:32:12 | <monochrom> | You are all wimps. Wirth envisioned eliminating much of the kernel at all. :) |
| 22:32:54 | <newsham> | wire down the important parts of your critical filesystem? |
| 22:33:19 | <wli> | newsham: That ends up being all of them. |
| 22:33:27 | <newsham> | nah |
| 22:33:52 | <wli> | newsham: Yes. |
| 22:34:32 | <wli> | monochrom: My considerations were different from Wirth's. |
| 22:34:52 | <newsham> | i've used several systems without fs in kernel and they handled memory exhaustion gracefully |
| 22:35:33 | <ddarius> | Exokernels ho! |
| 22:35:45 | <SamB_XP> | newsham: how did they load the non-kernel code? |
| 22:35:47 | <LoganCapaldo> | Exo Exo Exo kernels ho! |
| 22:35:58 | <LoganCapaldo> | Exokernels are on the hunt, Exokernes are loose |
| 22:36:08 | <sorear> | wli: How gracefully does linux handle memory exhaustion? How much can still get done if kmalloc doesn't work? |
| 22:36:25 | <newsham> | samxp: not sure how you mean. the fs server? gets loaded during boot. |
| 22:37:11 | <sorear> | SamB_XP: Well, you have to load the kernel without a FS driver somehow too. It's not a great leap to load programs as well from the bootloader. |
| 22:37:20 | <newsham> | for example, grub supports loading modules into memory at boot time. |
| 22:37:47 | <ddarius> | Forth pages! |
| 22:38:00 | <newsham> | l4 has some distinguished process that gets initialized during boot |
| 22:38:29 | <SamB_XP> | sorear: who the heck loads kernels without filesystem drivers anymore? |
| 22:39:00 | <wli> | sorear: It's not that things can get done. It's that OS continues to respond in some fashion. |
| 22:39:18 | <sorear> | SamB_XP: the people who accidentally draw a distinction between bootstrap filesystem drivers and real ones :) |
| 22:39:26 | <SamB_XP> | newsham: however, you have a point |
| 22:39:43 | <ptolomy> | Now that all my recreational coding is in Haskell and in languages that support the equivalent of 'Show' natively, I have a bit of a hard time using languages where I have to hand-code pretty printing of my data types. |
| 22:40:00 | <SamB_XP> | ptolomy: you mean like Haskell? |
| 22:40:02 | <wli> | The concept was a mishmash of a number of of ideas going around from various research kernels. |
| 22:40:07 | <newsham> | ptolomy: you could always write a preprocessor to do that for you |
| 22:40:14 | <SamB_XP> | Show is kinda ugly |
| 22:40:25 | <user317> | is there anything in parsec that scans a string and returns a list of (stuff,string) pairs for the stuff and the string that caused teh match? |
| 22:40:57 | <SamB_XP> | user317: you are confused with the Dr Suess. parser monad |
| 22:41:05 | <ptolomy> | Show isn't beautiful, but at least it means that if I'm constructing a list of tuples of 'Maybe' or what have you, I can just do 'print' and I'll see it. |
| 22:42:37 | <user317> | is thre anything in parsec that will return the string that caused the match? |
| 22:43:05 | <user317> | i guess, that would be the intire input string |
| 22:43:06 | <LoganCapaldo> | WriterT Parsec? |
| 22:43:11 | <newsham> | you could write such a thing. |
| 22:43:30 | <newsham> | each individual parser returns the parsed data and the remaining string |
| 22:43:52 | <newsham> | you could write a wrapper which take orig-remaining and tacks that into the return result |
| 22:43:56 | <user317> | yea, i was hoping someone else did the work for me already |
| 22:43:59 | <Saizan_> | newsham: it would be useful to be able to write a general combinator for it |
| 22:44:17 | <LoganCapaldo> | ACTION wonders if such a thing woud be easier with an arrow based parser |
| 22:46:14 | <newsham> | i would think you could write a lifter to lift parsers into the WriterT Parsec monad |
| 22:46:25 | <newsham> | pretty easily |
| 22:46:45 | <monochrom> | @type Text.ParserCombinators.Parsec.string |
| 22:46:46 | <lambdabot> | forall st. String -> Text.ParserCombinators.Parsec.Char.CharParser st String |
| 22:46:59 | <monochrom> | That one returns the matching string. |
| 22:47:20 | <monochrom> | For example, (string "xxx") returns "xxx". |
| 22:47:35 | <newsham> | right, but he wants to parse arbitrary data out and get a copy of the strings as well as the data |
| 22:47:46 | <Saizan_> | monochrom: it's different, we wand foo p = (string parsed by p, p result) |
| 22:48:55 | <newsham> | ParserT ? :) |
| 22:49:41 | <Saizan_> | i don't see how using the transformer help finding how much input p has consumed |
| 22:50:35 | <newsham> | hrmm. |
| 22:51:48 | <newsham> | if you imported parsec's Parse (qualified) and defined your own Parse in terms of it, but with a Writer in it, and reproduced all of the primitives using a lift function |
| 22:52:05 | <newsham> | the rest of your parser would work fine with it, and you could keep track of all of the parsed input for each parser |
| 22:59:28 | <newsham> | lift (P.Parser p) = Parser p2 where p2 inp = let (r,resid) = parse p inp in (r,resid,take (length inp - length resid) inp)) |
| 23:02:16 | <newsham> | btw, does the parsec library keep track of parsing position (line number, column) for error reporting? |
| 23:02:34 | <newsham> | that might be useful for extracting the info you need |
| 23:02:42 | <user317> | yea, it does |
| 23:03:01 | <user317> | i think i could write a parser that does what i want |
| 23:03:13 | <user317> | in parsec, that just made my head spin |
| 23:07:07 | <Philippa> | the easiest thing to do re consumption is just to compare the positions before and after parsing something |
| 23:07:14 | <Philippa> | there's a combinator lets you do that |
| 23:07:16 | <user317> | yea, thats what i am doing |
| 23:10:16 | <Philippa> | unfortunately the standard position type only works in line/column, I guess if xerox and I had time we should've generalised on the position type as well |
| 23:11:04 | <SamB_XP> | at least included the offset as well |
| 23:27:06 | <user317> | there is no character position? |
| 23:28:33 | <sioraiocht> | leopard broke GNUreadline ;) |
| 23:28:38 | <sioraiocht> | :( even |
| 23:29:44 | <dons> | you should get some linuxes ;) |
| 23:29:48 | <sioraiocht> | GROSS |
| 23:29:53 | <sioraiocht> | I mean, uhh, no thanks |
| 23:31:06 | <dons> | eye candy freaks |
| 23:31:19 | <sioraiocht> | i can't live without antialiased fonts anymore |
| 23:31:22 | <allbery_b> | beta testers :> |
| 23:31:28 | <sioraiocht> | hahah |
| 23:31:36 | <sioraiocht> | i686-apple-darwin9-gcc-4.0.1: -compatibility_version only allowed with -dynamiclib |
| 23:31:37 | <Zao> | sioraiocht: s/antialiased/blurred to kingdom come/ |
| 23:31:37 | <sioraiocht> | bummer |
| 23:31:44 | <allbery_b> | ACTION usually waits for the first bugfix release. with good reason |
| 23:31:45 | <sioraiocht> | Zao: I disagree =p |
| 23:31:51 | <dons> | I guess you know X has anti-aliased fonts. |
| 23:31:59 | <mauke> | yeah, I had to disable them |
| 23:32:00 | <dons> | my vera sans is blurred all up nicely :) |
| 23:32:10 | <sioraiocht> | X and I never get along |
| 23:32:11 | <sioraiocht> | ever |
| 23:32:14 | <sioraiocht> | I've tried |
| 23:32:15 | <Excedrin> | I run linux on my macbook pro, it's OK, but I liked my thinkpad better |
| 23:32:16 | <dons> | pity the window manager sucks on the mac so much ;) |
| 23:32:17 | <Zao> | ACTION pets Terminus 9 |
| 23:32:31 | <dons> | gotta install X just to get productive |
| 23:32:47 | <sioraiocht> | ACTION puts on his fanboy ear muffs. |
| 23:33:06 | <EvilTerran> | who needs being able to maximise windows, anyway? |
| 23:33:11 | <sioraiocht> | lol |
| 23:34:26 | <user317> | what are windows? |
| 23:34:29 | <sioraiocht> | and is it just me, or is the task of correctly compiling libgmp somewhat daunting? |
| 23:34:47 | <sioraiocht> | ./configure is telling me I have a pentium3 |
| 23:34:50 | <sioraiocht> | do I listen to it? |
| 23:34:52 | <EvilTerran> | is that the arbitrary-precision numbers thingy? |
| 23:35:06 | <sioraiocht> | yes, the WORST arbitrary precision numbers thingy ever |
| 23:35:09 | <EvilTerran> | if so, yes it's daunting. if not, probably yes anyway. ;) |
| 23:35:10 | <sioraiocht> | but it's the only one =/ |
| 23:35:46 | <sioraiocht> | I'm trying to get the GIMPS people to code their stuff properly |
| 23:35:56 | <sioraiocht> | they have some really fast bignum FFT code |
| 23:36:03 | <sioraiocht> | but they can't be bothered to clean it up |
| 23:36:13 | <sioraiocht> | it's riddle with gotos and 10,000 line functions |
| 23:37:23 | <Spark> | is it asm? :) |
| 23:37:27 | <sioraiocht> | no |
| 23:37:29 | <sioraiocht> | it's C |
| 23:37:38 | <Spark> | "damnit, i knew there were a lot of gotos" |
| 23:37:51 | <mauke> | well, better than 10,000 functions on a single line |
| 23:38:07 | <sioraiocht> | mauke: you laugh, but I had to work on this code all summer |
| 23:38:25 | <dons> | mauke: or 1 function 10,000 chars long, on a single line :) list comprehensions ho! |
| 23:38:30 | <sioraiocht> | this guy was like, "I wonder why I always find all the compiler and optimisation limits with my code" |
| 23:38:37 | <mauke> | haha |
| 23:39:02 | <sioraiocht> | i sent him http://xkcd.com/292/ in response |
| 23:39:03 | <lambdabot> | Title: xkcd - A webcomic of romance, sarcasm, math, and language - By Randall Munroe |
| 23:39:03 | <Spark> | program analyses work best on inlined code and are very happy with gotos |
| 23:39:27 | <mauke> | "that's nothing, I made gcc crash by declaring a pointer to pointer to ... pointer to int, a few million levels deep" |
| 23:39:41 | <LoganCapaldo> | did you really? |
| 23:39:54 | <mauke> | yes :( |
| 23:40:00 | <Spark> | you can set up a tree of macros to do that |
| 23:40:03 | <mauke> | it's a stack overflow in the rec-descent parser |
| 23:40:04 | <Botje> | you sad sad man. |
| 23:40:12 | <mauke> | Spark: that doesn't crash the parser |
| 23:40:18 | <mauke> | er, wait. it does. |
| 23:40:30 | <Spark> | #define A ** #define B A A #define C B B #define D C C |
| 23:40:31 | <Spark> | etc |
| 23:40:46 | <Spark> | i'm sure something will break :) |
| 23:40:57 | <mauke> | Botje: someone in #c wanted to know the limits of pointer nesting so I had to test it |
| 23:41:06 | <Spark> | but gcc docs say that various things are limitted only be available memory |
| 23:41:11 | <LoganCapaldo> | why a millionish levels of indirection? |
| 23:41:12 | <sioraiocht> | mauke: and...? |
| 23:41:18 | <LoganCapaldo> | oh |
| 23:41:20 | <mauke> | it segfaulted |
| 23:41:25 | <LoganCapaldo> | you alreayd answered that question |
| 23:41:30 | <Spark> | mauke: due to lack of memory? |
| 23:41:42 | <mauke> | <mauke> it's a stack overflow in the rec-descent parser |
| 23:41:53 | <Spark> | ah right of course |
| 23:42:53 | <Mr_Awesome> | but really, what other kind of parser is there? |
| 23:43:11 | <wli> | Shift/reduce. |
| 23:43:31 | <wli> | Chart parsers. |
| 23:43:42 | <mauke> | the old parser was machine generated, I think |
| 23:43:44 | <mauke> | yacc or something |
| 23:43:48 | <Mr_Awesome> | hmm. touché |
| 23:44:08 | <mrd> | LR grammars aren't recursive descent |
| 23:44:34 | <wli> | ACTION wishes for GLR parser combinators. |
| 23:47:27 | <Mr_Awesome> | ACTION wishes he understood parsing theory more |
| 23:48:38 | <EvilTerran> | that's what the internet's for! |
| 23:49:17 | <LoganCapaldo> | the internet is for parsers |
| 23:50:32 | <Philippa> | for that, you should write the filk |
| 23:50:50 | <Philippa> | except you'll have hell making it scan |
| 23:51:17 | <wli> | Filk? |
| 23:51:18 | <allbery_b> | 'the internet's for parsers' - works for me |
| 23:51:27 | <allbery_b> | not quite a s filky though |
| 23:51:34 | <allbery_b> | might work I suppose |
| 23:51:56 | <omnId> | @jargon filk |
| 23:51:57 | <allbery_b> | @all-dicts filk |
| 23:51:57 | <lambdabot> | *** "filk" jargon "Jargon File (4.3.1, 29 Jun 2001)" |
| 23:51:58 | <lambdabot> | filk /filk/ n.,v. [from SF fandom, where a typo for `folk' was adopted |
| 23:51:58 | <lambdabot> | as a new word] Originally, a popular or folk song with lyrics revised or |
| 23:52:00 | <lambdabot> | completely new lyrics and/or music, intended for humorous effect when |
| 23:52:02 | <lambdabot> | read, and/or to be sung late at night at SF conventions. More recently |
| 23:52:04 | <lambdabot> | [8 @more lines] |
| 23:52:06 | <lambdabot> | *** "filk" jargon "Jargon File (4.3.1, 29 Jun 2001)" |
| 23:52:08 | <lambdabot> | filk /filk/ n.,v. [from SF fandom, where a typo for `folk' was adopted |
| 23:52:10 | <lambdabot> | as a new word] Originally, a popular or folk song with lyrics revised or |
| 23:52:12 | <lambdabot> | completely new lyrics and/or music, intended for humorous effect when |
| 23:52:14 | <lambdabot> | Plugin `dict' failed with: thread killed |
| 23:52:22 | <EvilTerran> | \(O.o)/ |
| 23:52:36 | <allbery_b> | *bonk* |
| 23:52:42 | <LoganCapaldo> | Thread ressurected |
| 23:52:43 | <allbery_b> | @bot |
| 23:52:43 | <lambdabot> | :) |
| 23:52:52 | <LoganCapaldo> | Thread necromancy |
| 23:53:09 | <wli> | Philippa: Burning question. How does one get up to speed on working with module systems on a practical level. e.g. for interpreters for toy languages, how/where does one get module systems added to the type system etc.? |
| 23:54:18 | <wli> | Philippa: ISTR you did something with module systems at one point, which is why I ask. |
| 23:59:49 | <bobafett> | |
| 23:59:49 | <bobafett> |
Back to channel and daily index: content-negotiated html turtle