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:02:06 | <bd_> | roconnor: right, but you'd have to examine its effects when used with the underlying monad to decide how to wrap it |
| 00:02:27 | <roconnor> | that's true for all monad transformers :) |
| 00:03:02 | <bd_> | hmmmm |
| 00:03:07 | <bd_> | :t \m -> liftM fst mfix (\p -> censor (snd p) m ) |
| 00:03:09 | <lambdabot> | forall a a1 w. (MonadWriter w ((,) a), MonadFix ((,) a)) => (a, (a1, w -> w)) -> a |
| 00:03:17 | <bd_> | why is this turning into a ((,) a) instance? |
| 00:03:25 | <Olathe> | @src censor |
| 00:03:26 | <lambdabot> | Source not found. Are you on drugs? |
| 00:03:52 | <bd_> | roconnor: anyway, censor is less powerful than pass |
| 00:04:04 | <roconnor> | yes |
| 00:04:11 | <roconnor> | but it is the only way that pass is used |
| 00:04:27 | <bd_> | roconnor: One option would be to just use a state monad |
| 00:04:41 | <bd_> | It would be easy enough to make a newtype wrapper that makes state act like writer |
| 00:04:51 | <roconnor> | and if censor was defined in MonadWriter instead of pass, then ContT (Writer w) would be an instance of MonadWriter. |
| 00:06:21 | <roconnor> | or more importantly ContT mw would be an instance of MonadWriter for any mw that is an instance of MonadWriter. |
| 00:06:33 | <bd_> | aha: |
| 00:06:37 | <bd_> | :t :t \m -> mdo { (rv, modF) <- censor modF m; return rv } |
| 00:06:38 | <lambdabot> | parse error on input `:' |
| 00:06:39 | <bd_> | :t \m -> mdo { (rv, modF) <- censor modF m; return rv } |
| 00:06:40 | <lambdabot> | forall w (t :: * -> *) t1. (MonadWriter w t, MonadFix t) => t (t1, w -> w) -> t t1 |
| 00:06:53 | <nha_> | wow i diddnt know (,) was a function haha |
| 00:06:56 | <bd_> | evil, but works :) |
| 00:07:01 | <bd_> | I think. |
| 00:07:05 | <bd_> | (also untested ;) |
| 00:07:11 | <roconnor> | bd_: it has the right type |
| 00:07:22 | <Pseudonym> | So it must work! |
| 00:07:29 | <bd_> | I'm feeling too lazy to test it right now :) |
| 00:08:01 | <bd_> | but yeah, ContT doesn't seem to lend itself to MonadFix-ification much |
| 00:08:08 | <Pseudonym> | This is a new instance of Knuth's Excuse. I've only type checked, I haven't tested it. |
| 00:08:10 | <roconnor> | Pseudonym: :D It's pretty easy to write broken code of the write type with fix and presumably mfix as well. |
| 00:08:16 | <roconnor> | s/write/right/ |
| 00:08:30 | <bd_> | true |
| 00:08:56 | <bd_> | but this shows why pass is more powerful than censor in the absense of MonadFix |
| 00:09:39 | <roconnor> | More powerful isn't always better |
| 00:09:50 | <roconnor> | more powerfull means fewer instances |
| 00:10:31 | <bd_> | Well, there are instances of MonadWriter which have pass but not MonadFix... :) |
| 00:10:36 | <bd_> | so MonadFix is 'too powerful' |
| 00:10:53 | <FunctorSalad_> | learning parsec... say I have "(try x) <|> y". if x fails, then y is silently tried, right? but is there a way to make the whole thing fail if some horrible error is encountered in x? |
| 00:11:57 | <Myoma> | you could have x succeed, but return a horrible thing |
| 00:12:04 | <FunctorSalad_> | =) |
| 00:12:16 | <Myoma> | (and case on it) |
| 00:12:18 | <Saizan_> | and call pfail if that happens |
| 00:12:30 | <bd_> | @hoogle pfail |
| 00:12:30 | <lambdabot> | Text.ParserCombinators.ReadP pfail :: ReadP a |
| 00:12:31 | <lambdabot> | Text.ParserCombinators.ReadPrec pfail :: ReadPrec a |
| 00:12:32 | <Cale> | FunctorSalad_: Well, the idea behind (try x) is that the parser consumes no input if parsing x fails. However, I believe parsec also has exceptions, so you could throw an exception? |
| 00:12:38 | <luqui> | eg. ContT (Writer w) |
| 00:12:38 | <preflex> | luqui: you have 1 new message. '/msg preflex messages' to read it. |
| 00:12:50 | <Saizan_> | or pzero, or mzero, or what is called :) |
| 00:13:09 | <bd_> | Saizan_: fail? :) |
| 00:13:15 | <FunctorSalad_> | Cale: exceptions seperate from monadic fail? |
| 00:13:37 | <Saizan_> | Cale: (<|>) will "catch" the exceptions, iirc |
| 00:13:40 | <Cale> | FunctorSalad_: yeah. (and monadic fail is just evil, use MonadPlus or the parser combinators) |
| 00:13:51 | <bd_> | FunctorSalad_: You put a ContT on top of the parsec monad, and wrap try in something like: |
| 00:14:56 | <bd_> | try' m = do { old <- getState; rv <- callCC $ (\ret -> setState (WrapperNewtype ret); fmap Right m }; setState old; case rv of Left s -> old rv; Right v -> return v } |
| 00:15:18 | <bd_> | er, (do { \ret .... }); |
| 00:15:34 | <bd_> | downside is now you need to lift all your parsec combinators |
| 00:15:34 | <FunctorSalad_> | maybe I should say what the context is :) say x parses a start tag, then a string, then an end tag. if there is no start tag, it should just fail. but if there is a start tag but no end tag, an error should be thrown to toplevel. maybe there's something simple I'm overlooking |
| 00:16:03 | <Philonous> | :t curry ketchup |
| 00:16:05 | <lambdabot> | forall a b. a -> b -> a |
| 00:16:14 | <FunctorSalad_> | bd_: thanks but ContT would be a first time too... one after the other :) |
| 00:16:17 | <bd_> | FunctorSalad_: tag = do { tagName <- startTag; contents <- manyUntil tag (endTag tagName) } or something? |
| 00:16:26 | <bd_> | I ... think manyUntil requires the ending element |
| 00:16:48 | <bd_> | manyTill* |
| 00:16:55 | <bd_> | :t manyTill |
| 00:16:56 | <lambdabot> | Not in scope: `manyTill' |
| 00:17:06 | <bd_> | :t Text.ParserCombinators.Parsec.Combinator.manyTill |
| 00:17:08 | <lambdabot> | forall tok st a end. Text.ParserCombinators.Parsec.Prim.GenParser tok st a -> Text.ParserCombinators.Parsec.Prim.GenParser tok st end -> Text.ParserCombinators.Parsec.Prim.GenParser tok st [a] |
| 00:17:17 | <FunctorSalad_> | bd_: yes. the question is how manyTill fails if it fails (I should just try it ;)) |
| 00:17:33 | <bd_> | try it :) |
| 00:18:49 | <Saizan_> | FunctorSalad_: can't you just use try only on startTag instead of the whole x? |
| 00:19:30 | <Saizan_> | FunctorSalad_: so once you've parsed startTag you've commited on that branch |
| 00:20:41 | <dobblego> | can you make GHCi be explicit with forall quantifiers? |
| 00:20:50 | <luqui> | dobblego, :set |
| 00:20:57 | <luqui> | gives you a whole bunch of options |
| 00:21:00 | <luqui> | (that's one of them) |
| 00:21:04 | <dobblego> | luqui, thanks |
| 00:21:40 | <FunctorSalad_> | Saizan_: hmm... so if (try start) >> (manyTill end) fails in the start phase, it won't have consumed any input? |
| 00:21:55 | <dmwit> | correct |
| 00:22:01 | <FunctorSalad_> | that should work then |
| 00:22:09 | <dmwit> | orrr.... no |
| 00:22:34 | <Saizan_> | the problem is if it fails at the first token of (manyTill end) |
| 00:22:52 | <Saizan_> | since i think that won't consume any input, but you want it to fail horribly |
| 00:22:54 | <dmwit> | s/if it fails/if it doesn't fail/ |
| 00:23:12 | <dobblego> | there is a GHCi option -fno-print-explicit-foralls but it already doesn't print explicit foralls? |
| 00:23:54 | <Saizan_> | no, wait, you will consume the startTag input, so (<|>) won't use y |
| 00:24:11 | <Saizan_> | however test this, i've not used parsec so much :) |
| 00:24:35 | <dmwit> | FunctorSalad_: (try start >> manyTill end) <|> y -- almost certainly does not do what you want, sadly |
| 00:24:38 | <dobblego> | the GHC manual says that explicit foralls are printed, yet my observations suggest this is not true, wtf? |
| 00:24:44 | <Saizan_> | dmwit: why? |
| 00:25:06 | <dmwit> | FunctorSalad_: If "start" fails, it reduces to "manyTill end <|> y". |
| 00:25:14 | <dmwit> | err... @Saizan_ |
| 00:25:31 | <FunctorSalad_> | that's unexpected |
| 00:25:37 | <Saizan_> | really? |
| 00:25:53 | <Saizan_> | so try masks error? |
| 00:26:03 | <dmwit> | try acts as if its argument consumes no input when it fails. |
| 00:26:27 | <Saizan_> | but it still fails. |
| 00:26:30 | <Saizan_> | i thought |
| 00:26:41 | <dmwit> | oh... that might be right |
| 00:26:42 | <FunctorSalad_> | what's the value of the try then? |
| 00:26:50 | <EvilTerran> | yes, it still fails |
| 00:26:52 | <dmwit> | Never mind me. =P |
| 00:27:08 | <EvilTerran> | try just means that, even if the parameter did consume input, you can still fall through a <|> |
| 00:28:04 | <mrsolo> | very impress with real world haskell so far :-) |
| 00:29:15 | <FunctorSalad_> | in do { value <- try start; ... }, value will be of type "a", won't it? so what's value if start fails? undefined? |
| 00:30:14 | <Myoma> | we should reinvent the JVM using dependent types for type safety |
| 00:30:16 | <FunctorSalad_> | (where a is the a in Parser a) |
| 00:30:20 | <int-e> | FunctorSalad_: there won't be a value |
| 00:30:25 | <Myoma> | that way we can remove silly things like checkcast |
| 00:30:31 | <mrsolo> | it, is that ghci only variable? |
| 00:31:01 | <Myoma> | by 'we' I mean someone else - who actually has a chance of doing it |
| 00:31:02 | <int-e> | FunctorSalad_: if start fails, the whole expression fails. 'try' just allows parsec to backtrack to the beginning of start if start fails |
| 00:31:33 | <FunctorSalad_> | int-e: ok, that is what I want it to do I think... |
| 00:41:28 | <Cale> | http://www.youtube.com/watch?v=g47V6qxKQNU -- new Catsters videos up :) |
| 00:41:29 | <lambdabot> | Title: YouTube - General limits and colimits 1 |
| 00:43:03 | <dobblego> | is it possible to get explicit foralls in GHCi? I see only lies |
| 00:43:03 | <Olathe> | Cale: Are there any Haskell packages or whatever that will do stuff like polynomial factorization and other algebra ? |
| 00:43:20 | <Cale> | dobblego: -fglasgow-exts ? |
| 00:43:37 | <dobblego> | Cale, that works, oddly |
| 00:43:41 | <Cale> | Olathe: hmm, I'm not sure about polynomial factorisation. |
| 00:44:33 | <Cale> | Olathe: You could look around on Hackage... there's a bit of stuff. |
| 00:44:59 | <Olathe> | Alright, I'll check there. Thanks :) |
| 00:45:38 | <malune> | are there any good haskell teach yourself videos? |
| 00:46:45 | <thetallgu1> | not that I know of, but there SPJ's OSCon talk from 2007 was quite accessible to people outside the FP community |
| 00:47:17 | <malune> | thetallgu1: yeah I've seen that, is there anything closer to university lectures? |
| 00:47:35 | <thetallgu1> | not that I know of. |
| 00:48:10 | <malune> | :< |
| 00:48:55 | <mmorrow> | Olathe: there's this, but i don't know much about it. http://www.haskell.org/docon/ |
| 00:48:55 | <lambdabot> | Title: DoCon the Algebraic Domain Constructor |
| 00:51:35 | <TomMD> | So when I'm getting from darcs.h.o and it stops on a random patch can I wait this out or will it never start going again? |
| 00:51:52 | <TomMD> | The first time I waited about ten minutes and it didn't get any further. |
| 00:52:15 | <mmorrow> | whenever that happens i just kill first ask questions later |
| 00:52:36 | <mmorrow> | and then try to get it by other mean / try again |
| 00:52:39 | <TomMD> | That should be lambdabots @faq answer. |
| 00:52:59 | <Myoma> | @nixon |
| 00:53:00 | <lambdabot> | Any lady who is first lady likes being first lady. I don't care what they say, they like it. |
| 00:54:01 | <chrisdone> | can anyone write this better? http://hpaste.org/10130 |
| 00:54:04 | <mmorrow> | TomMD: ha |
| 00:54:17 | <chrisdone> | other than just translating directly to a regex library or w/e |
| 00:54:30 | <mmorrow> | hiya Myoma |
| 00:55:21 | <chrisdone> | I think parsing the wild card string with parsec, and producing a new parser from it, would be totally sweet, but maybe OTT |
| 00:56:16 | <chrisdone> | ACTION tries anyway |
| 00:57:34 | <mmorrow> | parsers like the one in that paste are super fast |
| 00:58:37 | <Myoma> | hey mmorrow :) |
| 00:58:56 | <mmorrow> | how's chess? |
| 00:59:13 | <Myoma> | I haven't done anything since I figured out the right HTML yet |
| 01:00:02 | <Myoma> | I'm hoping I will find some chess library so I don't have to write all the rules out myself |
| 01:00:04 | <mmorrow> | heh, that was a pretty slick page |
| 01:00:31 | <mmorrow> | oh, yeah that'd be rough. |
| 01:00:53 | <mmorrow> | hmm, i wonder how that's even organized |
| 01:01:13 | <mmorrow> | or if there's one "common" way it's done or something |
| 01:01:23 | <Myoma> | I doubt it :p |
| 01:02:08 | <mmorrow> | yeah |
| 01:02:50 | <Myoma> | ACTION is mostly unrolling loops in some java code |
| 01:03:05 | <mmorrow> | haha, awesome. |
| 01:03:29 | <mmorrow> | by hand? |
| 01:03:50 | <Myoma> | in my head |
| 01:03:59 | <Myoma> | I'll code it later |
| 01:04:32 | <mmorrow> | ACTION had a completely different picture in his head of what was happening |
| 01:04:36 | <Myoma> | hehe |
| 01:04:39 | <mmorrow> | ha |
| 01:08:53 | <Olathe> | mmorrow: Thanks :) |
| 01:12:02 | <bos> | @seen dons |
| 01:12:03 | <lambdabot> | dons is in #xmonad, #haskell, #ghc, #darcs and #arch-haskell. I last heard dons speak 1h 40m 8s ago. |
| 01:15:44 | <chrisdone> | lojbot: w *is* |
| 01:15:45 | <lojbot> | entry ``*is*'' not found, or invalid |
| 01:15:58 | <chrisdone> | ;_; |
| 01:16:12 | <chrisdone> | lojbot: d *is* |
| 01:16:13 | <lojbot> | gismu {badna}, glossing to {banana}: $x_{1}$ is a banana/plantain [fruit/plant] of species/breed $x_{2}$. (See also {grute}.) |
| 01:16:14 | <lojbot> | 2679 more results. use the more command |
| 01:16:32 | <chrisdone> | mmorrow: doesn't really break a sweat. fast enough |
| 01:20:57 | <dons> | bos |
| 01:22:40 | <wman> | hello, is any1 happs-savvy awake ? ;-) |
| 01:22:40 | <bos> | hey hey |
| 01:22:49 | <bos> | dons: what's happening with the haskell platform? |
| 01:23:10 | <dons> | we're hammering it into shape. the meta-package lives at code.haskell.org/haskell-platform |
| 01:23:27 | <dons> | there's a new hackage written, running on code.haskell.org, that tracks build reports, and does more QA. |
| 01:23:51 | <dons> | and we're putting together a script to make a .tar.gz from the metapackage -- an equivalent of extralibs. |
| 01:23:56 | <dons> | that'll be hp 1.0 |
| 01:23:58 | <TomMD> | is that based on happs (can't remember what that ones called)? |
| 01:24:02 | <dons> | yep |
| 01:24:09 | <dons> | http://code.haskell.org:5000/ |
| 01:24:10 | <lambdabot> | Title: Index of / |
| 01:25:11 | <dons> | bos, does that clarify things? basically, hp 1.0 will be extralibs, but produced via the metapackage |
| 01:25:21 | <dons> | then we go into a 6 monthly addition/review/release cycle |
| 01:25:27 | <bos> | nice. |
| 01:25:28 | <dons> | independent of ghc releases |
| 01:26:07 | <bos> | does the metapackage have some sort of familiar representation? is it e.g. a new piece of cabal functionality? |
| 01:26:23 | <dons> | the only change is that it is a dependency only package |
| 01:26:29 | <dons> | so it provides probably only docs. |
| 01:26:35 | <dons> | but you can: $ cabal install haskell-platform |
| 01:26:37 | <bos> | i see. |
| 01:26:40 | <dons> | and get the real deal. |
| 01:26:41 | <bos> | very nice. |
| 01:26:52 | <dons> | yeah, then we do meta-things like tracking the status of each distro in supporting it |
| 01:26:56 | <bos> | and it's tied to specific versions of each package? |
| 01:27:02 | <dons> | yeah. |
| 01:27:06 | <bos> | rather than ranged versions? cool. |
| 01:27:15 | <dcoutts> | bos: like a gnome release |
| 01:27:17 | <dons> | its a specific release set. |
| 01:27:28 | <bos> | so you're under the gun to ship this around or before the 6.10.1 RC? |
| 01:27:41 | <dons> | we just need to have an extralibs -matching tar.gz |
| 01:27:49 | <dons> | distros can then support ghc as is |
| 01:27:58 | <dons> | but the full platform dev cycle starts after ghc |
| 01:28:03 | <dons> | and distro support will be independent. |
| 01:28:25 | <bos> | ok, so 6.10.1 will have a traditional extralibs, just built with the platform tools? |
| 01:28:41 | <dons> | yep. |
| 01:28:47 | <bos> | we could really do with a distro-packagers list. |
| 01:28:50 | <dons> | ghc + core is the ghc release. they'll provide an extralibs.tar.gz |
| 01:29:04 | <dons> | yeah, its very unclear how haskell is supported on each platform. |
| 01:29:13 | <dons> | tracking that, and awarding visible brownie points, should help. |
| 01:29:20 | <bos> | it's also unclear to platform owners what's going on :-) |
| 01:29:28 | <dcoutts> | heh |
| 01:29:31 | <dons> | yes, that's a concern. |
| 01:29:34 | <bos> | a central point of communication would help with that. |
| 01:29:39 | <dons> | we need to be a bit more public about getting out what the situation is. |
| 01:29:41 | <dcoutts> | bos: right, that's one point of the platform |
| 01:29:44 | <dons> | spj's been asking for that. |
| 01:30:02 | <bos> | cabal-devel seems to be consumed with this endless silly discussion over whether cabal is a dessert topping or a floor wax. |
| 01:30:04 | <dcoutts> | bos: just like gnome, to tell people what it is they need to distribute |
| 01:30:11 | <bos> | dcoutts: yes. |
| 01:30:28 | <bos> | who wrote the happsified version of hackage? |
| 01:30:36 | <dcoutts> | bos: heh, yeah, well ghc-users, on cabal-devel we tackle serious subjects like patches :-) |
| 01:30:47 | <dcoutts> | bos: Lemmih and me |
| 01:31:13 | <dcoutts> | Lemmih visited Well-Typed HQ for a few weeks and we hacked on it in the evenings |
| 01:31:34 | <bos> | dcoutts: personally, i'm very happy with Build.Simple and the general direction cabal has taken. i like the idea of making it more modular, too. but incorporating both build and other metadata is important, and you've got that right. |
| 01:31:35 | <dcoutts> | I'm pretty pleased with it as an architecture, I think it'll be more extensible |
| 01:31:45 | <bos> | ah, cool. |
| 01:31:50 | <bos> | happs proving OK to work with? |
| 01:31:53 | <dcoutts> | yeah |
| 01:32:04 | <dcoutts> | at least with guidance from one of the main authors :-) |
| 01:32:15 | <dcoutts> | the docs are terrible, but the api is good |
| 01:32:18 | <dons> | hopefully it'll be as stable as hpaste -- that's been remarkably reliable, so i'm hopeful. |
| 01:32:59 | <dcoutts> | so far it's pretty light on memory use |
| 01:33:03 | <bos> | time to send the monthly nag to augustss to see if i can get his latest llvm changes. |
| 01:33:59 | <bos> | dcoutts: are you going to be at ICFP? |
| 01:34:15 | <dcoutts> | bos: yep |
| 01:34:26 | <bos> | cool. |
| 01:34:32 | <dcoutts> | bos: you're going to teach me about whiskey remember? :-) |
| 01:34:38 | <bos> | :^) |
| 01:34:46 | <dons> | hehe |
| 01:34:53 | <dcoutts> | try and convince me it's not just water filtered through a peat bog |
| 01:35:01 | <dons> | oh boy. |
| 01:35:15 | <bos> | it's filtered through a totally yummy peat bog! |
| 01:35:18 | <TomMD> | ... I really didn't understand what I was missing. |
| 01:35:24 | <Pseudonym> | dcoutts: Of course not. It's also been stuck in rotting wood for years. |
| 01:35:28 | <TomMD> | ICFP == Whisky. |
| 01:35:38 | <TomMD> | *whiskey |
| 01:35:41 | <dons> | apparently, Tom. you're missing out! :) |
| 01:35:49 | <bos> | i could also school you in cachaca, which is made from agribusiness waste. |
| 01:35:56 | <dcoutts> | hah hah |
| 01:35:57 | <Pseudonym> | This kind of reminds me of homeopathy. It's not just water, it's also been shaken! |
| 01:36:27 | <dcoutts> | bos: you make it sound so appetising |
| 01:36:28 | <dmhouse> | dcoutts: just think about what eggs are... |
| 01:36:56 | <dcoutts> | dmhouse: yeah, I know |
| 01:37:12 | <dcoutts> | it's not that I'm averse to eating peat bogs because they're dirty or something |
| 01:38:31 | <bos> | once they've been sitting in poison for long enough, the dirt hardly matters. |
| 01:39:49 | <Pseudonym> | I have a problem with drinking something that really should be used to clean a cut. |
| 01:40:04 | <Pseudonym> | Oh, wait, that's vodka. |
| 01:41:12 | <dmhouse> | Or... water. |
| 01:43:05 | <wman> | anybody knows how to stop happs from mangling my diacritic characters ? |
| 01:43:46 | <wman> | i tried to serve cp1250 - no luck, i tried converting to UTF-8, its even worse ;-) |
| 01:44:21 | <TomMD> | rss and HAppS-? had conflicting dependencies for versions of HaXML when installing hackage-server on a clean system. |
| 01:44:43 | <Saizan_> | wman: are you setting the encoding properly? |
| 01:44:49 | <bos> | whoa, binary-strict can do alternative parsing. |
| 01:45:07 | <Saizan_> | wman: in the http headers or in the html |
| 01:45:12 | <TomMD> | Fixed by manually installing an older version of rss (3000.0.0), fyi. |
| 01:45:37 | <dcoutts> | bos: yeah, continuations are great. I want to do that. I don't think it costs much performance. |
| 01:45:39 | <Saizan_> | bos: yeah, it supports errors :) |
| 01:45:41 | <wman> | how it's done properly ? like meta ! [....] ? |
| 01:46:07 | <bos> | dcoutts: from reading the code, it's free if you don't use it. |
| 01:46:31 | <dcoutts> | bos: well, the cost of constructing new continuations and passing them around, but yeah, not so expensive |
| 01:46:53 | <bos> | but the continuations are already used for partial results, so the added cost of supporting alternatives is zero. |
| 01:47:02 | <dcoutts> | bos: we originally didn't put in decent error handling because we were worried about the cost, but as we've learnt more about cont monad styles that's evaporated |
| 01:47:22 | <bos> | the partial result bit is the killer app for me, but alternatives-for-free doesn't hurt. |
| 01:47:43 | <dcoutts> | bos: our first experience was in binary too actually, that using cont monad for the serialisation optimises really well, most continuation constructions get inlined. |
| 01:47:45 | <Saizan_> | wman: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <-- like this |
| 01:48:53 | <bos> | isn't the current Builder just a difference list? |
| 01:49:09 | <wman> | i tried that, for cp-1250 and utf-8. is there any way to stop it from converting characters into the &#...; form ? |
| 01:50:15 | <Olathe> | How do you get lambdabot to tell you what module something's in ? |
| 01:50:28 | <Saizan_> | wman: it depends on how you're constructing the output, really |
| 01:50:44 | <Saizan_> | ?index foldl' |
| 01:50:45 | <lambdabot> | Data.List |
| 01:51:47 | <Olathe> | Thanks :) |
| 01:52:16 | <wman> | saizan: HDBC-ODBC -> String -> Iconv -> Text.XHTML -> toResponse |
| 01:52:18 | <TomMD> | Starting compiling hackage-server was pretty easy. It start in a blink of an eye, but I'm not yet sure how to configure it. |
| 01:53:00 | <TomMD> | dcoutts: If I were to figure out hackage-server and blog about building/configuring ones own 'hackage' would the info be obsoleted too soon? This is assuming I figure out the config. |
| 01:53:44 | <haskellian> | id i want to create a new syntax, like [1,3..10] -> [1,3,5,7,9] do I have to do that "outside" the langage then? or is there some macro-like functiona la lisp? |
| 01:54:08 | <wman> | might as well try to set the page encoding to cp852 (the original) and see what happens ;-) |
| 01:54:36 | <TomMD> | > [1,3..10] |
| 01:54:40 | <lambdabot> | [1,3,5,7,9] |
| 01:54:41 | <Saizan_> | wman: if you're using Text.XHTML i suggest to feed it a String of unicode codepoints and use latin1 as the encoding in the page |
| 01:55:02 | <haskellian> | wrong forum, meant to aks in ocaml lol |
| 01:55:11 | <TomMD> | :-) |
| 01:55:30 | <Saizan_> | wman: because Text.XHTML escapes chars > 255 and latin1 corresponds to unicode codepoints for <= 255 |
| 01:56:26 | <Armored_Azrael> | Is there a symbol for the maximum value of the Int datatype on a system? |
| 01:56:32 | <wman> | i thought UTF-8 had all chars < 255 |
| 01:57:36 | <Saizan_> | no utf8 is byte-compatible with unicode only for ascii |
| 01:57:37 | <bos> | wman: nope. |
| 01:58:27 | <Armored_Azrael> | a la INT_MAX in C? |
| 01:58:42 | <Saizan_> | > maxBound :: Int |
| 01:58:45 | <lambdabot> | 9223372036854775807 |
| 01:58:56 | <Armored_Azrael> | Thanks |
| 02:00:45 | <wman> | to rephrase it more correctly, utf-8 uses series of 8-bit values to encode possibly multi-byte characters, sounds better ? |
| 02:02:11 | <wman> | would it be possible to block any attempts at conversion/html-escaping done on the string i'm passing to it ? |
| 02:03:00 | <wman> | force it to just swallow the string i'm shoving down it's throat and render it verbatim ? |
| 02:03:29 | <Saizan_> | wman: look in the haddock, there's something like primHtml for that iirc |
| 02:03:37 | <dcoutts> | TomMD: if you don't mind I'd hold off a few days, so I can fix some stuff before announcing it properly (and having something that can actually be cabal-installed) |
| 02:03:56 | <wman> | thx |
| 02:04:14 | <dcoutts> | TomMD: but in the mean time, do play with it, do the install, import the data, play around and tell me what I have to fix :-) |
| 02:05:10 | <dcoutts> | TomMD: but certainly in the end one of the points was to make it easier to set up new instances, so yeah I'd be happy for you to write about it |
| 02:05:36 | <dcoutts> | TomMD: I'm actively working on it, so it shouldn't be too long to wait |
| 02:06:37 | <dcoutts> | ACTION :: Sleep -> IO () |
| 02:08:04 | <TomMD> | @tell dcoutts I'll hold off. One thing to note is, when installing from a clean setup, the version of HaXML required by rss and that required by one of the HAppS packages conflict. I needed to install rss-3000.0.0 to get it to build. |
| 02:08:05 | <lambdabot> | Consider it noted. |
| 02:13:08 | <Myoma> | @w80 kepler rosette |
| 02:13:10 | <lambdabot> | *** "Kepler" wn "WordNet (r) 2.0" |
| 02:13:10 | <lambdabot> | Kepler |
| 02:13:10 | <lambdabot> | n : German astronomer who first stated laws of planetary motion |
| 02:13:10 | <lambdabot> | (1571-1630) [syn: {Johannes Kepler}, {Johan Kepler}] |
| 02:13:10 | <lambdabot> | |
| 02:13:12 | <lambdabot> | [9 @more lines] |
| 02:18:43 | <Olathe> | Is there a way to add a function that has different implementations for each Num instance ? |
| 02:19:24 | <dons> | using type classes? |
| 02:19:38 | <Jedai> | Olathe: Not directly, but you can just create a Num2 typeclass |
| 02:20:29 | <Olathe> | Ahh, thanks. |
| 02:20:29 | <Jedai> | Olathe: anyway you would need to write one method for every instance even if you could "add a method" to Num |
| 02:20:53 | <Olathe> | How do you say that, say, Integer is an instance of Num2 ? |
| 02:21:02 | <Jedai> | Olathe: If your Num2 inherit from Num, you can use all the method from Num in the method for Num2 |
| 02:21:25 | <Jedai> | instance Num2 Integer where yadayada |
| 02:21:31 | <Olathe> | Ahh, thanks. |
| 02:21:56 | <Jedai> | Do you know typeclass basics ? |
| 02:23:33 | <Olathe> | Not really. |
| 02:24:40 | <Olathe> | @hoogle (Integral a) => Int -> a |
| 02:24:41 | <lambdabot> | Prelude (!!) :: [a] -> Int -> a |
| 02:24:41 | <lambdabot> | Data.List (!!) :: [a] -> Int -> a |
| 02:24:41 | <lambdabot> | Data.Sequence index :: Seq a -> Int -> a |
| 02:24:42 | <Jedai> | Olathe: Learn about it, it's one of the feature that sets Haskell apart from some of the other functional languages, it gives you some pretty sweet overloading and you can do some crazy things once you really master them |
| 02:24:55 | <Olathe> | Alright, I will :) |
| 02:25:20 | <Olathe> | I'm going through RWH at the moment, so I'll get to them eventually. |
| 02:25:38 | <Jedai> | @type fromIntegral |
| 02:25:40 | <lambdabot> | forall a b. (Num b, Integral a) => a -> b |
| 02:26:28 | <Olathe> | > let a :: Int -> Integer; a n = fromIntegral n in a (5::Int) |
| 02:26:31 | <lambdabot> | 5 |
| 02:26:37 | <Olathe> | :t let a :: Int -> Integer; a n = fromIntegral n in a (5::Int) |
| 02:26:39 | <lambdabot> | Integer |
| 02:27:34 | <araujo> | haskell.org down? |
| 02:27:37 | <cads> | hey, you guys have any suggestions for (very) introductory paper in category theory? |
| 02:28:18 | <cads> | umm, papers, even |
| 02:28:46 | <cads> | Things I'e found jump directly to notation I've neer seen defined before |
| 02:29:00 | <araujo> | nvm |
| 02:29:04 | <araujo> | very slow here |
| 02:30:05 | <mgoldman> | So, I'm trying to build the latest cabal library (Cabal-1.1.6) and when try to build, it tells me that Text.PrettyPrint is in the hidden module pretty |
| 02:30:17 | <ivanm> | mgoldman: "latest"? :o |
| 02:30:18 | <mgoldman> | ghc-pkg shows pretty as exposed |
| 02:30:24 | <ivanm> | that is nowhere near the latest ;-) |
| 02:30:32 | <mgoldman> | well, latest available from hackage.haskell.org |
| 02:30:42 | <ivanm> | @hackage Cabal |
| 02:30:43 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Cabal |
| 02:30:59 | <ivanm> | mgoldman: ummmm.... 1.4.0.2 is the latest... |
| 02:31:06 | <ivanm> | even there |
| 02:31:25 | <ivanm> | the "other versions" section lists them in _increasing_ order, and don't include the latest... |
| 02:31:28 | <mgoldman> | Hmm, I must have mis-read what I was wanted to pull |
| 02:31:32 | <ivanm> | heh |
| 02:31:33 | <mgoldman> | sorry, mild dislexia |
| 02:31:42 | <ivanm> | so you _are_ using 1.4.0.2? |
| 02:31:45 | <ivanm> | which version of ghc? |
| 02:32:15 | <dmwit> | ivanm: Give him a chance to try the right version... ;-) |
| 02:32:33 | <ivanm> | dmwit: heh, k |
| 02:33:28 | <mgoldman> | Indeed |
| 02:33:41 | <mgoldman> | Now that I've quit being retarded, this may work |
| 02:35:17 | <Olathe> | Can someone tell me why Int instead of Integral is inferred at http://hpaste.org/10132#a1 ? |
| 02:37:47 | <TSC> | Olathe: Could it be because of length? |
| 02:38:00 | <TSC> | Or !! |
| 02:39:35 | <mgoldman> | That worked |
| 02:39:38 | <Olathe> | It could be. |
| 02:40:06 | <Olathe> | Ahh, I think it probably is. |
| 02:40:08 | <Olathe> | Let me check. |
| 02:40:53 | <Olathe> | TSC: Ahh, that worked. Thanks a lot :) |
| 02:52:40 | <mgoldman> | Soon I will have xmonad back on my computer. |
| 02:52:56 | <mgoldman> | I'm amazed at how much I loathe other window managers now. |
| 02:53:08 | <dons> | hehe |
| 02:53:20 | <mgoldman> | I blame you dons! |
| 02:53:41 | <thoughtpolice> | or should you blame others for writing sucky window managers? |
| 02:53:59 | <mgoldman> | A little from column a, a little from column b. |
| 02:54:17 | <mgoldman> | xmonad happens to match how I want to interact with the computer amazingly well. |
| 02:54:31 | <mgoldman> | I didn't even know that was how I wanted to interact until I had tried it. |
| 02:54:45 | <mgoldman> | and then, bam, instant muscle memory. |
| 02:56:29 | <thoughtpolice> | i do miss xmonad since I got this macbook. sure it works, but I don't want to go through the hassle of having to reinstall lots of applications and build them against x11 instead of cocoa, and plus leopard's X11 is slightly broken so total full-screen isn't possible |
| 02:56:40 | <thoughtpolice> | when i get another computer and install linux it will be the first thing there though, I guarantee it |
| 02:57:33 | <cjb> | thoughtpolice: why not install Linux on your current one? ;-) |
| 02:58:07 | <thoughtpolice> | i see no reason to get rid of leopard after I have put this much work into getting it set up the way I want |
| 02:58:22 | <dons> | that's lock-in for you :) |
| 02:58:27 | <thoughtpolice> | plus I find OS X in general to be an interesting playground of various ideas (xnu's architecture is really interesting, for example) |
| 02:58:50 | <Myoma> | ACTION finds OS X extremly unreliable and crashy |
| 02:59:03 | <Myoma> | I would probably think the same of anything though |
| 02:59:19 | <cjb> | now that I've gone to all the trouble of setting up this automatic machine to hit me in the face, it'd be so much trouble to turn it off :) |
| 02:59:30 | <thoughtpolice> | i've actually crashed linux more times than os x, which is exactly one time |
| 02:59:45 | <thoughtpolice> | (note, it was because I deliberately wrote a device driver to do so because I was bored and curious) |
| 03:00:10 | <mgoldman> | So, are we excluding actual flakey hardware from linux crashes? |
| 03:00:15 | <thoughtpolice> | cjb: it would be a good analogy if it felt like OS X was constantly hitting me in the face, but it doesn't. |
| 03:01:53 | <thoughtpolice> | note I certainly don't agree with a few apple practices (see: dtrace, although it was 'fixed' in a certain way I guess) and probably never will - but that's not exactly unusual for any business, I've found. |
| 03:02:37 | <thoughtpolice> | mgoldman: I meant I wrote the device driver for the linux system - i've never crashed this leopard install |
| 03:02:42 | <thoughtpolice> | sorry, worded improperly |
| 03:03:17 | <thoughtpolice> | i think the worst thing that happened was that aqua seemed to lock up while I was using spaces so I had to reboot, but that's it. |
| 03:04:16 | <wman> | is there any other way than using Text.Prinf.printf to stop ghc from escaping characters in output ? |
| 03:04:35 | <Myoma> | putStr . return $ 'x' |
| 03:04:49 | <Myoma> | putChar 'x' |
| 03:08:12 | <dons> | wman: show ? |
| 03:08:20 | <dons> | oh, to stop. putStr |
| 03:08:23 | <mgoldman> | Hmm, rxvt seems to be doing something strange. <enter> is not being seen as an end of line but a literal ^m by applications |
| 03:08:25 | <wman> | probably it's show doing it for me for a data ... derive Show |
| 03:11:23 | <ivanm> | wman: you mean that you want "\n" to be treated as a newline, etc.? |
| 03:11:53 | <Myoma> | @mike |
| 03:11:54 | <lambdabot> | Maybe you meant: dice more time wiki |
| 03:12:09 | <roconnor> | @src print |
| 03:12:10 | <lambdabot> | print x = putStrLn (show x) |
| 03:12:19 | <ivanm> | > let escape ('\"':xs) = '\\' : '\"' : escape xs; escape (x:xs) = x : escape xs; escape [] = [] in escape "\thello\n" |
| 03:12:23 | <lambdabot> | "\thello\n" |
| 03:12:36 | <wman> | no, i'm getting desperate debugging some codepage conversion code, so i'm tring to print it out to console. and it's giving me the awful trigraphs |
| 03:12:40 | <Myoma> | > id "\thello\n" |
| 03:12:44 | <lambdabot> | "\thello\n" |
| 03:12:55 | <ivanm> | whoops, that's not right |
| 03:13:01 | <ivanm> | > let escape ('\\':xs) = '\\' : '\\' : escape xs; escape (x:xs) = x : escape xs; escape [] = [] in escape "\thello\n" |
| 03:13:03 | <roconnor> | > read "\thello\n" |
| 03:13:05 | <lambdabot> | "\thello\n" |
| 03:13:07 | <lambdabot> | mueval: Prelude.read: no parse |
| 03:13:07 | <lambdabot> | mueval: *** Exception: Prelude.read: no parse |
| 03:13:11 | <roconnor> | > read "\thello\n" :: String |
| 03:13:15 | <lambdabot> | mueval: Prelude.read: no parse |
| 03:13:15 | <lambdabot> | mueval: "*** Exception: Prelude.read: no pa... |
| 03:13:41 | <wman> | so, if i would provide my own show definition using string concatenation, would it stop being so fucking helpful ? ;-) |
| 03:13:44 | <ivanm> | OK, shouldn't that have worked? |
| 03:13:52 | <roconnor> | > show "\thello\n" |
| 03:13:56 | <lambdabot> | "\"\\thello\\n\"" |
| 03:14:05 | <rwbarton> | ivanm: there aren't any backslashes in the string you're passing it. |
| 03:19:12 | <mmorrow> | wman: try utf8-string |
| 03:19:40 | <mmorrow> | > greekAlpha |
| 03:19:42 | <wman> | defining my own show sufficed ;-) |
| 03:19:44 | <lambdabot> | "\945\946\947\948\949\950\951\952\953\954\955\956\957\958\959\960\961\962\9... |
| 03:19:48 | <mmorrow> | > say greekAlpha |
| 03:19:52 | <lambdabot> | αβγδεζηθικλμνξοπρςστυφχψω |
| 03:20:01 | <Myoma> | yes |
| 03:20:09 | <mmorrow> | say (greek 10) |
| 03:20:11 | <mmorrow> | > say (greek 10) |
| 03:20:14 | <lambdabot> | Couldn't match expected type `[Char]' against inferred type `Char' |
| 03:20:19 | <mmorrow> | > say [greek 10] |
| 03:20:23 | <lambdabot> | λ |
| 03:20:26 | <Myoma> | > (say . map toUpper . const greekAlpha) () |
| 03:20:30 | <lambdabot> | ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΣΤΥΦΧΨΩ |
| 03:20:31 | <wman> | the derived version does the conversion :-( |
| 03:20:54 | <mmorrow> | Myoma: sweet! i didn't know toUpper worked with unicode |
| 03:21:51 | <mmorrow> | wman: yeah, from what i understand, come 6.10 unicode IO'll be baked in. |
| 03:22:26 | <mmorrow> | > sup 7 |
| 03:22:29 | <lambdabot> | mueval: Prelude.read: no parse |
| 03:22:53 | <wman> | well, i'm not even trying unicode, just some non-ascii chars i wanted to see for real ;-) |
| 03:23:12 | <mmorrow> | however you want to call it :) |
| 03:23:21 | <Myoma> | it would be cool if ⟦⟧ ⟨⟩ ⟪⟫ ⦅⦆ etc got put into the parser as parens |
| 03:23:28 | <Myoma> | ones that you can redefine |
| 03:23:34 | <mmorrow> | oh yesh |
| 03:23:47 | <mmorrow> | they are /so/ many cool things that could be done with unicode |
| 03:24:02 | <wman> | mmorrow> you mean that national chars in windows-1250 or cp852 are called unicode too ? |
| 03:24:16 | <mmorrow> | oh, ok you're right |
| 03:24:18 | <mmorrow> | ;) |
| 03:24:42 | <mmorrow> | windows is still around? |
| 03:25:13 | <mmorrow> | > say "\8704" |
| 03:25:16 | <lambdabot> | ∀ |
| 03:25:24 | <mmorrow> | > maxBound :: Char |
| 03:25:28 | <lambdabot> | '\1114111' |
| 03:26:14 | <roconnor> | @type mfix return |
| 03:26:17 | <lambdabot> | forall a (m :: * -> *). (MonadFix m) => m a |
| 03:26:34 | <mmorrow> | @type return (fix id) |
| 03:26:36 | <lambdabot> | forall a (m :: * -> *). (Monad m) => m a |
| 03:27:07 | <roconnor> | @instances MonadFix |
| 03:27:09 | <lambdabot> | ((->) r), Either e, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, [] |
| 03:29:14 | <Myoma> | > mfix 1 |
| 03:29:17 | <lambdabot> | No instance for (Show (m a)) |
| 03:29:18 | <lambdabot> | arising from a use of `show' at <in... |
| 03:29:22 | <Myoma> | > mfix 1 :: [Integer] |
| 03:29:24 | <lambdabot> | No instance for (Num (Integer -> [Integer])) |
| 03:29:25 | <lambdabot> | arising from the li... |
| 03:29:26 | <Myoma> | :t mfix |
| 03:29:28 | <lambdabot> | forall a (m :: * -> *). (MonadFix m) => (a -> m a) -> m a |
| 03:29:38 | <Myoma> | > mfix (:) :: [()] |
| 03:29:40 | <lambdabot> | Couldn't match expected type `[()]' |
| 03:29:53 | <mmorrow> | > mfix (:[]) |
| 03:29:56 | <lambdabot> | Terminated |
| 03:30:31 | <Myoma> | > mfix $ (:[]) . ("x"++) |
| 03:30:34 | <lambdabot> | ["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... |
| 03:31:57 | <mmorrow> | > (say . concat) (mfix $ (:[]) . (greek (negate 1) :)) |
| 03:32:01 | <lambdabot> | ÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏ... |
| 03:32:04 | <mmorrow> | crap |
| 03:32:11 | <mmorrow> | > (say . take 10 . concat) (mfix $ (:[]) . (greek (negate 1) :)) |
| 03:32:14 | <lambdabot> | ωωωωωωωωωω |
| 03:32:28 | <dons> | (:[]) . (greek (negate 1) :) is an awesome bit of haskell |
| 03:33:02 | <mmorrow> | heh, capture the frustation with '-' among so many other things |
| 03:33:18 | <mmorrow> | (all of the other things are good though) |
| 03:35:36 | <wman> | goddamn 15-year-old legacy apps, goddamn freaking old .dbf files, and goddamn kamenickych charset, the not quite so cp852. every time i have to touch this $%^ i spend 2 days just looking for the right conversion tables cause the old ones miraculously don't work, and even when in the old php app iconv does the right thing, somehow it doesnt now |
| 03:36:13 | <Olathe> | > let map' _ _ [] = []; map' fhead frest (x:xs) = fhead x:map frest xs in map' (+1) (+2) [0..] |
| 03:36:17 | <lambdabot> | [1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2... |
| 03:36:24 | <wman> | how should one more or less painlessly kill himself ? |
| 03:36:29 | <Olathe> | Is there a function like map' already ? |
| 03:36:55 | <lament> | wman: certain drugs, there's info online |
| 03:37:11 | <Myoma> | Olathe: f . head &&& map g . tail ? |
| 03:37:19 | <parodyoflanguage> | wman: Life will do that on it's own. |
| 03:37:27 | <lament> | for more extravagance, tie a buch of high explosives to your hed |
| 03:37:28 | <Myoma> | :t uncurry (:) . (?f . head &&& map ?g . tail) |
| 03:37:29 | <lament> | *head |
| 03:37:30 | <lambdabot> | forall a b. (?g::a -> b, ?f::a -> b) => [a] -> [b] |
| 03:37:36 | <Olathe> | Myoma: Thanks. |
| 03:37:37 | <parodyoflanguage> | > 1 |
| 03:37:41 | <lambdabot> | 1 |
| 03:37:46 | <wman> | parodyoflanguage: life is the most cruel form of suicide i know of ... |
| 03:38:13 | <lament> | wman: only when it involves foxpro/dbase |
| 03:38:25 | <parodyoflanguage> | wman: What's bugging ya? |
| 03:38:44 | <wman> | and windows, and diacritics, and other, so called normal people ... ;-) |
| 03:39:10 | <parodyoflanguage> | Ah, character mappings. |
| 03:40:28 | <parodyoflanguage> | > foldr (+) [1,2,3] |
| 03:40:30 | <lambdabot> | Overlapping instances for Show ([[t]] -> [t]) |
| 03:40:30 | <lambdabot> | arising from a use... |
| 03:40:47 | <parodyoflanguage> | > foldr (+) 0 [1,2,3] |
| 03:40:50 | <lambdabot> | 6 |
| 03:41:49 | <Olathe> | > scanr (+) 0 [1,2,3] |
| 03:41:53 | <lambdabot> | [6,5,3,0] |
| 03:42:03 | <Olathe> | > scanr1 (+) 0 [1,2,3] |
| 03:42:06 | <lambdabot> | Couldn't match expected type `[t1] -> t' |
| 03:42:09 | <Olathe> | :( |
| 03:42:18 | <Myoma> | > scanr1 (+) [1,2,3] |
| 03:42:21 | <Olathe> | :t scanr1 |
| 03:42:22 | <lambdabot> | [6,5,3] |
| 03:42:23 | <lambdabot> | forall a. (a -> a -> a) -> [a] -> [a] |
| 03:42:25 | <parodyoflanguage> | Hmm...dunno scanr yet. |
| 03:42:39 | <Olathe> | It gives the intermediate results for foldr |
| 03:42:59 | <Olathe> | It starts with 0, then goes to 3, 5, 6. |
| 03:43:13 | <parodyoflanguage> | Olathe: Only backwards? |
| 03:43:25 | <Olathe> | Well, from the right (foldr is from the right) |
| 03:43:44 | <Myoma> | :? |
| 03:43:49 | <Myoma> | I don't like that idea |
| 03:43:53 | <Myoma> | foldr isn't from any direction |
| 03:44:57 | <parodyoflanguage> | ah |
| 03:45:32 | <parodyoflanguage> | Myoma: Then what's the difference between foldr and foldl? :) |
| 03:45:53 | <Myoma> | foldr is a fold, foldl just gums the stuff in the list together |
| 03:47:11 | <parodyoflanguage> | > foldl (+) [1,2,3] |
| 03:47:14 | <lambdabot> | Overlapping instances for Show ([[t]] -> [t]) |
| 03:47:14 | <lambdabot> | arising from a use... |
| 03:47:20 | <parodyoflanguage> | > foldl (+) 0 [1,2,3] |
| 03:47:23 | <lambdabot> | 6 |
| 03:47:25 | <parodyoflanguage> | Bah, did it again :) |
| 03:47:32 | <dons> | Prelude> foldr (:) [] [1..10] |
| 03:47:33 | <dons> | [1,2,3,4,5,6,7,8,9,10] |
| 03:47:41 | <dons> | > foldl (flip (:)) [] [1..10] |
| 03:47:46 | <lambdabot> | [10,9,8,7,6,5,4,3,2,1] |
| 03:48:35 | <parodyoflanguage> | > foldr (flip (:)) [] [1..10] |
| 03:48:39 | <lambdabot> | Occurs check: cannot construct the infinite type: b = [b] |
| 03:48:39 | <lambdabot> | Expect... |
| 03:48:58 | <dons> | foldl (') is a tail call though. that's probably the biggest difference. foldr is that natural fold, it recurses under the constructor, foldl' is the imperative loop. |
| 03:49:44 | <mmorrow> | @src concat |
| 03:49:45 | <lambdabot> | concat = foldr (++) [] |
| 03:49:50 | <mmorrow> | @src reverse |
| 03:49:50 | <lambdabot> | reverse = foldl (flip (:)) [] |
| 03:49:54 | <mmorrow> | @src sum |
| 03:49:54 | <lambdabot> | sum = foldl (+) 0 |
| 03:49:58 | <mmorrow> | @src product |
| 03:49:58 | <lambdabot> | product = foldl (*) 1 |
| 03:50:30 | <dons> | that's kinda broken. |
| 03:50:44 | <Myoma> | > flip (foldr (:)) "ioo" "quu" |
| 03:50:47 | <lambdabot> | "iooquu" |
| 03:51:01 | <mmorrow> | yeah |
| 03:51:47 | <mgoldman> | So did something happen to defaultGaps in xmonad? |
| 03:51:47 | <mmorrow> | (yeah about sum/prod) |
| 03:51:51 | <dons> | in reality, those functions use a manual foldl' |
| 03:51:56 | <dons> | mgoldman: wrong chan? #xmonad :) |
| 03:52:18 | <dons> | sum l = sum' l 0 |
| 03:52:18 | <dons> | where |
| 03:52:18 | <dons> | sum' [] a = a |
| 03:52:18 | <dons> | sum' (x:xs) a = sum' xs (a+x) |
| 03:52:19 | <mgoldman> | Noted |
| 03:52:36 | <dons> | still relies on strictness analysis though |
| 03:52:45 | <dons> | {-# SPECIALISE sum :: [Int] -> Int #-} |
| 03:52:55 | <dons> | so ... finally, that's enough to make it work on Int. |
| 03:52:58 | <dons> | all rather awkward. |
| 03:53:33 | <mmorrow> | i always do sum and prod as foldl' (+) 0 foldl' (*) 1 "just to be sure" |
| 03:53:41 | <dons> | yep |
| 03:53:49 | <Myoma> | ACTION uses foldr (+) 0 |
| 03:53:56 | <mmorrow> | lol |
| 03:54:08 | <Myoma> | it works because I don't use lists longer than 10 |
| 03:54:35 | <mmorrow> | wow, if you start using your toes tou can double that |
| 03:55:04 | <roconnor> | ACTION couldn't figure out what to use for sum :: [a -> Integer] -> a -> Integer |
| 03:55:05 | <Myoma> | dunno why anyone would calculutate numbers with haskell though |
| 03:55:08 | <roconnor> | foldl or foldr |
| 03:55:17 | <dons> | Myoma: eh, why? |
| 03:55:29 | <roconnor> | numbers are so unstructured |
| 03:55:38 | <roconnor> | might as well be working with the untyped lambda calculus |
| 03:55:42 | <dons> | :) |
| 03:55:44 | <roconnor> | and goedel codes |
| 03:55:55 | <roconnor> | or goedel codes |
| 03:56:15 | <Myoma> | :t foldr (liftM2 (+)) id |
| 03:56:17 | <lambdabot> | forall a. (Num a) => [a -> a] -> a -> a |
| 03:56:19 | <roconnor> | people only use numbers because they have "hardware support" |
| 03:56:29 | <Myoma> | ummm |
| 03:56:35 | <roconnor> | and "thousands of years of history":/ |
| 03:56:41 | <dons> | just that. |
| 03:56:51 | <dons> | stupid memes. |
| 03:56:53 | <Myoma> | :t foldr (\f g -> uncurry (+) . f &&& g) id |
| 03:56:55 | <lambdabot> | Occurs check: cannot construct the infinite type: c' = (a, c') |
| 03:56:55 | <lambdabot> | Expected type: a1 -> c' |
| 03:56:55 | <lambdabot> | Inferred type: a1 -> (a, c') |
| 03:57:11 | <roconnor> | Myoma: ya, but is foldl more efficent? |
| 03:57:18 | <roconnor> | I assumed not |
| 03:57:22 | <roconnor> | so I used foldr |
| 03:57:24 | <Myoma> | roconnor: what efficient ? |
| 03:57:25 | <roconnor> | but I didn't know |
| 03:57:37 | <roconnor> | foldr (liftM2 (+)) id vs foldl' (liftM2 (+)) id |
| 03:57:42 | <mmorrow> | not stack overflowing and crashing the breathing machine/airliner |
| 03:57:49 | <roconnor> | er |
| 03:57:54 | <roconnor> | I think that id should be (const 0) |
| 03:58:04 | <Myoma> | ok |
| 03:58:10 | <mmorrow> | :) |
| 03:58:23 | <Myoma> | I think they both suck |
| 03:58:23 | <Olathe> | @let id = (const 0) |
| 03:58:26 | <lambdabot> | Defined. |
| 03:58:30 | <mmorrow> | um |
| 03:58:31 | <roconnor> | dons: types are catching up :) |
| 03:58:40 | <mmorrow> | > fix id |
| 03:58:43 | <lambdabot> | Ambiguous occurrence `id' |
| 03:58:43 | <lambdabot> | It could refer to either `L.id', defined... |
| 03:58:49 | <Myoma> | why don't you add an accumulator parameter and write it in ocaml^H^H^H^Hadd strictness annotations |
| 03:58:56 | <roconnor> | or prehaps I should say algebraic / inductuve data types are catching up |
| 03:58:56 | <dmwit> | > fix Prelude.id |
| 03:59:01 | <lambdabot> | mueval: Prelude.read: no parse |
| 03:59:01 | <lambdabot> | mueval: *** Exception: stack overflow |
| 03:59:09 | <mmorrow> | > fix L.id |
| 03:59:12 | <lambdabot> | 0 |
| 03:59:16 | <dons> | nice ffi tutorial, http://www.reddit.com/r/programming/comments/6zrep/using_c_from_haskell_a_short_introduction/ |
| 03:59:19 | <lambdabot> | Title: Using C From Haskell: A Short Introduction : programming, http://tinyurl.com/58367y |
| 03:59:25 | <BMeph_> | roconor mempty? :) |
| 03:59:32 | <dons> | we need a decent reddit story, there's so much dumbass downmodding there now. |
| 03:59:37 | <Myoma> | roconnor: Ways to use hardware support to speed up the abstract data types |
| 03:59:38 | <dons> | even the gpu/haskell story died. so sad. |
| 03:59:48 | <roconnor> | Myoma: meh, I'd rather the complier add an accumlating parameter. :) |
| 03:59:55 | <BMeph_> | s/ m/: m/ |
| 04:00:07 | <mmorrow> | haskell's ffi rocks |
| 04:00:32 | <roconnor> | Myoma: what do you mean? |
| 04:00:59 | <dons> | reading that, i think he must have learnt from RWH. |
| 04:01:27 | <dons> | oh hehe, yes. he mentions that at the end. |
| 04:01:38 | <bos> | gpu hm? |
| 04:01:53 | <dons> | didn't see it bos? |
| 04:01:59 | <bos> | nope |
| 04:02:09 | <dons> | http://www.galois.com/blog/2008/08/29/gpugen-bringing-the-power-of-gpus-into-the-haskell-world/ |
| 04:02:13 | <lambdabot> | Title: Galois › Blog › Blog » Bringing the Power of GPUs to Haskell, http://tinyurl.com/5s7fwn |
| 04:02:59 | <bos> | this one of chillix's students? |
| 04:03:06 | <bos> | thanks for the pointer. |
| 04:03:09 | <Myoma> | I want to have lambdabot print out the core versoin of some code |
| 04:03:19 | <dons> | bos, yup. |
| 04:03:26 | <dons> | Myoma: omg no. |
| 04:04:46 | <Myoma> | roconnor, I'd write it like this |
| 04:04:49 | <Myoma> | aaa x [] _ = x |
| 04:04:49 | <Myoma> | aaa x (f:fs) o = aaa $! (x + f o) fs o |
| 04:05:00 | <Myoma> | but that isn't a foldr or foldl afaict |
| 04:05:20 | <Myoma> | oh (aaa $! (x + f o)) |
| 04:05:51 | <Myoma> | so.. maybe it can be done but I don't see it |
| 04:05:55 | <roconnor> | how sad. |
| 04:06:16 | <roconnor> | stupid operational semantics |
| 04:06:42 | <Myoma> | :t (sum . ) . map |
| 04:06:44 | <lambdabot> | forall a b. (Num b) => (a -> b) -> [a] -> b |
| 04:07:04 | <roconnor> | :t (sum .) . sequence |
| 04:07:07 | <lambdabot> | forall a a1. (Num a1) => [a -> a1] -> a -> a1 |
| 04:07:11 | <dons> | mm. this ffi post is nice. if that's the kind of things people are able to do after reading RWH, i'll be happy. |
| 04:07:51 | <roconnor> | (sum .) . sequence is even better than that foldl foldr crap. |
| 04:08:01 | <dons> | ?src sequence |
| 04:08:02 | <lambdabot> | sequence [] = return [] |
| 04:08:02 | <lambdabot> | sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs) |
| 04:08:02 | <lambdabot> | --OR |
| 04:08:02 | <lambdabot> | sequence xs = foldr (liftM2 (:)) (return []) xs |
| 04:08:13 | <dons> | ?src sum |
| 04:08:14 | <roconnor> | well |
| 04:08:14 | <lambdabot> | sum = foldl (+) 0 |
| 04:08:15 | <dons> | heh |
| 04:08:25 | <roconnor> | I guess it is both foldl and foldr crap |
| 04:08:32 | <roconnor> | best of both worlds :P |
| 04:08:32 | <dons> | there's no escape! |
| 04:08:37 | <Myoma> | you can't fuse foldl with a foldr can yo |
| 04:08:37 | <Myoma> | u |
| 04:08:50 | <roconnor> | I doubt it |
| 04:09:24 | <roconnor> | then again, you can't fuse with your accumulating parameter function either |
| 04:09:38 | <roconnor> | I'd like to see these 4 functions pitted against each other. |
| 04:09:58 | <mmorrow> | to the death |
| 04:10:10 | <mmorrow> | (==StackOverflow) |
| 04:11:12 | <roconnor> | (sum .) . sequence looks the best to me |
| 04:11:28 | <mmorrow> | did you time it with -O2 |
| 04:11:28 | <roconnor> | I could believe it is equvalent to the accumulating parameter function. |
| 04:11:28 | <dons> | yeah, no fusion though. |
| 04:11:34 | <dons> | its a bit inside out. |
| 04:11:42 | <roconnor> | the sequence bit will fuse. |
| 04:11:58 | <dons> | well, its just foldr, so yeah, with something that generates a list. |
| 04:12:16 | <Myoma> | when you guys say fuse you mean that the compiler does it and when I say fuse I mean to do it with algebra :p |
| 04:12:24 | <roconnor> | mmorrow: no, I'm just making a prediction |
| 04:12:45 | <roconnor> | Myoma: I understand that the compiler does it with algebra :P |
| 04:12:55 | <Myoma> | ACTION wont trust it |
| 04:14:44 | <roconnor> | Myoma: won't trust it to be correct, or won't trust it to actually rewrite the program? |
| 04:14:51 | <dons> | i wish there was a way to aggregate to p.h.o, just this article, or just that article. not every blog needs to be subscribed |
| 04:15:02 | <dons> | but guest bloggers who write maybe one haskell article, they don't get aggregated. |
| 04:15:18 | <Myoma> | I don't have a clue what it does I just expect it to run the program |
| 04:15:20 | <roconnor> | dons: can't you filter the feed? |
| 04:15:48 | <dons> | roconnor: i mean, i'd like to submit an article someone writes, without syndicating them |
| 04:15:56 | <chrisdone> | dons: yeah, I refrained from putting some things on my blog because it would appear on planet haskell and be completely irrelevant |
| 04:15:59 | <dons> | e.g. http://blog.bjrn.se is all python |
| 04:16:03 | <lambdabot> | Title: blog.bjrn.se |
| 04:16:04 | <dons> | but one really nice haskell article |
| 04:16:06 | <ivanm> | dons: maybe you should write your own planet clone! |
| 04:16:13 | <dons> | so i'd like to go to p.h.o, and click 'submit' |
| 04:16:21 | <chrisdone> | can't you filter by entries tagged haskell? |
| 04:16:26 | <dons> | and we'd have just one article from this 'guest author' |
| 04:16:29 | <dons> | chrisdone: yeah, if he tagged it |
| 04:17:01 | <dons> | so i want a planet-like aggregator, but with a 'submit' button for editors. |
| 04:18:10 | <roconnor> | planet haskell isn't about haskell, it's about haskellers |
| 04:18:43 | <ivanm> | though I wish people utilised those options in blog engines so that you have a "to read the rest of the article, click here" link |
| 04:18:55 | <ivanm> | rather than having the entire long blog post on p.h.o :s |
| 04:19:11 | <dons> | ivanm: i guess you just end up with the haskell subreddit at that point. |
| 04:19:20 | <dons> | or a spin on that idea. |
| 04:19:32 | <ivanm> | heh |
| 04:19:47 | <ivanm> | who is it that puts all those posts on the haskell subreddit? |
| 04:19:53 | <roconnor> | ivanm: I always felt that was the job of the agrigator rather than the author. |
| 04:20:10 | <dons> | ivanm: isn't it the gst bot? |
| 04:20:17 | <ivanm> | roconnor: oh? but how does the aggregator know when its a logical place to stop? |
| 04:20:21 | <ivanm> | dons: gst is a bot? :o |
| 04:20:36 | <roconnor> | ivanm: after the first paragraph? |
| 04:20:51 | <ivanm> | roconnor: true... |
| 04:29:54 | <Crypt0> | Hey |
| 04:41:24 | <cads> | is it necessary to know formal concepts from category theory in order to understand and create monads? |
| 04:43:30 | <Heffalump> | cads: no |
| 04:45:10 | <Cale> | cads: It's unnecessary even to understand how monads relate to category theory at all. |
| 04:45:35 | <Cale> | cads: If you'd like, a monad is just a library which supports a particular API. |
| 04:46:30 | <Cale> | If you implement a new library which supports that API (and supports it in a way which follows a few simple rules), you have a new monad :) |
| 04:48:00 | <dmwit> | Not only you have a new monad; you have a whole slew of useful library functions pre-made which operate on your library. |
| 04:48:16 | <dmwit> | Control.Monad is one of the cooler modules we have. |
| 04:50:32 | <cads> | I have the feeling that I just need to get to coding up a few examples |
| 04:51:55 | <cads> | the way I understand it, a monad is a type used to wrap another type to give it a state or a way of input or output without side effects |
| 04:52:36 | <cads> | but it's a little hard to understand how that is possible |
| 04:56:40 | <rwbarton> | Well, it is sometimes said that the state only appears to exist from a viewpoint "inside" the monad. Viewed from the "outside", it's just functions being composed together in a certain way (for the State s monad). |
| 05:01:15 | <newsham> | its a "wrapper" type (if you will) with a way to combine them together (in such a way that the intermediate value is exposed) |
| 05:01:23 | <rwbarton> | Likewise with the [] monad and nondeterministic computation vs. keeping a list of all the possibilities. |
| 05:02:12 | <newsham> | > do { x <- Maybe 3; y <- Maybe 5; return (x*3 + y*21) } |
| 05:02:15 | <lambdabot> | mueval: Prelude.read: no parse |
| 05:02:24 | <newsham> | > do { x <- Just 3; y <- Just 5; return (x*3 + y*21) } |
| 05:02:28 | <lambdabot> | Just 114 |
| 05:03:22 | <newsham> | > do { x <- ReadFile "foo"; y <- ReadFile "bar"; return (x ++ y) } |
| 05:03:25 | <lambdabot> | mueval: Prelude.read: no parse |
| 05:03:32 | <newsham> | > do { x <- readFile "foo"; y <- readFile "bar"; return (x ++ y) } |
| 05:03:36 | <lambdabot> | mueval: Prelude.read: no parse |
| 05:03:36 | <lambdabot> | mueval: *** Exception: "<IO [Char]>" |
| 05:04:27 | <newsham> | > do { x <- [5,3]; y <- "ab"; return (replicate x y) } |
| 05:04:31 | <lambdabot> | ["aaaaa","bbbbb","aaa","bbb"] |
| 05:05:29 | <newsham> | got Maybe Int mixing with Maybe Int, IO String mixing with IO String, and [Int] mixing with [Char] |
| 05:33:03 | <Olathe> | If I have [(a, Int)], where the Ints are unique and sorted, is there any simple function to fill in the gaps from 0 to the maximum one ? |
| 05:34:17 | <Olathe> | Hmm, never mind. I think I found a better way. |
| 05:43:01 | <ivanm> | are there any numeric line-fitting, etc. libraries? |
| 05:44:48 | <BMeph> | Olathe: grats on figuring out a dif't sol'n, but I'm still curious - with what were you going to fill in those gaps? :) |
| 05:44:48 | <cads> | ivan, let me know if you find something interesting |
| 05:46:12 | <BMeph> | ivanm: I've seen folks doing it on-the-fly in-channel lately - try poking around the 'vector-space' library, you should find something there, if only a referent to something else. :) |
| 05:46:31 | <ivanm> | *nod* thanks BMeph |
| 05:46:38 | <ivanm> | ACTION is also looking through hmatrix |
| 05:47:51 | <cads> | hmatrix looks pretty interesting |
| 05:50:07 | <ivanm> | is the "linear least squares" problem that hmatrix refers to the same as using least squares to fit data to a straight line? |
| 05:51:38 | <cads> | a least squares fit of a polynomial in general might be considered linear |
| 05:52:43 | <cads> | i.e. optimizing over a linear space of polynomials |
| 05:58:58 | <Myoma> | > (9^9+9)*9 |
| 05:59:02 | <lambdabot> | 3486784482 |
| 06:19:38 | <ivanm> | how do people successfully google for haskell-related things without including results of other haskells (as in people's names, university of haskell, etc.)? :s |
| 06:20:04 | <cads> | > let f n = n==0 1 | n*f (n-1) in [1..5] |
| 06:20:07 | <lambdabot> | mueval: Prelude.read: no parse |
| 06:20:25 | <cads> | poo |
| 06:22:27 | <cads> | ivan, I've found that just surfing from haskell sites is more informative |
| 06:22:39 | <cads> | haskell.org is real good |
| 06:23:10 | <ivanm> | yes, but not everything haskell related is on h.o |
| 06:23:40 | <cads> | and then if your searching if your term is haskell + (programming related term) it usually returns few non haskell related results I'e found |
| 06:29:31 | <ivanm> | who was this macarena person? |
| 06:29:54 | <dibblego> | spammer |
| 06:30:31 | <ivanm> | how'd you know? I didn't see any spam up above :s |
| 06:30:57 | <malune> | is there a list datatype in haskell which can contain arbitrarily nested lists? |
| 06:31:07 | <dons> | a tree :) |
| 06:31:16 | <ivanm> | BMeph: did you mean the vecotr space library that requires ghc 6.9? |
| 06:31:50 | <malune> | dons: but is there one which uses native lists? |
| 06:31:59 | <dons> | a tree type that uses lists? |
| 06:32:02 | <dons> | Data.Tree, I guess. |
| 06:32:08 | <BMeph> | ivanm: Oh, does it? I hadn't checked, sorry. :\ |
| 06:32:32 | <ivanm> | heh |
| 06:32:42 | <dons> | -- | Multi-way trees, also known as /rose trees/. |
| 06:32:42 | <dons> | data Tree a = Node { rootLabel :: a , subForest :: Forest a } |
| 06:32:42 | <dons> | type Forest a = [Tree a] |
| 06:32:50 | <ivanm> | ACTION wonders if it'd be worth it to dig out his old notes on how to implement linear least squares and implement it |
| 06:33:20 | <malune> | dons: interesting i didn't think of it like this. :) thanks |
| 06:36:35 | <thatsright> | i can't define this even though the manual said so |
| 06:36:51 | <thatsright> | mulop = do{ symbol "*"; return (*) } <|> do{ symbol "/"; return (div) |
| 06:42:26 | <thoughtpolice> | thatsright: works fine for me in GHCi, but you want "mulop symbol = do { symbol "*"; return (*) } <|> do { symbol "/"; return (div) }" |
| 06:42:34 | <thoughtpolice> | (I think, anyway) |
| 06:42:54 | <Myoma> | thatsright: There is an infix parser in parsec |
| 06:43:05 | <Myoma> | oh you are probably using it |
| 06:44:55 | <thatsright> | thoughtpolice: symbol is a function |
| 06:46:34 | <thoughtpolice> | thatsright: then what's the err? |
| 06:48:20 | <thatsright> | ill codepad it |
| 06:49:44 | <ivanm> | dons: I must say, your mean function you had in your blog post a couple of months ago seems to work better than the one in the hstats package... |
| 06:49:56 | <ivanm> | even though the only difference that I can find is that it uses a fold :s |
| 06:50:23 | <thatsright> | http://codepad.org/RE2KKoxI |
| 06:50:45 | <dons> | ivanm: hmm. |
| 06:50:53 | <thatsright> | source : http://legacy.cs.uu.nl/daan/download/parsec/parsec.html |
| 06:50:55 | <lambdabot> | Title: Parsec, a fast combinator parser |
| 06:51:03 | <ivanm> | dons: http://hackage.haskell.org/packages/archive/hstats/0.2/doc/html/src/Math-Statistics.html |
| 06:51:05 | <dons> | ivanm: oh, fold with no-monomorphic state? |
| 06:51:10 | <lambdabot> | Title: Haskell Code by HsColour, http://tinyurl.com/6hknuu |
| 06:51:18 | <dons> | yeah, it has a lazy pair. |
| 06:51:29 | <dons> | should submit a patch to the author |
| 06:51:34 | <dons> | and a link to the post explaining why. |
| 06:51:56 | <dons> | hmm. a lot of classical haskell there. |
| 06:51:58 | <ivanm> | dons: I even managed to make a generalised version of yours! \o/ |
| 06:52:01 | <dons> | cov xs ys = sum (zipWith (*) (map f1 xs) (map f2 ys)) / (n - 1) |
| 06:52:05 | <dons> | could be a fusion testsuite! |
| 06:52:28 | <ivanm> | heh |
| 06:52:29 | <dons> | ivanm: submit a patch to the author (and some QC tests testing equivalence) |
| 06:52:42 | <ivanm> | ummm.... I've never touched QC :s |
| 06:53:04 | <dons> | ?check myqc == yourqc |
| 06:53:06 | <lambdabot> | Terminated |
| 06:53:26 | <ivanm> | hmmmm... and QC will make up data? |
| 06:53:38 | <dons> | yeah |
| 06:53:42 | <dons> | check the testing chapter of RWH |
| 06:53:47 | <ivanm> | heh |
| 06:53:48 | <dons> | should be able to use the examples there |
| 06:53:48 | <thoughtpolice> | thatsright: 'symbol' expects a TokenParser but you give it a string is the problem |
| 06:53:57 | <ivanm> | dons: you're really pushing your book, aren't you :p |
| 06:54:14 | <dons> | well, it's online. |
| 06:54:16 | <dons> | and free. |
| 06:54:16 | <ivanm> | @slap expensive australian bookstores |
| 06:54:17 | <lambdabot> | ACTION pokes expensive australian bookstores in the eye |
| 06:54:18 | <dons> | so ... :) |
| 06:54:20 | <ivanm> | dons: true |
| 06:54:27 | <dons> | pity the .au dollar declined so much :( |
| 06:54:32 | <ivanm> | yeah :s |
| 06:54:37 | <dons> | would have been 50 bucks a month ago |
| 06:54:41 | <dons> | now its like 75. |
| 06:54:54 | <thatsright> | dons: will i one day see real world haskell in borders? |
| 06:54:56 | <ivanm> | dons: last I checked, it's still around $90 for pre-order here :s |
| 06:55:08 | <dons> | that's a fair bit. |
| 06:55:12 | <dons> | want me to send you a copy? :) |
| 06:55:17 | <ivanm> | dons: \o/ |
| 06:55:20 | <dons> | it'll probably be in the unsw bookshop at some point. |
| 06:55:27 | <ivanm> | what's the QC library to load into ghci? |
| 06:55:36 | <dons> | thatsright: in borders, i guess so. do they have o'reilly books? |
| 06:55:43 | <dons> | ivanm: Test.QuickCheck |
| 06:56:09 | <thatsright> | dons: they had an ocaml and an erlang book |
| 06:56:25 | <dons> | oh, well, i'd say definitely then |
| 06:56:49 | <dons> | yeah, looks like it is in borders already |
| 06:57:12 | <dons> | thatsright: http://www.borders.com/online/store/SearchResults?keyword=real+world+haskell&type=0&simple=1 |
| 06:57:15 | <lambdabot> | Title: Real World Haskell - Borders - Books, Music and Movie, http://tinyurl.com/6q6zfn |
| 06:57:39 | <dons> | ACTION has no idea how the distribution end of things works |
| 06:57:43 | <dons> | they just seem to appear |
| 06:58:32 | <dons> | maybe we should do a "recommend RWH to a java programmer" campaign :) |
| 06:58:51 | <ivanm> | is there a QC function that does the same as lambdabot's ?check ? |
| 06:59:01 | <dons> | guerilla RWH: go into borders and replace the java books with copies of RWH. hehe |
| 06:59:09 | <dons> | ivanm: quickCheck |
| 06:59:11 | <ivanm> | @remember dons maybe we should do a "recommend RWH to a java programmer" campaign :) |
| 06:59:12 | <lambdabot> | I will never forget. |
| 06:59:52 | <ivanm> | dons: doesn't that require a pre-done function? :o |
| 07:00:03 | <dons> | i wonder if they have things like that for books: recommend it to a java programmer, and get a discount |
| 07:00:22 | <dons> | ivanm: yeah, quickCheck $ \x -> mytest x == yourtest x |
| 07:00:29 | <dons> | or something like that. |
| 07:01:09 | <ivanm> | failed after 1 test! :o |
| 07:02:17 | <ivanm> | dons: hmmm.... does yours work for [] ? |
| 07:03:16 | <thoughtpolice> | hm, i wonder what the new quickcheck that will be at defun will come with :] |
| 07:04:10 | <ivanm> | is there any way to have quickcheck print what it used as its test? |
| 07:04:21 | <ivanm> | *test data |
| 07:09:15 | <quicksilver> | ivanm: Yes. |
| 07:09:24 | <ivanm> | how? |
| 07:09:26 | <quicksilver> | I don't remember exactly but it's in the haddock. |
| 07:09:28 | <quicksilver> | verboseCheck is it? |
| 07:09:53 | <ivanm> | quicksilver: for which version of quickcheck? |
| 07:10:03 | <quicksilver> | the one which comes with GHC. |
| 07:10:39 | <ivanm> | hmmm... |
| 07:11:42 | <ivanm> | OK, how do I specify which version of quickcheck I want to load in ghci if I have 1.1.0.0 and 2.0? |
| 07:13:21 | <dons> | use -package QuickCheck 1.1.0.0 at the command line |
| 07:13:22 | <thoughtpolice> | by default it'll pull in 2.0 naturally, but you can do 'ghci --hide-package QuickCheck-2.0.0.0' |
| 07:13:28 | <thoughtpolice> | or yeah, that too |
| 07:13:39 | <dons> | yeah |
| 07:13:43 | <dons> | --hide-package is better |
| 07:13:43 | <ivanm> | well, I've already loaded ghci... |
| 07:14:36 | <ivanm> | --hide-package is an unrecognised flag :s |
| 07:15:12 | <ivanm> | heh... ghci says to use --help, but then complains that you can't you --interactive with --help ;-) |
| 07:24:04 | <ivanm> | dons: the problem I'm having using quickcheck is that it fails if the two answers differ in the 15th place or something like that |
| 07:24:13 | <ivanm> | if it's that close, I'd be tempted to say they're equal :s |
| 07:24:22 | <dons> | ah , so don't use == |
| 07:24:28 | <dons> | used a custom =~ |
| 07:24:35 | <ivanm> | *nod* |
| 07:24:49 | <dons> | e.g. epsilonify x == epsilonify y |
| 07:25:23 | <ivanm> | actually, from looking at the code, the reason I think that the answers are slightly different is that it works slightly better for numbers that are very large or very different from each other |
| 07:26:29 | <ivanm> | but in terms of efficiency, it should probably be updated to use something slightly closer to yours (rather than a fold) |
| 07:35:23 | <dons> | i mean, they can have the same loop body |
| 07:35:31 | <dons> | but using foldr and a lazy tuple will just be slower. |
| 07:42:03 | <dons> | btw, for those who didn't see it earlier, this is a rather exciting debut into haskell blogging, http://www.reddit.com/r/programming/comments/6zrep/using_c_from_haskell_a_short_introduction/ |
| 07:42:06 | <lambdabot> | Title: Using C From Haskell: A Short Introduction : programming, http://tinyurl.com/58367y |
| 07:42:15 | <dons> | clear, sharp intro to the ffi |
| 07:42:26 | <Myoma> | is it possible to set a heap limit for ghci which will make it give up instead of swamping the computer if you try to compute something like that |
| 07:42:51 | <dons> | Myoma: you should use the compiler if you care about that kind of stuff :) |
| 07:43:09 | <dons> | but yes, hang on... |
| 07:44:02 | <dons> | -Mfoo |
| 07:44:08 | <dons> | where 'foo' is a maximum heap size |
| 07:44:23 | <Myoma> | I don't know what value to use |
| 07:44:28 | <dons> | "Msize |
| 07:44:29 | <dons> | [Default: unlimited] Set the maximum heap size to size bytes. The heap normally grows and shrinks according to the memory requirements of the program. The only reason for having this option is to stop the heap growing without bound and filling up all the available swap space" |
| 07:44:35 | <dons> | Myoma: oh, 500M ? |
| 07:44:46 | <dons> | so, ghci +RTS -M500M -RTS |
| 07:45:29 | <dons> | $ ghci +RTS -M10M -RTS |
| 07:45:29 | <dons> | Prelude> 1+2 |
| 07:45:29 | <dons> | 3 |
| 07:45:29 | <dons> | Prelude> product [1..] |
| 07:45:30 | <dons> | Heap exhausted; |
| 07:45:36 | <dons> | :) |
| 07:45:46 | <Myoma> | great!! |
| 07:45:53 | <Wild_Cat> | something worth reading on reddit? Nonsense. |
| 07:47:08 | <dons> | fwiw, and this might be moderately OT, i'm twittering all these little haskell tips and tricks http://twitter.com/donsbot |
| 07:47:11 | <lambdabot> | Title: Twitter / donsbot |
| 07:47:58 | <Myoma> | export GHCRTS=-M500M |
| 07:48:09 | <dons> | hopefully i'll be doing live twittering of the ICFP conference too |
| 07:57:14 | <BeelsebobWork> | dons: I have this... http://hpaste.org/10135 -- which is faster than the current mandelbrot, but only on 4 cores |
| 07:57:17 | <Adamant> | Twitter seems to be breaking into the tech mainstream more and more, and outside of it |
| 07:57:27 | <BeelsebobWork> | any extra ideas welcome |
| 07:58:15 | <Wild_Cat> | Twitter's been popular in tech for quite a while now. |
| 07:58:21 | <Myoma> | why don't you remove the fromIntegrals |
| 07:58:33 | <BeelsebobWork> | ... because then it wouldn't type check |
| 07:58:47 | <Myoma> | by that I don't mean s/fromIntegral// |
| 07:58:56 | <Wild_Cat> | (I guess it's one of the areas where microblogging makes sense) |
| 07:59:34 | <Adamant> | Wild_Cat: I tended to see it more on the Web 2.0 types |
| 07:59:38 | <sjanssen> | Adamant: I've noticed that CNN is using twitter frequently in their broadcasts |
| 07:59:53 | <Adamant> | that's another sign of mainstreaming |
| 08:00:11 | <BeelsebobWork> | Myoma: actually, no, that's fine |
| 08:00:15 | <BeelsebobWork> | I see what you mean |
| 08:01:01 | <BeelsebobWork> | well, that's another 0.1 seconds gone |
| 08:01:38 | <Myoma> | how do you view the file? |
| 08:01:51 | <BeelsebobWork> | the output of the mand generator? it's in portable bitmap format |
| 08:02:06 | <Myoma> | it's so portable infact, that I don't have any programs to view it |
| 08:02:07 | <BeelsebobWork> | so, find a viewer for your platform -- it's not easy |
| 08:02:11 | <BeelsebobWork> | yeh |
| 08:02:12 | <BeelsebobWork> | good init |
| 08:02:27 | <BeelsebobWork> | tbh, it's a stupid format anyway |
| 08:02:31 | <BeelsebobWork> | so no surprise |
| 08:14:00 | <BeelsebobWork> | okay, a careful sprinkling of bang patterns, thanks to svorg and removal of fromInts has got it a bit faster |
| 08:14:01 | <BeelsebobWork> | http://hpaste.org/10135#a2 |
| 08:14:27 | <dons> | BeelsebobWork: might be time to get ghc head, so you can use -thread + -prof |
| 08:14:43 | <dons> | looks nice though |
| 08:14:46 | <BeelsebobWork> | oh, does the latest head allow you to combine them? |
| 08:14:46 | <dons> | i think we can work with that. |
| 08:14:49 | <dons> | yeah |
| 08:14:55 | <BeelsebobWork> | dons: warning -- I don't think it's quite right |
| 08:15:00 | <BeelsebobWork> | but I think it's a floating point precission thing |
| 08:15:13 | <BeelsebobWork> | it's only 2 bytes that are coming out different between it and the C version |
| 08:15:15 | <BeelsebobWork> | :/ |
| 08:15:22 | <dons> | -fexcess-precision ? |
| 08:15:22 | <BeelsebobWork> | I can't figure out for the life of me what it thinks its doing |
| 08:15:27 | <BeelsebobWork> | same result |
| 08:15:39 | <dons> | -optc-On messing things up? |
| 08:15:43 | <dons> | different results with -fasm ? |
| 08:16:28 | <BeelsebobWork> | no change again |
| 08:16:32 | <BeelsebobWork> | other than slightly slower |
| 08:20:21 | <xci> | is that Real World Haskell available in pdf-format already? |
| 08:22:12 | <Myoma> | Aren't you allowed to exploit symmetry of the mandelbrot? |
| 08:22:20 | <BeelsebobWork> | nope |
| 08:22:27 | <BeelsebobWork> | gotta use the same algorithm as the C version |
| 08:22:44 | <BeelsebobWork> | I wanted to write a sherman contour crawler :( |
| 08:23:34 | <BeelsebobWork> | ACTION ponders if the couple of bytes difference is that it's upside down |
| 08:23:40 | <BeelsebobWork> | ACTION checks what order the C generates the rows in |
| 08:23:51 | <ivanm> | dumb question... how can I write a function that does \ n -> 10^(-n)? |
| 08:24:02 | <BeelsebobWork> | exactly like that |
| 08:24:04 | <BeelsebobWork> | ? |
| 08:24:12 | <quicksilver> | (10^) . negate |
| 08:24:18 | <ivanm> | nope, doesn't seem to work :s |
| 08:24:21 | <ivanm> | negative exponent error :s |
| 08:24:24 | <quicksilver> | ah |
| 08:24:26 | <quicksilver> | you want ^^ |
| 08:24:32 | <ivanm> | ahhh |
| 08:24:33 | <quicksilver> | ^ doesn't take negative exponents |
| 08:24:40 | <ivanm> | *nod* |
| 08:24:44 | <ivanm> | @ty (^^) |
| 08:24:46 | <lambdabot> | forall a b. (Integral b, Fractional a) => a -> b -> a |
| 08:25:44 | <xci> | yeah, try ^^ or ** instead |
| 08:25:56 | <Wild_Cat> | otherwise, \n -> 1 / (10^n) -- would work, I guess. |
| 08:26:02 | <sjanssen> | y'know, if we moved (^) into the Num class, we could avoid this |
| 08:26:11 | <quicksilver> | (^) is for positive exponent, any base, and preserves the type of its base. ^^ is for integer exponent, any base, and preserves the type of its base. |
| 08:26:25 | <quicksilver> | ** is for fractional exponent but should really only be used with positive base |
| 08:26:48 | <quicksilver> | sjanssen: I don't think I'd want (^)'s type to change. I like the separation between (^) (^^) and (**). |
| 08:26:59 | <quicksilver> | sjanssen: there are other reasons to move it into Num, though. |
| 08:27:05 | <quicksilver> | Interval arithmetic for one. |
| 08:27:28 | <rwbarton> | move it into Num how? |
| 08:27:29 | <rwbarton> | :t (^) |
| 08:27:31 | <lambdabot> | forall a b. (Integral b, Num a) => a -> b -> a |
| 08:27:58 | <quicksilver> | make it a method, rwbarton |
| 08:29:02 | <rwbarton> | how would that help interval arithmetic? |
| 08:29:13 | <quicksilver> | the current (^) uses (*) |
| 08:29:22 | <quicksilver> | in interval arithmetic that's suboptimal |
| 08:29:27 | <quicksilver> | [0,1] ^ 2 is [0,1] |
| 08:29:33 | <quicksilver> | erm, try again ;) |
| 08:29:38 | <quicksilver> | [-1,1] ^ 2 is [0,1] |
| 08:29:46 | <quicksilver> | but [-1,1] * [-1,1] is [-1,1] |
| 08:30:05 | <quicksilver> | so, for interval arithmatic, x^2 is not x*x |
| 08:30:16 | <rwbarton> | I think that's a failure of interval arithmetic, not the Num typeclass. |
| 08:30:53 | <purestorm> | Hi. Is it somehow possible to install Haskell packages with one command like apt-get, easy_install or gem? |
| 08:30:55 | <rwbarton> | i.e. [-1,1] is not a complete description of the number, there is also a notion of the number's "identity" |
| 08:31:24 | <Wild_Cat> | purestorm: you're looking for cabal-install |
| 08:31:42 | <BeelsebobWork> | shaved a bit more off by inlining fractal and f |
| 08:33:01 | <ivanm> | is there a function that rounds a Double to a specified number of digits? |
| 08:33:23 | <ivanm> | the obvious would be *10^x, round, /10^x, but that doesn't sound too efficient :s |
| 08:33:30 | <Myoma> | ivanm: That is efficient |
| 08:33:35 | <ivanm> | Myoma: oh? |
| 08:33:40 | <ivanm> | not very pretty then :p |
| 08:33:46 | <Myoma> | it is pretty |
| 08:33:59 | <ivanm> | heh |
| 08:34:02 | <ivanm> | fine then, I'll use it |
| 08:34:32 | <Myoma> | > let places pi n = (% (10^n)) . toInteger . ((10^n) *) in places pi 3 |
| 08:34:35 | <lambdabot> | Overlapping instances for Show (b -> Ratio Integer) |
| 08:34:36 | <lambdabot> | arising from... |
| 08:35:30 | <purestorm> | Wild_Cat: Awesome, thanks. |
| 08:35:36 | <Myoma> | > let places n = (% (10^n)) . floor . ((10^n) *) in places 3 pi |
| 08:35:40 | <lambdabot> | 3141%1000 |
| 08:35:57 | <quicksilver> | rwbarton: eh? No, it's not. |
| 08:36:14 | <quicksilver> | rwbarton: it's true that to reason about interval arithmetic you need to understand identity. But you don't to use it. |
| 08:36:45 | <quicksilver> | rwbarton: [-1,1] ^ 2 = [0,1] is an instance of a simple rule. |
| 08:37:05 | <quicksilver> | of course, you can argue 'Num' isn't designed for interval arithmetic |
| 08:37:07 | <quicksilver> | and that's fair enough |
| 08:37:21 | <quicksilver> | but the fact is, Num is actually very close to being perfect for interval arithmetic :) |
| 08:37:29 | <quicksilver> | (^) is an annoying exception. |
| 08:38:48 | <dons> | purestorm: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall |
| 08:38:50 | <lambdabot> | Title: CabalInstall - Hackage - Trac |
| 08:39:11 | <purestorm> | dons: Thanks, but already google'd it and installed my first packgage. |
| 08:39:28 | <dons> | great :) |
| 08:39:39 | <dons> | now you can go nuts and install 750 packages from hackkage |
| 08:39:43 | <ivanm> | lol |
| 08:39:55 | <dons> | cabal install yeah, hell yeah, everything |
| 08:40:23 | <ivanm> | dons: OK, after eventually finding an approximation function, I've managed to QC the two, and the results are comparable |
| 08:40:32 | <dons> | great! |
| 08:41:36 | <ivanm> | only difference is, yours fails if the list is empty |
| 08:43:46 | <dons> | did i miss f [] = 0 or something ? |
| 08:43:53 | <ivanm> | yup |
| 08:44:06 | <ivanm> | well, you need to have it before going to the "go" inner function... |
| 08:44:14 | <ivanm> | otherwise you get x / 0 |
| 08:44:21 | <ivanm> | (since the current length of the list is 0) |
| 08:55:02 | <ivanm> | dons: http://hpaste.org/10136 |
| 08:55:24 | <ivanm> | just running it now, it failed for 13 and 15 digits but that's it |
| 08:56:23 | <ivanm> | dons: want me to CC the email I'm sending to the author to you? |
| 09:07:10 | <ivanm> | dons: not sure if this went before since my IRC connection seems to have cut, but do you want me to CC the email I'm sending to the author to you? |
| 09:18:17 | <rwbarton> | quicksilver: if f(x) = x^2+x, what is f([-1,1])? |
| 09:20:30 | <quicksilver> | rwbarton: Right; the rules will get that wrong. |
| 09:20:40 | <quicksilver> | rwbarton: this is a limitation of IA, indeed. |
| 09:20:55 | <quicksilver> | rwbarton: although they never produce an inconsistent answer, just a conservative one. |
| 09:21:03 | <quicksilver> | You can always add new rules to the system, though. |
| 09:21:18 | <quicksilver> | and you might as get ^ right instead of deferring to * which is too conservative. |
| 09:21:45 | <quicksilver> | actually, that's [-1,2] and the rules get it right, isn't it? |
| 09:22:04 | <quicksilver> | ah no, it's wrong indeed as you suggested. |
| 09:30:35 | <rwbarton> | I guess the more fundamental issue is with the Eq instance :) |
| 09:46:15 | <quicksilver> | conal: morning. |
| 09:46:26 | <quicksilver> | conal: I have something of an abstraction gap, but maybe I'm thinking wrong. |
| 09:46:28 | <conal> | quicksilver: hi there |
| 09:46:50 | <quicksilver> | conal: we have combinators which let us defint Event (Behaviour a) -> Event a |
| 09:47:03 | <quicksilver> | a 'discrete sample' of some behaviours |
| 09:47:24 | <quicksilver> | but it seems hard to generalise that to 'Event (x,Behaviour a) -> Event (x,a)' |
| 09:47:40 | <quicksilver> | [and other similar transformations] |
| 09:47:59 | <conal> | quicksilver: what combinators let us define Event (Behaviour a) -> Event a ? |
| 09:49:11 | <quicksilver> | well switcher :: Event (Behaviour a) -> Behaviour a |
| 09:49:14 | <quicksilver> | and then snapshot? |
| 09:49:44 | <quicksilver> | very likely I'm thinking about this all wrong. |
| 09:51:22 | <conal> | okay, switcher :: Behavior a -> Event (Behavior a) -> Behavior a |
| 09:51:33 | <conal> | what would you like to define? |
| 09:52:32 | <quicksilver> | conal: well the point is I can 'evaluate' a behaviour at a given time. |
| 09:52:50 | <quicksilver> | conal: but I can only do that in a context which has a notion of 'current time' |
| 09:52:58 | <quicksilver> | conal: such as, inside an Event. |
| 09:53:29 | <conal> | quicksilver: as in snapshot |
| 09:53:32 | <quicksilver> | right. |
| 09:53:40 | <conal> | ok |
| 09:53:42 | <quicksilver> | but there doesn't seem to be a general way of doing this. |
| 09:54:09 | <quicksilver> | let me give a concrete example. |
| 09:54:19 | <quicksilver> | Event (x , x -> Behaviour y) |
| 09:54:35 | <quicksilver> | I claim I should be able to get an 'Event y' out of that. |
| 09:55:05 | <quicksilver> | and I think I can write it using the underlying implementation, btu I can't seem to write it using the general combinators. |
| 09:55:49 | <guenni> | good morning |
| 09:56:41 | <conal> | quicksilver: oh, okay. and, fmap (flip ($)) to get Event (Behavior y) and ask the same question of the simpler result |
| 09:58:13 | <quicksilver> | conal: Hmm. OK that's the wrong example then. |
| 09:58:27 | <quicksilver> | conal: my real example has a worse problem. Let me think again. |
| 09:59:38 | <quicksilver> | conal: Ah, I rememmber. Here it is: |
| 09:59:55 | <quicksilver> | Event (Behaviour (x -> y), x) |
| 10:00:23 | <quicksilver> | conal: I need to sample the behaviour at each time stamp, to pull the function out, then apply it to the value which is also hanging around. |
| 10:01:08 | <quicksilver> | but that's OK too, isn't it? because behaviours are functors. |
| 10:01:24 | <EvilTerran> | i see a great many sqlite bindings |
| 10:01:29 | <EvilTerran> | how do i know which one i want? |
| 10:01:36 | <quicksilver> | I can fmap (\(b,x) -> fmap ($x) b) |
| 10:01:41 | <Axman6> | EvilTerran: you want them all |
| 10:02:16 | <quicksilver> | conal: I'm actually trying to join piecewise behaviours together, which I suspect is a problem you have already solved. |
| 10:02:23 | <EvilTerran> | haskelldb-hdbc-sqlite3 haskelldb-hsql-sqlite haskelldb-hsql-sqlite3 HDBC-sqlite3 hsql-sqlite3 hsSqlite3 sqlite |
| 10:02:33 | <quicksilver> | conal: but I am finding it instructive trying to solve it myself. |
| 10:02:43 | <EvilTerran> | ^ those are all the hackages with "sqlite" in the name |
| 10:02:50 | <conal> | quicksilver: if you do that fmap, you won't have sampled the function behavior. is that okay? |
| 10:03:15 | <conal> | quicksilver: do you have a bunch of behaviors that you want to switch between? |
| 10:03:22 | <quicksilver> | conal: well after the double fmap I have Event (Behaviour y) |
| 10:03:34 | <conal> | quicksilver: yeah |
| 10:03:35 | <quicksilver> | conal: which I can "pseudo-join" to get Event y. |
| 10:03:53 | <conal> | quicksilver: can you? |
| 10:04:00 | <quicksilver> | I claim I can. |
| 10:04:15 | <quicksilver> | using switcher + snapshot at self. |
| 10:04:21 | <conal> | quicksilver: yeah. |
| 10:04:49 | <Axman6> | EvilTerran: i say you want them all so that you can test them out, and then blog about which one is the best in your oppinion. (easiest to use would probably make the greatest difference) |
| 10:04:51 | <quicksilver> | conal: I have a bunch of behaviours I want to 'connect'. |
| 10:05:04 | <quicksilver> | conal: the behaviours are parametric so you can specify their initial values. |
| 10:05:18 | <quicksilver> | conal: I want to set the initial value, at each event, to be the final value of the *last* behaviour |
| 10:05:26 | <quicksilver> | conal: thus producing something continuous. |
| 10:05:34 | <conal> | quicksilver: oh ... now i get it. |
| 10:05:49 | <quicksilver> | I wrote a combintor for an event which remembers previous occurrences |
| 10:05:56 | <quicksilver> | so I have access to 'last behaviour' |
| 10:06:04 | <quicksilver> | then I need to snapshot last behaviour at current time |
| 10:06:07 | <conal> | as in withPrevE ? |
| 10:06:12 | <quicksilver> | to get the right initial value to feed to new behaviour. |
| 10:06:24 | <quicksilver> | ACTION checks. |
| 10:06:36 | <conal> | quicksilver: or just snapshot the behavior you're defining, rather than the last segment. |
| 10:06:56 | <conal> | i.e., a self-referential definition. |
| 10:07:19 | <quicksilver> | no, it's not self-referential |
| 10:07:33 | <quicksilver> | or, at least, the self-reference is hidden inside withPrevE |
| 10:07:36 | <quicksilver> | or something like it :) |
| 10:07:38 | <conal> | i'm suggesting simplifying it by giving a self-referential definition. |
| 10:07:55 | <conal> | instead of snapshotting the previous phase of the behavior, snapshot the behavior itself. |
| 10:07:55 | <quicksilver> | That was one of the many things that crossed my mind ;) |
| 10:08:17 | <quicksilver> | I have a random observation, too. |
| 10:08:28 | <quicksilver> | Event/Reactive/Behaviour are used in two slightly different ways. |
| 10:08:37 | <quicksilver> | Abstractly, they are defined 'for all time' |
| 10:08:41 | <conal> | quicksilver: i don't know if you got the point about why you'd *want* self-referential in this case. |
| 10:08:54 | <quicksilver> | concretely, we frequently reduce them to something with is only defined 'from this point forward' |
| 10:09:02 | <quicksilver> | to enable old data to be discarded. |
| 10:09:15 | <conal> | in the implementation, yes. though one could use a zipper |
| 10:09:21 | <quicksilver> | it's easy to get confused between teh value which represents 'the whole stream' and a value which represents 'half-stream' |
| 10:09:24 | <quicksilver> | ACTION nods |
| 10:09:28 | <quicksilver> | half-streams make good sense. |
| 10:09:32 | <quicksilver> | it's just possible to get confused :) |
| 10:10:00 | <conal> | quicksilver: are you talking about the implementation? or use of Reactive? |
| 10:10:29 | <ivanm> | can strictness annotations be used with records? |
| 10:10:45 | <quicksilver> | conal: I did miss the point about self-reference, yes. |
| 10:10:56 | <quicksilver> | conal: would you like to elaborate. |
| 10:11:35 | <quicksilver> | conal: I'm talking about the use, actually. A concrete haskell value of type 'Behaviour a' sometimes represents a half-stream. |
| 10:11:39 | <b\\6> | ivanm: yeah, i just saw someone do it. |
| 10:11:55 | <b\\6> | ivanm: http://techguyinmidtown.com/2008/07/16/lessons-learned-parsing-csv-in-haskell-and-python/ like tickerR? |
| 10:11:57 | <lambdabot> | Title: Lessons Learned: Parsing CSV in Haskell and Python « tech guy in midtown, http://tinyurl.com/57bctu |
| 10:12:00 | <quicksilver> | of course, you can 'sample' it at previous times. But you might get the wrong answer because you've lost information about reactions before the current time. |
| 10:12:25 | <conal> | quicksilver: about self-reference, if i understood your description, you're taking care to remember a previous phase of a composite behavior b, so you can snapshot that phase in helping to define b. i'm suggesting it'd be simpler to *not* remember the previous phases, and instead simply snapshot b as part of its own definition. |
| 10:12:37 | <EvilTerran> | Axman6, but i don't want to try all of them and write a blog post =/ |
| 10:13:22 | <ivanm> | b\6: yeah |
| 10:13:37 | <quicksilver> | conal: I'm sure that would be simpler. I couldn't quite get my head around it. I will try again. |
| 10:14:14 | <quicksilver> | conal: I was suprised at how hard it was to write accumE and accumR. In the end I just used your definitions, but I spent quite a while trying to write them myself. I wasn't expecting to need mutual recursion. |
| 10:14:17 | <conal> | quicksilver: if you try the self-referential version, i'd like to hear. i carefully crafted the semantics to make it work, but i'm not sure the implementation is up to it. |
| 10:14:40 | <ivanm> | is there a strict version of iterate? |
| 10:14:42 | <quicksilver> | conal: I was convinced I could write accumE standalone, but I failed :) |
| 10:14:44 | <conal> | quicksilver: you're getting deep in to this stuff! |
| 10:15:25 | <quicksilver> | ivanm: you can just use iterate (f$!), I think. Depending what you meant by strict. |
| 10:15:31 | <quicksilver> | ivanm: it's not normally necessary. |
| 10:15:38 | <ivanm> | *nod* |
| 10:15:46 | <conal> | quicksilver: keep trying. i've been noodling about this stuff since 1992 or so. |
| 10:16:03 | <ivanm> | just wondering if it delays computing f (f (f ( ... )))) until you actually ask for it... |
| 10:16:11 | <b\\6> | i thought dropping in bytestring might speed up parsec, but i'm seeing the opposite. i'm using readFile from Data.ByteString and Parser from Text.Parsec.ByteString; thought for sure that'd beat normal lazy reads and strings. |
| 10:16:56 | <conal> | quicksilver: about half-streams, i'd hope that you can't tell that sampling before a certain time wouldn't give you the answer you'd expect. |
| 10:17:16 | <conal> | quicksilver: can you tell? |
| 10:18:12 | <conal> | quicksilver: and could you define accumE by itself simply by inlining accumR? |
| 10:18:34 | <conal> | quicksilver: s/could/couldn't/ |
| 10:20:24 | <quicksilver> | conal: absolutely, but it wasn't obvious how to do so :) |
| 10:20:42 | <quicksilver> | the function you fmap over the Future (you call it 'h') is a very non-obvious one. |
| 10:20:59 | <quicksilver> | it applies a function to the first 'fixed' value of the reactive and does something totally different to the tail of the reactive. |
| 10:21:17 | <quicksilver> | well maybe it's obvious in retrospect but I was unable to come up with until I gave up and cheated :) |
| 10:21:29 | <quicksilver> | ivanm: it delays computing until you ask for it, yes. |
| 10:21:44 | <quicksilver> | ivanm: but on the otherhand it remembers the n-1th value when calculating the nth value |
| 10:21:51 | <quicksilver> | ivanm: you get a chain of thunks which reference each other. |
| 10:21:58 | <ivanm> | it does? fair enough then |
| 10:22:05 | <ivanm> | even if you lazily consume the list? |
| 10:22:12 | <quicksilver> | especially if you lazily consume the list :) |
| 10:22:44 | <quicksilver> | the nth thunk contains a reference to the n-1th thunk, so even if you 'consume' the n-1th it still can' tbe GCed yet. |
| 10:23:14 | <quicksilver> | conal: I think that 'user code' shouldn't really play directly with the half-streams |
| 10:23:17 | <conal> | quicksilver: which function has the 'h'? |
| 10:23:34 | <quicksilver> | conal: accumE, in the paper version. |
| 10:23:40 | <ivanm> | yay! strictness on my record data type prevented ghci from using up all the RAM! |
| 10:23:51 | <conal> | quicksilver: looking ... |
| 10:24:29 | <quicksilver> | the half-streams are there in the implenetation as you 'unwrap' the Reactives. Which is fine. |
| 10:24:41 | <quicksilver> | but the user works with streams 'defined over my whole program' |
| 10:24:47 | <quicksilver> | still I wonder if there is a pitfall. |
| 10:25:20 | <quicksilver> | I also wonder if forgetThePast :: Event (Behaviour a) -> Event (Behaviour a) is useful. |
| 10:26:22 | <conal> | quicksilver: i see. i'd lost some appreciation for the subtlety of this style. |
| 10:27:14 | <quicksilver> | conal: I am a very practical computer scientist. I need to try to write programs in order to give me intuition for the issues. |
| 10:27:29 | <quicksilver> | conal: I have a couple more 'exercises' for myself yet to do :) |
| 10:28:11 | <conal> | quicksilver: the library needs a good suite of commented examples. it'll get there, especially with conributions from you & others. |
| 10:28:41 | <quicksilver> | conal: I have another slight type-system mismatch. |
| 10:28:49 | <quicksilver> | conal: I keep wanting to 'zipWith' two Events |
| 10:28:55 | <conal> | quicksilver: do you see user code playing with half-streams and being able to distinguish them from full streams? |
| 10:29:11 | <quicksilver> | conal: but the meaning of zipWith I have in mind only makes sense if the events are all simultaneous |
| 10:29:41 | <conal> | quicksilver: sure. you can do something similar, though. fmap Left over one & Right over the other, and mappend them. |
| 10:29:55 | <conal> | i have some nice examples somewhere in a blog post |
| 10:30:58 | <conal> | quicksilver: have you played with pairE ? |
| 10:31:47 | <EvilTerran> | ACTION notes that HSQL and HDBC appear to be the same layer, so you only need one |
| 10:32:15 | <conal> | quicksilver: http://conal.net/blog/posts/pairs-sums-and-reactivity/ |
| 10:32:20 | <lambdabot> | Title: Conal Elliott » Pairs, sums, and reactivity |
| 10:32:33 | <quicksilver> | conal: well I came to the conclusion that I should be using Event (a,b) instead, if I knew they were simultaneous. |
| 10:32:43 | <quicksilver> | conal: tell the type system that I know about simultaneity. |
| 10:33:08 | <quicksilver> | conal: which goes against my haskell/list processing instincts to prefer 'zipWith' over explicit lists of tuples :) |
| 10:34:50 | <conal> | quicksilver: sure. in a synchronous setting. still, it doesn't alway make "sense" to zipWith two lists. i.e., without a reason to relate the nth element of one list to the nth element of another |
| 10:35:56 | <quicksilver> | conal: true, true ;) |
| 10:36:15 | <conal> | quicksilver: i'm enjoying these discussions. |
| 10:36:35 | <besiria> | i was looking at shootout.alioth.debian.org earlier this day and i saw that there is a significant difference in perfomance between x86 and x86_64 Haskell benchmark results. is that normal? |
| 10:37:16 | <quicksilver> | besiria: well their x86_64 machine has 4 cores and will have much larger caches. |
| 10:37:21 | <quicksilver> | besiria: those things can make big differences. |
| 10:37:59 | <quicksilver> | conal: I have a sneaking suspicions I am going to want something 'like' monad or notation or arrow notation soon. |
| 10:38:03 | <quicksilver> | conal: but I haven't pinned it down. |
| 10:38:30 | <besiria> | quicksilver: i understand. but i'm going to benchmark some parallel prog models and maybe i should use a x86 for comparison? 4cores and more |
| 10:39:00 | <quicksilver> | conal: I have this strong intuition then when you're "inside" an Event, you are allowed to evaluate behaviours and reactives as much as you like. |
| 10:39:18 | <quicksilver> | conal: that is analogous to the idea that when you're "inside" IO you are allowed to execute as many IO actions as you like. |
| 10:39:53 | <quicksilver> | conal: in do notation, this is acheived by <- which desugared into join. So really this is all "about" the existence of join :: IO (IO a) -> IO a |
| 10:40:09 | <quicksilver> | conal: the 'pseudo-join' :: Event (Behaviour a) -> Event a gives rise to a similar feeling. |
| 10:40:51 | <conal> | quicksilver: cool. play around and let me know. i've intentionally hidden the representations, and you might have to unhide them in order to add some more primitives. |
| 10:41:08 | <quicksilver> | besiria: what are you trying to compare with what? If you're comparing different programming models then the most important thing is just that you use the same machine for all your tests; what other people use is not directly relevant. |
| 10:41:15 | <quicksilver> | conal: well, I'm currently using my implementation not yours :) |
| 10:41:21 | <conal> | quicksilver: what's important to me is that all of the primitives fit the semantic model. |
| 10:41:23 | <quicksilver> | conal: just for instructive purposes. |
| 10:41:41 | <conal> | quicksilver: oh yeah. btw, we now have a bunch of QC tests you can use. |
| 10:42:03 | <quicksilver> | I saw the clever class laws tests. |
| 10:42:36 | <conal> | reactive is a jumbled mess now, with the tests in the code and the extension interface muddled with the functional interface. i want to get it all neatly straightened out again. |
| 10:42:59 | <besiria> | quicksilver: models and languages. haskell, erlang, java |
| 10:43:28 | <cads> | in haskell, saying x:xs is like saying cons x xs, and car x and cdr x are head x and tail x? |
| 10:43:55 | <quicksilver> | cads: yes. |
| 10:44:22 | <conal> | quicksilver: btw, watch out for recomputation, particularly of future values. afaik, everyone who's tried to implement data-driven frp has run into the problem of recomputing future values, including me. that's why i dropped using IO or STM in the representation. |
| 10:45:10 | <quicksilver> | conal: I have a helper 'buildFuture' :: IO a -> Future a |
| 10:45:22 | <quicksilver> | conal: it guarantees the action only gets called once :) |
| 10:45:28 | <quicksilver> | actually IO(Future a) |
| 10:45:57 | <quicksilver> | unfortunately, though, it's not general enough to use every time I need a future. My event's `mappend` has to cheat. |
| 10:46:08 | <guenni> | parsec, one more time: has anyone done done a scan/parse, scan/parse, scan/parse ..... with Parsec? |
| 10:46:49 | <b\\6> | guenni: did you put a busted try at incremental parser on hpaste a while back? |
| 10:47:15 | <guenni> | b\6: I think so |
| 10:47:18 | <quicksilver> | conal: it definitely 'basically works' I have some examples working. I'll send you the code. |
| 10:47:30 | <b\\6> | guenni: yeah, welcome to the unhappy @ parsec Stream club. |
| 10:48:06 | <guenni> | b\6: that doesn't sound good :( |
| 10:48:22 | <b\\6> | guenni: did you make an instance of Parsec Stream? |
| 10:48:27 | <conal> | quicksilver: thx. and give the qc tests a try. for instance, determinacy of future&event mappend was tricky for me. which is what led me to the functional unamb combinator. |
| 10:48:58 | <guenni> | b\6: not sure what you mean |
| 10:49:16 | <quicksilver> | conal: Yes. I'm pretty sure my event mappend is not guaranteed deterministic. |
| 10:49:30 | <quicksilver> | conal: I think it's likely to be under the GHC RTS though :) |
| 10:49:45 | <eth01> | possibly |
| 10:49:47 | <conal> | quicksilver: testing will probably tell. |
| 10:49:48 | <b\\6> | guenni: think you'd know if you had. Parsec has a class called Stream with a function uncons. it acted kind of funny for me. |
| 10:49:53 | <conal> | quicksilver: i suspect unamb has a lot of cool uses for functional programming. |
| 10:50:25 | <quicksilver> | conal: I'm not trying to make a better implementation than yours, anyway. I'm trying to make a simple implementation to help me understand yours :) It's hard to understand design decisions without having explored the space a bit. |
| 10:50:58 | <guenni> | b\6: it's kind of an unresolved issue then? |
| 10:51:16 | <conal> | quicksilver: was sure hard for me too. and i hope you or someone else does make a better implementation than mine. |
| 10:52:27 | <b\\6> | guenni: dunno. i couldn't figure out how to do what i wanted. i think it's kind of tricky because parsec needs certain things to be true about its streams and they aren't all specified. |
| 10:53:16 | <quicksilver> | b\6, guenni: have you tried lazy polyparse? |
| 10:53:23 | <guenni> | b\6: well I know how to work around the problem, it just means a hell of a lot of boilerplate code |
| 10:54:03 | <quicksilver> | conal: I have a good target for a real but very small app to convert to reactive. |
| 10:54:13 | <quicksilver> | conal: I have a simple particle system which does, e.g., fire effects. |
| 10:54:26 | <guenni> | quicksilver: I had a glimpse at polyparse, but it is less documented than Parsec and I wondered of the relationship between those 2 libraries |
| 10:54:33 | <quicksilver> | conal: would be very nice to use reactive to decouple the sampling from the frame-rate. |
| 10:54:42 | <quicksilver> | less documented than parsec? |
| 10:54:51 | <quicksilver> | surely that woudl only be possible if you had *NO* documentation at all. |
| 10:54:59 | <guenni> | quicksilver: of what I could find, yes |
| 10:55:39 | <guenni> | quicksilver: parsec had those 2 nice pdfs, polyparse only seemed to have haddocks |
| 10:56:11 | <conal> | quicksilver: great. i'd like to see know how it goes. now i'm off to fool around in antwerp. |
| 10:56:23 | <EvilTerran> | anyone used HaskellDB? is it worth using? |
| 10:56:32 | <guenni> | quicksilver: but if you suggest to check it out I certainly will give it more effort |
| 11:03:56 | <Saizan_> | b\6: parsec3 is highly unoptimized |
| 11:04:11 | <Saizan_> | b\6: so it's not surprising that you're getting bad performance |
| 11:04:45 | <thoughtpolice> | it apparently has better performance over e.g. bytestrings |
| 11:04:56 | <thoughtpolice> | but for regular strings there are apparently big regressions from parsec2 |
| 11:04:56 | <b\\6> | not in my tests. |
| 11:05:10 | <guenni> | I had the impression, being totaly impressionable by anything as a newbie, that parsec was, well, state of the art? |
| 11:05:43 | <thoughtpolice> | b\6: well that info came from someone who built pandoc against parsec3 and tested over strings v. bytestrings |
| 11:05:47 | <thoughtpolice> | ymmv, for sure |
| 11:06:09 | <b\\6> | guess i'll try with parsec2. |
| 11:06:27 | <Saizan_> | guenni: parsec2 has been the parsing library of choice for quite some time, and it's still one of the most used |
| 11:06:37 | <malcolmw> | guenni: Here is a paper about polyparse: http://www-users.cs.york.ac.uk/~malcolm/partialparse.html |
| 11:06:39 | <thoughtpolice> | parsec2 is about ~6yrs old isn't it? |
| 11:06:39 | <lambdabot> | Title: Partial parsing: combining choice with commitment |
| 11:06:40 | <maltem> | guenni: It's widely used, but that's a different thing :) And it has a very nice interface |
| 11:08:06 | <guenni> | malcolmw: thx for the paper |
| 11:08:11 | <quicksilver> | I don't think parsec is anything like state of the art, tbh. |
| 11:08:33 | <malcolmw> | parsec is from year 2000 |
| 11:08:33 | <quicksilver> | it's expressive and robust, and fast enough for most people. |
| 11:08:45 | <quicksilver> | it's not cutting-edge parsing technology by any means. |
| 11:08:59 | <guenni> | quicksilver: well I certainly have come to value your opinion very much |
| 11:09:09 | <malcolmw> | the main reason parsec is widely used is because it has been distributed with ghc for many years |
| 11:09:11 | <quicksilver> | of course, you don't necessarily need something state of the art to get a job done :) |
| 11:09:19 | <quicksilver> | you need smoething which gets the job done. |
| 11:09:33 | <quicksilver> | I personally prefer polyparse's decision to go for symmetric choice. |
| 11:09:53 | <maltem> | Well when Parsec was written, [Char] was the overshadowing bottleneck anyway. ByteString has changed some perspectives, I guess |
| 11:10:02 | <quicksilver> | and, it happens that polyparse has an experiment lazy parser |
| 11:10:11 | <mapreduce> | Grr, "A Taste of Haskell" keeps pausing in a way that it doesn't seem to recover from. |
| 11:10:13 | <quicksilver> | which I think was relevant to what people were talking about :) |
| 11:11:37 | <Saizan_> | i still wonder if you can do the control inversion trick using delimited continuations with parsec3 |
| 11:16:37 | <skorpan> | OT: how do i hide my e-mail address from my google code profile? |
| 11:18:18 | <ivanm> | use a dummy address? :p |
| 11:18:47 | <skorpan> | :P |
| 11:35:37 | <ivanm> | if I'm going to be doing computations where I have a list of n elements xs, and I'm gradually going to somehow combine xs and a shifted version of xs [0<=j<n], what would be better? for each j re-calcualte what the shifted list will be (uncurry (flip (++)) $ split j xs) or else keep passing around (cycle xs) and just do drop j on it? |
| 11:41:41 | <maltem> | ivanm: My guess is that the latter is better. cycle is space-efficient, and gradually dropping is less steps than re-dropping |
| 11:42:41 | <maltem> | ivanm: I'm not sure if that guess still applies if you need the shifted list to have exactly n elements |
| 11:44:30 | <ivanm> | maltem: well, I'm doing a zip with the original list anyway |
| 11:44:43 | <ivanm> | I figured cycle would be better, but wanted a 2nd opinion ;-) |
| 11:45:17 | <ivanm> | besides, the cycled list would never contain more than 2n-1 elements (well, 2n-1 elements and 1 thunk) |
| 11:46:11 | <ivanm> | usually less than that as I'm trying to find the first j that matches certain criteria, which is usually << n |
| 11:46:44 | <maltem> | iirc ghc compiles cycle xs to a real cyclic list, where the last pointer is redirected to the first element |
| 11:47:07 | <maltem> | so you wouldn't even get 2n-1 elements, in the ideal case |
| 11:47:30 | <ivanm> | :o |
| 11:47:34 | <ivanm> | \o/ |
| 11:47:51 | <ivanm> | it makes the type sig less "nice" of the subsidiary function, but shmeh |
| 11:55:43 | <cads> | what editors do you guys use for haskell? |
| 11:56:00 | <quicksilver> | emacs. |
| 11:56:01 | <Husio> | vim |
| 11:56:03 | <Husio> | :) |
| 11:56:20 | <ivanm> | ACTION uses the same as quicksilver |
| 11:56:25 | <Twey> | ACTION uses the same as Husio |
| 11:56:29 | <guenni> | still for hoping for a good one but using emacs for now |
| 11:56:36 | <Husio> | it doesn't really matter, just user the force ;) |
| 11:56:40 | <ivanm> | guenni: but emacs _is_ a good one! |
| 11:56:41 | <ivanm> | ;-) |
| 11:56:43 | <Twey> | ACTION chuckles. |
| 11:57:08 | <guenni> | ivanm: you put the bar pretty low then :) |
| 11:57:22 | <cads> | oh no please no fite |
| 11:57:22 | <ivanm> | @slap guenni |
| 11:57:23 | <lambdabot> | ACTION will count to five... |
| 11:57:25 | <ivanm> | heretic! |
| 11:57:31 | <Husio> | but it has build in tetris! |
| 11:57:41 | <ivanm> | lambdabot is obviously being lazy about counting to five... |
| 11:57:48 | <cads> | have you guys seen the leksah ide? |
| 11:57:54 | <ivanm> | yeah, I"ve installed |
| 11:58:01 | <ivanm> | haven't really played much with it |
| 11:58:06 | <guenni> | cads: don't bother trying that one yet |
| 11:58:14 | <ivanm> | there's also yi, which I had trouble installing :s |
| 11:58:18 | <guenni> | it's a pain to install and then doesn't work |
| 11:58:24 | <ivanm> | guenni: oh? how doesn't it work? |
| 11:58:49 | <Axman6> | cads: what platform are you on? |
| 11:58:56 | <guenni> | ivanm: once you do manage to install it, it just crashes / freezes, that is on XP |
| 11:59:19 | <ivanm> | guenni: _there's_ your problem! |
| 11:59:22 | <randomity> | elp hilight |
| 11:59:26 | <cads> | axman: ubuntu |
| 11:59:37 | <ivanm> | cads: no, that's your distribution |
| 11:59:41 | <quicksilver> | saying "Yi doesn't work" is just stupid. |
| 11:59:49 | <quicksilver> | of course it works, the developers use it. |
| 11:59:51 | <ivanm> | quicksilver: he meant leksah |
| 11:59:53 | <ivanm> | your platform is gnu/linux |
| 11:59:54 | <quicksilver> | oh |
| 12:00:11 | <quicksilver> | yeah, it might be true that lekash doesn't work :) |
| 12:00:12 | <cads> | ivan, gnu/linux is what I meant |
| 12:00:18 | <cads> | oh |
| 12:00:25 | <cads> | man I'm slow this morning |
| 12:00:31 | <Axman6> | i wouldn't that technically just be the kernel? |
| 12:00:34 | <maltem> | yi has pretty specific cutting-edge always-changing dependencies, which is why so few people get it to compile |
| 12:00:36 | <ivanm> | does anyone actually use kdevelop for haskell support? |
| 12:00:46 | <guenni> | ivanm: can't do anything about that, need to develop for WinXP |
| 12:00:54 | <quicksilver> | having just been a pedant, myself, I'm going to be hypocritical and criticise ivanm for being pedantic ;) |
| 12:00:55 | <ivanm> | Axman6: linux is the kernel, gnu/linus is one of the ways of specifying the entire toolchain+kernel+system utils |
| 12:01:03 | <quicksilver> | ubuntu is a perfectly sensible answer to 'platform'. |
| 12:01:10 | <ivanm> | quicksilver: lol |
| 12:01:11 | <quicksilver> | platform is a loosely defined concept at best. |
| 12:01:16 | <ivanm> | though I beg to differ |
| 12:01:21 | <quicksilver> | ubuntu tells you which package manager they use |
| 12:01:27 | <quicksilver> | which is a very important part of a platform. |
| 12:01:40 | <ivanm> | no it isn't |
| 12:02:09 | <ivanm> | quicksilver: because windows doesn't have a pkg manager |
| 12:02:29 | <ivanm> | http://en.wikipedia.org/wiki/Platform_(computing) |
| 12:02:32 | <quicksilver> | yes. That's a very important part of the windows platform. |
| 12:02:35 | <quicksilver> | That it has no package manager. |
| 12:02:42 | <quicksilver> | one of the many things I don't like about it. |
| 12:02:50 | <ivanm> | heh, true |
| 12:02:51 | <quicksilver> | Although there is add/remove programs so it's not quite true. |
| 12:03:11 | <ivanm> | quicksilver: no, it has an often malfunctioning central repository for removing packages |
| 12:03:11 | <Botje> | well, most programs use MS installer nowadays |
| 12:03:24 | <ivanm> | which is < 1/2 the job of a package manager |
| 12:03:56 | <ivanm> | Botje: a variant of MS installer anyway |
| 12:04:57 | <cads> | is there a way to use a gnu package manager in windows without say cygwin? |
| 12:05:21 | <cads> | actually, nevermind that |
| 12:05:45 | <ivanm> | cads: closest I can think of is gentoo-prefix |
| 12:06:18 | <cads> | even when dealing with extremely weird bugs am I happy to no longer be on windows |
| 12:10:37 | <Saizan_> | what do you use to search through the papers on your HD? i'm to lazy to rename the pdf to something sensible |
| 12:10:43 | <Saizan_> | "too" |
| 12:10:47 | <ivanm> | Saizan_: grep? :p |
| 12:10:58 | <Saizan_> | for pdfs? |
| 12:11:00 | <ivanm> | IIRC, adobe reader at one stage had a way of searching pdfs |
| 12:11:14 | <ivanm> | maybe something like beagle can index pdfs? |
| 12:12:54 | <cads> | could run pdf2txt on everything then grep that |
| 12:13:07 | <kig> | pdftotext foo.pdf - | grep |
| 12:13:29 | <Saizan_> | looks slow :) |
| 12:14:12 | <ivanm> | filter (contains "foo") . map pdftotext $ find . -name "*.pdf" ;-) |
| 12:16:14 | <kig> | -name glob filename = glob_match glob filename |
| 12:16:55 | <quicksilver> | Saizan_: I use apple's spotlight. I think there are similar things for other platforms |
| 12:16:59 | <Axman6> | wait, wtf? PDF's are perfectly searchable :S |
| 12:18:04 | <Axman6> | ACTION is a little confused |
| 12:18:22 | <quicksilver> | he wants to search his HD for a PDF |
| 12:18:26 | <quicksilver> | not search a single PDF. |
| 12:18:40 | <Axman6> | well, enter spotlight, as you said |
| 12:18:40 | <Saizan_> | yeah |
| 12:18:45 | <ivanm> | or beagle |
| 12:18:55 | <Saizan_> | i'll try beagle, thanks |
| 12:18:57 | <ivanm> | or whatever the new competitor for beagle is |
| 12:19:03 | <ivanm> | Saizan_: I did say that before... ;-) |
| 12:19:52 | <Saizan_> | i didn't say anything against it :) |
| 12:20:47 | <ivanm> | http://www.wikinfo.org/index.php/Comparison_of_desktop_search_software |
| 12:21:00 | <lambdabot> | Title: Comparison of desktop search software - Wikinfo, http://tinyurl.com/5ujaty |
| 12:21:42 | <cads> | how would you guys do math on an irrational number where arbitrary precision would be needed? |
| 12:21:56 | <quicksilver> | CReal |
| 12:22:21 | <cads> | mm that reminds me to get some breakfast |
| 12:22:37 | <quicksilver> | see also |
| 12:22:38 | <quicksilver> | http://www.haskell.org/haskellwiki/Libraries_and_tools/Mathematics#Arbitrary_precision |
| 12:22:41 | <lambdabot> | Title: Applications and libraries/Mathematics - HaskellWiki, http://tinyurl.com/hq4t3 |
| 12:22:47 | <quicksilver> | and the following section on 'Dynamic' precision |
| 12:23:18 | <mgsloan> | has anyone here used the haskell protocol buffers library? |
| 12:24:18 | <cads> | that looks good quicksilver |
| 12:25:35 | <mgsloan> | dons - in the comments of http://stuartsierra.com/2008/07/10/thrift-vs-protocol-buffers you say there is another protocol buffers lib in dev? |
| 12:25:37 | <lambdabot> | Title: Thrift vs. Protocol Buffers - Digital Digressions by Stuart Sierra |
| 12:25:56 | <matthew-_> | sigh, that would have been the wrong irssi command... |
| 12:27:15 | <Axman6> | heh |
| 12:29:16 | <opqdonut> | wow http://sneezy.cs.nott.ac.uk/fplunch/weblog/?p=111 |
| 12:29:18 | <lambdabot> | Title: FP Lunch » Blog Archive » Modular Monad Transformers |
| 12:38:03 | <quicksilver> | opqdonut: that looks very clever. Although I don't entirely grok it :) |
| 12:38:20 | <quicksilver> | opqdonut: It looks like a big step in the direction of a better theory of monad transformers, though. |
| 12:39:11 | <opqdonut> | yes |
| 12:39:34 | <opqdonut> | i love this kind of haskell research. small, cute, obvious and powerful |
| 12:40:15 | <jinjing> | obvious ? |
| 12:40:36 | <opqdonut> | well, it's saying nothing fancy |
| 12:40:54 | <opqdonut> | in terms of types and category theory |
| 12:41:14 | <jinjing> | ok |
| 12:41:15 | <quicksilver> | obvious in the "good ideas are obvious in retrospect" sense |
| 12:41:22 | <quicksilver> | not in the "I could have thought of that" sense :) |
| 12:41:32 | <opqdonut> | yes |
| 12:41:40 | <opqdonut> | i wanted to do my (err, what should i call it) "bachelor's dissertation" on something like this but my mentor recommended functional data structures instead :( |
| 12:41:57 | <opqdonut> | i'll try to sway him, of course |
| 12:42:08 | <quicksilver> | restricting monad operations to only algebraic morphisms which automatically obey the laws is a really nice idea |
| 12:42:21 | <quicksilver> | my gut instinct would be "I bet that means most interesting things are not valid" |
| 12:42:24 | <opqdonut> | but he does computational medical biology or something like that, not very much into theoretical cs |
| 12:42:25 | <quicksilver> | but hopefully I'm wrong. |
| 12:42:43 | <opqdonut> | quicksilver: well the Reader' example is pretty good |
| 12:43:54 | <maltem> | opqdonut: Hah, these "computational" things. I'm enrolled into Computational Engineering Science, but had to find out it doesn't cover CS at all |
| 12:44:10 | <maltem> | little, anyway |
| 12:44:37 | <quicksilver> | there is a lot of pressure for universities not to teach real CS |
| 12:44:42 | <opqdonut> | yes |
| 12:44:44 | <quicksilver> | that being, students don't like it and aren't good at it. |
| 12:44:45 | <opqdonut> | it's a shame |
| 12:45:01 | <quicksilver> | the pressure is towards teaching things that people will get good results in :) |
| 12:45:16 | <ivanm> | quicksilver: CS? what's that? :p |
| 12:45:16 | <opqdonut> | our uni is very much into machine learning |
| 12:45:28 | <quicksilver> | in a good university you can hope this pressure reduces as you move towards Masters and later degrees. |
| 12:45:28 | <ivanm> | my uni likes databases :s |
| 12:45:35 | <ivanm> | oh, and web-based interfaces to those databases |
| 12:45:39 | <opqdonut> | which is pretty nice compared to db or software engineering stuff |
| 12:45:44 | <opqdonut> | ivanm: exactly :P |
| 12:45:53 | <ivanm> | opqdonut: yeah :s |
| 12:45:53 | <Botje> | mine does a bit of everything |
| 12:46:00 | <opqdonut> | it's just that i've never felt any love for machine learning |
| 12:46:11 | <opqdonut> | it's mostly linear algebra and statistics for chrissakes |
| 12:46:14 | <quicksilver> | some bits of machine learning are very interesting. |
| 12:46:18 | <Botje> | in soviet russia, machine learns to love YOU! |
| 12:46:26 | <opqdonut> | quicksilver: of course |
| 12:46:27 | <quicksilver> | They're not likely to be usefully teachable to undergrads though. |
| 12:46:44 | <ivanm> | I was the only IT student who did the software specification subject... everyone else was SE (for which it was compulsory) |
| 12:46:46 | <quicksilver> | undergrads can learn about expert systems which are useless except as 20-questions toys |
| 12:46:52 | <quicksilver> | and about neural nets which don't actually work. |
| 12:47:11 | <quicksilver> | makes for a really rewarding course, I find :) |
| 12:47:58 | <maltem> | quicksilver: I do hope so, in re "move towards Master", also by including some courses from CS Bachelor |
| 12:48:46 | <quicksilver> | try to establish links with people doing active research in the areas that interest you |
| 12:48:52 | <quicksilver> | they will help you find good places. |
| 12:49:02 | <opqdonut> | i've been doing that |
| 12:49:03 | <maltem> | (I just felt fooled after they advertised this program being one third CS, and there isn't even discrete mathematics in it) |
| 12:49:12 | <quicksilver> | almsot everyone responds positively to people who are interested in their research |
| 12:49:17 | <opqdonut> | and we've racked up student pressure for functional programming and type theory courses |
| 12:49:27 | <opqdonut> | a haskell workshop should be happening later this semester |
| 12:49:34 | <maltem> | quicksilver: sounds like good advice |
| 12:49:35 | <quicksilver> | that's pretty cool |
| 12:49:44 | <opqdonut> | yes |
| 12:49:45 | <quicksilver> | we dropped functional programming about 3-5 years before I started teaching |
| 12:49:56 | <quicksilver> | I always hoped we could push it back, but the pressure was too great |
| 12:49:59 | <opqdonut> | fp was dropped the same year I enrolled |
| 12:50:00 | <quicksilver> | (and I was very junior) |
| 12:50:18 | <opqdonut> | because the prof who had lectured all the courses left for another univ |
| 12:50:19 | <quicksilver> | we did teach a bit of program logic to 2nd/3rd years, though, that was cool. |
| 12:51:53 | <maltem> | whew, bad timing for both of you |
| 12:52:13 | <ivanm> | quicksilver: which uni is this? |
| 12:53:09 | <quicksilver> | that was Queen Mary. |
| 12:53:17 | <quicksilver> | (London) |
| 12:53:19 | <ivanm> | *nod* |
| 12:53:29 | <kig> | opqdonut: the fp course used sml/nj and didn't really go very far with it iirc. had some lazy eval stuff at the end |
| 12:53:38 | <ivanm> | yes, I noticed a dearth of FP there when I had a look through their pages :s |
| 12:54:58 | <opqdonut> | oh, hi kig :) |
| 12:57:40 | <quicksilver> | ivanm: there is plenty of FP in research at QM - in the theory group. It's just not represented in the undergrad syllabus |
| 12:58:01 | <ivanm> | well, I was looking more at the postgrad end... |
| 12:58:13 | <quicksilver> | no PL research, though. |
| 12:58:18 | <ivanm> | maybe I missed it because I was looking more at usage of fp rather than fp fundamentals |
| 12:58:26 | <quicksilver> | but plenty of related research which uses FPs as tools |
| 12:58:33 | <quicksilver> | logic, type theory, program proof |
| 12:58:54 | <ivanm> | ACTION was aiming at more at computational combinatorics |
| 12:58:59 | <quicksilver> | this bunch : http://www.dcs.qmul.ac.uk/researchgp/theory.php |
| 12:59:10 | <lambdabot> | Title: Theory |
| 13:00:19 | <araujo> | morning |
| 13:03:22 | <Arnar> | hi all.. |
| 13:04:02 | <Arnar> | I'm looking for something that I feel should be in the library somewhere.. generating n-dimensional lattices over a list.. |
| 13:04:34 | <Arnar> | i.e. lattice 2 [0,1] == [[0,0],[0,1],[1,0],[1,1]] |
| 13:05:20 | <quicksilver> | > replicateM 3 [0,1] |
| 13:05:24 | <lambdabot> | [[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]] |
| 13:05:32 | <Arnar> | quicksilver: excellent.. thanks |
| 13:05:36 | <Arnar> | @src replicateM |
| 13:05:37 | <lambdabot> | replicateM n x = sequence (replicate n x) |
| 13:05:48 | <ivanm> | @src sequence |
| 13:05:49 | <lambdabot> | sequence [] = return [] |
| 13:05:49 | <lambdabot> | sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs) |
| 13:05:49 | <lambdabot> | --OR |
| 13:05:49 | <lambdabot> | sequence xs = foldr (liftM2 (:)) (return []) xs |
| 13:06:16 | <quicksilver> | it's do { a <- [0,1]; b <- [0,1]; c <- [0,1]; return [a,b,c] } |
| 13:06:22 | <quicksilver> | if you find that easier to thing about. |
| 13:06:25 | <ivanm> | yeah, that's what I figured |
| 13:06:35 | <Arnar> | quicksilver: sure.. replicateM makes sense too |
| 13:06:55 | <Twey> | > let lattice xs = replicateM (length xs) xs in lattice [0, 1] |
| 13:06:59 | <lambdabot> | [[0,0],[0,1],[1,0],[1,1]] |
| 13:07:04 | <Twey> | > let lattice xs = replicateM (length xs) xs in lattice [0, 2] |
| 13:07:08 | <lambdabot> | [[0,0],[0,2],[2,0],[2,2]] |
| 13:07:12 | <Twey> | Hmph |
| 13:07:17 | <Twey> | Not quite right |
| 13:07:40 | <Twey> | Oh, I see. |
| 13:07:42 | <Arnar> | Twey: no, the length of the list and the dimension are independent |
| 13:07:46 | <Twey> | Silly me. |
| 13:07:47 | <Twey> | Yes. |
| 13:08:32 | <quicksilver> | of course it doesn't really generate the lattice. |
| 13:08:38 | <quicksilver> | just the selections. |
| 13:08:52 | <quicksilver> | it's a bit more work to generate the structure. but not too much. |
| 13:08:57 | <Arnar> | quicksilver: what do you mean? |
| 13:09:11 | <Arnar> | oh.. by "lattice" I mean just the vector elements |
| 13:09:13 | <maciek__> | I have getMousePos :: IO (GLfloat,GLfloat) and I want to apply result of this function to renderRect :: (GLfloat,GLfloat) -> (GLfloat,GLfloat) -> IO (). How to do it? |
| 13:09:16 | <quicksilver> | ah, OK ;) |
| 13:09:47 | <quicksilver> | maltem: do (x,y) <- getMousePos; renderRect (x,y) (x+1,y+1) |
| 13:09:51 | <quicksilver> | maciek__: that was for you. |
| 13:09:54 | <quicksilver> | (sorry maltem ) |
| 13:10:01 | <maciek__> | thanks! |
| 13:10:36 | <ddarius> | maciek__: You need to read up on how to use the IO monad, because if you can't answer that question yourself you aren't going to be able to do much else. |
| 13:11:05 | <maciek__> | works, thanks. |
| 13:11:47 | <maciek__> | yes, I know, but in tutorial I saw operator =<< to do this and I thought it's something different |
| 13:12:18 | <Arnar> | maciek__: you mean =>> ? |
| 13:12:27 | <maciek__> | H.setPosition b =<< getMousePos |
| 13:12:35 | <Botje> | a =<< b = do res <- b; a res |
| 13:13:00 | <quicksilver> | maciek__: the <- I did is a convenient notation for >>= |
| 13:13:07 | <quicksilver> | or, at least, some people find it convenient. |
| 13:13:10 | <quicksilver> | I do! :) |
| 13:13:40 | <Botje> | =<< is just too awesome for words :p |
| 13:13:50 | <maciek__> | Botje: thanks, now I understand tutorial's example too |
| 13:14:26 | <Arnar> | so (=<<) = flip (>>=) ? |
| 13:14:32 | <Arnar> | @src (=<<) |
| 13:14:32 | <Botje> | yup |
| 13:14:36 | <Arnar> | cool |
| 13:14:40 | <lambdabot> | f =<< x = x >>= f |
| 13:14:44 | <maciek__> | where can I find what operator means? I cannot google for it.. |
| 13:15:01 | <Botje> | check the documentation? |
| 13:15:01 | <Arnar> | maciek__: the word "operator" ? |
| 13:15:22 | <Arnar> | maciek__: try Hoogle |
| 13:15:27 | <Arnar> | you can search for operators there |
| 13:15:38 | <Arnar> | @where hoogle |
| 13:15:39 | <lambdabot> | http://haskell.org/hoogle |
| 13:16:04 | <maciek__> | thanks, hoogle is what I was looking for |
| 13:16:16 | <Arnar> | maciek__: you can use it through lambdabot too |
| 13:16:20 | <Botje> | heh |
| 13:16:24 | <Arnar> | @hoogle =<< |
| 13:16:24 | <lambdabot> | Prelude (=<<) :: Monad m => (a -> m b) -> m a -> m b |
| 13:16:25 | <lambdabot> | Control.Monad (=<<) :: Monad m => (a -> m b) -> m a -> m b |
| 13:16:41 | <maciek__> | and how to do this inline? without (x,y) <- getPos and renderRect (x,y) |
| 13:16:55 | <maciek__> | I mean in renderRect second argument |
| 13:17:00 | <Arnar> | renderRect =<< getPos |
| 13:17:14 | <maciek__> | render rect gets second argument,too |
| 13:17:15 | <Arnar> | I guess (I don't know the GL stuff) |
| 13:17:35 | <Arnar> | one trick is: |
| 13:17:49 | <Arnar> | (`renderRect` secondarg) =<< getPos |
| 13:18:04 | <Arnar> | or (flip renderRect) secondarg =<< getPos |
| 13:18:23 | <maciek__> | not beautiful. |
| 13:18:30 | <Arnar> | true |
| 13:18:47 | <Botje> | getPos >>= \pos -> renderRect pos secondArg |
| 13:18:48 | <quicksilver> | maciek__: and that's why we have do notaiton :) |
| 13:18:55 | <EvilTerran> | ACTION notes that an infix name for "flip" might be useful |
| 13:19:05 | <maciek__> | can I do ((renderRect =<< getPos) size)? |
| 13:19:14 | <quicksilver> | everyone_: useful for obfuscation, certainly :) |
| 13:19:18 | <Arnar> | EvilTerran: example? |
| 13:19:20 | <quicksilver> | damn tab complete |
| 13:19:23 | <quicksilver> | that was for you EvilTerran |
| 13:19:23 | <Botje> | ACTION proposes (/|\) |
| 13:19:34 | <Botje> | maciek__: no. |
| 13:19:51 | <EvilTerran> | Arnar, (renderRect $$ secondArg) |
| 13:19:58 | <EvilTerran> | or whatever you want to call it |
| 13:20:01 | <Arnar> | EvilTerran: ah. |
| 13:20:13 | <EvilTerran> | renderRect `flip` secondArg :P |
| 13:20:17 | <Arnar> | (renderRect <?> secondArg) |
| 13:20:23 | <Arnar> | <?> serving as a placeholder for the missing arg |
| 13:20:36 | <EvilTerran> | well, <_> is kinda taken by Applicative and its ilk |
| 13:20:52 | <EvilTerran> | (renderRect --- secondArg)? |
| 13:21:13 | <EvilTerran> | or ... |
| 13:21:16 | <Botje> | renderRect `somethingElse` secondArg |
| 13:21:17 | <Botje> | :o) |
| 13:21:25 | <Arnar> | is ... possible? |
| 13:21:34 | <Arnar> | although.. that implies there can be more than one |
| 13:21:41 | <EvilTerran> | > let (...) = flip in (f ... x) y :: Expr |
| 13:21:44 | <lambdabot> | f y x |
| 13:21:46 | <Botje> | heh heh :) |
| 13:21:47 | <Arnar> | cool |
| 13:21:52 | <Botje> | EvilTerran++ |
| 13:22:06 | <Arnar> | > let (__) = flip in (f __ x) y :: Expr |
| 13:22:06 | <EvilTerran> | > let (???) = flip in (f ??? x) y :: Expr |
| 13:22:10 | <lambdabot> | Overlapping instances for Show ((a -> b -> c) -> b -> a -> c) |
| 13:22:10 | <lambdabot> | ar... |
| 13:22:12 | <lambdabot> | Terminated |
| 13:22:15 | <quicksilver> | > let (...) = flip in (f a b c ... e f g) d :: Expr |
| 13:22:16 | <EvilTerran> | __ is not infix |
| 13:22:17 | <Arnar> | oops |
| 13:22:18 | <lambdabot> | Couldn't match expected type `a -> a1 -> b' |
| 13:22:26 | <EvilTerran> | > let __ = 1 in __ |
| 13:22:27 | <quicksilver> | ^^ this is the problem, IMO. |
| 13:22:30 | <lambdabot> | 1 |
| 13:22:38 | <quicksilver> | it feels like you should be able to use it anywhere |
| 13:22:44 | <quicksilver> | and, of course, that's not how precedence works |
| 13:22:45 | <EvilTerran> | quicksilver, yeah, i know =/ |
| 13:22:51 | <quicksilver> | > let (...) = flip in (f a b c ... e $ f $ g) d :: Expr |
| 13:22:54 | <lambdabot> | Add a type signature |
| 13:23:01 | <Arnar> | quicksilver: right.. we need a new syntacitc sugar at the language level :) |
| 13:23:02 | <quicksilver> | hmm. that should work, I thought. |
| 13:23:20 | <EvilTerran> | quicksilver, f and g are too polymorphic |
| 13:23:29 | <quicksilver> | trying to formalie "expressions with holes" leads you back to lambda notation |
| 13:23:29 | <Saizan_> | ?seen nominolo |
| 13:23:30 | <lambdabot> | nominolo is in #haskell-soc, #ghc and #haskell. I don't know when nominolo last spoke. |
| 13:23:31 | <EvilTerran> | > let (...) = flip in (f a b c ... x $ y $ z) d :: Expr |
| 13:23:33 | <lambdabot> | Couldn't match expected type `a -> b' against inferred type `Expr' |
| 13:23:35 | <quicksilver> | it's a road I've been down more than once. |
| 13:23:41 | <EvilTerran> | also, the associativity of $ is wrong |
| 13:23:55 | <Arnar> | rewrite (f a b _ c _ d e) to (\x1 x2 -> f a b x1 c x2 d e) |
| 13:24:04 | <EvilTerran> | indeed, but an infix flip would cover the most basic (and so most common) case |
| 13:24:12 | <quicksilver> | yes, agreed. |
| 13:24:14 | <nominolo> | Saizan_: whatup? |
| 13:24:22 | <quicksilver> | but a special case for 2-arg functions would annoy me |
| 13:24:25 | <EvilTerran> | (map -?- xs), etc |
| 13:24:28 | <quicksilver> | I don't think they're common enough to warrant it. |
| 13:24:35 | <EvilTerran> | do fst, snd, curry, and uncurry annoy you too? |
| 13:24:39 | <quicksilver> | yes. |
| 13:24:45 | <quicksilver> | I never use any of those four :P |
| 13:24:45 | <EvilTerran> | oh well |
| 13:24:48 | <EvilTerran> | :P |
| 13:24:48 | <Arnar> | they annoy me to :) |
| 13:24:52 | <Arnar> | I still use them |
| 13:24:59 | <quicksilver> | actually I very occasionally use curry/uncurry |
| 13:25:04 | <quicksilver> | in a higher-order context |
| 13:25:13 | <quicksilver> | never fst or snd |
| 13:25:22 | <besiria> | what the.. i was trying the threadring bench on my pc and with +RTS -N2 -RTS i'm getting ~3min with no rts i'm getting 9s !? |
| 13:25:24 | <EvilTerran> | pairs are thoroughly tied to arrows as well |
| 13:25:48 | <Arnar> | how about this syntactic sugar idea? is it nonsense? |
| 13:25:54 | <quicksilver> | EvilTerran: that's always annoyed me - in a low-level way - because it makes people think Arrows are "mostly" about pairing. |
| 13:26:07 | <quicksilver> | EvilTerran: which distracts from what Arrows are really about. |
| 13:26:13 | <EvilTerran> | Arnar, well, as quicksilver says, you rapidly end up back at lambdas |
| 13:26:23 | <Saizan_> | nominolo: when we was talking about dependency analysis for gsoc this spring you mentioned delimited continuations, was that because of the work of Umut Acar et al. on adaptive computations? |
| 13:26:39 | <EvilTerran> | quicksilver, see, if tuples were syntactic sugar for chains of snd-strict pairs and (), it wouldn't be a problem :P |
| 13:26:57 | <Arnar> | EvilTerran: how so? I'm talking about arbitrary number of _-s at arbitrary positions |
| 13:27:30 | <EvilTerran> | Arnar, where does a _-containing expression stop? |
| 13:27:40 | <nominolo> | Saizan_: I don't think so |
| 13:27:41 | <EvilTerran> | you need some kinda marker |
| 13:27:46 | <Arnar> | hmm |
| 13:27:49 | <quicksilver> | Arnar: take a look at http://www.haskell.org/pipermail/haskell-cafe/2007-July/thread.html#27845 |
| 13:27:51 | <EvilTerran> | let's call it "\" :P |
| 13:27:52 | <lambdabot> | Title: The Haskell-Cafe July 2007 Archive by thread, http://tinyurl.com/59gvgh |
| 13:27:59 | <quicksilver> | Arnar: the post by "Jules Bean" is particularly insightful. |
| 13:28:06 | <quicksilver> | what a smart guy he must be :P |
| 13:28:16 | <Saizan_> | nominolo: oh, ok :) |
| 13:28:29 | <Leaves> | hello, do you know of a tutorial how to install cabal packages on ubuntu? |
| 13:28:35 | <nominolo> | Saizan_: i actually don't remember telling you that |
| 13:28:44 | <nominolo> | Saizan_: have a log? :) |
| 13:29:10 | <Saizan_> | nominolo: mmh, maybe i can find it :) |
| 13:29:30 | <Arnar> | quicksilver: ah.. I had to whois you to get the joke :) |
| 13:30:00 | <nominolo> | Saizan_: maybe because of zipper = reified delim. continuation |
| 13:30:26 | <dcoutts> | Leaves: check the cabal home page, top link is the instructions |
| 13:31:15 | <Arnar> | quicksilver: ah, I get it.. your email explains it |
| 13:31:28 | <quicksilver> | well, conor's reply challenges what I say. |
| 13:31:38 | <quicksilver> | There might be space here for some neat sugar |
| 13:31:43 | <quicksilver> | but it's not obvious where the sweet spot is |
| 13:31:47 | <quicksilver> | lambda is pretty good. |
| 13:32:13 | <Saizan_> | nominolo: yeah, probably, now that i found the log it was just me asking what knowledge would be useful for the project and you adding continuations :) |
| 13:32:30 | <nominolo> | heh |
| 13:32:59 | <Saizan_> | thanks anyway :) |
| 13:33:01 | <nominolo> | Saizan_: yeah, there's some room for now work with delimited continuations |
| 13:33:08 | <Arnar> | quicksilver: reading Conor's reply. so this would only be possible with explicit scoping (he uses {})? |
| 13:33:10 | <nominolo> | *new* work |
| 13:33:15 | <Arnar> | that kinda ruins it.. |
| 13:33:33 | <Arnar> | btw there should be a ascii code for a "hole" |
| 13:33:41 | <nominolo> | Arnar: it's usually [ ] |
| 13:33:44 | <Saizan_> | nominolo: for dependency analysis? have any specific pointers? |
| 13:33:45 | <Botje> | an anti-char? :) |
| 13:33:50 | <Arnar> | would be cool if future morphing displays would render it as an actual hole |
| 13:34:01 | <Botje> | Arnar: well, there's always the goatse combinator |
| 13:34:02 | <Botje> | =()= |
| 13:34:03 | <quicksilver> | you need some notion of scoping. |
| 13:34:05 | <Botje> | or ={}= |
| 13:34:10 | <quicksilver> | explict or implicit. |
| 13:34:16 | <Arnar> | quicksilver: yes.. |
| 13:34:19 | <Botje> | that hole-y enough for you? :) |
| 13:34:20 | <quicksilver> | in a more rich language than text, you could use colours. |
| 13:34:34 | <quicksilver> | or you can anchor it to some existing construct |
| 13:34:48 | <quicksilver> | like "nearest enclosing () or definition) |
| 13:34:52 | <EvilTerran> | quicksilver, colours'd basically be a funny way of displaying lambdas, right? |
| 13:35:03 | <quicksilver> | ...but such rules can be confusing in practice. |
| 13:35:15 | <EvilTerran> | anchoring to an existing construct like that would break some rather nice algebraic rules |
| 13:35:20 | <quicksilver> | EvilTerran: well, I think we'd avoid naming parameters, and instead just use them left-to-right. |
| 13:35:28 | <EvilTerran> | ah |
| 13:35:33 | <quicksilver> | EvilTerran: *exactly*. THat was the problem with 'monadic subexpression' |
| 13:35:41 | <quicksilver> | EvilTerran: (which was anchored to the nearest 'do') |
| 13:35:49 | <nominolo> | Saizan_: not OTTOMH |
| 13:35:58 | <Arnar> | quicksilver: one possibility of an implicit rule is use lambdas "extend as far to the right as possible", right? |
| 13:36:04 | <quicksilver> | Yes. |
| 13:36:06 | <Arnar> | and use braces to stop |
| 13:36:06 | <EvilTerran> | i agree. we'd want some other kind of marker to indicate where to bind to for monadic subexpressions |
| 13:36:23 | <Saizan_> | nominolo: 'k |
| 13:36:32 | <quicksilver> | There is definitely a design space here, but I couldn't think of anything which I thought was enough better than lambda |
| 13:36:33 | <Arnar> | s/braces/parentheses/ |
| 13:36:35 | <quicksilver> | to be worth the hassle. |
| 13:36:39 | <nominolo> | Saizan_: did you finish your gsoc project? |
| 13:37:22 | <Saizan_> | nominolo: yeah |
| 13:37:30 | <EvilTerran> | quicksilver, i was thinking something like a <- at the start of a line in a do-block meaning "put any following monadic subexpressions here" could work |
| 13:37:45 | <nominolo> | Saizan_: does it work well? |
| 13:37:51 | <Saizan_> | nominolo: but the language for describing compilation rules is still quite low-level |
| 13:38:11 | <EvilTerran> | do <- putStrLn $ f (<- readLine) |
| 13:38:29 | <EvilTerran> | or as a line on its own, even; do <-; putStrLn $ f (<- readLine) |
| 13:38:39 | <Saizan_> | nominolo: yup, it does everything required :) darcs pull code.haskell.org/~Saizan/cabal |
| 13:38:40 | <quicksilver> | EvilTerran: *nod* |
| 13:39:01 | <Saizan_> | nominolo: it's still only used for preprocessors and yhc there |
| 13:39:04 | <EvilTerran> | seeing as i usually put a newline after "do" anyway, that'd be very minimal inconvenience for me :) |
| 13:39:43 | <quicksilver> | EvilTerran: but you might occasionally surprise yourself if you wrote do <-; foo; bar; putStrLn $ (<- baz) |
| 13:39:52 | <EvilTerran> | yeah |
| 13:39:55 | <quicksilver> | EvilTerran: and you weren't expecting 'baz' to run before foo and b ar |
| 13:40:01 | <quicksilver> | I mean, it's a rule and you've broken it. |
| 13:40:09 | <quicksilver> | but the question is, is it pretty enough to be worth it :) |
| 13:40:12 | <EvilTerran> | you'd have to be alert enough to write "do foo; bar; <-; putStrLn (<- baz)" |
| 13:40:14 | <nominolo> | Saizan_: nice, includes QC tests |
| 13:40:22 | <EvilTerran> | if it mattered |
| 13:40:33 | <quicksilver> | EvilTerran: it's certainly a new way of making mistakes. But I guess any new feature would be that. |
| 13:40:46 | <quicksilver> | EvilTerran: I think people anticipated mostly using this in monads with commutative effects anyway. |
| 13:40:49 | <EvilTerran> | quicksilver, alternatively, "do <-" could introduce a special type of do block whose lines caught monadic subexpressions |
| 13:41:11 | <quicksilver> | App (<- newSym) (<- newSym) |
| 13:41:13 | <nominolo> | Saizan_: did that catch some bugs? |
| 13:41:30 | <quicksilver> | (of course, App $ newSym <*> newSym works fine, but doesn't scale) |
| 13:41:42 | <EvilTerran> | quicksilver, that might be less liable to provoke mistakes |
| 13:41:47 | <quicksilver> | s/$/<$>/ |
| 13:41:49 | <quicksilver> | *nod* |
| 13:42:07 | <Saizan_> | nominolo: more bugs in the tests than elsewhere :) but just writing down the properties has been quite useful |
| 13:42:23 | <Botje> | quicksilver: but don't you lose sequencing in that fashion? |
| 13:42:33 | <Botje> | how can you tell which <- happens first? |
| 13:42:45 | <quicksilver> | Botje: left to right as presented on screen. |
| 13:42:52 | <quicksilver> | but you're supposed to use it mostly when you don't really care. |
| 13:42:57 | <quicksilver> | (as in the newSym case) |
| 13:42:57 | <Botje> | ah |
| 13:42:59 | <nominolo> | Saizan_: right. I always forget how useful writing tests is even if they seem trivial |
| 13:43:04 | <EvilTerran> | Botje, in that way, it's the same as App <$> newSym <*> newSym |
| 13:43:17 | <Botje> | yeah. i can see that. |
| 13:43:19 | <nominolo> | Saizan_: makes you think about semantics and often API, too |
| 13:43:34 | <Botje> | i was thinking about something like login (<- getUsername) (<- getPassword) |
| 13:44:22 | <EvilTerran> | (by "in that way", i mean wrt the left-to-right aspect) |
| 13:44:40 | <Saizan_> | nominolo: exactly, i had some misconceptions about the use of the cache (where we store represenations of old values) and the tests cleared them out |
| 13:44:49 | <quicksilver> | Botje: yes. That kind of thing would probably be recommended against. |
| 13:45:02 | <Botje> | okay :) |
| 13:45:07 | <quicksilver> | Botje: although in that precise example its simple to see the ordering, in more complex ones it wouldn't be. |
| 13:45:21 | <quicksilver> | But when your monad is returning fresh values, or random numbers |
| 13:45:29 | <quicksilver> | or writing to a commutative monoid |
| 13:45:36 | <quicksilver> | or applying commutative transforms to a state monad |
| 13:45:39 | <quicksilver> | you really don't care. |
| 13:45:54 | <quicksilver> | even unification is commutative up-to getting the right answer. |
| 13:46:19 | <quicksilver> | (the order you try to unify terms may make the type error appear in a different place, but it will not change whether or not it succeeds) |
| 13:50:28 | <Arnar> | I read the paper by SPJ on the spineless tagless g-machine, from 1991 |
| 13:50:37 | <Arnar> | is that still the underpinnings of GHC? |
| 13:50:59 | <Arnar> | btw that was one of the most enjoyable reads I've had for a long time |
| 13:51:30 | <ivanm> | anyone here familiar with hmatrix? |
| 13:55:40 | <thoughtpolice> | Arnar: I'm fairly certain quite a bit has changed over the past 17 years or so, but it is still fairly relevant - I still haven't read all the way through the paper yet |
| 14:02:38 | <quicksilver> | Arnar: people who understand GHC better than I claim it is no longer either spineless or tagless. |
| 14:02:50 | <quicksilver> | Arnar: however the general intuitions from that paper are still correct. |
| 14:03:09 | <EvilTerran> | > let (<,>) = (,) in 1 <,> 2 |
| 14:03:13 | <lambdabot> | mueval: Prelude.read: no parse |
| 14:03:14 | <EvilTerran> | aww |
| 14:03:51 | <EvilTerran> | ACTION notes that the only place being able to use , in operators would be ambiguous would be infix declerations, which've really weird syntax anyway |
| 14:03:53 | <Arnar> | quicksilver: ok, the main thing seemed to use code instead of tags and big branches |
| 14:04:09 | <EvilTerran> | space-separating those would probably make more sense than comma-separating them anyway |
| 14:04:13 | <Arnar> | I guess that's the "tagless" part |
| 14:04:26 | <EvilTerran> | i guess you also couldn't have things like ,,, as an operator, because then (,,,) would be ambiguous |
| 14:04:31 | <Arnar> | and the other big thing was the CPS nature of it.. if I understood correctly that was the "spineless" part |
| 14:04:46 | <Arnar> | thoughtpolice: ok.. |
| 14:05:19 | <EvilTerran> | ACTION is going to play around with strict-snd pairs as a representation of n-tuples, but wanted to be able to call his pair type "data a :, as = a :, !as" |
| 14:06:19 | <EvilTerran> | i'll just call it :+ or something, seeing as a+b is (a,b) by another notation anyway |
| 14:06:29 | <EvilTerran> | er, sorry, s/+/*/g |
| 14:07:49 | <quicksilver> | EvilTerran: I suspect you will end up with something like HList won't you? |
| 14:08:07 | <quicksilver> | EvilTerran: although HList isn't particular about strictness. |
| 14:08:10 | <EvilTerran> | quicksilver, well, like one little bit of HList, yeah |
| 14:08:14 | <quicksilver> | but is about nested pairs. |
| 14:08:29 | <EvilTerran> | i'm not going for the whole type-indexed-lists, extensible-records lark |
| 14:08:42 | <EvilTerran> | just a nicer formulation of tuples |
| 14:08:46 | <quicksilver> | ACTION nods |
| 14:08:55 | <ivanm> | is there a generic power function? |
| 14:09:04 | <EvilTerran> | there's three of them |
| 14:09:07 | <EvilTerran> | ?type (^) |
| 14:09:08 | <lambdabot> | forall a b. (Integral b, Num a) => a -> b -> a |
| 14:09:09 | <EvilTerran> | ?type (^^) |
| 14:09:11 | <lambdabot> | forall a b. (Integral b, Fractional a) => a -> b -> a |
| 14:09:11 | <EvilTerran> | ?type (**) |
| 14:09:13 | <ivanm> | as in Double -> Double -> Double |
| 14:09:13 | <lambdabot> | forall a. (Floating a) => a -> a -> a |
| 14:09:18 | <EvilTerran> | that'd be (**) |
| 14:09:19 | <ivanm> | ahhhh, ** was what I wanted |
| 14:09:20 | <EvilTerran> | ?src (**) |
| 14:09:20 | <lambdabot> | Source not found. Sorry. |
| 14:09:26 | <quicksilver> | ivanm: of course, no such function exists. |
| 14:09:33 | <quicksilver> | ivanm: you have to restrict to positive bases. |
| 14:09:38 | <quicksilver> | (or restrict the exponent) |
| 14:10:01 | <ivanm> | well, I wanted to raise to a power of a quarter, etc. |
| 14:10:26 | <quicksilver> | yes, then you want ** |
| 14:10:33 | <Saizan_> | EvilTerran: using a recursive gadt might be useful, maybe |
| 14:11:05 | <ivanm> | quicksilver: why do you need restrictions? I realise that you can't have 0**(-ve), but in general? |
| 14:12:08 | <EvilTerran> | Saizan_, eh, i don't think it's really needed for just tuples |
| 14:12:09 | <quicksilver> | you can't have (-ve) ^ (arbitrary number) |
| 14:12:20 | <quicksilver> | for example, -1 ^ (1/2) has to be i |
| 14:12:28 | <quicksilver> | but what is -1 ^ (irrational) ? |
| 14:12:28 | <ivanm> | duh, not thinking straight |
| 14:12:46 | <quicksilver> | there is no analytic extension of ^ to the whole of R |
| 14:12:51 | <quicksilver> | (let alone the whole of C) |
| 14:13:32 | <EvilTerran> | Saizan_, seeing as "data a :*: as = a :*: !as" gives me ((x::a) :*: (y::b) :*: () :: a :*: b :*: ()), which reads the same as (x::a,y::b) :: (a,b) |
| 14:13:51 | <EvilTerran> | albeit fuglier |
| 14:14:21 | <ivanm> | oh sh*t... hmatrix keeps throwing gsl errors :s |
| 14:14:29 | <EvilTerran> | ACTION notes it might be possible to write some TH you wrap your whole program in to steal the tuple syntax |
| 14:14:48 | <quicksilver> | EvilTerran: yes, indeed. |
| 14:14:56 | <quicksilver> | EvilTerran: although a proper notion of 'source filter' might be nicer. |
| 14:15:00 | <EvilTerran> | $(withPairTuples [d| {- the whole file -} |]) |
| 14:15:06 | <quicksilver> | type-safe whole-file preprocessing. |
| 14:15:12 | <EvilTerran> | yeah, it'd be nice to not have to have a |]) at the end, at least |
| 14:15:43 | <quicksilver> | a proper notion of type-safe whole file preprocessing would really open up the stage to haskell-like language development |
| 14:15:52 | <quicksilver> | you could do all kinds of things as source transforms. |
| 14:15:57 | <EvilTerran> | ACTION notes that this might also be a job for uniplate |
| 14:16:07 | <quicksilver> | of course the error messages would look like evil slimy things |
| 14:16:10 | <quicksilver> | but you can't win em all. |
| 14:16:14 | <EvilTerran> | yeah =/ |
| 14:16:28 | <quicksilver> | you need a formal ADT for GHC type errors |
| 14:16:35 | <EvilTerran> | that'd be nice |
| 14:16:35 | <quicksilver> | then you could do type-safe error post-processing |
| 14:16:41 | <quicksilver> | to match your source pre-processing |
| 14:16:50 | <quicksilver> | and then you'd really have a language construction toolkit. |
| 14:16:59 | <quicksilver> | (does ocaml do some of this stuff with ocamlp?) |
| 14:17:08 | <EvilTerran> | if we had a compiler that were factored into libraries for parsing, typechecking, etcetc, that'd be good |
| 14:17:27 | <dcoutts> | ACTION has finally booked flights and registered for ICFP |
| 14:17:32 | <EvilTerran> | ACTION has been thinking a bit about extensible parsers |
| 14:17:55 | <quicksilver> | EvilTerran: that's the direction it's going, thanks to nominolo and others. |
| 14:17:59 | <quicksilver> | EvilTerran: it's a long road though. |
| 14:18:40 | <EvilTerran> | i think you'd want to represent them as a Map Nonterminal [Either Nonterminal Terminal] or something like that |
| 14:19:29 | <EvilTerran> | probably have a compileParser function |
| 14:19:52 | <EvilTerran> | but you could get an existing parser, add a bit to it that would previously be a parse error, then compile that |
| 14:20:01 | <EvilTerran> | so you could trivially add syntax to an existing language (eg haskell :D) |
| 14:20:33 | <EvilTerran> | you'd probably need sth like Data Types A La Carte for the parse tree |
| 14:20:38 | <quicksilver> | isn't that complicated by the fact the parser isn't context-free? |
| 14:20:46 | <quicksilver> | adding new syntax has non-local effects? |
| 14:20:50 | <EvilTerran> | well, i haven't thought it through in full |
| 14:21:05 | <EvilTerran> | but it'd need to be a lot more concrete than a monadic parser |
| 14:21:14 | <EvilTerran> | and probably more so than an arrow parser, too, although that might be usable |
| 14:22:54 | <EvilTerran> | ah well, this'll give me something to think about on the long walk i'm about to head off on :) |
| 14:22:57 | <EvilTerran> | ACTION -> away! |
| 14:27:41 | <quicksilver> | ./win 27 |
| 14:27:43 | <quicksilver> | grrr |
| 14:27:47 | <quicksilver> | ./lose! |
| 14:28:06 | <lilac> | zsh: no such file or directory: ./lose! |
| 14:28:29 | <quicksilver> | hmm. You really shouldn't set zsh to execute commands sent to you in IRC :P |
| 14:28:49 | <lilac> | ACTION is secretly a bot written in zsh script |
| 14:29:40 | <lilac> | and in any case, if you think that's bad, you should see what that 'win' binary you just ran did :) |
| 14:30:19 | <ivanm> | lilac: it told you where you wanted to go today? |
| 14:31:00 | <lilac> | :( yes |
| 14:31:03 | <lilac> | ACTION feels dirty |
| 14:31:56 | <ivanm> | ACTION passes lilac a bar of soap aka a disk formatter |
| 14:32:37 | <Botje> | you made soap magnetic?! |
| 14:32:41 | <Botje> | best invention evar! |
| 14:32:57 | <ivanm> | Botje: no, sliced bread is still better! |
| 14:34:11 | <Botje> | :) |
| 15:11:18 | <Feuerbach> | Can anybody halp with defining Either monad? I think I know what the problem is but have no idea how to fix it. http://hpaste.org/10138 |
| 15:11:40 | <dmead> | > mapM print [1..10] |
| 15:11:45 | <lambdabot> | mueval: Prelude.read: no parse |
| 15:11:46 | <lambdabot> | mueval: *** Exception: "<IO [()]>" |
| 15:11:51 | <dmead> | > map print [1..10] |
| 15:11:54 | <lambdabot> | mueval: Prelude.read: no parse |
| 15:11:54 | <lambdabot> | mueval: [*** Exception: "<IO ()>" |
| 15:11:57 | <dmead> | wat |
| 15:12:03 | <Feuerbach> | If that helps, I'll use it for _one_ particular Either type, but I need do-notation for it |
| 15:12:24 | <Valodim> | dmead: you can't use IO in lambdabot |
| 15:12:39 | <dmwit> | Feuerbach: There's already an instance for Either, isn't there? |
| 15:12:48 | <dmead> | ah yes |
| 15:12:52 | <Feuerbach> | dmwit: no, there's only for EitherT |
| 15:13:02 | <dmwit> | ?instances Monad |
| 15:13:03 | <lambdabot> | ((->) r), ArrowMonad a, Cont r, ContT r m, Either e, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, [] |
| 15:13:10 | <dmwit> | \bot disagrees |
| 15:13:16 | <Feuerbach> | wow. |
| 15:13:20 | <dmwit> | Feuerbach: But you need (Error e) => in front. |
| 15:13:20 | <quicksilver> | there is one |
| 15:13:27 | <quicksilver> | but Feuerbach's quesiton is still interesting. |
| 15:13:33 | <quicksilver> | why won't his code infer? |
| 15:14:03 | <Feuerbach> | quicksilver: because compiler isn't sure that Left _ -> x will typecheck |
| 15:14:18 | <xif> | Hi. I read through the Tim Sweeney presentation about the possible use of Haskell in the future of game development. Is there any other material about it? Anything that elaborates on the ideas in that presentation, or adds another perspective? |
| 15:14:19 | <Feuerbach> | only I know that it must be "Left" |
| 15:14:27 | <dmwit> | Feuerbach: You have to do |
| 15:14:32 | <dmwit> | Left x' -> Left x' |
| 15:14:42 | <dmead> | Feuerbach, don't use _ |
| 15:14:52 | <Feuerbach> | dmwit: good option, I'll try it |
| 15:14:56 | <dmwit> | (i.e. you need to allow 'x' to become an Either of a different type) |
| 15:15:01 | <quicksilver> | ah, of course. |
| 15:15:07 | <quicksilver> | Feuerbach: do you understand? |
| 15:15:15 | <quicksilver> | "x" could be Either Error String |
| 15:15:18 | <Wild_Cat> | xif: Tim "Epic Games" Sweeney? Do you have a link to that presentation? |
| 15:15:27 | <quicksilver> | but the intended return type of "f" could be Either Error Int |
| 15:15:32 | <xif> | Wild_Cat: sure: http://www.willamette.edu/~fruehr/254/Tim-POPL.ppt |
| 15:15:33 | <quicksilver> | you have to allow the Left to 'switch types' |
| 15:15:34 | <Feuerbach> | it works, thanks :) |
| 15:15:38 | <Feuerbach> | yep |
| 15:15:48 | <quicksilver> | stupid me for not spotting it. |
| 15:15:57 | <quicksilver> | quicksilver-- # dumb |
| 15:16:15 | <xif> | Wild_Cat: (if it's the first time you heard about this presentation, but are familiar with Tim and Epic, you're in for a surprise ;) |
| 15:16:31 | <Wild_Cat> | Ta. |
| 15:16:52 | <Wild_Cat> | xif: 404 :( |
| 15:17:14 | <xif> | hm, sec, I'll find a better link (otherwise, I'll upload the one I have) |
| 15:18:26 | <xif> | Wild_Cat: http://cag.csail.mit.edu/crg/papers/sweeney06games.pdf |
| 15:18:29 | <lambdabot> | Title: Microsoft PowerPoint - Tim-POPL |
| 15:18:34 | <xif> | seems the be the same one. |
| 15:18:50 | <Wild_Cat> | This one works. Cheers. |
| 15:19:27 | <Feuerbach> | > Right 3 >>= Right.(^2) |
| 15:19:30 | <lambdabot> | Add a type signature |
| 15:19:44 | <Feuerbach> | > Right 3 >>= Right.(^2) :: Either Int Int |
| 15:19:49 | <lambdabot> | No instance for (Error Int) |
| 15:19:49 | <lambdabot> | arising from a use of `>>=' at <inte... |
| 15:20:02 | <dmwit> | > fmap (^2) (Right 3) :: Either String Int |
| 15:20:06 | <lambdabot> | Right 9 |
| 15:20:21 | <dmwit> | > ap (Right (^2)) (Right 3) :: Either String Int |
| 15:20:25 | <lambdabot> | Right 9 |
| 15:21:23 | <Feuerbach> | dmwit: any ideas why ghci doesn't see Functor(Either a) even when I :m +Data.Either? |
| 15:21:32 | <arj__> | join #postfix |
| 15:21:50 | <quicksilver> | Feuerbach: I suspect it's in Control.Monad.Instances |
| 15:21:58 | <dmead> | whats the correct way to map print over a list? |
| 15:21:58 | <quicksilver> | that's where the miscellaneous Functor instances live |
| 15:22:02 | <quicksilver> | (against all expectations) |
| 15:22:05 | <dmead> | when the list has no IO in it |
| 15:22:10 | <quicksilver> | dmead: mapM_ print [list] |
| 15:22:11 | <byorgey> | dmead: use mapM_ |
| 15:22:19 | <dmead> | whats the _ for? |
| 15:22:27 | <quicksilver> | to say you don't care about the return values |
| 15:22:30 | <dmhouse> | dmead: it throws away the result |
| 15:22:31 | <dmead> | ah |
| 15:22:35 | <quicksilver> | (print returns a list of (), so you don't carea bout those) |
| 15:22:39 | <dmead> | ?src mapM_ |
| 15:22:39 | <quicksilver> | mapM print [list] would work fine |
| 15:22:40 | <lambdabot> | mapM_ f as = sequence_ (map f as) |
| 15:22:48 | <quicksilver> | but would waste time constructing and discarding a list of () |
| 15:22:54 | <dmead> | mapM print [list] won't work |
| 15:22:59 | <dmead> | or rather |
| 15:22:59 | <Feuerbach> | quicksilver: why then haddock lists that instance for Data.Either? Is he smarter than ghci? |
| 15:23:00 | <dmead> | doesn't work |
| 15:23:13 | <byorgey> | well, probably because it doesn't have the right type |
| 15:23:20 | <quicksilver> | dmead: that was a kind of clumsy pseudo syntax |
| 15:23:24 | <Feuerbach> | http://hackage.haskell.org/packages/archive/base/3.0.1.0/doc/html/Data-Either.html |
| 15:23:26 | <lambdabot> | Title: Data.Either, http://tinyurl.com/68zx8m |
| 15:23:28 | <dmead> | byorgey, thats like the most generic error in haskell |
| 15:23:30 | <quicksilver> | dmead: as in mapM print [a,list,here] |
| 15:23:31 | <byorgey> | mapM print [list] has type IO [()] |
| 15:23:40 | <byorgey> | whereas mapM_ print [list] has type IO () |
| 15:23:46 | <byorgey> | dmead: yes, and also the most useful =) |
| 15:23:52 | <dmead> | =) |
| 15:24:04 | <quicksilver> | Feuerbach: haddock doesn't list instances where they are declared |
| 15:24:17 | <quicksilver> | Feuerbach: it lists instances where it thinks you might be interested in finding out about them. |
| 15:24:23 | <quicksilver> | Feuerbach: it's a kind of cross-linking feature |
| 15:24:39 | <byorgey> | dmead: I think quicksilver's point was that if you used 'mapM print [list]' in a context which was expecting that type, it would correctly print out the list, just like mapM_ |
| 15:24:53 | <dmead> | right |
| 15:24:59 | <byorgey> | but it would construct a useless list of ()'s |
| 15:25:03 | <quicksilver> | and "do" blocks are written to not care about ignored return values |
| 15:25:09 | <quicksilver> | which in some respects is a shame |
| 15:25:17 | <quicksilver> | but in other respects the alternative would be a nightmare :) |
| 15:25:52 | <byorgey> | quicksilver: why is it a shame? |
| 15:26:41 | <quicksilver> | because arguably it indicates a bug if you discard a return value without explicitly asking to. |
| 15:26:45 | <quicksilver> | in many APIs at least. |
| 15:27:05 | <quicksilver> | but, equally, in many other APIs there are return values which are actually intended to be discarded quite often. |
| 15:27:16 | <quicksilver> | it's one place the type checker could help us where it currently doesn't, though. |
| 15:27:28 | <Feuerbach> | quicksilver: I thought when haddock lists an instance, it's at least (re-)exported from that module |
| 15:27:37 | <quicksilver> | Feuerbach: nope. |
| 15:28:23 | <Feuerbach> | and what can be the reason for Data.Either not to re-export instances? |
| 15:28:52 | <quicksilver> | it doesn't import them. |
| 15:28:57 | <quicksilver> | it has no idea those instances exist. |
| 15:29:19 | <quicksilver> | I don't think threre is a good reason. |
| 15:29:25 | <quicksilver> | Just a hysterical raisin. |
| 15:29:42 | <Feuerbach> | ok |
| 15:29:55 | <quicksilver> | instances are global in haskell anyway |
| 15:30:01 | <quicksilver> | which is why there isn't a way to restrict import/export |
| 15:47:15 | <Wild_Cat> | xif: hrmm. Epic considering a switch to a FP language is an interesting development. |
| 15:47:38 | <quicksilver> | Wild_Cat: I was very disappointed that GLSL and HLSL are so incredibly non-FP-like. |
| 15:47:43 | <xif> | Wild_Cat: definitely. I'm looking for more material about it. |
| 15:47:55 | <quicksilver> | Wild_Cat: I mean, shaders always seemed like a potentially declarative concept |
| 15:48:01 | <quicksilver> | and they went for a cut down version of C :-( |
| 15:48:17 | <Wild_Cat> | I admit I agree with most of Tim Sweeney's point. |
| 15:48:56 | <Wild_Cat> | and he's right about GHC's error messages being crap, even though he says they're a language misfeature where they're just an (important) implementation problem. |
| 15:49:50 | <quicksilver> | Wild_Cat: it's a fact about the language that it's bloody hard to get the error messages nice. |
| 15:50:01 | <quicksilver> | Wild_Cat: maybe it's unfair to call it 'misfeature' |
| 15:50:12 | <quicksilver> | but it's definitely a property of the language. |
| 15:50:31 | <Wild_Cat> | however, Haskell's the only language I know that fits all his requirements. ML is neither lazy nor threadable, IIRC. |
| 15:50:32 | <quicksilver> | of course compiler writers solve hard problems all the time :) |
| 15:50:36 | <xif> | Unreal 4 being written in a functional language would be huge. unfortunately, I can't find any evidence of how serious it is. |
| 15:50:50 | <xif> | Wild_Cat: O'Caml might be an alternative he'd cosider. |
| 15:50:55 | <quicksilver> | more likely they'd start by putting functional elements into their "scripting" language. |
| 15:50:59 | <quicksilver> | I would guess? |
| 15:51:15 | <Wild_Cat> | quicksilver: I doubt that. The scripting language is probably the most likely to remain imperative. |
| 15:51:15 | <xif> | (it doesn't fit all his requirements, but Haskell doesn't quite fit them all as well) |
| 15:51:41 | <quicksilver> | Wild_Cat: reactive scripting for game engines = win! |
| 15:51:58 | <quicksilver> | Wild_Cat: just you wait until my haskell project written entirely in my spare time eclipse's epic's next blockbuster! |
| 15:52:02 | <quicksilver> | or not. |
| 15:52:02 | <Wild_Cat> | quicksilver: you can do event-driven imperative. |
| 15:52:47 | <Wild_Cat> | and the scripting parts don't need to scale. They use no CPU time compared to the actual game (hence the switch to Lua, Python and UnrealScript). |
| 15:53:07 | <quicksilver> | of course you can do event-driven imperative. |
| 15:53:10 | <quicksilver> | but I still say reactive = win! |
| 15:54:59 | <Wild_Cat> | also, the scripting has to remain the easiest part of the game engine to pick up, because it'll be exposed to the whole world. A game engine success is measured by its moddability. And you can't seriously expect kids with no experience in programming to pick up monads. "when X happens do Y" is a more immediate concept IMO ;) |
| 15:57:01 | <Saizan_> | but writing reactive values is probably way simpler than coordinating event-driven callbacks? |
| 15:57:14 | <quicksilver> | Saizan_: In principle. Given the right combinators. |
| 15:57:22 | <Wild_Cat> | I have no experience in reactive programming, so I can't answer that. |
| 15:57:36 | <quicksilver> | and disguising those combinators in a way which makes them attractive, perhaps even with a GUI |
| 15:57:36 | <Wild_Cat> | I'm still in the process of "getting" the basic parts of Haskell, really ;) |
| 15:57:57 | <mapreduce> | You might overestimate the difficulty of monads. |
| 15:58:08 | <quicksilver> | I think reactive-style programming is more readily GUI-able / diagrammable than imperative programming. |
| 15:58:16 | <mapreduce> | > map (*2) [1..10] |
| 15:58:20 | <lambdabot> | [2,4,6,8,10,12,14,16,18,20] |
| 15:58:22 | <quicksilver> | but, I'm only guessing. |
| 15:58:28 | <quicksilver> | well, informed guess. |
| 15:58:30 | <mapreduce> | I think that's much easier than the equivalent for loop. |
| 15:59:55 | <Wild_Cat> | mapreduce: to tell the truth, I still don't understand why lists are monadic. |
| 16:00:46 | <mapreduce> | Wild_Cat: Consider List, which knows how to compute n elements. |
| 16:01:04 | <mapreduce> | Wild_Cat: Consider also Maybe, which knows how to compute 1 or 0 elements. |
| 16:02:00 | <Wild_Cat> | mapreduce: Both have trivial non-monadic definitions. |
| 16:02:06 | <mapreduce> | One can write a function to apply a function to every element of either of these, but there's no obvious type that that function could have unless you have subtyping and make a Mappable interface or something. |
| 16:02:29 | <Wild_Cat> | mmh... Right. |
| 16:02:53 | <mapreduce> | Lists are monadic because you can make a monad instance from them. |
| 16:02:55 | <Saizan_> | Wild_Cat: both are defined non-monadically in haskell too, it's just that we also note they have return adn (>>=) which obey the monad laws |
| 16:03:54 | <Wild_Cat> | > let a = Nothing :: (Maybe Int) in map (*2) a |
| 16:03:57 | <lambdabot> | Couldn't match expected type `[a]' |
| 16:04:09 | <Saizan_> | use fmap |
| 16:04:12 | <Saizan_> | ?type map |
| 16:04:14 | <lambdabot> | forall a b. (a -> b) -> [a] -> [b] |
| 16:04:16 | <Saizan_> | ?type fmap |
| 16:04:18 | <lambdabot> | forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b |
| 16:04:26 | <Wild_Cat> | @src map |
| 16:04:26 | <lambdabot> | map _ [] = [] |
| 16:04:27 | <lambdabot> | map f (x:xs) = f x : map f xs |
| 16:04:31 | <Wild_Cat> | @src fmap |
| 16:04:32 | <lambdabot> | Source not found. Just what do you think you're doing Dave? |
| 16:04:33 | <Saizan_> | map is the restriced version for lists |
| 16:04:38 | <Saizan_> | @src Maybe fmap |
| 16:04:39 | <lambdabot> | fmap _ Nothing = Nothing |
| 16:04:39 | <lambdabot> | fmap f (Just a) = Just (f a) |
| 16:04:47 | <Saizan_> | @src [] fmap |
| 16:04:47 | <lambdabot> | fmap = map |
| 16:04:54 | <Wild_Cat> | aha. |
| 16:05:03 | <Saizan_> | are you familiar with type classes? |
| 16:05:05 | <Wild_Cat> | @src mapM |
| 16:05:06 | <lambdabot> | mapM f as = sequence (map f as) |
| 16:05:12 | <Wild_Cat> | Saizan_: yup. |
| 16:05:38 | <Saizan_> | ok then :) |
| 16:05:39 | <Wild_Cat> | coming from an OO background, I identified type classes as a Very Useful Feature early on :D |
| 16:05:58 | <Twey> | Haha |
| 16:06:10 | <Wild_Cat> | and I'd probably have defined Mappable / Foldable type classes had I been writing the Prelude. |
| 16:06:30 | <mapreduce> | Type classes are statically resolved. |
| 16:06:34 | <Saizan_> | there's a Foldable :) |
| 16:06:39 | <Twey> | I think there are classes that do that. |
| 16:06:47 | <Twey> | Mappable would be Functor? |
| 16:06:49 | <Saizan_> | Mappable = Functor |
| 16:06:51 | <Twey> | ACTION nods. |
| 16:07:03 | <mapreduce> | @instances Functor |
| 16:07:05 | <lambdabot> | ((,) a), ((->) r), Cont r, ContT r m, Either a, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, [] |
| 16:07:07 | <quicksilver> | type classes == OO classes is a poor intuition. |
| 16:07:11 | <Twey> | See, I'm learning, I'm learning! .o'a |
| 16:07:13 | <quicksilver> | (just in case that's what you were thinking) |
| 16:07:21 | <Wild_Cat> | quicksilver: type classes == OO interfaces, actually. |
| 16:07:21 | <quicksilver> | type classes == interfaces is just slightly better |
| 16:07:32 | <quicksilver> | type classes == operator overloading is the best, though. |
| 16:07:42 | <mapreduce> | Emulating type classes in Java/C# is pain. |
| 16:07:53 | <Twey> | ACTION identified them with CLOS generics. |
| 16:08:13 | <Wild_Cat> | okay, so Functor is what I'd have called Mappable. We're back to fmap being easy to define on Maybe and [] without resorting to monad laws. Or am I missing something? |
| 16:08:22 | <mapreduce> | CLOS generics are dispatched at runtime. |
| 16:08:35 | <quicksilver> | Wild_Cat: no, you're missing nothing. |
| 16:08:46 | <quicksilver> | Wild_Cat: Maybe and [] are both vyer useful indeed without talking about monads. |
| 16:08:56 | <Saizan_> | Wild_Cat: right, but Monad gives you more interesting operations than just fmap |
| 16:08:59 | <quicksilver> | monads are something extra, on top of what we've discussed so far. |
| 16:09:00 | <Wild_Cat> | so it still doesn't answer my original question, which is "why are they monads?" |
| 16:09:10 | <quicksilver> | Maybe is a monad because of this: |
| 16:09:24 | <Twey> | > (Just 5) >>= return . (*5) |
| 16:09:28 | <lambdabot> | Just 25 |
| 16:09:36 | <Twey> | > Nothing >>= return . (*5) |
| 16:09:40 | <lambdabot> | Nothing |
| 16:09:42 | <quicksilver> | case mx of Nothing -> Nothing ; Just y -> case f y of Nothing -> Nothing; Just z -> case g z of Nothing -> Nothing; Just omega -> .... |
| 16:09:48 | <quicksilver> | that's why you want maybe to be a monad. |
| 16:09:50 | <Saizan_> | Twey: that reduces to fmap thogh :) |
| 16:09:56 | <mapreduce> | Wild_Cat: Because they are instances of the Monad typeclass and follow it's laws properly. |
| 16:09:59 | <quicksilver> | because when you start using maybe you end up with loads of case statements |
| 16:10:09 | <quicksilver> | where the 'Nothing' parts trail off to Nothing |
| 16:10:09 | <mapreduce> | its* |
| 16:10:13 | <quicksilver> | and the 'Just' parts keep going. |
| 16:10:20 | <Twey> | Saizan_: Aye, but not everything using bind does :) |
| 16:10:26 | <Wild_Cat> | quicksilver: aha! |
| 16:10:29 | <quicksilver> | The monad instance for maybe just abstracts that pattern |
| 16:10:35 | <quicksilver> | "Nothing" meaning -> stop now, this isn't working |
| 16:10:48 | <Wild_Cat> | it's a shortcut, then. Somewhat akin to exception propagation. |
| 16:10:59 | <quicksilver> | it's very like exception propagation |
| 16:11:00 | <Twey> | Aye. |
| 16:11:06 | <quicksilver> | except we're storing no information in the exception |
| 16:11:13 | <Twey> | (Either does that) |
| 16:11:24 | <quicksilver> | "Either Exception a" is an upgrade of the maybe monad |
| 16:11:24 | <Twey> | ACTION frowns. |
| 16:11:28 | <Twey> | I need to learn Either |
| 16:11:29 | <quicksilver> | which has the same style of semantic |
| 16:11:38 | <quicksilver> | but allows you to indicate "why we stoppped" |
| 16:11:44 | <quicksilver> | instead of just "it didn't work" |
| 16:11:48 | <Saizan_> | and list is another upgrade where the successful part gives multiple results |
| 16:12:05 | <quicksilver> | (here 'Exception' is supposed to stand for any sensible type, chosen by you, to model things that go wrong) |
| 16:12:14 | <quicksilver> | not some built-in Exception type, in general. |
| 16:12:16 | <Wild_Cat> | quicksilver: so, your massive case above could reduce to answer mx = mx >>= f >>= g, right? |
| 16:12:27 | <quicksilver> | Wild_Cat: >=> actually |
| 16:12:30 | <quicksilver> | but that's the idea. |
| 16:12:32 | <Wild_Cat> | where answer mx :: Maybe Result |
| 16:12:41 | <Wild_Cat> | :t (>=>) |
| 16:12:43 | <lambdabot> | forall a (m :: * -> *) b c. (Monad m) => (a -> m b) -> (b -> m c) -> a -> m c |
| 16:12:50 | <Wild_Cat> | :t (>>=) |
| 16:12:53 | <lambdabot> | forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b |
| 16:13:09 | <quicksilver> | they're very similar. |
| 16:13:29 | <quicksilver> | >=> is the associative version, in a way. |
| 16:13:29 | <Saizan_> | >>= was right i think, you were feeding the content of the Maybe to f and g, not the whole maybe |
| 16:13:47 | <quicksilver> | hmm, yes |
| 16:13:56 | <quicksilver> | (mx >>= f) >>= g |
| 16:13:58 | <quicksilver> | is the same as |
| 16:14:04 | <quicksilver> | mx >>= (f >=> g) |
| 16:14:07 | <Saizan_> | right |
| 16:14:15 | <Wild_Cat> | Saizan_: well, I expect f :: WhateverMxReturnsAsJust -> Maybe ResultFromF |
| 16:14:24 | <quicksilver> | same reason as f $ g $ x and f . g $ x |
| 16:14:28 | <Wild_Cat> | and g :: ResultFromF -> Maybe ResultFromG |
| 16:14:33 | <quicksilver> | only written the other way around. |
| 16:14:39 | <quicksilver> | Wild_Cat: anyhow I think you got the idea :) |
| 16:14:48 | <quicksilver> | slight errors on my part notwithstanding. |
| 16:15:01 | <Wild_Cat> | Yeah, I think I get the idea. |
| 16:16:53 | <Wild_Cat> | now what of lists? |
| 16:17:11 | <Twey> | Lists... do combinin' |
| 16:17:21 | <Wild_Cat> | propagation of [] instead of Nothing, or is there more to it? |
| 16:17:52 | <Saizan_> | with lists you have multiple results |
| 16:17:52 | <Twey> | > [1, 2, 3] >>= return . (*2) >>= return . (-3) |
| 16:17:55 | <lambdabot> | No instance for (Num (b -> b1)) |
| 16:17:55 | <Wild_Cat> | (actually no, propagation of [] makes no sense, it's pretty much automatic) |
| 16:17:56 | <lambdabot> | arising from a use of `negate' a... |
| 16:17:58 | <Twey> | Ack |
| 16:18:16 | <lilac> | > [1, 2, 3] >>= \x -> [2*x, 5*x] |
| 16:18:19 | <lambdabot> | [2,5,4,10,6,15] |
| 16:18:35 | <lilac> | the list monad produces all possible results |
| 16:18:40 | <Saizan_> | case mx of [] -> []; xs -> case concat (map f xs) of [] -> []; xs -> .... |
| 16:19:08 | <Saizan_> | Wild_Cat: it models non-deterministic computations |
| 16:19:57 | <lilac> | due to laziness, it performs a depth-first search with backtracking |
| 16:19:57 | <Wild_Cat> | mmh... A kind of shortcut, again. I'm not certain it's more readable, unlike the Maybe one. |
| 16:20:16 | <quicksilver> | Wild_Cat: try something like this then: |
| 16:20:22 | <lilac> | Wild_Cat: list comprehensions are basically another way of using the list monad |
| 16:20:29 | <lilac> | and they're very useful in practice |
| 16:20:52 | <Wild_Cat> | lilac: yeah, due to similarities with the do notation, I somehow suspected LCs had to do with the monadic nature of lists. |
| 16:21:02 | <quicksilver> | > do { suit <- "HDCS"; num <- "A23456789JQK"; return (suit,num) } |
| 16:21:05 | <lambdabot> | [('H','A'),('H','2'),('H','3'),('H','4'),('H','5'),('H','6'),('H','7'),('H'... |
| 16:21:12 | <quicksilver> | house of cards! |
| 16:21:16 | <Twey> | ACTION laughs. |
| 16:21:33 | <quicksilver> | the list monad lets you work with multiple possible worlds conceptually in parallel. |
| 16:21:38 | <quicksilver> | (not really in parallel, though) |
| 16:21:45 | <quicksilver> | so you can explore multiple possibilities at once. |
| 16:21:59 | <quicksilver> | in reality it's a depth-first search, but you can cut branches |
| 16:22:11 | <quicksilver> | and depth-first search is a fairly useful general technique. |
| 16:22:12 | <Beelsebob> | > (fmap (,) "HDCS") <$> "A23456789JQK" |
| 16:22:15 | <lambdabot> | Couldn't match expected type `a -> a1' |
| 16:22:22 | <Wild_Cat> | > [(suit, num) | suit <- "HDCS", num <- "A23456789JQK"] |
| 16:22:25 | <lambdabot> | [('H','A'),('H','2'),('H','3'),('H','4'),('H','5'),('H','6'),('H','7'),('H'... |
| 16:22:28 | <Beelsebob> | > fmap (,) "HDCS" |
| 16:22:31 | <lambdabot> | Overlapping instances for Show (b -> (Char, b)) |
| 16:22:32 | <lambdabot> | arising from a u... |
| 16:22:47 | <Beelsebob> | ACTION ponders why that doesn't work |
| 16:22:48 | <Wild_Cat> | right, so LCs *are* syntactic sugar for do notation. |
| 16:22:54 | <Saizan_> | > (,) <$> "HDCS" <*> "A23456789JQK" |
| 16:22:57 | <lambdabot> | [('H','A'),('H','2'),('H','3'),('H','4'),('H','5'),('H','6'),('H','7'),('H'... |
| 16:23:04 | <Beelsebob> | well sure, but why doesn't the other work |
| 16:23:08 | <Beelsebob> | > (fmap (,) "HDCS") <$> "A23456789JQK" -- this one |
| 16:23:11 | <lambdabot> | Couldn't match expected type `a -> a1' |
| 16:23:14 | <Saizan_> | Wild_Cat: they do more than do-notation, since you can put guards |
| 16:23:23 | <Wild_Cat> | Saizan_: right. |
| 16:23:54 | <Saizan_> | Beelsebob: because <$> /= <*> |
| 16:24:02 | <Beelsebob> | oh, no, neither it does |
| 16:24:03 | <Beelsebob> | >.< |
| 16:24:12 | <Beelsebob> | > (fmap (,) "HDCS") <*> "A23456789JQK" -- this one |
| 16:24:15 | <lambdabot> | [('H','A'),('H','2'),('H','3'),('H','4'),('H','5'),('H','6'),('H','7'),('H'... |
| 16:24:19 | <Beelsebob> | better :) |
| 16:24:33 | <Saizan_> | ?type guard |
| 16:24:35 | <lambdabot> | forall (m :: * -> *). (MonadPlus m) => Bool -> m () |
| 16:24:35 | <lilac> | Saizan_: i'm not sure that's true; monads permit guards without MonadPlus |
| 16:25:12 | <lilac> | ?type \b -> do True <- return Bool; return () |
| 16:25:14 | <lambdabot> | Not in scope: data constructor `Bool' |
| 16:25:18 | <lilac> | ?type \b -> do True <- return b; return () |
| 16:25:20 | <lambdabot> | forall (t :: * -> *). (Monad t) => Bool -> t () |
| 16:25:39 | <Saizan_> | sssh, that's fail and it shouldn't be there! |
| 16:25:44 | <Saizan_> | ;) |
| 16:25:59 | <lilac> | Saizan_: actually, i disagree with that, but i don't want to be flamed, so pretend i said nothing |
| 16:26:08 | <Wild_Cat> | well, I have to be going. This was enlightening, thank you folks. |
| 16:26:40 | <Wild_Cat> | see you around. |
| 16:27:20 | <Saizan_> | lilac: a lot of monads lack a sensible definition of fail, and since it's not fundamental for the other operations i feels more reasonable to have it in a distinct class |
| 16:27:49 | <Saizan_> | in fact in 1.4 they had MonadZero iirc |
| 16:28:09 | <Saizan_> | s/i/it/ |
| 16:28:23 | <lilac> | Saizan_: would you prefer that (a) do notation with refutable patterns requires MonadFail, or (b) patterns in do are treated as irrefutable, or (c) something else ? |
| 16:28:33 | <Saizan_> | (a) |
| 16:29:51 | <lilac> | to be honest, (a) doesn't sound too bad, but i worry that it'd require lots of actually-irrefutable-but-Haskell-doesn't-know-that cases to have the ~ added |
| 16:30:00 | <lilac> | i guess the ~ is good documentation, though... |
| 16:30:39 | <lilac> | looks like Haskell' will keep Monad fail, in any case, so i guess we have to put up with it |
| 16:30:42 | <Saizan_> | you can use that or a let |
| 16:31:16 | <lilac> | quite frankly, the fact that let *doesn't* call fail on a pattern match error is in my opinion a bug |
| 16:31:37 | <Feuerbach> | is there kind of zipper which "remembers" the root? I.e. which can reproduce partial ordering induced by the tree with root. |
| 16:31:43 | <lilac> | i oftren find myself writing 'pattern <- return value' |
| 16:32:46 | <Saizan_> | so you'd like let in do-notation to desugar to that? |
| 16:33:02 | <lilac> | yes, i think that'd be an improvement |
| 16:33:17 | <lilac> | or avoid the return and bind altogether |
| 16:33:47 | <lilac> | although i guess you can't actually avoid them, can you? :) |
| 16:33:55 | <Saizan_> | Feuerbach: what do you mean? zippers usually remember the root, but not in a O(1) to access point |
| 16:34:42 | <Saizan_> | lilac: for fail to be useful you've to connect it with the rest of the monadic expression, so you can't avoid >>= |
| 16:35:00 | <lilac> | right, i realised that a little too late :) |
| 16:35:10 | <lilac> | IRC needs an 'undo' button :) |
| 16:35:54 | <lilac> | you can avoid the return, though, i think? |
| 16:36:01 | <Saizan_> | also you'd be implementing a non-recursive let, unless you require MonadFix |
| 16:36:26 | <Feuerbach> | Saizan_: oh.. I think I got it |
| 16:37:05 | <lilac> | you could still get recursion from "let ... in do" |
| 16:37:33 | <pmurias> | why does haskell have both map and fmap? |
| 16:37:55 | <lilac> | pmurias: i'm told it's because the Haskell98 committee didn't like polymorphism |
| 16:38:03 | <Saizan_> | pmurias: so we don't have to explain the Functor typeclass to beginners that want to use lists |
| 16:38:44 | <lilac> | Saizan_: it sounds to me like Haskell98 was in many ways a step backwards |
| 16:40:40 | <lilac> | this MonadZero thing sounds pretty sensible |
| 16:40:49 | <Saizan_> | lilac: i never used haskell before h98, but i tend to agree |
| 16:40:56 | <lilac> | ACTION likes the way proc notation requires exactly the typeclasses you use |
| 16:41:44 | <pmurias> | so the map/fmap duplication was intendend rather then a historical consequence |
| 16:42:49 | <quicksilver> | pmurias: something of both. |
| 16:43:02 | <quicksilver> | it is a historical accident that the situation is as it is. |
| 16:43:13 | <quicksilver> | but it was a concious decision to preserve that history in the standard. |
| 16:43:32 | <pmurias> | seem a bit silly |
| 16:43:36 | <pmurias> | * seems |
| 16:43:53 | <quicksilver> | in retrospect I would favour "map" for the method of Functor, and mapList for the list specialisation. |
| 16:44:14 | <quicksilver> | I think that meets the requirement for a monomorphic version for teaching and simpler error messages |
| 16:44:17 | <quicksilver> | ACTION shrugs |
| 16:44:20 | <quicksilver> | it's a bit late now thaough. |
| 16:50:02 | <ddarius> | Install a pre-H98 implementation |
| 16:50:08 | <ddarius> | HBC is a decent one. |
| 16:51:50 | <quicksilver> | ;) |
| 16:53:40 | <bos> | @seen dons |
| 16:53:40 | <lambdabot> | dons is in #xmonad, #haskell, #ghc, #darcs and #arch-haskell. I last heard dons speak 8h 9m 53s ago. |
| 16:53:46 | <bos> | @seen dcoutts |
| 16:53:47 | <lambdabot> | dcoutts is in #gentoo-haskell, #haskell, #ghc, #darcs, #haskell-overflow and #haskell-soc. I last heard dcoutts speak 2h 36m 20s ago. |
| 16:53:51 | <bos> | hm. |
| 16:56:44 | <ddarius> | I wonder if I port all of Hackage to Haskell 1.4 if I can get the GHC folks to add a H14 flag. |
| 17:00:23 | <quicksilver> | ddarius: I'm sure if you write the code for the H14 flag they'd commit it. |
| 17:00:31 | <quicksilver> | Well, I'm not entirely sure, But I suspect they would. |
| 17:01:12 | <ddarius> | I guess I could do that. |
| 17:11:54 | <augustss> | a H14 flag would be cool |
| 17:13:44 | <twanvl> | Do we have Haskell 14 already? |
| 17:14:27 | <augustss> | if we 98 we have 14 |
| 17:14:39 | <augustss> | 7*14 = 98 |
| 17:14:41 | <lilac> | quicksilver: Haskell 1.4 had 'map' as the Functor method |
| 17:15:28 | <augustss> | the eta rule was valid in H1.4 |
| 17:15:44 | <lilac> | (likewise (++) was in MonadPlus, filter was filterM and concat was join, i think) |
| 17:16:25 | <lilac> | ... filter wasn't filterM but was similar in spriti |
| 17:21:54 | <psnively> | Hello Haskellites! |
| 17:23:23 | <augustss> | Hello Snivelite :) |
| 17:23:44 | <psnively> | I'm more of a snivel-heavy, actually. :-D |
| 17:23:55 | <augustss> | heh |
| 17:24:54 | <psnively> | Anyone know what the status of JHC is, or DHC? I keep hoping for something like one of them, I guess. Supercompiler or non-lazy Haskell... |
| 17:25:41 | <Twey> | Strict Haskell? But why? |
| 17:27:05 | <psnively> | Because of the difficulties in reasoning about space/time costs in lazy languages. |
| 17:27:55 | <roconnor> | psnively: just space costs |
| 17:28:19 | <roconnor> | psnively: the time costs are always less than or equal to the time costs of strict evaluation. |
| 17:28:31 | <b\\6> | is subtracting getCPUTimes how i should find how many ms something took? super accuracy isn't needed. |
| 17:29:19 | <roconnor> | b\6: that's how I do it |
| 17:29:21 | <psnively> | roconnor: Really? Hmmm. |
| 17:29:32 | <b\\6> | roconnor: thanks. |
| 17:29:46 | <roconnor> | b\6: just be careful that what you want to evaulate is really being done between the two calls to getCPUTimes |
| 17:29:55 | <roconnor> | psnively: almost by definition of lazy evaluation |
| 17:30:13 | <psnively> | Almost. |
| 17:30:48 | <Deewiant> | of course there's lazyness overhead |
| 17:31:00 | <Deewiant> | s/y/i/ |
| 17:31:02 | <roconnor> | well, if you think that strick evaluation also entails access to mutation, then the argument becomes more complex. |
| 17:31:25 | <roconnor> | and I'm talking about asymtotic time here. |
| 17:31:44 | <roconnor> | sctrict |
| 17:31:46 | <roconnor> | strict |
| 17:32:01 | <dblazakis> | roconnor: wouldn't the (possibly much) larger amount of allocation churn create possibly significant runtime overhead? |
| 17:32:10 | <dblazakis> | possibly ;-) |
| 17:32:12 | <roconnor> | dblazakis: only a constant factor |
| 17:32:29 | <Deewiant> | yeah, the /asymptotic/ costs are the same. |
| 17:33:21 | <lilac> | a computer scientist returns home to find his house has been consumed in a fire. the fireman says "i'm sorry, 90% of the house was destroyed". the compsci says, "don't worry, it's only worse by a constant factor". |
| 17:33:49 | <psnively> | Back later. |
| 17:34:14 | <roconnor> | dblazakis: the reason lazy code is are sometimes slower in practice is exactly what you say. The potentially large space usage creates a large overhead. |
| 17:34:51 | <dblazakis> | roconnor: does the intelligence of the allocator affect this much? is it simply allocation overhead or are there other time sinks? |
| 17:35:51 | <roconnor> | there is also the laziness overhead Deewiant talked about. I'm not sure, but I think they pale in comparison to the allocation issues (granted they are also somewhat related to the allocation issues) |
| 17:37:12 | <roconnor> | I doubt the intelligence of the allocator affects this much. |
| 17:37:55 | <dblazakis> | i could imagine a lazy program missing the cache more often, but i don't know if that would be a reality or if it would be noticable if it did |
| 17:39:15 | <dblazakis> | where's the obligatory spj paper showing me numbers? :-) |
| 18:12:34 | <Baughn> | @src enumFromTo |
| 18:12:34 | <lambdabot> | Source not found. :( |
| 18:12:40 | <Baughn> | @src Float enumFromTo |
| 18:12:41 | <lambdabot> | Source not found. Sorry about this, I know it's a bit silly. |
| 18:13:45 | <Baughn> | ACTION wonders why [0.0,0.2..3.8] winds up printing 3.800000000000001, when there is a perfectly good number that actually does print as 3.8 |
| 18:13:50 | <roconnor> | ugh, float shouldn't be a member of enum |
| 18:14:15 | <Botje> | random fp weirdness :) |
| 18:14:22 | <Baughn> | I'd claim it's convenient, except for stuff like this |
| 18:14:47 | <roconnor> | I had this discussion before, and I think the conclusion was to split enum into two classes |
| 18:14:55 | <Baughn> | Fortunately I don't have to deal with FP a lot. Passing ints into a gpu as floats was.. an adventure. ^^; |
| 18:14:56 | <roconnor> | but I forget how that was supposed to work |
| 18:14:56 | <Beelsebob> | Baughn: I *think* it's because it's done with repeated adds |
| 18:15:12 | <Beelsebob> | I suspect the same thing is causing my mandelbrot implementation to be not quite right |
| 18:15:46 | <Baughn> | Beelsebob: It's a possibility. |
| 18:15:50 | <Baughn> | ACTION goes looking for the source |
| 18:16:34 | <roconnor> | Beelsebob: don't worry, the mandlebrot set isn't known to be computable. :) |
| 18:16:53 | <Saizan_> | Baughn: 0.1 is not representable, so the errors accumulate afaiu |
| 18:17:28 | <Beelsebob> | roconnor: yeh, it's my parallel version for the shootout -- it's gotta match their output |
| 18:17:38 | <Baughn> | Saizan_: The errors /would/ accumulate (thus why you shouldn't iterate over floats), but I'm starting at 0.2, not 0.1 ;) |
| 18:17:46 | <Beelsebob> | but 2 of the bytes are wrong |
| 18:17:49 | <roconnor> | > map fromRational [0.0, 0.2, .. 3.8] :: [Float] |
| 18:17:52 | <lambdabot> | mueval: Prelude.read: no parse |
| 18:18:01 | <roconnor> | > map fromRational [0.0, 0.2 .. 3.8] :: [Float] |
| 18:18:05 | <lambdabot> | [0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.... |
| 18:18:49 | <Baughn> | Saizan_: Actually, 0.1 /is/ representable, in the "it's the shortest textual representation for a FP number" sense |
| 18:19:58 | <Baughn> | And thinking of them as ranges gives me less grief overall. ;) |
| 18:22:50 | <Saizan_> | Baughn: well it's not representable with finite digits in binary, no? |
| 18:23:33 | <Baughn> | Saizan_: Depends on your definition of "representable". I've given you mine. |
| 18:24:10 | <Saizan_> | well ok, i was using the IEEE 754 one :) |
| 18:24:23 | <Baughn> | The one where they have an exact rational value? Sure.. |
| 18:24:37 | <Baughn> | Things really do work better if you regard them as ranges, though. Try it. ;) |
| 18:25:00 | <Baughn> | (For one thing, it explains why 0.1 prints as 0.1 and not its exact value) |
| 18:31:29 | <Myoma> | @keal |
| 18:31:29 | <lambdabot> | can haskell pipe the raw irrational megaequation into an analog device |
| 18:31:37 | <Myoma> | ?faq can haskell pipe the raw irrational megaequation into an analog device |
| 18:31:38 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 18:34:30 | <dmwit> | I'm intrigued by the concept of controlling lasers with five irrational numbers. |
| 18:34:44 | <dmwit> | Please: explain me how to spell a triangle in less than three corners using dark manifolds! |
| 18:35:06 | <Cale> | Is that also from Keal? |
| 18:35:15 | <Cale> | @keal |
| 18:35:16 | <lambdabot> | all i know is i have experienced my own death unhappening... |
| 18:35:22 | <Cale> | @keal |
| 18:35:23 | <lambdabot> | what are epsilons? |
| 18:35:59 | <Myoma> | what are epsilons!! |
| 18:36:05 | <Cale> | @keal |
| 18:36:06 | <lambdabot> | doubles and floats cause b*(Floor[v/b^p]/b-Floor[Floor[v/b^p]/b) to fuck up |
| 18:36:16 | <Cale> | @keal |
| 18:36:17 | <lambdabot> | somone would expect that trees 500gb hdds of expressions as if they were floppy dicks |
| 18:36:21 | <Myoma> | @QEAL |
| 18:36:22 | <lambdabot> | Unknown command, try @list |
| 18:36:28 | <Myoma> | :[ |
| 18:36:40 | <Myoma> | @KEAL |
| 18:36:41 | <lambdabot> | Unknown command, try @list |
| 18:36:45 | <Myoma> | why does this not work ? |
| 18:36:48 | <Myoma> | @nikon |
| 18:36:48 | <lambdabot> | Government enterprise is the most inefficient and costly way of producing jobs. |
| 18:42:05 | <Myoma> | @nikon |
| 18:42:06 | <lambdabot> | You won't have Nixon to kick around anymore, because, gentlemen, this is my last press conference. |
| 18:43:04 | <dmwit> | @nixon |
| 18:43:04 | <lambdabot> | Sure there are dishonest men in local government. But there are dishonest men in national government too. |
| 18:43:21 | <dmwit> | heh |
| 18:46:07 | <jeffersonheard> | http://hpaste.org/10140 -- I get a compile error saying it cannot deduce (Ord a) from `compare` |
| 18:46:29 | <Myoma> | jeffersonheard: try to move (Ord a, Eq a) => to the instance |
| 18:46:33 | <Myoma> | instead of in the data |
| 18:47:07 | <Heffalump> | (Ord a, Eq a) is redundant btw, you can always just use (Ord a) |
| 18:47:08 | <jeffersonheard> | that's a thought... but then not all instances of interval would be instances of Ord, no? |
| 18:47:20 | <Heffalump> | jeffersonheard: are you using GHC and willing to use GHC extensions? |
| 18:47:41 | <dmwit> | jeffersonheard: It's usually considered bad form to put class restrictions on a data type. |
| 18:47:43 | <jeffersonheard> | happily |
| 18:47:56 | <Heffalump> | then use the new where syntax for data declarations, and it'll work |
| 18:48:02 | <jeffersonheard> | k |
| 18:48:10 | <dmwit> | jeffersonheard: i.e. there's usually no good reason to prevent somebody from making an Interval out of something that's not an Ord instance, so long as they never need to use the Ord instance. |
| 18:48:27 | <Heffalump> | dmwit: it's only bad form because Haskell 98 is broken. |
| 18:48:40 | <dmwit> | Not really. |
| 18:48:48 | <dmwit> | Or I should say: I disagree. |
| 18:49:55 | <jeffersonheard> | dmwit, I can see why that's true in the general case, but this isn't library code, and what would an interval look like that can't understand conjunction, disjunction, and overlap? |
| 18:50:12 | <dmwit> | It would look like an interval. |
| 18:50:13 | <jeffersonheard> | which you can't have without an ordering, if all you have is a low and hi |
| 18:50:28 | <jeffersonheard> | not really, since this is an interval on the number line |
| 18:50:37 | <jeffersonheard> | it would look like a coding error |
| 18:50:41 | <dmwit> | If I want an (Interval id const), who are *you* to stop me? |
| 18:50:45 | <dmwit> | =) |
| 18:51:00 | <jeffersonheard> | define your own interval type then, but don't try to use my code with it |
| 18:51:16 | <jeffersonheard> | I'm the coder, after all. I'm exactly the person to stop you from using bad data in my code |
| 18:51:26 | <jeffersonheard> | 's what type checking's for |
| 18:51:30 | <dmwit> | No, that's the type-checker's job. |
| 18:51:31 | <dmwit> | Exactly. |
| 18:51:50 | <jeffersonheard> | But I'm still using the type-checker |
| 18:51:53 | <dmwit> | As soon as I try to do (compare (Interval id const))... *that* is when I want an error to occur. |
| 18:52:32 | <dmwit> | But, as you say: this is a matter of taste. |
| 18:53:04 | <jeffersonheard> | it is indeed |
| 18:57:48 | <Myoma> | jeffersonheard: type checker doesn't stop you from using bad data |
| 18:57:53 | <dmwit> | :t split |
| 18:57:55 | <lambdabot> | forall g. (RandomGen g) => g -> (g, g) |
| 18:57:59 | <dmwit> | :t break |
| 18:58:01 | <Myoma> | jeffersonheard: type checker ensures that _nonsense_ doesn't happen |
| 18:58:02 | <lambdabot> | forall a. (a -> Bool) -> [a] -> ([a], [a]) |
| 18:58:13 | <dmwit> | > break (== ',') "a,b" |
| 18:58:17 | <lambdabot> | ("a",",b") |
| 19:00:51 | <Myoma> | > (head [], 1/0, fromJust Nothing) |
| 19:00:55 | <lambdabot> | mueval: Prelude.read: no parse |
| 19:00:55 | <lambdabot> | mueval: (*** Exception: Prelude.head: empty... |
| 19:01:08 | <Myoma> | > (map (+1) "foo", 7 + "car", reverse Nothing) |
| 19:01:11 | <lambdabot> | Couldn't match expected type `[a]' against inferred type `Maybe a1' |
| 19:02:27 | <nominolo> | anyone care to review a 6-page draft paper about instruction scheduling, due on Sunday? |
| 19:10:53 | <zulusulta> | hi how long does it take to learn haskell |
| 19:11:11 | <Myoma> | 100 years |
| 19:11:14 | <Myoma> | :)) |
| 19:11:21 | <trofi> | like any natural language :] |
| 19:11:28 | <Myoma> | you can start writing real and useful programs in a week though |
| 19:12:29 | <zulusulta> | is it easier to learn haskell or .net |
| 19:12:32 | <zulusulta> | c# |
| 19:12:47 | <zulusulta> | cause I know i can get a job with C# |
| 19:12:50 | <Myoma> | I suggest you learn both, I don't think there's any other way you could know |
| 19:13:09 | <Myoma> | (which one was easier to learn) |
| 19:13:14 | <zulusulta> | is there a dot net users group on freenode? |
| 19:13:18 | <malune> | if its jobs you are looking for, definitely go for C# |
| 19:13:23 | <zulusulta> | i can't find it |
| 19:13:33 | <zulusulta> | the thing is I am intrested in machine learning |
| 19:13:35 | <Myoma> | I think there's a C# channel |
| 19:13:44 | <malune> | however if you're passionate about programming, learn haskell |
| 19:13:55 | <malune> | or even Scheme, which is a lighter beginning |
| 19:14:19 | <zulusulta> | i am intrested in creating progams that can make intellingent decisions |
| 19:14:25 | <zulusulta> | but i need a job |
| 19:14:36 | <malune> | both languages allow you to create such programs... |
| 19:14:55 | <malune> | but Prolog may be what you are looking for |
| 19:14:58 | <zulusulta> | yeah but C# would get me job to pay for rent |
| 19:15:08 | <zulusulta> | prolog has no batteries |
| 19:15:14 | <dblazakis> | zulusulta: if you want a c# channel, try #mono on irc.gimp.net |
| 19:15:24 | <zulusulta> | thanks |
| 19:15:25 | <malune> | C has batteries, every language has some sort of communication with C |
| 19:15:30 | <Myoma> | zulusulta: Batteries? |
| 19:15:54 | <zulusulta> | framework, libraries |
| 19:16:02 | <zulusulta> | stuff to do usefull things with |
| 19:16:11 | <malune> | Python / Java / C# |
| 19:16:21 | <Myoma> | zulusulta: It's possible to do useful things in Prolog |
| 19:16:54 | <malune> | Myoma: he wants to be able to get hired though |
| 19:17:21 | <zulusulta> | yeah need money in the bank |
| 19:17:46 | <Myoma> | sitting around chatting on IRC never seems to generate much money ... |
| 19:19:29 | <zulusulta> | lol |
| 19:19:47 | <zulusulta> | yes but need ideas and inspiration |
| 19:19:50 | <malune> | zulusulta: how much programming experience have you already got? |
| 19:20:03 | <zulusulta> | scjp |
| 19:20:19 | <malune> | ??? |
| 19:20:25 | <Myoma> | Sun Certified Java Programmer |
| 19:20:45 | <Myoma> | ACTION considers getting that |
| 19:21:00 | <malune> | there are lots of jobs available for java programmers... so whats the problem? |
| 19:21:18 | <zulusulta> | i am a qa |
| 19:21:34 | <zulusulta> | once i got the cert i never touched java again |
| 19:21:45 | <malune> | so can you programin java? |
| 19:21:48 | <Myoma> | zulusulta: Why did you get it? |
| 19:21:59 | <zulusulta> | yes\ |
| 19:22:14 | <zulusulta> | though it would help to land a job |
| 19:22:30 | <b\\6> | maybe you should find a job doing something you actually *like*. |
| 19:22:37 | <b\\6> | doesn't sound like computers/programming is it. |
| 19:23:07 | <zulusulta> | yes but i spent 4 years getting a bachelors of comp sci |
| 19:23:18 | <b\\6> | not too late to admit it was a mistake. |
| 19:23:19 | <zulusulta> | what do I do? |
| 19:23:36 | <Myoma> | hehe |
| 19:23:40 | <malune> | to be honest in the industry its probably better to have his attitude |
| 19:23:53 | <zulusulta> | yes but i have no fall back plan |
| 19:23:54 | <malune> | learn java, land a job doing entreprise software ... |
| 19:24:10 | <malune> | thats what most companies seem to want |
| 19:24:17 | <_ar> | zulusulta: what do you do in your freetime? |
| 19:24:20 | <zulusulta> | dot net is way easier |
| 19:24:20 | <Myoma> | @protontorpedo |
| 19:24:21 | <lambdabot> | so given that how does haskell let one turn business calcualtion anreocrding of info into somethng liek a big spreadsheet? |
| 19:24:25 | <zulusulta> | watch movies |
| 19:24:36 | <zulusulta> | surf on the net |
| 19:25:13 | <nominolo> | ACTION is looking forward to read about zulusulta on the daily wtf |
| 19:25:20 | <Myoma> | zulusultra: You should learn haskell! :p |
| 19:25:29 | <Myoma> | zulusultra: It is a lot of fun |
| 19:25:30 | <malune> | so you want something easy, which will let you write intelligent software, which will land you a job... |
| 19:25:46 | <malune> | try Python, I guess |
| 19:26:00 | <Myoma> | malune: Why not python over haskell ? |
| 19:26:01 | <zulusulta> | i like python |
| 19:26:10 | <Myoma> | s/not // |
| 19:26:16 | <zulusulta> | i learnt it in a week |
| 19:26:35 | <_ar> | zulusulta: how are your writing skills? you could be a consumer advocate, critic, etc. |
| 19:26:38 | <nominolo> | that doesn't mean you can actually write decent programs in it |
| 19:26:38 | <malune> | Myoma: because Haskell has a type system and is generally quite mathematical... Can you really imagine him getting his head around lazy evaluation, pattern matching, types, monads... |
| 19:26:47 | <zulusulta> | thank job, i was scared u were going to say vb script |
| 19:26:56 | <_ar> | malune: why not? |
| 19:27:00 | <Myoma> | malune: You're right! Nobody could ever understand all those crazy things :P |
| 19:27:08 | <trofi> | :] |
| 19:27:28 | <zulusulta> | _ar: no minimum wage jobs |
| 19:27:51 | <malune> | Myoma: I just think its a lot to learn, and can't really be classed as "easy" |
| 19:27:52 | <nominolo> | i think drug dealing is kinda well-paid |
| 19:28:04 | <nominolo> | of course, no benefits |
| 19:28:04 | <_ar> | zulusulta: they're not wage jobs, you'd be self employed |
| 19:28:31 | <_ar> | of course that is most likely actually worse than minimum wage jobs most of the time |
| 19:28:41 | <Myoma> | malune: Is Python easy? Can I write more efficient more realible programs in python faster than in haskell? |
| 19:29:03 | <_ar> | but it plays to the consumption you do in your free time |
| 19:29:06 | <malune> | Myoma: maybe. :) |
| 19:29:40 | <malune> | Myoma: but it is definitely easier to read & learn.. Could you have learnt haskell without knowing about lambda calculus & combinatorics? |
| 19:29:43 | <_ar> | malune: anyone can get used to anything |
| 19:29:48 | <nominolo> | more efficient only if it's a library call |
| 19:30:08 | <nominolo> | malune: of course |
| 19:30:20 | <nominolo> | why would you need that? |
| 19:30:25 | <Myoma> | I don't know how combinatorics are relevant to haskell |
| 19:30:34 | <nominolo> | Real Word Haskell contains no LC or combinatorics |
| 19:30:44 | <_ar> | malune: you certainly can learn haskell without knowing lambda calculus and combinatorics is not very helpful |
| 19:30:53 | <malune> | nominolo: real world haskell is for people who can already program.. |
| 19:31:06 | <nominolo> | not necessarily |
| 19:31:25 | <malune> | nominolo: at least, that is what it says in the introduction... |
| 19:31:31 | <zulusulta> | writing skills are good |
| 19:32:35 | <Saizan_> | haskell is harder for people who can already program in imperative languages, probably :) |
| 19:32:52 | <malune> | _ar: well I'm probably wrong anyway, but personally I needed to establish those fundamental principles before I could understand fp.. |
| 19:33:06 | <malune> | (to any degree) |
| 19:34:15 | <_ar> | malune: i can't argue against your personal experience, but those fundamental principles are there because they've been abstracted from real world stuff. |
| 19:34:19 | <_ar> | In the sense that real world stuff came first |
| 19:34:43 | <malune> | _ar: I thought math came first... Church Turing thesis? |
| 19:35:06 | <Myoma> | How is Church Turing thesis relevant to programmiNG ? |
| 19:35:11 | <Saizan_> | it's not like math comes from nowhere :) |
| 19:35:28 | <malune> | how is it not relevant to programming? i don't understand the question |
| 19:36:11 | <malune> | Saizan_: yes, the greeks came first mwahaha |
| 19:36:45 | <dblazakis> | i'm still missing how combinatorics is in any way related... do you mean combinatory logic? |
| 19:36:54 | <malune> | dblazakis: yes |
| 19:36:57 | <_ar> | malune: the study of functions came from considering rules which to one thing assign another. To each person assign their age, to each farm animal assign a monetary value. |
| 19:37:19 | <_ar> | malune: it was because these kinds of rules are so common that people thought to study the type of rule itself |
| 19:37:46 | <dblazakis> | ah, ok -- i still disagree, but i can see the argument :) |
| 19:38:13 | <Saizan_> | combinatory logic is relevant for pointsfree |
| 19:39:19 | <_ar> | malune: i guess all i'm trying to say is that you don't need to reason formally to reason correctly |
| 19:40:51 | <malune> | _ar: I agree with that, but to truly understand what you are programming in FP, I still think exposure at least to the lambda calculus is extremely useful |
| 19:41:47 | <_ar> | malune: i am not sure anyone truly understands =) |
| 19:42:02 | <Myoma> | I do!! |
| 19:42:04 | <Myoma> | :p |
| 19:42:04 | <_ar> | but theory is good, when you're ready for it... |
| 19:42:39 | <_ar> | imagine trying to learn something formal, like abstract algebra, without ever having an example to help guide your intuition |
| 19:43:13 | <malune> | _ar: I guess all I'm trying to say is that when you start programming you are in a middle abstraction, where you grasp what is there... but its important to go in 2 orthogonal directions in your mind from there, one which goes towards the lambda calculus, and the other which goes towards understanding the more complex ideas in whichever language you are learning. |
| 19:43:51 | <malune> | _ar: of course though I agree that you can never get to the bottom, or the top, of anything |
| 19:44:03 | <malune> | (at least I don't think so) |
| 19:47:02 | <malune> | _ar: that is, unless the Y combinator is the bottom. :) |
| 19:48:03 | <Saizan_> | (Y id) is the bottom |
| 19:56:04 | <bos> | @seen augustss |
| 19:56:05 | <lambdabot> | augustss is in #haskell. I last heard augustss speak 2h 32m 9s ago. |
| 20:03:01 | <Myoma> | does anyone know of some other papers about inverting folds? |
| 20:07:22 | <b\\6> | oh, boy. i missed you. |
| 20:08:01 | <mauke> | so ... how about a threadWaitRead :: Fd -> STM ()? does that even make sense? |
| 20:10:36 | <koninkje> | @pl \x y -> f x (g y) |
| 20:10:37 | <lambdabot> | (. g) . f |
| 20:14:15 | <BMAway> | Myoma: which papers has you already seen? :) |
| 20:18:10 | <Myoma> | Inverting Functions as Folds - Mu, Bird |
| 20:18:32 | <im_alone> | @ggl gasART |
| 20:18:33 | <lambdabot> | Maybe you meant: ghc pl url |
| 20:19:35 | <im_alone> | @google GasART |
| 20:19:37 | <lambdabot> | No Result Found. |
| 20:19:48 | <im_alone> | @google AppART |
| 20:19:55 | <lambdabot> | http://www.appart.com/ |
| 20:19:56 | <lambdabot> | Title: AppArt�Hosted Brand Asset Management and Production Services |
| 20:20:16 | <RayNbow> | @djinn (k -> k -> v) -> (k -> v) |
| 20:20:16 | <lambdabot> | f a b = a b b |
| 20:20:49 | <Myoma> | :t join :: (k -> k -> v) -> (k -> v) |
| 20:20:51 | <lambdabot> | forall k v. (k -> k -> v) -> k -> v |
| 20:21:06 | <mauke> | @. pl djinn (k -> k -> v) -> (k -> v) |
| 20:21:07 | <lambdabot> | f = join |
| 20:21:49 | <im_alone> | @google GasART resonance |
| 20:21:51 | <lambdabot> | No Result Found. |
| 20:26:53 | <trofi> | @hoogle unpack |
| 20:26:53 | <lambdabot> | Data.ByteString unpack :: ByteString -> [Word8] |
| 20:26:54 | <lambdabot> | Data.ByteString.Char8 unpack :: ByteString -> [Char] |
| 20:26:54 | <lambdabot> | Data.ByteString.Lazy unpack :: ByteString -> [Word8] |
| 20:27:04 | <mmorrow> | @hoogle c2w |
| 20:27:05 | <lambdabot> | Data.ByteString.Internal c2w :: Char -> Word8 |
| 20:27:08 | <mmorrow> | @hoogle w2c |
| 20:27:09 | <lambdabot> | Data.ByteString.Internal w2c :: Word8 -> Char |
| 20:27:16 | <mmorrow> | (useful) |
| 20:27:40 | <Saizan_> | ?type toEnum . fromEnum |
| 20:27:42 | <lambdabot> | forall a a1. (Enum a1, Enum a) => a1 -> a |
| 20:28:09 | <trofi> | thanks. is there ByteStringed analogues for Parsec.string? |
| 20:28:11 | <mmorrow> | true, but c2w/w2c have {-# INLINE #-} and supposedly usually get optimized away |
| 20:28:35 | <Myoma> | BMeph_: It is good but I don't know if I can apply it to my problem |
| 20:30:08 | <mmorrow> | Saizan_: how's parallelizing cabal coming? that paste the other day looked like an interesting problem. |
| 20:31:37 | <BMeph_> | Myoma: Hm, it isn't my field, either. You could, though, look on Citeseer, for papers that reference that one, or other papers that Shin-Cheng Mu has written |
| 20:32:02 | <Saizan_> | mmorrow: i kept that version for now, however the backend is there, it's mostly a matter of exposing the option in the UI e convert the compiling code for ghc to that |
| 20:33:15 | <mmorrow> | Saizan_: is that in http://darcs.haskell.org/Cabal/ then? |
| 20:33:16 | <lambdabot> | Title: Index of /Cabal |
| 20:33:43 | <mmorrow> | or am i misunderstanding what that code was for? |
| 20:34:20 | <Saizan_> | mmorrow: it's still only in my repo un c.h.o, i've to remove the mtl and fgl dependencies first |
| 20:35:01 | <mmorrow> | Saizan_: cool. link? |
| 20:35:26 | <mmorrow> | ah, found it |
| 20:37:15 | <Saizan_> | mmorrow: i've just pushed a patch that enables parallel building by default for preprocessors |
| 20:37:26 | <mmorrow> | nice nice |
| 20:38:15 | <mmorrow> | getting now |
| 20:39:10 | <Saizan_> | i'm not sure what's the best way to avoid getting all the messages interleaved on stdout |
| 20:39:47 | <mmorrow> | this is the behaviour of make -jN, N>1 |
| 20:40:34 | <Saizan_> | ah, so there's no good way?:) |
| 20:40:38 | <Myoma> | 'It is therefore an instance of the "generator - filter" paradigm that recurs frequently in functional programming" -- what is this ? |
| 20:40:51 | <mmorrow> | Saizan_: i'm not sure. what ordering would you have them be in? |
| 20:41:15 | <mauke> | probably something like 'generate hueg data structure first, filter later' ... but that's a lazy paradigm |
| 20:41:53 | <mmorrow> | yeah, without laziness that would suck bigtime |
| 20:43:29 | <Saizan_> | mmorrow: mmh, at least one line per process, instead of one character would be nice, maybe i've to play with buffering settings |
| 20:43:45 | <mmorrow> | ohhh, i gotcha. haha. |
| 20:43:54 | <mmorrow> | so it's just gibberish then |
| 20:44:26 | <dmead> | > mean [1..10] |
| 20:44:29 | <lambdabot> | mueval: Prelude.read: no parse |
| 20:44:38 | <dmead> | is there a mean? |
| 20:44:43 | <dmead> | @hoogle mean |
| 20:44:44 | <lambdabot> | No results found |
| 20:45:09 | <Myoma> | :t liftA2 (/) sum length |
| 20:45:12 | <lambdabot> | No instance for (Fractional Int) |
| 20:45:12 | <lambdabot> | arising from a use of `/' at <interactive>:1:7-9 |
| 20:45:12 | <lambdabot> | Possible fix: add an instance declaration for (Fractional Int) |
| 20:45:39 | <mauke> | :t liftA2 (/) sum (fromIntegral . length) |
| 20:45:41 | <lambdabot> | forall b. (Fractional b) => [b] -> b |
| 20:45:48 | <Myoma> | :t liftA2 (/) sum (foldr (const (+1)) 0) |
| 20:45:50 | <lambdabot> | forall a. (Fractional a) => [a] -> a |
| 20:46:16 | <mmorrow> | Saizan_: yeah definitely possible somehow. maybe somthing like a (T)Chan String, and a write thread or something. |
| 20:47:20 | <mmorrow> | (where the String could be entire atomic messages, not just lines) |
| 20:47:29 | <Saizan_> | yup |
| 20:48:20 | <Feuerbach> | can I make list (as * -> *) a instance of some class (like Monad or Functor)? |
| 20:48:35 | <dmhouse> | Sure. |
| 20:48:42 | <dmhouse> | Although [] already has Monad and Functor instances. |
| 20:48:45 | <Feuerbach> | how is it written? |
| 20:48:50 | <Feuerbach> | no, it's my own class |
| 20:48:50 | <dmhouse> | instance Monad [] where ... |
| 20:48:59 | <Feuerbach> | thanks |
| 20:49:12 | <Myoma> | :t undefined :: [] Integer |
| 20:49:14 | <lambdabot> | [Integer] |
| 20:49:27 | <rwbarton> | :t undefined :: [] 1 |
| 20:49:29 | <lambdabot> | [Unit] |
| 20:49:41 | <dmhouse> | ?hoogle 1 |
| 20:49:41 | <lambdabot> | Parse error: |
| 20:49:42 | <lambdabot> | --count=20 1 |
| 20:49:42 | <lambdabot> | ^ |
| 20:49:50 | <dmhouse> | Who defined that? |
| 20:49:55 | <Myoma> | GHC.Generics.Unit |
| 20:50:01 | <mauke> | @index 1 |
| 20:50:01 | <lambdabot> | bzzt |
| 20:50:08 | <dmhouse> | Okay. How does it differ from ()? |
| 20:50:18 | <mmorrow> | @src Unit |
| 20:50:19 | <lambdabot> | Source not found. You speak an infinite deal of nothing |
| 20:50:20 | <dmhouse> | Or is it for type-level numerals? |
| 20:50:24 | <dmhouse> | ?hoogle Unit |
| 20:50:25 | <lambdabot> | Data.Generics data Unit |
| 20:50:25 | <lambdabot> | Data.Generics Unit :: Unit |
| 20:50:25 | <lambdabot> | Language.Haskell.Syntax unit_con :: HsExp |
| 20:50:48 | <dmhouse> | Prelude Data.Generics> :i Unit |
| 20:50:48 | <dmhouse> | data Unit = Unit -- Defined in GHC.Base |
| 20:50:56 | <mmorrow> | ah |
| 20:50:59 | <dmhouse> | :t undefined :: 2 |
| 20:51:01 | <lambdabot> | Only unit numeric type pattern is valid |
| 20:51:26 | <dmhouse> | Prelude Data.Generics> :t undefined :: 1 |
| 20:51:26 | <dmhouse> | undefined :: 1 :: Unit |
| 20:51:29 | <dmhouse> | ^^ weird. |
| 20:51:36 | <dmhouse> | It's some kind of magic. |
| 20:52:09 | <byorgey> | what the heck? |
| 20:52:24 | <TomMD> | A witch! Burn dmhouse |
| 20:52:26 | <dmhouse> | rwbarton: what is this nonsense? |
| 20:52:41 | <mmorrow> | to the stake! |
| 20:54:14 | <mmorrow> | > typeOf (undefined::1) |
| 20:54:18 | <lambdabot> | No instance for (Typeable Unit) |
| 20:54:18 | <lambdabot> | arising from a use of `typeOf' a... |
| 20:54:44 | <nominolo> | @unlet 1 |
| 20:54:45 | <lambdabot> | Parse error |
| 20:54:59 | <mmorrow> | oh nice, there's an unlet |
| 20:54:59 | <mauke> | let == unlet |
| 20:55:04 | <mmorrow> | aww |
| 20:55:21 | <mmorrow> | > fix L.id |
| 20:55:24 | <lambdabot> | 0 |
| 20:55:29 | <dmhouse> | :| |
| 20:55:33 | <mauke> | :t L.id |
| 20:55:35 | <lambdabot> | forall b t. (Num t) => b -> t |
| 20:55:35 | <mmorrow> | tricksters |
| 20:55:43 | <mmorrow> | > fix id |
| 20:55:46 | <dmhouse> | > L.id 3 |
| 20:55:49 | <lambdabot> | Ambiguous occurrence `id' |
| 20:55:49 | <lambdabot> | It could refer to either `L.id', defined... |
| 20:55:52 | <lambdabot> | 0 |
| 20:55:52 | <mauke> | > L.id () |
| 20:55:56 | <mmorrow> | someone made it const 0 |
| 20:55:56 | <lambdabot> | 0 |
| 20:56:11 | <dmhouse> | ?unlet L.id |
| 20:56:12 | <lambdabot> | Parse error |
| 20:56:17 | <dmhouse> | (How's that done?) |
| 20:56:19 | <dmhouse> | ?undefine |
| 20:56:23 | <mmorrow> | i don't think you can |
| 20:56:24 | <dmhouse> | :t L.id |
| 20:56:25 | <mauke> | @redefine id |
| 20:56:26 | <lambdabot> | Not in scope: `L.id' |
| 20:56:32 | <dmhouse> | Okay, it's ?undefine. |
| 20:56:33 | <mmorrow> | without undefining everything |
| 20:56:44 | <dcoutts> | bos: pong |
| 20:56:47 | <mmorrow> | yeah, all or nothing it seems |
| 20:56:56 | <nominolo> | dcoutts: ping |
| 20:57:06 | <_zenon_> | omfg, it hurts soo bad to get salt in a wound |
| 20:57:14 | <dcoutts> | nominolo: pong |
| 20:57:21 | <nominolo> | _zenon_: yeah, don't do that |
| 20:57:27 | <mmorrow> | _zenon_: add lime too |
| 20:57:38 | <dmhouse> | _zenon_: hence the expression, one would guess. |
| 20:57:46 | <_zenon_> | I got this mouth wound, I bit my check by accident |
| 20:57:52 | <dmhouse> | _zenon_: I mean, if it were only *midly* painful to add salt to the wound, who would say that? |
| 20:57:54 | <_zenon_> | and the little thing won't heal |
| 20:58:07 | <_zenon_> | so I took a flake of salt and put it there. |
| 20:58:07 | <dcoutts> | Saizan_: so are you writing about the outcome of the GSoC? I think we're going to put together some summary for the community. |
| 20:58:19 | <dmhouse> | "It's like biting your lip" -- not really the same effect. |
| 20:58:49 | <_zenon_> | dmhouse, maybe a gentleman? "May your bite in a mildly sour apple" |
| 20:59:03 | <Myoma> | "so I took a flake of salt and put it there" lol |
| 20:59:32 | <Saizan_> | dcoutts: i'm keeping tomorrow free to do that |
| 20:59:35 | <_zenon_> | Myoma, yeah, I thought it might do something about the pain, and it did |
| 20:59:55 | <Myoma> | _zenon_: Something to worry about is getting your teeth pulled out because you keep biting yourself |
| 21:00:01 | <mmorrow> | _zenon_: i've had that. is it infected yet? gargle with <insert-the-stuff-you-disinfect-cuts-with-i-can't-think-of-the-name-right-now> (but DONT! swallow any) |
| 21:00:14 | <Myoma> | _zenon_: ...if you're looking for something to worry about :) |
| 21:00:22 | <TomMD> | So... anyone use Haskell? :-P |
| 21:00:39 | <_zenon_> | Myoma, well, I would prefer not to loose my teeth though, what will I grind then? |
| 21:00:57 | <_zenon_> | mmorrow, will it heal faster? I'll try though |
| 21:01:09 | <_zenon_> | mmorrow, it's really annoying to being able to eat properly. |
| 21:01:50 | <mmorrow> | hydrogen peroxide is the name |
| 21:01:58 | <TomMD> | H2O2 |
| 21:01:59 | <dcoutts> | Saizan_: cool |
| 21:02:13 | <mmorrow> | _zenon_: yeah, and it'll kill infection. this is what a doctor would have you do. |
| 21:02:17 | <dmead> | sexy |
| 21:02:18 | <dmead> | "*** Exception: /home/dan/cdc_haskell/mkt.hs:108:23-66: Irrefutable pattern failed for pattern (z : zs) |
| 21:02:42 | <_zenon_> | mmorrow, oh, thanks. |
| 21:02:43 | <dmwit> | I vote you write total functions from now on. |
| 21:02:49 | <dmwit> | ;-) |
| 21:02:52 | <TomMD> | dmead: I'd call that a need for CATCH - this was when running an open source app? |
| 21:03:07 | <mmorrow> | _zenon_: (and do it a few times a day until it stops being a problem) |
| 21:03:08 | <dmead> | nope |
| 21:03:40 | <_zenon_> | mmorrow, I'll also add a mental note to stop biting myself. |
| 21:03:45 | <Myoma> | dmead: Yeah it would be interesting to see a real example of a program written in a total way, do you know any examples ? |
| 21:03:56 | <dmead> | total way? |
| 21:03:58 | <mmorrow> | _zenon_: heh |
| 21:03:58 | <dmead> | what do you mean? |
| 21:04:02 | <b\\6> | you guys might want to check out my band 'iRREFUTABLE PATTERNS' latest album 'THE INTELLIGENCE OF THE ALLOCATOR' |
| 21:04:06 | <Myoma> | dmead: every function being total |
| 21:04:22 | <TomMD> | Myoma: By your definition does that mean we can't use type classes? |
| 21:04:23 | <dmead> | meaning what exactly? |
| 21:04:30 | <opqdonut> | b\6: heh |
| 21:04:30 | <dmead> | pattern matching can't fail? |
| 21:04:39 | <TomMD> | dmead: That would certainly be one result. |
| 21:04:44 | <Myoma> | dmead: I thought you'd know what total meant since you used the term ... |
| 21:04:58 | <dmead> | i did? |
| 21:04:59 | <mmorrow> | > ([x,y]->(x,y)) [0..] |
| 21:05:01 | <lambdabot> | mueval: Prelude.read: no parse |
| 21:05:10 | <TomMD> | Myoma: You are thinking of dmwit |
| 21:05:12 | <Myoma> | dmead: Oh you didn't you have a similar nick to dmwit |
| 21:05:17 | <dmead> | ah |
| 21:05:20 | <dmead> | yea that happens |
| 21:05:22 | <mmorrow> | ghci> (\[x,y]->(x,y)) [0..] |
| 21:05:22 | <mmorrow> | *** Exception: <interactive>:1:1-13: Non-exhaustive patterns in lambda |
| 21:05:35 | <mauke> | > (\[x,y]->(x,y)) [0..] |
| 21:05:38 | <lambdabot> | mueval: Prelude.read: no parse |
| 21:05:38 | <lambdabot> | mueval: *** Exception: /tmp/113032543589885... |
| 21:05:49 | <b\\6> | what can be done for closed-source apps to satisfy the lgpl thing about providing a way to link to other versions of the library? i'm talking about stuff like sdl and openal. |
| 21:06:04 | <dmwit> | Myoma: I try to write all my programs with only total functions. |
| 21:06:05 | <TomMD> | b\6: Don't link in those libraries. |
| 21:06:32 | <dmwit> | Myoma: So do many other people. |
| 21:06:45 | <dmwit> | Myoma: xmonad, for example, is mechanically checked for totality using Catch. |
| 21:06:47 | <Myoma> | I can't recall any such .. |
| 21:06:49 | <TomMD> | b\6: Sorry, you said lgpl, hummm. IANAL, but I didn't think lgpl libs posed much of an issue, do they? |
| 21:06:50 | <dmwit> | (A very cool result!) |
| 21:07:08 | <Myoma> | do you always use structural recursion?? |
| 21:07:10 | <mauke> | b\6: provide object code |
| 21:07:44 | <TomMD> | dmwit, Myoma: To be fair, xmonad hasn't been checked using CATCH since version ~0.3 afaik. |
| 21:08:15 | <b\\6> | TomMD: think so. like this: http://www.libsdl.org/license-lgpl.php |
| 21:08:17 | <lambdabot> | Title: Simple DirectMedia Layer |
| 21:08:38 | <sjanssen> | dmwit, Myoma, TomMD: mostly because yhc sucks |
| 21:08:54 | <sjanssen> | though I don't think StackSet has really changed since then |
| 21:08:57 | <b\\6> | i guess maybe somehow it's ok as long as it's not static. |
| 21:09:09 | <TomMD> | sjanssen: Yes, I know. ndm was working on bringing catch to GHC - not sure where that is. |
| 21:09:49 | <TomMD> | b\6: If I were using Haskell for closed source apps I'd be concerned about GHCs use of gmp first and foremost. |
| 21:10:18 | <b\\6> | hmm, thanks for the info. reading. |
| 21:12:02 | <mmorrow> | b\6: who're you selling a closed source app to? |
| 21:12:31 | <b\\6> | mmorrow: nobody's selling anything for a while, if ever. i'm just wondering. |
| 21:12:32 | <TomMD> | mmorrow: Hint: the app is called "Windows Server 2010" ;-) |
| 21:12:37 | <b\\6> | damn it. |
| 21:12:48 | <b\\6> | don't release details of my proprietary project. |
| 21:12:50 | <mmorrow> | we got you! |
| 21:12:53 | <bos> | dcoutts: was getting about 1.5KB/sec out of hackage.haskell.org earlier, wondered if you knew who to prod. |
| 21:12:54 | <TomMD> | Sorry! |
| 21:13:05 | <mmorrow> | to the stake! |
| 21:13:17 | <mmorrow> | :) |
| 21:13:22 | <dcoutts> | bos: dons, who could ask their IT bod |
| 21:13:40 | <bos> | ok, thanks! |
| 21:13:55 | <TomMD> | bos: If you are on company time and money then this is just a good excuse to fly to Portland and do it yourself... |
| 21:14:04 | <TomMD> | Could be fun. |
| 21:14:22 | <bos> | TomMD: er, hardly. |
| 21:15:21 | <dmead> | is there a convenient way to find out where a pattern match fails? |
| 21:15:31 | <dmead> | if i have no idea what function failed |
| 21:15:58 | <Heffalump> | pattern match failure should come with a message saying where, in GHC |
| 21:15:59 | <Myoma> | line 108 |
| 21:16:06 | <Heffalump> | or do you mean what called the thing that went wrong? |
| 21:16:29 | <mmorrow> | mkt.hs:108:23-66: Irrefutable pattern failed |
| 21:16:35 | <mmorrow> | mkt.hs:108:23-66 |
| 21:17:02 | <mmorrow> | yeah, finding out what called it is a /bitch/ |
| 21:17:11 | <Heffalump> | the ghci debugger can sometimes help |
| 21:17:31 | <Cale> | Shouldn't the ghci debugger generally find it? |
| 21:18:20 | <mmorrow> | ACTION immediately begins rtfm |
| 21:18:21 | <dmead> | ah |
| 21:18:22 | <dmead> | hmm |
| 21:18:35 | <dmead> | yea i can see i don't cover a pattern there |
| 21:18:44 | <dmead> | but i'd think ghci would abe able to throw more info in said exception |
| 21:18:48 | <dmead> | java style, etc |
| 21:18:53 | <dmead> | with the backtrace and everything |
| 21:19:02 | <TomMD> | Use Debug.Trace if you want that. |
| 21:19:06 | <dmead> | ah |
| 21:19:23 | <mauke> | TomMD: how does that give you a backtrace? |
| 21:19:27 | <TomMD> | and ghci does have a debugger. |
| 21:20:03 | <nominolo> | dmead: ghci -fbreak-on-exception |
| 21:20:07 | <TomMD> | mauke: Yes, I spoke too soon, didn't I. dmead: GHC debugger is what you want - assuming it doesn't drive you mad. I like it, but some done. |
| 21:20:09 | <TomMD> | *don't. |
| 21:20:14 | <nominolo> | dmead: then :back |
| 21:20:32 | <nominolo> | though, a more integrated UI would be nice |
| 21:22:51 | <dmead> | so :set -fbreak-on-exception? |
| 21:22:57 | <dmead> | and then :back when it dies? |
| 21:23:04 | <dmead> | do i have to import debug.trace too? |
| 21:23:22 | <bos> | http://www.realworldhaskell.org/blog/2008/09/05/speaking-in-silicon-valley-next-week/ |
| 21:23:24 | <TomMD> | dmead: No, ignore my redherring... its a useful but separate tool. |
| 21:23:28 | <lambdabot> | Title: Real World Haskell » Blog Archive » Speaking in Silicon Valley next week, http://tinyurl.com/55tfx8 |
| 21:23:32 | <dmead> | ah |
| 21:23:32 | <dmead> | k |
| 21:23:41 | <mmorrow> | yeah, Debug.Trace doesn't |
| 21:23:48 | <mmorrow> | just tried |
| 21:24:47 | <mmorrow> | ACTION has the same problem as dmead with someone elses code |
| 21:24:55 | <dmead> | how do you continue when it breaks? |
| 21:25:01 | <dmead> | or show the stack etc |
| 21:25:02 | <dmead> | :S |
| 21:25:15 | <mmorrow> | http://www.haskell.org/ghc/dist/current/docs/users_guide/ghci-debugger.html |
| 21:25:17 | <lambdabot> | Title: 3.5.�The GHCi Debugger, http://tinyurl.com/2nxab2 |
| 21:25:24 | <dmead> | kewl |
| 21:25:35 | <TomMD> | dmead: do see that link, but in brief ":back" ":history" etc. |
| 21:25:46 | <TomMD> | oh, and ":help" ;-) |
| 21:26:30 | <dmead> | =] |
| 21:27:47 | <dmead> | cool |
| 21:27:54 | <dmead> | this is way easier than gcc |
| 21:30:34 | <cr8xor> | im looking into using haskell for some programs, what advantages does it have. can it use tcp protocls? |
| 21:30:46 | <mauke> | :-| |
| 21:31:14 | <mauke> | @faq can I hax the gibson? |
| 21:31:14 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 21:32:04 | <mwc> | cr8xor: look into Network |
| 21:32:06 | <TomMD> | Drat, the troll left. |
| 21:32:30 | <mwc> | actually, the only thing it doesn't have for networking is SCTP support... yet |
| 21:32:57 | <TomMD> | mwc: It is missing a lot in networking. So much that I considered writing a higher level "hsNetwork" library. |
| 21:33:06 | <olsner> | hmm, what in the world *does* has SCTP support? |
| 21:33:20 | <TomMD> | For a basic example - I don't think there is any "IPHeader" data structure with binary instances in Network.* |
| 21:33:28 | <mwc> | olsner: linux, freebsd ;) |
| 21:33:46 | <mmorrow> | someone came here a few weeks ago and asked an almost identical question as cr8xor. i thought he was a troll at first but he was serious. |
| 21:33:52 | <mwc> | heh |
| 21:33:59 | <olsner> | mwc: so, if you're building unix-only software that only has to speak to other unixen, you can actually use sctp? :P |
| 21:34:10 | <TomMD> | mmorrow: I was typing out a response saying as much when he left. |
| 21:34:10 | <mwc> | olsner: sure, or dedicated in house stuff |
| 21:34:17 | <mmorrow> | heh |
| 21:34:17 | <mauke> | "why so serious?" |
| 21:34:47 | <mwc> | oughta be the new troll greeting |
| 21:35:00 | <mwc> | anybody want to photoshop the joker's scar into a lambda? |
| 21:35:10 | <Heffalump> | what does import "packagename" Foo in the sources of base3-compat mean? |
| 21:35:32 | <TomMD> | I thought we could just have lambdabot do statistical recognition on peoples first questions - if it rates 'troll' then we have our lambdabot-net DOS them. |
| 21:35:34 | <mmorrow> | Heffalump: oh, i was a comment in darcs changes in ghc about that |
| 21:35:42 | <mmorrow> | one sec |
| 21:36:04 | <Heffalump> | ok, I'll have a look for that then |
| 21:36:18 | <Heffalump> | ah, -XPackageImports |
| 21:36:21 | <mmorrow> | exactly |
| 21:36:42 | <Heffalump> | when I first saw it in Data.Unique I wondered if <- had been implemented on the sly :-) |
| 21:36:55 | <mmorrow> | haha |
| 21:37:01 | <ddarius> | TomMD: That would be the wrong thing to do. |
| 21:37:17 | <mwc> | Anybody have haskell badges, a la vim, xhtml, etc? |
| 21:37:39 | <TomMD> | ddarius: Its not that I don't understand that, its that I don't know what the Right Thing (TM) is. |
| 21:37:58 | <mwc> | TomMD: we could sent SPJ to their house with a neuralyzer |
| 21:38:51 | <olsner> | if every troll got a house visit by someone explaining the errors of their ways, I think most would be too scared to troll #haskell ever again :D |
| 21:39:41 | <mwc> | Right, I'll build an android combat chassis for lambdabot then, right after I finish the replicant body for @vixen |
| 21:39:55 | <mmorrow> | botwars! |
| 21:40:22 | <mmorrow> | p |
| 21:40:57 | <olsner> | hmm, wouldn't that give lambdabot two bodies? isn't that a bit schizo? |
| 21:41:13 | <olsner> | @vixen how many are there of you? |
| 21:41:14 | <lambdabot> | let's just say a few |
| 21:41:37 | <Heffalump> | where does the most recent version of hs-plugins live? http://www.cse.unsw.edu.au/~dons/hs-plugins/ ? |
| 21:41:39 | <lambdabot> | Title: hs-pluginsDynamically Loaded Haskell Modules |
| 21:42:50 | <mmorrow> | Heffalump: http://code.haskell.org/~dons/code/hs-plugins/ |
| 21:42:51 | <lambdabot> | Title: Index of /~dons/code/hs-plugins |
| 21:43:12 | <mmorrow> | (i think that's the most recent. where i get from at least.) |
| 21:43:29 | <Heffalump> | oh, I looked on code.haskell.org, but not in ~dons :-) |
| 21:43:43 | <Heffalump> | thanks. |
| 21:44:36 | <mmorrow> | it's kinda hidden too, the if you goto c.h.o/~dons then click hs-plugins/ it takes you to the old page |
| 21:45:34 | <mwc> | Galois conspiracy? |
| 21:45:43 | <mmorrow> | i'd bet my bottom dollar |
| 21:46:18 | <Myoma> | > fix ($) |
| 21:46:20 | <lambdabot> | Overlapping instances for Show (a -> b) |
| 21:46:21 | <lambdabot> | arising from a use of `s... |
| 21:46:28 | <mmorrow> | ah, the link here is the correct one: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins |
| 21:46:35 | <lambdabot> | Title: HackageDB: plugins-1.3, http://tinyurl.com/5mbt3u |
| 21:47:13 | <mmorrow> | Heffalump: whoa, looks like the one on hackage is newer than that darcs repo |
| 21:47:42 | <Heffalump> | lol |
| 21:48:29 | <bos> | @type fix ($) |
| 21:48:31 | <lambdabot> | forall a b. a -> b |
| 21:48:35 | <bos> | @type mfix ($) |
| 21:48:37 | <lambdabot> | Occurs check: cannot construct the infinite type: b = a -> b |
| 21:48:37 | <lambdabot> | Probable cause: `$' is applied to too many arguments |
| 21:48:37 | <lambdabot> | In the first argument of `mfix', namely `($)' |
| 21:51:06 | <Myoma> | has anyone read Type Theory should eat itself |
| 21:51:25 | <hackage> | Uploaded to hackage: xmonad-contrib 0.8 |
| 21:51:25 | <hackage> | Uploaded to hackage: xmonad 0.8 |
| 21:53:19 | <skorpan> | hm awesome |
| 21:53:39 | <mmorrow> | Myoma: no, but if it's about what i think it might be i definitely want to |
| 21:53:50 | <mmorrow> | Myoma: link? |
| 21:54:01 | <Myoma> | http://www.cs.nott.ac.uk/~jmc/Publications_files/lfmtp08_jmc.pdf |
| 21:54:04 | <lambdabot> | Title: Type Theory should eat itself |
| 21:54:12 | <mmorrow> | Myoma: thx |
| 21:54:56 | <mmorrow> | Myoma: exccccellent, just as i suspected |
| 21:56:00 | <Baughn> | "Checker for type theory in type theory" <-- Incompleteness theorem doesn't get in the way? |
| 21:56:31 | <mwc> | perhaps not completely |
| 21:56:32 | <Myoma> | Baughn, that's what I am confused abuot |
| 21:56:52 | <Myoma> | the Agda code is online I will look at it later |
| 21:57:02 | <Baughn> | I'll have to read the paper, then. This should be good. |
| 21:57:59 | <Heffalump> | is darcs.haskell.org throwing a wobbly again? |
| 21:58:09 | <bos> | all of hackell.org is sucking |
| 21:58:30 | <Heffalump> | grmph |
| 22:03:31 | <Feuerbach> | which Haskell compilers are capable of producing code for old systems? |
| 22:04:05 | <Feuerbach> | like Linux 2.4.32 |
| 22:04:21 | <ddarius> | All of them? |
| 22:04:58 | <Feuerbach> | with ghc I get "FATAL: kernel too old" followed by segfault |
| 22:05:15 | <Feuerbach> | it fails to access /dev/tty |
| 22:05:35 | <roconnor> | @check join . (uncurry (++)) === (uncurry (++)) . fmap join |
| 22:05:37 | <lambdabot> | precedence parsing error |
| 22:05:37 | <lambdabot> | cannot mix `(.)' [infixr 9] and `(===... |
| 22:05:45 | <Feuerbach> | or maybe not, dunno |
| 22:06:00 | <roconnor> | @check \x -> ((join . (uncurry (++))) x) == (((uncurry (++)) . fmap join) x) |
| 22:06:02 | <lambdabot> | Occurs check: cannot construct the infinite type: a = [a] |
| 22:06:02 | <lambdabot> | Expect... |
| 22:06:24 | <roconnor> | @type join . (uncurry (++)) |
| 22:06:26 | <Feuerbach> | execve("./helloworld", ["./helloworld"], [/* 20 vars */]) = 0 |
| 22:06:26 | <Feuerbach> | uname({sys="Linux", node="riptide", ...}) = 0 |
| 22:06:26 | <Feuerbach> | open("/dev/tty", O_RDWR|O_NONBLOCK|O_NOCTTY) = 3 |
| 22:06:26 | <Feuerbach> | writev(3, [{"FATAL: kernel too old\n", 22}], 1FATAL: kernel too old |
| 22:06:26 | <lambdabot> | forall a. ([[a]], [[a]]) -> [a] |
| 22:06:43 | <roconnor> | @type (uncurry (++)) . fmap join |
| 22:06:45 | <lambdabot> | forall a. ([a], [[a]]) -> [a] |
| 22:07:09 | <roconnor> | ah, wrong fmap |
| 22:07:40 | <roconnor> | @type (uncurry (++)) . (\f (a,b) -> (f a, f b)) join |
| 22:07:42 | <lambdabot> | forall a. ([[a]], [[a]]) -> [a] |
| 22:07:59 | <roconnor> | @check \x -> ((join . (uncurry (++))) x) == (((uncurry (++)) .(\f (a,b) -> (f a, f b)) join) x) |
| 22:08:03 | <lambdabot> | mueval: Time limit exceeded |
| 22:08:30 | <roconnor> | lambdabot: oh come on, at least tell me how many tests succeeded :P |
| 22:08:34 | <mmorrow> | Feuerbach: which ghc is that with? |
| 22:08:59 | <Feuerbach> | mmorrow: 6.8.2 (but compiled on another machine and linked statically) |
| 22:09:25 | <mmorrow> | hmm, that might be the problem |
| 22:09:38 | <Feuerbach> | how? and how can I solve it? |
| 22:09:50 | <mmorrow> | maybe try building from src yourself? |
| 22:10:35 | <Feuerbach> | mmorrow: that's a simple helloworld program. I have no hopes to build whole GHC there. |
| 22:10:48 | <mmorrow> | ahh, so you have to bootstrap. |
| 22:11:15 | <ddarius> | Feuerbach: You'd need to use an old GHC to build a newer one on the machine. |
| 22:11:16 | <mmorrow> | i had this problem. i managed to get a ghc6.4, then built 6.8.3 with it (took a /long/ time :)) |
| 22:11:29 | <dancor> | how do you sleep in python |
| 22:11:40 | <bos> | you ask on #python |
| 22:11:46 | <dancor> | err haskell |
| 22:11:59 | <dancor> | ACTION wakes up |
| 22:12:05 | <Feuerbach> | ddarius, mmorrow: building GHC there is not an option, anyway. I need just working statically linked binary |
| 22:12:24 | <bos> | @hoogle delay |
| 22:12:25 | <lambdabot> | Control.Concurrent threadDelay :: Int -> IO () |
| 22:12:48 | <mmorrow> | Feuerbach: hmm, i guess you'll have to find one what was built on a machine whose kernel is similar to the one you're dealing with then (or something like that) |
| 22:12:59 | <ddarius> | Install 2.4.32 on a different machine and build GHC there and the program you want and copy. |
| 22:14:00 | <dons> | ?users |
| 22:14:01 | <lambdabot> | Maximum users seen in #haskell: 497, currently: 472 (95.0%), active: 23 (4.9%) |
| 22:14:06 | <ddarius> | You can try not linking statically |
| 22:14:18 | <Feuerbach> | related question: can I disable pthread in produced binary? I'm sure it won't work there with pthread |
| 22:15:36 | <Feuerbach> | ddarius: at least I'd like to link statically against libgmp. Is it possible? |
| 22:15:47 | <dons> | yeah |
| 22:15:51 | <dons> | optl-static |
| 22:16:15 | <Feuerbach> | but ddarius suggesting that I don't link statically against core libs (libc?) |
| 22:17:52 | <mmorrow> | Feuerbach: if i were you (i'm only speaking for myself) would find /some/ way to get /any/ ghc >= 6.4 on that machine, then build 6.8 with it |
| 22:18:43 | <ddarius> | Feuerbach: Worst case scenario you can perform the link yourself. |
| 22:18:44 | <mmorrow> | because it seems like it'd just be a continual pain in the ass to deal with moving binaries trying to get binaries you built on another machine working there |
| 22:19:01 | <mmorrow> | s/moving binaries// |
| 22:19:25 | <Feuerbach> | ddarius: how do I do that? |
| 22:20:00 | <Feuerbach> | ld? |
| 22:20:01 | <ddarius> | Another possibility would be to try to statically link the libc and co. from the target machine into the binary on the build machine. |
| 22:20:02 | <mmorrow> | ghc -c + ghc -optl-l... -optl-l... |
| 22:20:10 | <rwbarton> | My program uses a particular RWS monad (e.g., RWS Integer String Double). Is it a good idea to create a newtype for it, or is that silly? |
| 22:20:18 | <rwbarton> | (should I just use a type synonym) |
| 22:20:27 | <Myoma> | I would just use type |
| 22:20:51 | <ddarius> | rwbarton: Oftentimes you end up adding more things later, so newtyping isn't a bad idea. |
| 22:21:35 | <Feuerbach> | ok, what about disabling pthreads? |
| 22:21:52 | <mmorrow> | i have no idea about that one :) |
| 22:22:10 | <mmorrow> | probably ask in #ghc |
| 22:22:17 | <Feuerbach> | ok |
| 22:22:33 | <mauke> | rwbarton: I newtype monads all the time |
| 22:22:48 | <mauke> | also, (newtype deriving)++ |
| 22:23:00 | <rwbarton> | mauke: Yeah, but it's still several lines of newtype deriving :) |
| 22:23:11 | <mauke> | how so? |
| 22:23:31 | <cads> | is it really possible to make emacs display haskell using tex style math symbols for stuff like the lambda, arrow and composition operators? |
| 22:23:53 | <mauke> | ... deriving (Functor, Monad, MonadReader Integer, MonadWriter String, MonadState Double) |
| 22:23:58 | <mauke> | or am I missing something? |
| 22:24:23 | <Baughn> | cads: Yes, sure, easily |
| 22:24:36 | <rwbarton> | ok, several lines was a small exaggeration. |
| 22:24:51 | <Baughn> | cads: M-x customize-group haskell |
| 22:25:42 | <roconnor> | I newtype Monads all the time, ususally because I want to create a new set of "primitives" for my new monad, and hide the general state, environment, etc. operations. |
| 22:26:36 | <Myoma> | roconnor: huh. I do the same, but I don't newtype |
| 22:26:50 | <mauke> | then the general operations aren't exactly hidden |
| 22:43:29 | <dons> | http://www.reddit.com/r/programming/comments/6zx8t/exponentials_of_containers/ |
| 22:43:32 | <lambdabot> | Title: Exponentials of containers : programming, http://tinyurl.com/5hwaxu |
| 22:43:51 | <ddarius> | dons: Why on reddit? |
| 22:43:56 | <dons> | why not? |
| 22:44:06 | <dons> | reddit's boring otherwise. |
| 22:44:39 | <dons> | ACTION doesn't want to hear endless chrome stories, or how to use jquery. |
| 22:44:43 | <Cale> | Yeah. If it wasn't for the occasional good post from dons or a few others, I wouldn't even look at the programming reddit anymore. |
| 22:44:44 | <ddarius> | My, admittedly very underinformed, opinion is that most redditors will not find that particularly interesting. |
| 22:44:58 | <skorpan> | at least it's not as painfully boring as slashdot |
| 22:45:11 | <ddarius> | skorpan: You read slashdot? |
| 22:45:18 | <Cale> | The programming reddit is about to die from overexposure :) |
| 22:45:18 | <dons> | bos, nice talk coming up by the sound of it. |
| 22:45:29 | <skorpan> | ddarius: absolutely not |
| 22:45:29 | <dons> | Cale, yeah, its getting kinda saturated. |
| 22:45:51 | <dons> | stories that a year ago would be very exciting get a lot of downmods (gpugen :( |
| 22:45:55 | <dons> | ah well |
| 22:46:07 | <bos> | dons: yeah, hope so. |
| 22:46:18 | <bos> | reddit is both boring and broken. |
| 22:46:26 | <Cale> | hmm, that guy uses strange notation... |
| 22:46:43 | <Myoma> | that is Thorsten! |
| 22:46:50 | <dons> | i wonder what a perfect news site would be like. |
| 22:46:53 | <Myoma> | I read lots of his papers ... |
| 22:47:05 | <dons> | commentary, community, quality, focus. |
| 22:47:15 | <dons> | and regular updates. |
| 22:47:32 | <bos> | and less of the swarming-horde-of-fandom nature. |
| 22:47:52 | <dons> | Cale, there's something like 48k subscribers now |
| 22:47:58 | <dons> | compared to maybe 1-2k when we started using it. |
| 22:48:05 | <dons> | seems to have jumped a lot this year. |
| 22:48:20 | <ddarius> | All that Haskell press pulled people in. |
| 22:48:21 | <dons> | the days of it being a bastion of FP .pdfs is long gone |
| 22:48:51 | <dons> | a .ps.gz made the top of reddit a year or two ago. no chance now. |
| 22:49:09 | <ddarius> | Which ps.gz? |
| 22:49:25 | <Cale> | Hehe, it would be neat to have a forum where to become a member, you are asked to prove some random easy theorem from category theory :) |
| 22:49:33 | <dons> | i think it might have been one of gibbon's papers. |
| 22:49:39 | <dons> | or possibly okasaki |
| 22:50:14 | <ddarius> | Perhaps you should make an fppdf reddit. |
| 22:50:17 | <dmhouse> | I quite like Haskell at the moment because of that. The language is just hard enough and just non-mainstream enough so that the only people who try it out are actually interested in programming. |
| 22:50:31 | <ddarius> | Or to not be overly specific, cspapers |
| 22:50:37 | <dmhouse> | No-one gets forced to learn Haskell for their job. This increases the quality of discussion dramatically. |
| 22:50:47 | <dons> | dmhouse: some people do. |
| 22:50:48 | <Cale> | We could start using the Haskell reddit more. |
| 22:51:02 | <Baughn> | dmhouse: I have, recently, forced someone to learn haskell |
| 22:51:17 | <ddarius> | dmhouse: This place is going downhill. |
| 22:51:20 | <Cale> | Baughn: oh? |
| 22:51:30 | <Myoma> | ddarius, lol |
| 22:51:34 | <dons> | ddarius: you could hang out with smerdy in #ocaml :) |
| 22:51:47 | <Baughn> | Cale: My cryptography teacher. That, or he's just marking them "working" without checking; I'm the only programmer in that class. ^^; |
| 22:51:54 | <ddarius> | Ugh. I can't stand O'Caml. |
| 22:52:05 | <dmhouse> | dons: where do these people work? |
| 22:52:05 | <Myoma> | ocaml is awesome |
| 22:52:17 | <jeffwheeler> | I got into functional programming with OCaml. |
| 22:52:23 | <dmhouse> | dons: I'm willing to bet it's a company that hires people that are actually interested in programming |
| 22:52:25 | <jeffwheeler> | I found it as a good way to learn some of it. |
| 22:52:34 | <dons> | ah, yes, <Smerdyakov> Really, good language design discourages random questions. Even if everyone knew about OCaml, its channel would have comparatively few questions |
| 22:52:38 | <roconnor> | I didn't understand any of that notation for exponentials of containers |
| 22:52:57 | <Cale> | It seems like the only one posting to the Haskell reddit at the moment is that stupid gst bot. |
| 22:53:02 | <ddarius> | dons: But seriously, if this channel did go downhill enough, I'd simply leave. |
| 22:53:05 | <Myoma> | dons: is this a better subject for #hasell-blah ? |
| 22:53:14 | <dons> | ddarius: yeah, we don'twan that to happen. |
| 22:53:23 | <dons> | so keep discussing hard things. |
| 22:53:34 | <dons> | i mean, we've made it to 500 users |
| 22:53:40 | <newsham> | is there a simple description of the algorithm for unifying two paramterized types in H-M? |
| 22:53:45 | <newsham> | somewhere online |
| 22:53:55 | <dons> | how much bigger does it get before things fall over? |
| 22:54:06 | <ddarius> | newsham: Isn't it just unification? |
| 22:54:07 | <Myoma> | newsham: I have code if you want |
| 22:54:09 | <dmhouse> | Cale: is gst a bot? Whose? |
| 22:54:14 | <Cale> | dmhouse: I don't know. |
| 22:54:19 | <Myoma> | oh 'parametrized' types ? |
| 22:54:21 | <Cale> | But it very much seems like a bot. |
| 22:54:22 | <dmhouse> | Cale: he appears to have left a comment |
| 22:54:27 | <newsham> | ddarius: *shrug* pretend i dont know anything about type unification. |
| 22:54:37 | <Cale> | hmm |
| 22:54:38 | <newsham> | myoma: sure. email newsham at lava.net? |
| 22:54:42 | <dmhouse> | Cale: that doesn't rule out bot-ness, of course. |
| 22:55:05 | <patchwork> | I would switch over to the haskell subreddit, but it doesn't seem to be updated very often |
| 22:55:08 | <dons> | i think he's a person + rss + submit scripts |
| 22:55:13 | <Myoma> | newsham: it is just first order unification for types, I don't know if that is what you were referring to, is it? |
| 22:55:19 | <newsham> | i need to write something that takes two parameterized types and spits out a list of constraints if they can be unified |
| 22:55:20 | <dons> | patchwork: also, we don't want to live in a ghetto |
| 22:55:31 | <dons> | we should be part of the mainstream language discussion |
| 22:55:45 | <patchwork> | It does make sense though that as the community grows, it would fragment along interest lines |
| 22:55:46 | <Myoma> | What does this 'parameterized types' mean? |
| 22:55:56 | <patchwork> | That is one way to keep focus |
| 22:56:00 | <dons> | yep |
| 22:56:05 | <Myoma> | We should have less slagging off of people in #haskell :/ |
| 22:56:05 | <ddarius> | newsham: That would just be the normal unification algorithm unless, as Myoma is suggesting, you mean something unusual by "parameterized" |
| 22:56:36 | <newsham> | (Foo a (X b a)) vs. (Foo Int (X c c)) for example |
| 22:57:03 | <Myoma> | oh and you want a = Int, b = Int, c = Int ? |
| 22:57:04 | <ddarius> | @google "unification algorithm" |
| 22:57:07 | <lambdabot> | http://www.geocities.com/Paris/6502/unif.html |
| 22:57:07 | <lambdabot> | Title: An efficient linear unification algorithm |
| 22:57:09 | <newsham> | should return affirmative with the constrant that a,b=Int on lhs and c=Int on rhs |
| 22:57:21 | <ddarius> | Actually, read Shriram's PLAI |
| 22:57:27 | <Myoma> | newsham, maybe useful http://rascal-haskell.googlecode.com/svn/trunk/Infer.hs |
| 22:57:55 | <ddarius> | newsham: http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/ |
| 22:57:59 | <lambdabot> | Title: Programming Languages: Application and Interpretation by Shriram Krishnamurthi, http://tinyurl.com/2bhkwx |
| 22:58:07 | <newsham> | danke both of you. |
| 22:58:24 | <ddarius> | newsham: That's an enjoyable hands-on approach to implementation including type checking. |
| 22:58:59 | <newsham> | (need to write type checker to implement GUI for pluggable components... *sigh*) |
| 22:59:39 | <Myoma> | newsham: (There is also Typecheck.hs in there) |
| 23:00:03 | <newsham> | does your code have unicode in it? |
| 23:00:09 | <Myoma> | of course! |
| 23:00:27 | <newsham> | browser is showing it as ascii |
| 23:01:04 | <Myoma> | set encoding to UTF-8 |
| 23:01:05 | <newsham> | i didnt know ghc supported unicode in srcs |
| 23:01:23 | <mauke> | View>Character Encoding>UTF-8 |
| 23:01:34 | <mauke> | and it's showing it as Latin-1 |
| 23:01:39 | <Myoma> | yes it is nice to write x ≡ y nather than unify x y |
| 23:01:40 | <newsham> | not using IE. set your web server to return utf8 mime type! ;-) |
| 23:01:54 | <Myoma> | ACTION doesn't actually own google :p |
| 23:02:43 | <ddarius> | Myoma: That is not very enterprising of you. |
| 23:25:02 | <mapreduce> | :t (:) |
| 23:25:04 | <lambdabot> | forall a. a -> [a] -> [a] |
| 23:26:11 | <roconnor> | @type local |
| 23:26:13 | <lambdabot> | forall r (m :: * -> *) a. (MonadReader r m) => (r -> r) -> m a -> m a |
| 23:33:02 | <mapreduce> | @hoogle Boolean -> a -> Maybe a |
| 23:33:03 | <lambdabot> | Warning: Unknown type Boolean |
| 23:33:03 | <lambdabot> | Prelude asTypeOf :: a -> a -> a |
| 23:33:03 | <lambdabot> | Control.Parallel par :: a -> b -> b |
| 23:33:27 | <mauke> | @hoogle Bool -> a -> Maybe a |
| 23:33:27 | <Myoma> | @let bool true false True = true ; bool true false False = false |
| 23:33:27 | <lambdabot> | Control.Exception assert :: Bool -> a -> a |
| 23:33:28 | <lambdabot> | Prelude asTypeOf :: a -> a -> a |
| 23:33:28 | <lambdabot> | Control.Parallel.Strategies sforce :: NFData a => a -> b -> b |
| 23:33:29 | <lambdabot> | Defined. |
| 23:33:39 | <Myoma> | :t bool Just (const Nothing) |
| 23:33:40 | <lambdabot> | forall a. Bool -> a -> Maybe a |
| 23:33:54 | <dmwit> | :t \p x -> guard (p x) >> return x |
| 23:33:54 | <mauke> | congratulations, you've just reinvented 'if' |
| 23:33:54 | <lambdabot> | dmwit: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 23:33:55 | <lambdabot> | forall (m :: * -> *) b. (MonadPlus m) => (b -> Bool) -> b -> m b |
| 23:34:03 | <Myoma> | if sucks |
| 23:34:07 | <mauke> | @djinn Bool -> a -> Maybe a |
| 23:34:07 | <mapreduce> | > bool True 5 |
| 23:34:08 | <lambdabot> | f a b = |
| 23:34:08 | <lambdabot> | case a of |
| 23:34:08 | <lambdabot> | False -> Nothing |
| 23:34:08 | <lambdabot> | True -> Just b |
| 23:34:10 | <lambdabot> | Overlapping instances for Show (Bool -> Bool) |
| 23:34:10 | <lambdabot> | arising from a use... |
| 23:34:29 | <EvilTerran> | if should desugar to a prelude function so us -XNoImplicitPrelude folks could tinker with it |
| 23:34:33 | <dmwit> | ?clear-messages |
| 23:34:33 | <lambdabot> | Messages cleared. |
| 23:34:42 | <mapreduce> | :t bool True 5 |
| 23:34:44 | <lambdabot> | No instance for (Num Bool) |
| 23:34:45 | <lambdabot> | arising from the literal `5' at <interactive>:1:10 |
| 23:34:45 | <lambdabot> | Possible fix: add an instance declaration for (Num Bool) |
| 23:35:28 | <mapreduce> | @let bmap b a => if (b) then Just a else Nothing |
| 23:35:29 | <lambdabot> | Parse error |
| 23:35:40 | <mapreduce> | @let bmap b a = if (b) then Just a else Nothing |
| 23:35:41 | <lambdabot> | Defined. |
| 23:35:44 | <mapreduce> | too many languages error |
| 23:35:49 | <Myoma> | 'bmap' :S ? |
| 23:35:50 | <mapreduce> | > bmap True 5 |
| 23:35:53 | <lambdabot> | Just 5 |
| 23:36:05 | <dmwit> | ?let bmap' b a = return a <* guard b |
| 23:36:06 | <lambdabot> | Defined. |
| 23:36:09 | <dmwit> | :t bmap' |
| 23:36:11 | <lambdabot> | forall a (f :: * -> *). (MonadPlus f, Applicative f) => Bool -> a -> f a |
| 23:36:42 | <Myoma> | > (bool Just (const Nothing)) True () |
| 23:36:44 | <Myoma> | > (bool Just (const Nothing)) False () |
| 23:36:46 | <lambdabot> | Just () |
| 23:36:46 | <lambdabot> | Terminated |
| 23:37:04 | <EvilTerran> | ?type let bmap b a = guardA b *> pure a |
| 23:37:05 | <lambdabot> | <no location info>: |
| 23:37:05 | <lambdabot> | not an expression: `let bmap b a = guardA b *> pure a' |
| 23:37:07 | <EvilTerran> | ?type let bmap b a = guardA b *> pure a in bmap |
| 23:37:08 | <lambdabot> | Not in scope: `guardA' |
| 23:37:21 | <EvilTerran> | bah |
| 23:37:48 | <EvilTerran> | ?type \p x -> if p then pure x else empty |
| 23:37:49 | <lambdabot> | forall a (f :: * -> *). (Alternative f) => Bool -> a -> f a |
| 23:38:11 | <dmwit> | if sucks ;-) |
| 23:38:13 | <Myoma> | :t bool return (const mzero) |
| 23:38:15 | <lambdabot> | forall (m :: * -> *) a. (MonadPlus m) => Bool -> a -> m a |
| 23:39:18 | <dmwit> | Myoma: You keep defining it with the arguments backwards; it's confusing me to no end. =P |
| 23:39:54 | <Myoma> | backwards with respect toa |
| 23:39:55 | <Myoma> | ? |
| 23:40:02 | <dmwit> | ?src Bool |
| 23:40:03 | <lambdabot> | data Bool = False | True deriving (Eq, Ord) |
| 23:40:18 | <dmwit> | False first, then True |
| 23:40:30 | <bd_> | , Show, Read, Enum, Bounded... |
| 23:42:57 | <mapreduce> | @instances Monad |
| 23:42:59 | <lambdabot> | ((->) r), ArrowMonad a, Cont r, ContT r m, Either e, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, [] |
| 23:51:33 | <mauke> | grr. why is TypeRep not an instance of Ord? |
| 23:52:09 | <ddarius> | What's the ordering? |
| 23:52:18 | <mauke> | I don't care |
| 23:52:30 | <Myoma> | axiom of choice |
| 23:53:15 | <mauke> | it's all Ints and Strings internally |
| 23:54:18 | <ddarius> | You can write your own Ord instance. |
| 23:54:24 | <TomMD> | mauke: Similar complaint about Errno. |
| 23:54:46 | <TomMD> | Things should always be an instance of Ord so long as they can be. |
| 23:55:16 | <mauke> | ddarius: how? |
| 23:55:41 | <mauke> | well, I could use unsafePerformIO |
| 23:55:57 | <ddarius> | instance Ord TypeRep where compare = comparing show |
| 23:56:11 | <mauke> | heh. hax! |
| 23:58:03 | <mauke> | instance Ord TypeRep where compare = comparing (unsafePerformIO . typeRepKey) |
Back to channel and daily index: content-negotiated html turtle