Available formats: content-negotiated html turtle (see SIOC for the vocabulary)
Back to channel and daily index: content-negotiated html turtle
These logs are provided as an experiment in indexing discussions using IRCHub.py, Irc2RDF.hs, and SIOC.
| 00:00:28 | <ksf> | ...you can do fun stuff like serialising a list of records sparsely, non-saved records either defaulting to some value given in the dtd or the previously serialised element of the same id. |
| 00:01:54 | <edwardk> | the term that scares me here is DTD ;) |
| 00:02:23 | <edwardk> | i really would like an extensible markup where the 'DTD' format could be used recursively i.e. if you have docs of docs |
| 00:02:33 | <ksf> | it's not as bad as it sounds. given an adt, it could be auto-generated, modulo advanced features. |
| 00:02:55 | <ksf> | I was thinking of includes |
| 00:03:10 | <copumpkin> | composable document formats? :o |
| 00:03:26 | <ksf> | ebml kinda does it right now, importing the general ebml header, that could easily be generalised. |
| 00:03:42 | <edwardk> | copumpkin: yes, start by making the empty document valid and removing the special start node so its a monoid ;) |
| 00:03:58 | <copumpkin> | lol, I feel more stuff floating into your monoids package :P |
| 00:04:28 | <edwardk> | thats why i'm consciously trying to keep the parsimony stuff as a separate package ;) |
| 00:05:00 | <ksf> | `mpose` ... |
| 00:05:36 | <ksf> | class MonadPose a where |
| 00:06:01 | <ksf> | class MonadCoPose where |
| 00:06:09 | <ksf> | wth is coposing? |
| 00:06:36 | <copumpkin> | well, pumpkin is a poser, so I guess coposing is what I do |
| 00:06:48 | <mmorrow> | edwardk: what do you think about (or your thoughts/whatnot) on this code that allows you to (in one way or another) create a C closure which looks like a C function pointer once it's "fully applied" http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2343#a2343 ? |
| 00:07:11 | <SamB> | copumpkin: if you were compumkin, would you be a composer? |
| 00:07:27 | <copumpkin> | probably |
| 00:07:42 | <zcvvc> | 'cabal: cannot configure base-4.0.0.0. It requires ghc-prim -any and integer-any'. I've got ghc 6.8.2, is newer required? |
| 00:07:55 | <copumpkin> | yup |
| 00:08:01 | <mmorrow> | so i want to use a variation on that to allow closures in my interp to be viewed from C as function ptrs |
| 00:08:07 | <sjanssen> | zcvvc: you should not attempt to upgrade base |
| 00:08:26 | <edwardk> | mmorrow: ah i've built something like that before |
| 00:08:27 | <mmorrow> | edwardk: (that's roughly following the description from an smlnj paper) |
| 00:08:30 | <copumpkin> | we need some keyboard cats in the haskell world |
| 00:08:35 | <copumpkin> | lolcats are so last year |
| 00:08:53 | <mmorrow> | edwardk: is there anything immediately apparent that you'd do differently ? |
| 00:08:58 | <edwardk> | oh this one accumulates its own args imperatively |
| 00:09:00 | <edwardk> | neat |
| 00:09:05 | <mmorrow> | yeah, exactly |
| 00:09:37 | <ksf> | mmmmmmhhh... the hairy thing with composing ebml dtds is id overlap. "114d9b74" is matroska's tag for Seek information, and bytes are going to hit the fan if your dtd allows your version to be a child of the same id as matroska does. |
| 00:09:44 | <copumpkin> | mmorrow: that's pretty neat :) |
| 00:09:46 | <mmorrow> | well, some other code has to set them.. i want to make a variant that <i'm-not-sure-yet-what-exactly> |
| 00:09:50 | <edwardk> | well, use it and abuse it and i'm sure you'll come upw ith something |
| 00:09:53 | <mmorrow> | copumpkin: :) |
| 00:09:58 | <Cale> | http://www.reuters.com/article/lifestyleMolt/idUSTRE5444XQ20090505 -- this seems like it should be an onion article, but it's not :) |
| 00:10:08 | <copumpkin> | lol |
| 00:10:09 | <mmorrow> | edwardk: cool |
| 00:11:28 | <ksf> | otoh, something like 2^49 possible id's with identity possibly resolved by (optional) structure is still a hell a lot. |
| 00:11:32 | <edwardk> | mmorrow: added StateT to monad-ran, just Cont, ContT, RWS and RWST to go |
| 00:11:45 | <edwardk> | oh and i think WriterT |
| 00:11:45 | <mmorrow> | edwardk: woot |
| 00:11:59 | <edwardk> | oh and probably several hundred {-# INLINE #-} pragmasa |
| 00:12:14 | <mmorrow> | @unmtl RWST r w s (Cont o) a |
| 00:12:15 | <lambdabot> | r -> s -> (a -> s -> w -> o) -> o |
| 00:12:21 | <mmorrow> | heh |
| 00:12:25 | <copumpkin> | @src Reader |
| 00:12:26 | <lambdabot> | Source not found. Are you on drugs? |
| 00:12:58 | <mmorrow> | @unmtl RWST r w s (ContT o (StateT ss (Cont oo)) a |
| 00:12:58 | <lambdabot> | err: Parse error |
| 00:13:01 | <mmorrow> | @unmtl RWST r w s (ContT o (StateT ss (Cont oo))) a |
| 00:13:02 | <lambdabot> | r -> s -> (a -> s -> w -> ss -> (o -> ss -> oo) -> oo) -> ss -> (o -> ss -> oo) -> oo |
| 00:13:05 | <mmorrow> | hehe |
| 00:13:15 | <copumpkin> | mmorrow: so how much space does each closure take up? and could you make it variable-length to allow for fewer/more args? |
| 00:13:23 | <edwardk> | i have the instances defined for RWS, etc. just writing the liftRan, lowerRan, etc. |
| 00:13:37 | <copumpkin> | mmorrow: what do you do about W^X and similar stuff? |
| 00:14:12 | <mmorrow> | copumpkin: yeah, with that code you can just write (c_beg-c_end)-(6-numargs) to wherever |
| 00:14:24 | <copumpkin> | ah, yeah |
| 00:14:30 | <mmorrow> | copumpkin: what's W^X? |
| 00:14:42 | <edwardk> | here's a question. if i generate a value of the form forall o. (Int# -> Int# -> o) -> o -- i wonder how could i trick the compiler to unbox those ints in the closure? |
| 00:14:58 | <SamB> | ACTION wonders why emacs doesn't issue more emacs-friendly parse errors |
| 00:15:13 | <copumpkin> | mmorrow: preventing writable memory from being executable... you'd need lots of mprotects :) |
| 00:15:13 | <mmorrow> | edwardk: which closure? |
| 00:15:33 | <mmorrow> | copumpkin: ahhh, yeah i'm mmapping with PROT_EXEC |
| 00:15:34 | <edwardk> | the closure for that function |
| 00:15:37 | <copumpkin> | ah |
| 00:19:37 | <edwardk> | data family Tree a ::* -> *; newtype Tree Int = TreeInt { runTree :: forall o. (Int# -> Int# -> a -> Tree Int -> Tree Int -> o) -> o -> o } |
| 00:19:43 | <edwardk> | mmorrow: for instance |
| 00:20:18 | <edwardk> | er |
| 00:20:30 | <edwardk> | newtype Tree Int a = TreeInt { runTree :: forall o. (a -> Int# -> Int# -> Tree Int -> Tree Int -> o) -> o -> o } |
| 00:20:51 | <edwardk> | er newtype instance Tree Int a = ... |
| 00:21:41 | <edwardk> | the reason is, in this form i can indicate the 'unboxedness' the individual elements with separate newtype wrappers down that chain... |
| 00:21:50 | <edwardk> | er of the |
| 00:22:19 | <mib_crazy> | hi, good night... i need help, who i can separate numbers? example, 21, take numbers separated? 2 1 ? |
| 00:22:20 | <KeyboardCat> | ACTION starts playing for edwardk |
| 00:23:02 | <mmorrow> | KeyboardCat: http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2343#a2344 |
| 00:23:30 | <mmorrow> | edwardk: hmm |
| 00:23:42 | <edwardk> | basically that type is a 'Data.Map' with unboxed key iif i can get it to be smart about how it builds the environment |
| 00:24:06 | <copumpkin> | :) |
| 00:24:33 | <mmorrow> | interesting, i don't think i've ever played around with data families before |
| 00:24:51 | <Cale> | mib_crazy: div and mod will help :) |
| 00:24:52 | <edwardk> | well, the fundamental approach works even without the family |
| 00:24:57 | <Cale> | > 21 `mod` 10 |
| 00:24:59 | <lambdabot> | 1 |
| 00:25:03 | <Cale> | > 21 `div` 10 |
| 00:25:04 | <lambdabot> | 2 |
| 00:25:41 | <edwardk> | newtype Tree a = TreeInt { runTree :: forall o. (a -> Int# -> Int# -> Tree Int -> Tree Int -> o) -> o -> o } -- i wonder if i built the function with the values i was going to feed into those Int#'s as unboxed integers in scope if it'd pick them up unboxed when it built the closure rather than randomly rebox them |
| 00:25:52 | <mib_crazy> | Cale: thanks! |
| 00:25:59 | <edwardk> | unfortunately vacuum can't show me closures ;) |
| 00:26:23 | <copumpkin> | what's needed to make that happen? |
| 00:26:31 | <edwardk> | copumpkin: deep magic |
| 00:26:37 | <copumpkin> | black magic? |
| 00:26:43 | <mmorrow> | yeah, that's too bad. i've found a hook into C with some StablePtr hackery though, so that might turn out nicely |
| 00:27:01 | <mmorrow> | copumpkin: heh, very black magic :) |
| 00:27:53 | <mmorrow> | well, the only thing i'm unsure about is just when the gc is going to pull the rug out from under me |
| 00:27:56 | <zcvvc> | I'm attempting to install yi, have no experience with cabal. What to do with http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2345? |
| 00:28:27 | <mmorrow> | so it's kindof sketchy |
| 00:28:36 | <zcvvc> | I installed QuickCheck-1.1.0.0 and utility-ht-0.0.5, but the error stays |
| 00:32:02 | <Cale> | zcvvc: hmm |
| 00:32:35 | <Cale> | zcvvc: If you cabal-install utility-ht-0.0.5 separately, it doesn't help? |
| 00:33:04 | <zcvvc> | Cale: it is already installed |
| 00:33:52 | <zcvvc> | I installed newer QuickCheck too, but the error is still the same |
| 00:34:56 | <Cale> | hmm, I wonder what it even needs QuickCheck or that utility-ht package for... it doesn't show up in the dep list on hackage... |
| 00:35:46 | <edwardk> | inRan (RWST m) = Ran (λk → RWSTH (λr s w → getRan (m r s) (λ ~(a, s', w') → getRWSTG (k a) s' (w `mappend` w')))) -- seems sadly easy once you figure it out |
| 00:36:25 | <Cale> | zcvvc: I'll give installing yi a shot |
| 00:38:29 | <Cale> | zcvvc: hmm, well, I got past where you got |
| 00:39:00 | <Cale> | zcvvc: aha, it installed utility-ht-0.0.4 |
| 00:39:21 | <Cale> | hmm |
| 00:39:37 | <zcvvc> | just installed utility-ht-0.0.4. But error is the same |
| 00:40:00 | <Cale> | actually... |
| 00:40:11 | <Cale> | It didn't install utility-ht at all, I already had it |
| 00:41:25 | <Cale> | Out of interest, which ghc are you using? |
| 00:41:45 | <Cale> | Not that the error message has anything to do with that... |
| 00:41:51 | <zcvvc> | got it |
| 00:42:00 | <copumpkin> | yi depends on utility-ht ? :o |
| 00:42:02 | <sw17ch> | sweet! atom-0.0.3 is out. |
| 00:42:26 | <Cale> | copumpkin: Not in any obvious way, but perhaps one of its dependencies does? |
| 00:42:41 | <zcvvc> | I've got newest. I uninstalled utility-ht-0.0.5, installed utility-0.0.4 and it passed |
| 00:42:44 | <zcvvc> | thanks Cale |
| 00:42:50 | <Cale> | Interesting |
| 00:43:13 | <Cale> | I'm really sick of these QuickCheck dependency issues. |
| 00:44:01 | <Cale> | Packages unrelated to testing should not demand QuickCheck... |
| 00:44:59 | <tiglionabbit_> | I can't cabal install nano-hmac because HMAC.hsc:57: error: ‘SHA224_DIGEST_LENGTH’ undeclared |
| 00:45:13 | <tiglionabbit_> | can't find info about this. What should I do? |
| 00:45:39 | <Cale> | Sounds like you have a different version of the C library than the binding expected, perhaps? |
| 00:45:57 | <tiglionabbit_> | maybe. I'm on an intel mac (leopard) |
| 00:48:41 | <copumpkin> | tiglionabbit: does it depend on openssl? I vaguely remember that the one bundled with mac os doesn't support the various SHA2 hashes |
| 00:49:00 | <Cale> | Yes, it does |
| 00:49:23 | <c_wraith> | yeah, if you build openssl from source on OS X you get a lot more than the version included by default. |
| 00:49:26 | <Cale> | Look in /usr/include/openssl/sha.h (or wherever that file is on your system) |
| 00:49:31 | <copumpkin> | yeah, that's what I ended up doing |
| 00:49:43 | <Cale> | and see that it has |
| 00:49:45 | <Cale> | #define SHA224_DIGEST_LENGTH 28 |
| 00:50:03 | <copumpkin> | hah, the only one in my system header is #define SHA_DIGEST_LENGTH 20 |
| 00:50:11 | <copumpkin> | no mention of any of the sha2 ones |
| 00:50:16 | <copumpkin> | (I'm on mac os too) |
| 00:53:54 | <Cale> | Hehe, distributions should learn from Debian's mistake and not make modifications to the OpenSSL library. |
| 00:57:48 | <tchakkazulu> | Hey, is there a package somewhere to read, write, and modify .bmp files? |
| 00:58:30 | <tchakkazulu> | I've tried the DevIL bindings, but when I read a file with it, and directly write it to another file, it only writes a black thing. |
| 00:58:54 | <tchakkazulu> | At least, with the two test .bmps I used. |
| 01:00:35 | <mmorrow> | tchakkazulu: i have some C code (for rgb 8x8x8 uncompressed bmp's only) that i got from elsewhere in here: http://moonpatio.com/repos/vacuum-gl/c/bmp.c and bmp.h |
| 01:00:47 | <mmorrow> | you can ffi to if fairly easily |
| 01:00:59 | <mmorrow> | and it also shouldn't be too hard to rewrite in haskell |
| 01:01:06 | <mmorrow> | (if you're so inclined) |
| 01:01:27 | <Cale> | The SDL-image library is supposed to support BMPs. |
| 01:01:32 | <tchakkazulu> | I'll look at it. Thanks, mmorrow. |
| 01:01:44 | <mmorrow> | tchakkazulu: no prob |
| 01:02:03 | <tchakkazulu> | Yeah, I looked at the SDL libs, and you can read files into some "Surface" datatype, but I couldn't find any functions to write an image back to file. |
| 01:03:13 | <Cale> | ah, hmm |
| 01:06:33 | <ksf> | ACTION needs a many $ oneOf that succeeds exactly one or zero times for any parser, in any order. |
| 01:07:17 | <ksf> | let's make that n to k times. |
| 01:07:51 | <tiglionabbit_> | Cale: I did port install openssl, but I guess that version isn't good enough either? |
| 01:08:01 | <tiglionabbit_> | what version should I get and how should I add it |
| 01:08:12 | <ksf> | ...either it's involved enough to be worth more thinking, or I'm plain tired. |
| 01:11:51 | <ManateeLazyCat> | I'm finding some functional purely GUI toolkit, and looks Fudgets is good, have any other FP GUI toolkit? Any suggestions? Thanks! |
| 01:12:27 | <ksf> | there's conal's TV stuff, Phooey. |
| 01:12:34 | <ksf> | It's all out of date, though. |
| 01:12:43 | <ksf> | speaking of conal... |
| 01:13:14 | <ksf> | ...nope, still no new version of reactive on hackage. |
| 01:13:51 | <tiglionabbit_> | Cale: should I just put the definition in there or something? |
| 01:14:27 | <ksf> | there's grapefruit, which i don't know anything about except that it's arrow-based. |
| 01:15:13 | <ksf> | you might want to have a look at elerea, it seems to work quite well and could be usable for a decent reactive tk. |
| 01:16:33 | <thoughtpolice> | i've been looking at elerea a lot and it's pretty neat |
| 01:16:52 | <thoughtpolice> | very minimal - makes it easier to understand. :) |
| 01:17:38 | <ksf> | that's what I thought, too. I can cope much better with some unsafePerformIO magic than with conal's abstract nonsense. |
| 01:19:23 | <ksf> | heh. I can make another oneOf that discards the suceeding parser from the list and returns the other parsers alongside with the result, making it a monad of its own. |
| 01:20:25 | <ManateeLazyCat> | Thanks all for suggestions |
| 01:21:34 | <tchakkazulu> | ksf: optional p = Just <$> p <|> pure Nothing. Or perhaps use "try p" instead of "p". |
| 01:21:52 | <ksf> | ACTION goes off overdesigning what's right now "data Cardinality" |
| 01:21:56 | <tchakkazulu> | That's parsing 1 or 0, wrapping it in a Maybe. |
| 01:22:29 | <ksf> | I need at least any number, zero or one, one, and one or more. |
| 01:22:51 | <ksf> | ...better even if I can just generalise that to upper and lower bounds. |
| 01:23:20 | <tchakkazulu> | If you have 0-n, you can use "replicateM k" to lift it to k-(n+k). |
| 01:23:33 | <tchakkazulu> | And for 0-n... perhaps explicit recursion would be easiest for that. |
| 01:23:51 | <tchakkazulu> | But I must admit I don't know much about checking to see if a parser consumes input and such. |
| 01:24:42 | <ksf> | that's not the problem, the problem is that I have to match many parsers with different cardinality, and matches can occur in any order. |
| 01:25:12 | <tchakkazulu> | Ohh... like a permutation? |
| 01:25:31 | <ksf> | that's more like it, yes. |
| 01:26:30 | <ksf> | think of "a <html> element may contain exactly one <br> element, and one or more <table> elements, in arbitrary order" |
| 01:26:54 | <tchakkazulu> | Ahh, okay. |
| 01:28:04 | <ksf> | "...and if there isn't a <foo> element it's defined to be "234", and if there isn't a <bar> element it's defined to have the value it had in the previous <html> element" |
| 01:28:46 | <tchakkazulu> | http://hackage.haskell.org/packages/archive/parsec/3.0.0/doc/html/Text-Parsec-Perm.html#t%3AStreamPermParser <- should be able to do permutations, haven't tried it myself. |
| 01:28:49 | <ksf> | the last one implies haskell wins. |
| 01:28:57 | <tchakkazulu> | But having one-or-more... yeah, I see your problem. |
| 01:29:31 | <ksf> | sadly, parsec parsers can't be defined in terms of themselves. |
| 01:30:03 | <tchakkazulu> | Heh. Left recursion :( |
| 01:30:43 | <ksf> | polyparse can do it. as long as I don't code up cyclic dependencies i'm fine. |
| 01:31:32 | <ksf> | well, coding them up isn't the problem, forcing them is. |
| 01:32:55 | <ksf> | Is there some integral number type that has an element for infinity? |
| 01:33:29 | <badtruffle> | not that I know of |
| 01:33:38 | <Twey> | I believe not |
| 01:33:43 | <tchakkazulu> | You could fake it with Maybe, but other than that... nope. |
| 01:33:52 | <Twey> | Being as div is undefined for 0 |
| 01:33:59 | <Twey> | There's Float, of course |
| 01:34:11 | <dolio> | > 5 < infinity |
| 01:34:13 | <lambdabot> | True |
| 01:34:42 | <cypher-> | hmm.. my firefox uses 471 MB of memory and counting.. |
| 01:34:45 | <ksf> | I only need +/- , numbers > 0 and some comparisons. |
| 01:34:57 | <Twey> | :t let a = 5 in a < infinity `seq` a |
| 01:34:59 | <lambdabot> | forall t. (Num t) => t |
| 01:35:04 | <Twey> | Hmph |
| 01:35:12 | <tchakkazulu> | :t infinity |
| 01:35:14 | <lambdabot> | Natural |
| 01:35:17 | <dolio> | > 5 < infinity `div` 2 |
| 01:35:18 | <Twey> | > (5 :: Int) < infinity |
| 01:35:18 | <lambdabot> | True |
| 01:35:19 | <lambdabot> | Couldn't match expected type `Int' against inferred type `Natural' |
| 01:35:25 | <Twey> | ACTION ponders. |
| 01:35:31 | <tchakkazulu> | So... this Natural thing would be it. |
| 01:35:49 | <Twey> | Aha |
| 01:35:51 | <Twey> | Yeah |
| 01:35:53 | <tchakkazulu> | Not findable by hoogle, though. |
| 01:36:06 | <ksf> | it's not in the ghc libs, either. |
| 01:36:25 | <tchakkazulu> | http://hackage.haskell.org/packages/archive/numbers/2008.4.20.1/doc/html/Data-Number-Natural.html |
| 01:36:30 | <tchakkazulu> | There it is :) |
| 01:37:19 | <ksf> | ouch, it's implemented in peano. |
| 01:37:30 | <copumpkin> | mmmm efficiency |
| 01:37:54 | <ksf> | ...and 0 - 1 would be zero, in my case. |
| 01:38:04 | <tchakkazulu> | I occasionally use that to compare lengths of infinite lists, but yeah, that's too bad :( |
| 01:38:08 | <ksf> | ...or, actually, I wouldn't mind if it's bottom. |
| 01:38:38 | <edwardk> | hrmm it looks like the 'i don't need to shuffle stuff around invariants start to break on the ran transformers, maybe i can come up with a smarter layout of their arguments |
| 01:38:52 | <ray> | what's so hard about writing your own instances that do exactly what you want? :) |
| 01:39:23 | <ksf> | nothing, except #haskell. and the fact that i've been up coding for too long. |
| 01:43:57 | <ksf> | ACTION ponders about infinity - infinity |
| 01:44:45 | <dolio> | > 0 - infinity |
| 01:44:46 | <lambdabot> | * Exception: Natural: (-) |
| 01:45:00 | <ksf> | > infinity - infinity |
| 01:45:03 | <hatds> | :t infinity |
| 01:45:04 | <ksf> | ... |
| 01:45:05 | <lambdabot> | Natural |
| 01:45:08 | <ksf> | now that's bad. |
| 01:45:15 | <lambdabot> | thread killed |
| 01:45:33 | <hatds> | infinity + infinity |
| 01:45:49 | <hatds> | > infinity + infinity |
| 01:45:52 | <lambdabot> | * Exception: stack overflow |
| 01:45:53 | <tchakkazulu> | Heh |
| 01:45:58 | <kpreid> | > (infinity / infinity) > 3 |
| 01:46:00 | <lambdabot> | No instance for (Fractional Natural) |
| 01:46:00 | <tchakkazulu> | I think infinity = Suc infinity. |
| 01:46:00 | <lambdabot> | arising from a use of `/' a... |
| 01:46:06 | <hatds> | > infinity >= 3 |
| 01:46:06 | <kpreid> | > (infinity `div` infinity) > 3 |
| 01:46:08 | <lambdabot> | True |
| 01:46:09 | <ksf> | tchakkazulu, exactly. |
| 01:46:17 | <tchakkazulu> | So it cannot actually ever determine if a value is infinite <_< |
| 01:46:22 | <lambdabot> | thread killed |
| 01:46:35 | <kpreid> | kinda like how you can't determine the sign of a real number |
| 01:46:57 | <tchakkazulu> | So I guess a "data MyNat = Finite Int | Infinite deriving (Eq, Ord)" would do what you want. |
| 01:47:23 | <tchakkazulu> | And then define the Num instance yourself, but that shouldn't be too hard. |
| 01:47:54 | <ksf> | That's what I'm doing right now. |
| 01:49:30 | <ksf> | wait... isn't infinity * infinity the point where those strange other infinities kick in? |
| 01:49:53 | <tchakkazulu> | Not yet. That's with Infinity ^ Infinity. |
| 01:49:58 | <dolio> | Which? |
| 01:50:28 | <hatds> | ordinal numbers |
| 01:50:32 | <tchakkazulu> | If "Infinity" is the normal, countable, infinity, then Infinity * Infinity is also the normal, countable, infinity. |
| 01:50:59 | <ksf> | wth is signum? |
| 01:51:10 | <tchakkazulu> | :t signum |
| 01:51:12 | <lambdabot> | forall a. (Num a) => a -> a |
| 01:51:16 | <tchakkazulu> | signum (negate 4) |
| 01:51:19 | <tchakkazulu> | > signum (negate 4) |
| 01:51:21 | <lambdabot> | -1 |
| 01:51:33 | <tchakkazulu> | > (signum 0, signum 5) |
| 01:51:35 | <lambdabot> | (0,1) |
| 01:51:37 | <tchakkazulu> | sign. |
| 01:51:40 | <Saizan> | x = signum x * abs x |
| 01:54:43 | <tchakkazulu> | ksf: about your permutations, would this work: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4628#a4628 |
| 01:55:13 | <tchakkazulu> | where "pick" is your run-of-the-mill [a] -> [(a,[a])] function. |
| 01:56:07 | <tchakkazulu> | May need to insert some "try" for the backtracking behaviour, though... if you want it. |
| 01:56:44 | <ksf> | I'm using polyparse, it backtracks by default. |
| 01:56:56 | <tchakkazulu> | Ah, polyparse. Okay :) |
| 01:57:11 | <tchakkazulu> | (also, choice -> parseChoice) |
| 02:02:07 | <ksf> | ...nope, applicative alone won't be powerful enough, I need way more control over the possibilities. |
| 02:02:24 | <ksf> | ...I think. |
| 02:03:33 | <ksf> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4630#a4630 |
| 02:03:42 | <ksf> | ...use at your own risk, it merely compiles. |
| 02:04:28 | <tchakkazulu> | Yeah. I'd probably use error or something for the Infinity - Infinity case. |
| 02:04:30 | <ksf> | uh, and it's two lines too long. |
| 02:05:03 | <tchakkazulu> | Also, beware: (Nat x) - (Nat y) = Nat $ x - y <- does not check if (x - y) >= 0. |
| 02:05:20 | <kbateman> | ccw :: Point -> Point -> Point -> Bool; ccw x y z = (> 0) . cross |
| 02:05:22 | <ksf> | ouch, yes. |
| 02:05:31 | <kbateman> | Is there a way to define ccw in a point free style? |
| 02:05:51 | <kbateman> | oops. ccw x y z = (> 0) $ cross x y z |
| 02:05:56 | <tchakkazulu> | And the instances of Eq and Ord are the same as the ones that are derived. |
| 02:06:32 | <Saizan> | ?pl ccw x y z = (> 0) $ cross x y z |
| 02:06:32 | <lambdabot> | ccw = (((> 0) .) .) . cross |
| 02:06:33 | <tchakkazulu> | (though I'm kinda iffy about Infinity == Infinity... but I guess in this context it makes sense) |
| 02:07:18 | <ksf> | I'm proud not to be a mathematician. |
| 02:07:38 | <kbateman> | thanks, I guess. :) |
| 02:08:43 | <hatds> | where would this typeclass be useful do you think? |
| 02:09:15 | <tchakkazulu> | What I like is how any of the older parsing libraries have their own typeclass which is basically Applicative and some extras. |
| 02:12:36 | <ksf> | Infinity - Infinity == 0 follows from n - n = 0, which follows from n = n |
| 02:12:39 | <dropdrive> | I've got a string representation of a double in a ByteString, and I'm trying to convert it to an 8-byte ByteString representing the parsed double. I got as far as wrapping strtod and getting a CDouble; how should I proceed from here? |
| 02:12:55 | <ksf> | ...and even if that doesn't make sense to the mathematically enlightened, i'm sticking with it. |
| 02:13:31 | <copumpkin> | o.O |
| 02:14:09 | <hatds> | just don't fool yourself into thinking it is a semiring :) |
| 02:14:50 | <ksf> | I won't. I don't even know how they're defined. |
| 02:15:19 | <hatds> | ring without minus I think |
| 02:15:31 | <copumpkin> | so if Infinity + 1 == Infinity, what is Infinity - Infinity + 1? |
| 02:15:33 | <ksf> | I've got my own, very constructive perspective on numbers, which means that I can calculate everything by counting fingers, even if it takes me forever. |
| 02:15:51 | <tchakkazulu> | Ghehehe :p |
| 02:16:08 | <ksf> | uhmmm... |
| 02:16:14 | <Saizan> | dropdrive: i'd use that: http://haskell.org/ghc/docs/latest/html/libraries/bytestring/Data-ByteString-Internal.html#v%3Acreate |
| 02:16:25 | <Saizan> | dropdrive: together with castPtr and poke |
| 02:16:31 | <ksf> | Infinity - Infinity = EternalZero? |
| 02:17:00 | <ksf> | that is, a zero that's so small that no matter how much you add to it, it stays zero. |
| 02:17:14 | <ksf> | except maybe Infinity + EternalZero = 0. |
| 02:17:25 | <hatds> | lol |
| 02:17:28 | <hatds> | I like it |
| 02:17:34 | <copumpkin> | EternalZero === Hell |
| 02:17:41 | <dolio> | So Infinity + Infinity - Infinity = 0? |
| 02:18:01 | <hatds> | depends on how you order those operations |
| 02:18:06 | <dolio> | Right. |
| 02:18:16 | <ksf> | what, I have to care about associativity? |
| 02:18:29 | <dolio> | Maybe you should add DoubleInfinity. |
| 02:18:39 | <copumpkin> | well, we're trying to show you that Infinity - Infinity == 0 is a bad idea :P |
| 02:18:40 | <copumpkin> | or at least, I was |
| 02:18:43 | <hatds> | + is associative I think, but there is no negate.. you can't think of -Infinity as adding negative infinity |
| 02:19:13 | <ksf> | hatds, yeah, that's it. |
| 02:20:33 | <tiglionabbit_> | man, I don't know how to fix this openssl thing. I tried installing the standard openssl package, but I don't think cabal is using it |
| 02:20:43 | <tiglionabbit_> | join ssl |
| 02:20:45 | <tiglionabbit_> | oops |
| 02:21:01 | <ksf> | but then, 1 - 3 should't clamp to 0, either. |
| 02:21:32 | <dropdrive> | Saizan: Thanks for your help. I guess the key is that CDouble is an instance of Storable? |
| 02:21:51 | <tchakkazulu> | Yeah, all those nice properties for integers break when you leave out numbers smaller than 0. |
| 02:21:58 | <ksf> | it's that darn "negative number of people in an elevator" problem. conservation of numbers, so to speak. |
| 02:22:16 | <hatds> | should just make this a typeclass that has + and * but no minus |
| 02:22:36 | <hatds> | made / |
| 02:22:39 | <hatds> | *maybe |
| 02:22:43 | <Saizan> | dropdrive: yup |
| 02:23:02 | <Saizan> | Prelude Data.ByteString.Internal Foreign Foreign.C.Types> create 8 (\ptr -> poke (castPtr ptr) (-2/3 :: CDouble)) |
| 02:23:05 | <Saizan> | "UUUUUU\229\191" |
| 02:23:21 | <ksf> | the right solution is to use peano-semantics and agda to safe you from runtime errors. |
| 02:23:32 | <hatds> | agda? |
| 02:23:48 | <ksf> | http://wiki.portal.chalmers.se/agda/ |
| 02:23:54 | <ksf> | @where agda |
| 02:23:54 | <lambdabot> | http://tinyurl.com/yp6zsr |
| 02:24:18 | <ksf> | @where+ agda http://wiki.portal.chalmers.se/agda/ |
| 02:24:18 | <lambdabot> | Nice! |
| 02:24:30 | <tchakkazulu> | Yay agda! |
| 02:24:40 | <tchakkazulu> | ... or wrap the result of - in a Maybe >_> |
| 02:24:53 | <ksf> | ...we don't want to let people see that index._php_, now do we? |
| 02:24:56 | <deech_> | Hi all, I am trying to read GHC's implementation of Software Transactional Memory. I am new to Haskell, when reading the code can I reason about unboxed values and tuples as though they were not unboxed? |
| 02:25:15 | <ksf> | nearly. |
| 02:25:16 | <hatds> | really, isn't the whole point of Nats to avoid maybes and such where negative numbers wouldn't make sense? |
| 02:25:23 | <ksf> | in most of the cases, that is. |
| 02:25:48 | <ksf> | you've got less _|_, and less space taken up. |
| 02:26:03 | <Saizan> | deech_: well, you should at least consider that they are strict |
| 02:26:23 | <tchakkazulu> | No, the point is to avoid negative numbers at all. However, when you add operations that make negative numbers possible, you should have an alternative (or live with non-total functions). |
| 02:26:39 | <deech_> | Saizan : But aside from that I can ignore the #? |
| 02:27:29 | <hatds> | I would have - return an error. Force the user to convert if they want negative numbers |
| 02:27:44 | <Saizan> | deech_: yes, in types |
| 02:27:46 | <ksf> | it's about learning modesty. If there's two cakes, you can have both, even eat them, but you can't have three, and THOU SHALT NOT WANT THREE |
| 02:28:12 | <Saizan> | deech_: in function names # means something like "primitive" or "internal", it's more a convention than anything |
| 02:28:40 | <hatds> | hence the name C# |
| 02:28:44 | <ksf> | ACTION thinks of cake futures |
| 02:29:28 | <deech_> | Saizan : Ok, cool. Does that include datatypes like Int# ? |
| 02:29:29 | <thoughtpolice> | well, unboxed tuples are particularly magical |
| 02:29:33 | <thoughtpolice> | because they put stuff in registers |
| 02:31:01 | <ksf> | packed? like in 16-bytes-in-a-register? |
| 02:33:31 | <ksf> | hmmm. I could code up a nat type in agda, compile it to haskell, then use it from haskell and pretend I'm using typesafe code. |
| 02:34:27 | <hatds> | I never feel like dependent types are the right answer |
| 02:34:58 | <Saizan> | deech_: Int# is the unboxed version of Int, yeah |
| 02:35:00 | <Saizan> | ?src Int |
| 02:35:00 | <lambdabot> | data Int = I# Int# |
| 02:35:42 | <hatds> | wait.. what does # conventionally mean on a constructor then? |
| 02:36:00 | <lispy> | hatds: magic ghc primitive, afaict |
| 02:36:16 | <lispy> | (# isn't a primitive, but it marks them) |
| 02:37:49 | <hatds> | so you can't define unlifted data declarations? Makes sense I guess |
| 02:39:16 | <lispy> | you can do the safer thing though, convince GHC that it should try to unbox things and let it decide how/when it's okay |
| 02:41:34 | <tchakkazulu> | ACTION is back to stay. Sorry for the connect/disconnect spam. |
| 02:42:36 | <lispy> | hatds: but, what really is the difference between dependent types and dynamic types? |
| 02:44:13 | <hatds> | I wouldn't be the one to ask |
| 02:44:27 | <hatds> | > "dependent" \\ "dynamic" |
| 02:44:29 | <lambdabot> | "epedent" |
| 02:44:37 | <roconnor> | lispy: what's the question? |
| 02:44:58 | <hatds> | when are dependent types the best solution |
| 02:45:07 | <roconnor> | always! |
| 02:45:29 | <roconnor> | but that is just my opinion |
| 02:46:02 | <vixey> | oh I am in time for dependent types |
| 02:46:12 | <roconnor> | @oesis 10, 11, 12, 13, 14, 15, 16, 17, 20, 22, 24, 31, 100 |
| 02:46:12 | <lambdabot> | 16 in base 16-n. |
| 02:46:13 | <lambdabot> | [10,11,12,13,14,15,16,17,20,22,24,31,100,121,10000,1111111111111111] |
| 02:46:38 | <vixey> | If you call 'dynamic' typed instead: untyped -- then the difference is much cleare |
| 02:48:16 | <ManateeLazyCat> | Now have three packages that binding X11: "X11" "X11-extras" "X11-xft", them have *FULLY* binding X11 graphics library? |
| 02:48:33 | <lispy> | vixey: but, it's not untyped |
| 02:48:42 | <dolio> | It is. |
| 02:48:45 | <roconnor> | "dynamic types" lets you write almost any code. Depenent types finds hardly any code acceptable. |
| 02:48:46 | <dolio> | It's tagged. |
| 02:49:03 | <lispy> | roconnor: I was just thinking the other day how a dynamically typed program can have types that depend on values |
| 02:49:22 | <vixey> | lispy, what's not untyped? |
| 02:49:27 | <roconnor> | lispy: that's because dynamics typed program is not typed programming |
| 02:49:33 | <roconnor> | bastards took the name. |
| 02:49:35 | <lispy> | vixey: dynamic typing != untyped |
| 02:49:36 | <roconnor> | illegally |
| 02:49:54 | <roconnor> | vixey is right. dynamically types programs are essentially untyped. |
| 02:50:10 | <lispy> | take python for example |
| 02:50:14 | <roconnor> | for what we all understand types as. |
| 02:50:35 | <lispy> | You can still get type errors and you still have types, they are just done at run-time and associated with values not names of values |
| 02:50:51 | <roconnor> | how is python different from scheme is this respect? |
| 02:51:13 | <lispy> | I don't know scheme, but I assume it is very similar to python this way |
| 02:51:17 | <vixey> | lispy, runtime "type" error is exactly a pattern match fall through |
| 02:51:28 | <roconnor> | scheme is a typical example of an untyped language. |
| 02:51:51 | <lispy> | roconnor: how so? it has types |
| 02:52:08 | <vixey> | lispy, (this is a very clinical view of the situation but from that position it makes the distinction much cleare) |
| 02:52:12 | <vixey> | clearer* |
| 02:52:45 | <roconnor> | Types are not a run-time phenomenon. Typechecking occurs before execution. |
| 02:52:50 | <roconnor> | for what we call types. |
| 02:52:58 | <lispy> | in staticaly typed languages |
| 02:53:01 | <vixey> | lispy, what I am doing is fixing *one* definition of type and using that to think about /both/ languages |
| 02:53:26 | <vixey> | lispy, rather than using the haskell/type theory definition of type when I think about haskell and then the linguistic/dynamic definition of type when I think about python |
| 02:53:40 | <roconnor> | right. and "dynamically typed" languages have nothing to do with types from type theory. |
| 02:53:43 | <vixey> | lispy, same principle about changing only one variable to make good conclusions |
| 02:53:54 | <roconnor> | it is very confusing for them to use the name types |
| 02:54:03 | <roconnor> | and leads to all sorts of silly arguments, such as this one. |
| 02:54:10 | <lispy> | I don't understand how you can choose a definition that invalidates the other languages |
| 02:54:11 | <vixey> | that's why 'untyped' is meaningful here - and not contradictory to 'dynamically typed' |
| 02:54:27 | <vixey> | I am not making sense? |
| 02:54:31 | <ksf> | dependent typing is just like dynamic typing, only at compile time. |
| 02:54:34 | <lispy> | vixey: right |
| 02:54:41 | <lispy> | vixey: (about not making sense) |
| 02:54:53 | <roconnor> | lispy: calling python and scheme untyped is not a moral judgement on the languages. |
| 02:55:04 | <lispy> | roconnor: but it is wrong because they have types |
| 02:55:06 | <ksf> | assembly is typed, too. |
| 02:55:27 | <roconnor> | lispy: if you don't get type errors during typechecking, your language is untyped. |
| 02:55:31 | <ksf> | you just can't add float and integer registers. |
| 02:55:57 | <Saizan> | roconnor, vixey: can you formulate the definition of type-theory types such that excluding runtime type-checking doesn't look arbitrary? |
| 02:56:01 | <vixey> | roconnor: well the thing is they can have some type errors like if you do (DECLARE (INTEGER FOO)) .. and then use it as a string (in common lisp) |
| 02:56:02 | <ksf> | see, it even enforces typing on combinator-level. |
| 02:56:06 | <lispy> | roconnor: how do you figure? |
| 02:56:07 | <Saizan> | that would help in clearing this out i guess |
| 02:56:29 | <vixey> | roconnor: but I guess I'm throwing a spanner in the works here with thinking about advanced compilers |
| 02:56:42 | <roconnor> | lispy: that is part of definition of types from type theory. |
| 02:57:03 | <lispy> | roconnor: I don't believe you |
| 02:57:08 | <vixey> | You could claim than scheme is typed though in a really trivial sense |
| 02:57:19 | <roconnor> | lispy: it is simply semantics. |
| 02:57:23 | <vixey> | something like |- Y /\ |- X ==> |- (X Y) |
| 02:57:30 | <vixey> | and take as an axiom that everything is well typed :p |
| 02:57:33 | <hatds> | preservation and progress or something isn't it? |
| 02:57:45 | <vixey> | yeah you would not have progress |
| 02:58:02 | <lispy> | roconnor: Your semantics have a glaring flaw then, they left out dynamic types :) |
| 02:58:10 | <roconnor> | Saizan: type checking necessarily occurs before execution. It is a proof validation procedure that ensures certain properties hold about your program. |
| 02:58:41 | <roconnor> | lispy: dynamic types is a confusing term because it has nothing to do with type checking. |
| 02:58:52 | <lispy> | roconnor: and what if that type check happens "just in time" as in scheme? |
| 02:58:54 | <rieux_> | vixey: indeed, r6rs is typed |
| 02:59:11 | <rieux_> | vixey: but it only has one type, and all type errors are about terms being open :) |
| 02:59:28 | <roconnor> | lispy: dynamic types dont prove any properties of your program before execution. |
| 02:59:41 | <luqui> | is there a haskell98 compliant monad library? |
| 02:59:44 | <roconnor> | rieux_: having one type is the definition of untyped. |
| 02:59:52 | <roconnor> | or is a definition |
| 03:00:00 | <lispy> | roconnor: How do you define type? |
| 03:00:01 | <Saizan> | luqui: transformers should be |
| 03:00:03 | <rieux_> | roconnor: it may be trivial, but there's a type system |
| 03:00:05 | <rieux_> | and it's static |
| 03:00:09 | <luqui> | Saizan, thanks |
| 03:00:18 | <rieux_> | i can write it out for you in gentzen style |
| 03:00:20 | <lispy> | roconnor: you seem to have a definition that assumes the results of static type analysis |
| 03:00:22 | <roconnor> | rieux_: right. It is call the untyped. |
| 03:00:28 | <vixey> | lispy, please bear in mind we have multiple (vaugely related) definitions for words such as 'typed' |
| 03:00:30 | <ksf> | unlambda and lazy k may be untyped, but scheme's have integer and float types. |
| 03:00:44 | <roconnor> | lispy: static type analysis is type theory. |
| 03:00:49 | <rieux_> | roconor: disagree. it's not the same as you get in other untyped languages. you couldn't write out the type system for python |
| 03:00:52 | <ksf> | ...not to mention beasts like [#compiled-procedure] |
| 03:00:53 | <rieux_> | but for scheme you can |
| 03:01:17 | <roconnor> | rieux_: why not in python? |
| 03:01:22 | <lispy> | roconnor: this discussion is really boring. You seem to be going in circles and I fundamentally disagree with your premise that dynamically typed languages lack types |
| 03:01:27 | <weilawei> | is there a left-associate version of the dollar sign? |
| 03:01:31 | <weilawei> | *associative |
| 03:01:37 | <roconnor> | lispy: indeed it is boring. |
| 03:01:39 | <rieux_> | roconnor: because python (perl, ruby, etc.) don't actually do what scheme does. give me a second |
| 03:01:40 | <vixey> | lispy, I think you just don't get what we are saying |
| 03:01:42 | <hatds> | they lack static types, surely we can agree eh? |
| 03:01:49 | <vixey> | lispy, seems to be some communication problem |
| 03:01:59 | <lispy> | vixey: right, because you're talking non-sense :) |
| 03:02:05 | <vixey> | k |
| 03:02:10 | <vixey> | I'm gonna just not talk to you |
| 03:02:14 | <lispy> | vixey: python and scheem (as examples) have types. How can you claim otherwise? |
| 03:02:39 | <roconnor> | they don't have type theory types. |
| 03:02:46 | <roconnor> | they have some other beast that I would call tags |
| 03:02:51 | <roconnor> | less confusing |
| 03:02:52 | <Saizan> | well, it's a matter of accepting a definition or not, type theory only works with what others call static types |
| 03:03:01 | <weilawei> | something like (<$) :: a -> (a -> a -> a) -> a ? |
| 03:03:21 | <weilawei> | hoogle has nothing quite matching what I want |
| 03:03:26 | <hatds> | aren't they considering making $ left associative in Haskell' ? |
| 03:03:32 | <ksf> | :t (<$) |
| 03:03:33 | <lambdabot> | forall a (f :: * -> *) b. (Functor f) => a -> f b -> f a |
| 03:03:35 | <weilawei> | hatds: i can see uses for both directions |
| 03:03:36 | <ksf> | it's already taken. |
| 03:03:39 | <ksf> | just define your own. |
| 03:03:43 | <roconnor> | hatds: only hasCale is considering that |
| 03:04:00 | <rieux_> | roconnor: http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2346#a2346 |
| 03:04:20 | <weilawei> | haskell's type system and monads have only clicked like in the last couple days and im absolutely overjoyed how easy it is to find a function to do X. |
| 03:04:30 | <ksf> | ...others are being downmodded on haskit for suggesting editor support to "fix" that "problem" |
| 03:04:44 | <roconnor> | rieux_: and why can't you do something similar in python? I mean you will have different sorts, commands and expressions, but still. |
| 03:04:58 | <rieux_> | roconnor: you could, but it doesn't. R6RS mandates that. |
| 03:05:14 | <roconnor> | rieux_: if I could, that's good enough for me. |
| 03:05:36 | <rieux_> | roconnor: i'm not saying you couldn't stick a trivial type system like that on other "dynamic languages (though eval makes it tricky). i'm saying scheme actually had that type system now : |
| 03:05:50 | <rieux_> | s/had/has/ |
| 03:06:33 | <vixey> | lispy: just because you don't understand something doesn't make it nonsense and what you said is pretty rude actually |
| 03:06:34 | <roconnor> | rieux_: you are one of those people who believe a math result is true only after someone proves it, and that it wasn't true before the proof. :) |
| 03:07:14 | <roconnor> | vixey: I took lispy's comment in the most light hearted way possible. |
| 03:07:31 | <rieux_> | roconnor: ha! (i don't think i am.) |
| 03:07:45 | <vixey> | well I got the impression they are just trolling |
| 03:08:04 | <rieux_> | even trolls have teachable moments |
| 03:08:31 | <lispy> | No, I really would like to think about the differences between dependent and dynamic typing. But, we hit an impasse at the definition of type. |
| 03:08:44 | <lispy> | Not just a troll, but I actually want to compare the concepts. |
| 03:08:57 | <vixey> | anyway ran out of patience with it |
| 03:09:14 | <lispy> | That's why I'm so strongly having issues with the dismissal of dynamic types as a form of type. |
| 03:09:20 | <dolio> | Dependent typing lets you do fancy proving. Dynamic typing lets you do no proving whatsoever. |
| 03:09:26 | <rieux_> | perhaps if you want to understand the difference, you should just stipulate to the definition that people want to use. you can continue to use your preferred definition the rest of the type. but youll hardly make sense of dependent types otherwise. |
| 03:09:45 | <SamB> | lispy: it is a form of type |
| 03:09:55 | <SamB> | it's the form where you say "I don't want to prove anything" |
| 03:10:14 | <roconnor> | SamB: right. It is untyped. |
| 03:10:16 | <SamB> | i.e. data Duck = ... |
| 03:10:38 | <vixey> | lispy: Well you should have some respect for people who you want to talk to -- but then maybe you know I'm just some brainless idiot and would rather I didn't say any more on the topic |
| 03:10:51 | <SamB> | ACTION wishes Emacs would at least offer extensible dynamic tagging |
| 03:11:14 | <hatds> | so do dynamically typed languages have any way to spot an error like "filter xs isEven" without executing that code branch? |
| 03:11:25 | <SamB> | vixey: in the sense that variables don't have types ... |
| 03:11:29 | <ksf> | http://www.reddit.com/r/programming/comments/8i3kt/the_c_is_efficient_language_fallacy/ |
| 03:12:00 | <lispy> | vixey: I never said you were brainless. I said, that claiming python/scheme don't have types is non-sense. I base this on the observation that the languages have 'types'. |
| 03:12:12 | <roconnor> | > data Expr = Integer Integer | String String | ... -- The constructors Integer and String here are exactly what python calls types, but we'd never call them types in Haskell. |
| 03:12:13 | <lambdabot> | <no location info>: parse error on input `data' |
| 03:12:35 | <SamB> | well, the types are a totally different sort of types than you have in Haskell |
| 03:12:43 | <vixey> | roconnor: reminds me of this http://lambda-the-ultimate.org/node/3298 |
| 03:12:51 | <SamB> | the variables don't have types, that I can agree with myself on at least ;-) |
| 03:13:40 | <SamB> | hmm. |
| 03:13:54 | <SamB> | ACTION tries to compare the typing of ASM with that of Python, and fails |
| 03:13:59 | <roconnor> | vixey: heh. The "types" X and Y. |
| 03:15:06 | <roconnor> | python has what we would call "tags" |
| 03:15:19 | <roconnor> | we aren't saying that python's tags don't exist |
| 03:15:49 | <vixey> | roconnor: use Wadler and Guide puppets, Wadler says tags but Guide says types :p |
| 03:15:58 | <vixey> | Guiio |
| 03:16:01 | <roconnor> | lispy: so your question is, what is the difference between run-time tagging, and dependent types. |
| 03:16:12 | <lispy> | vixey: Guido? the python creator? |
| 03:16:14 | <SamB> | or that it isn't proper to call them types when programming in python |
| 03:16:20 | <SamB> | vixey: yeah, it is Guido |
| 03:16:42 | <vixey> | I am trying to get across the same point I was before -- multiple meanings of a word from different perspectives |
| 03:16:48 | <SamB> | he's the BDFL |
| 03:16:58 | <lispy> | roconnor: Why do you consider them to only be tags? |
| 03:17:08 | <lispy> | roconnor: what is the distinction you want to make? |
| 03:17:28 | <roconnor> | lispy: the run-time pre-runtime distinction |
| 03:17:29 | <lispy> | SamB: Benevolent or Bad? :) |
| 03:17:35 | <SamB> | lispy: toe-may-toes, toe-mah-toes |
| 03:17:48 | <SamB> | lispy: well, it's intended to be Benevolent |
| 03:17:53 | <roconnor> | lispy: types are checked before running your program to ensure certain behaviours are impossible. |
| 03:18:00 | <SamB> | but he's not afraid to make the wrong decision |
| 03:18:04 | <lispy> | roconnor: So, aside from that you consider them to be more or less equivalent concepts? |
| 03:18:43 | <hatds> | how often does dependently typed code need to be given a manual proof or whatever? |
| 03:18:46 | <roconnor> | lispy: tags necessarily exist at run-time and halt erronnious programs before undefined behaviour kicks in |
| 03:19:00 | <SamB> | hatds: code is proof |
| 03:19:05 | <tiglionabbit_> | hey guys. I am on a mac which has a nonstandard openssl library on it. So I installed a standard one. How do I make cabal use this one instead, when I install nano-hmac? |
| 03:19:06 | <SamB> | that's kinda the point |
| 03:19:07 | <roconnor> | lispy: I personally consider them totally different and independent concepts |
| 03:19:11 | <GoodBye> | Hello DCC SEND "0101010101010101" 0 0 0 |
| 03:19:15 | <roconnor> | lispy: Haskell has tags and types |
| 03:19:20 | <SamB> | hatds: though in Coq, you don't necessarily need to write it |
| 03:19:46 | <SamB> | you could instead write a proof script that will end up writing the code for you ... |
| 03:19:52 | <lispy> | roconnor: I've used tags in Haskell...well tagged types (or branded) |
| 03:19:54 | <vixey> | hatds, For a start just managing to write your program in Coq already proves lots of thisg about it such as it is strongly normalizing |
| 03:20:13 | <roconnor> | lispy: tags are constructors |
| 03:20:15 | <BMeph> | lispy: I prefer "Bowed-down-to" ;p |
| 03:20:22 | <vixey> | hatds, that can make writing some programs (ones with a complicated termination criteria) hard to write -- and require more proving |
| 03:20:33 | <lispy> | BMeph: heh |
| 03:20:36 | <vixey> | s/to write/ # redundant |
| 03:20:41 | <luqui> | and other programs impossible to write... |
| 03:20:57 | <SamB> | luqui: well, yes |
| 03:20:58 | <luqui> | (turns out not very many though... basically only those which actually dont terminate) |
| 03:21:06 | <SamB> | luqui: a lot of those you don't want to write anyway |
| 03:21:12 | <lispy> | roconnor: so here is the thing. To match what a python program can express at run-time, you need a pretty powerful type system, let's say one with undecidable type checking. |
| 03:21:19 | <luqui> | and those which always terminate, but in such a way as they try to find proofs of any proposition provable in coq itself |
| 03:21:20 | <roconnor> | hatds: the distinction between programming and writing manual proofs can be quite blurry. |
| 03:21:27 | <lispy> | roconnor: So, dependent types are in this category depending on the design choices |
| 03:21:28 | <luqui> | =P |
| 03:21:33 | <weilawei> | okay so.. i have my "left associative dollar sign" except that ($) :: (a -> b) -> a -> b and (<-$) :: a -> (a -> a) -> a... |
| 03:21:35 | <SamB> | some of them are just because of problems with the guardedness condition for corecursion ... |
| 03:21:36 | <weilawei> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4632#a4632 |
| 03:21:52 | <luqui> | Ugh. Corecursion is so gross in coq |
| 03:21:54 | <lispy> | roconnor: So why not, do static analysis of *parts* of python programs using dependent types and then let the dynamic types sort it out at run-time |
| 03:21:59 | <vixey> | weilawei: that doesn't seem like a good thing :( |
| 03:22:02 | <SamB> | luqui: indeed! |
| 03:22:10 | <roconnor> | lispy: I don't understand what it means to match what python program can express at runtime. |
| 03:22:18 | <weilawei> | vixey: yeah i want it to work exactly like a dollar sign.. but left associative |
| 03:22:24 | <SamB> | I was trying to implement differentiation with it, but it WOULD NOT WORK |
| 03:22:24 | <weilawei> | can I just redefined it's associativity? |
| 03:22:28 | <vixey> | luqui: have you seen these Agda guys doing mixed recursion/corecursion |
| 03:22:29 | <Cale> | lispy: Well, actually, I don't think you need much, you just flatten everything into one type, and do all the checking at runtime. |
| 03:22:41 | <roconnor> | lispy: I'm not passing a moral judgement on python. |
| 03:22:42 | <luqui> | vixey, no. :-) |
| 03:22:47 | <vixey> | s/untyped/onetyped/ and avoid all this fuss |
| 03:22:48 | <lispy> | roconnor: Well, let's say you want to use dependent types to match the tags of a python program. You want a correspondence between the dependent types and the run-time tags |
| 03:22:51 | <Cale> | weilawei: Why didn't you define it the same way then? |
| 03:22:57 | <lispy> | roconnor: oh, I am. Python is terrible. |
| 03:23:13 | <weilawei> | Cale: i did and then ghc complained at me so I changed the type signature. it works now, but it's not quite right. im still working on it |
| 03:23:13 | <Cale> | weilawei: just replace the definition with (<-$) = ($), and leave the fixity declaration |
| 03:23:16 | <SamB> | lispy: hmm. |
| 03:23:20 | <luqui> | I think neither recursion no corecursion should be built into the core calculus. they are complicated enough concepts that they should be proven. |
| 03:23:21 | <weilawei> | Cale: oh nice thank you |
| 03:23:28 | <SamB> | lispy: I dunno. it could use a spell checker, for sure, though! |
| 03:23:36 | <Cale> | Or f <-$ x = f x |
| 03:23:40 | <lispy> | SamB: yeah |
| 03:24:04 | <Cale> | which will probably give you fewer problems with the monomorphism restriction if you leave the type signature out |
| 03:24:08 | <SamB> | luqui: how are you going to prove those without some kind of loop ... ? |
| 03:24:18 | <Cale> | The correct type is (a -> b) -> a -> b |
| 03:24:20 | <vixey> | luqui: I know how to build up structural recursion from one-step structural recursion -- but without that one-step thing (the induction principles for date types) not sure what you can do |
| 03:24:20 | <luqui> | SamB, seen set theory? |
| 03:24:29 | <roconnor> | lispy: I don't know what it means for dependent types to match the tags of a python program. any given variable in a python program could have different tags at run-time. How is a static type system supposed to match that? |
| 03:24:30 | <luqui> | not that that's an ideal example, but it is an example |
| 03:24:36 | <SamB> | luqui: isn't that the PROBLEM? |
| 03:24:42 | <lispy> | roconnor: I use python at work daily. I dread refactoring and making the slightest changes. Why? Because python lacks static analysis and pylint is too conservative/weak. I'm trying to read up on type theory and figure out how to do static analysis of *reasonable* python programs so that refactoring is safer -- approaching the safety of refactoring in Haskell. |
| 03:24:50 | <SamB> | I think topology might be a better place to start ;-P |
| 03:25:02 | <luqui> | SamB, ;-) |
| 03:25:13 | <SamB> | lispy: how about adding a type system of some kind? |
| 03:25:21 | <lispy> | roconnor: Well, let's be fair about typical python programs. Usually once a variable has a value of a certain tag it continues to have that same tag. |
| 03:25:29 | <SamB> | you know, not a great one, but a somewhat more static one... |
| 03:25:36 | <SamB> | (in places, at least) |
| 03:25:40 | <lispy> | SamB: yeah, that's kind of what I would adding, regions of static type checking |
| 03:25:43 | <weilawei> | Cale: well i want the arguments swapped AND left-associative xD |
| 03:25:49 | <Cale> | weilawei: ah |
| 03:25:58 | <roconnor> | lispy: okay. Those programs could be type-checked by some sort of typed-python language. |
| 03:26:00 | <Cale> | weilawei: In that case, a -> (a -> b) -> b |
| 03:26:02 | <luqui> | vixey, well, i'm hopeful for ixi's viability. If it's consistent then it can do these things :-) |
| 03:26:02 | <lispy> | SamB: given the flexibility of a dynamically typed language, dependent types seem reasonable to me |
| 03:26:10 | <vixey> | luqui: that said -- If you can justify structural recursion in terms of the simpler type theory .. why not give a direct implementation? |
| 03:26:16 | <necroforest> | ACTION would like a typed python language |
| 03:26:17 | <SamB> | lispy: yeah. |
| 03:26:30 | <Cale> | weilawei: and x <-$ f = f x |
| 03:26:32 | <luqui> | vixey, touche, I suppose. |
| 03:26:33 | <roconnor> | lispy: well, some of those programs. |
| 03:26:37 | <vixey> | luqui: yeah that stuff is really cool |
| 03:26:38 | <rieux_> | necroforest: have you seen typed scheme?: http://www.ccs.neu.edu/home/samth/typed-scheme/ |
| 03:26:41 | <lispy> | (and I have a paper in my hand that claims that depnedent type checking need not be complex to implement) |
| 03:26:42 | <SamB> | lispy: the tricky bit (as always) is to keep the types terminating, I think ;-) |
| 03:26:43 | <roconnor> | lispy: probably a lot of them that occur in practice. |
| 03:27:01 | <weilawei> | Cale: works perfectly :) many thanks for pointing that out |
| 03:27:13 | <lispy> | SamB: yeah, but the programs we write at work could be written in anything, they don't really exploit the dynamicness of python |
| 03:27:19 | <necroforest> | I wouldn't consider scheme very python like |
| 03:27:20 | <rieux_> | necroforest: a similar approach conceivably could work for python, but the intersection of people who care and people who could do it may be . . . small. |
| 03:27:33 | <jinjing> | static python? checkout http://code.google.com/p/shedskin/ |
| 03:27:40 | <roconnor> | lispy: trying to approach dependent types from a dynamic-tags perspective won't really work. They have basically nothing in common. |
| 03:27:42 | <SamB> | scheme and python are exactly the same -- except that Python has syntax and comes with some libraries |
| 03:27:49 | <SamB> | (well, some is an understatement ;-) |
| 03:28:07 | <lispy> | jinjing: thanks, I'll look at it. In the past, I looked for a tool like this but nothing was powerful enough. |
| 03:28:09 | <SamB> | (also, new versions of Python seem to come out a bit more often) |
| 03:28:12 | <Cale> | necroforest: Actually, it's reasonably similar with regard to typing, I would think... |
| 03:28:18 | <rieux_> | necroforest: they're both basically the type-free lambda calculus with some crap bolted on |
| 03:28:19 | <roconnor> | lispy: it is better to understand dependent types from either a logic, or GADTs perspecive. |
| 03:28:22 | <Saizan> | the relation is that you'd want a type system that it's sound wrt the tags |
| 03:28:26 | <SamB> | oh, and scheme doesn't have OO built in |
| 03:28:27 | <necroforest> | python has significantly less parenthesis |
| 03:28:31 | <SamB> | but other than that |
| 03:28:35 | <Cale> | necroforest: But that's just syntax :) |
| 03:28:44 | <SamB> | I mean, they are both 1-lisps, so that's pretty similar to start with ;-) |
| 03:28:52 | <roconnor> | lispy: dependent types is largely (but perhaps not entirely) static phenomenom. |
| 03:29:02 | <lispy> | roconnor: I've made extensive use of GADTs. But, what do you mean? From the persective of implementing a GADT type checker? |
| 03:29:28 | <roconnor> | lispy: here is the key thing that dependent types allows you to do ... |
| 03:29:54 | <roconnor> | case b of { True -> blah; False -> blue } |
| 03:29:56 | <rieux_> | hm.. i suppose some of the refinement types stuff is essentially dependent types with some dynamic checks |
| 03:30:04 | <roconnor> | considere the above Haskell program. |
| 03:30:05 | <lispy> | jinjing: I think shedskin goes the wrong way for me. My deliverable is python source |
| 03:30:06 | <SamB> | roconnor: I think trying to approach dependant typing from the perspective of the documentation attached to dynamicly typed code might not be too unreasonable |
| 03:30:22 | <jinjing> | lispy: oh, i c |
| 03:30:25 | <roconnor> | blah and blue must have the same type. |
| 03:30:31 | <roconnor> | so we can switch them around |
| 03:30:39 | <roconnor> | case b of { True -> blue; False -> blah } |
| 03:30:48 | <roconnor> | and we still get a program that type checks. |
| 03:31:10 | <roconnor> | This means Haskell's type system is totally incapable of catching error of this sort. |
| 03:31:14 | <roconnor> | however |
| 03:31:19 | <roconnor> | with GADTs |
| 03:31:34 | <roconnor> | blah and blue might have different types |
| 03:31:44 | <lispy> | ACTION nods |
| 03:31:44 | <Pseudonym> | A program is well-typed if and only if my favourite type checker accepts it. |
| 03:31:48 | <roconnor> | (although b would have to be some GADT and not booleans) |
| 03:31:51 | <Cale> | lispy: hmm, but you could still use shedskin to compile your code... |
| 03:31:56 | <lispy> | roconnor: I made use of GADTs in a way just like this for my MS research |
| 03:32:08 | <Pseudonym> | And it's type-incorrect if and only if my favourite type checker rejects it. |
| 03:32:08 | <Cale> | lispy: (just to test if it typechecks) |
| 03:32:12 | <roconnor> | and so swaping blue an blah could lead to a type error. |
| 03:32:19 | <rieux_> | does shedskin of a soundness theorem? (roconnor: maybe you're right about me+math) |
| 03:32:30 | <SamB> | lispy: I didn't know you bought a branch of MSR |
| 03:32:34 | <SamB> | where did you get the money? |
| 03:33:01 | <roconnor> | This ability to potentially catch this new class of errors is one of the things dependent type theory allows you to do. |
| 03:33:04 | <edwardk> | Pseudonym: well. after suitable unsafeCoercions anyways |
| 03:33:06 | <Cale> | rieux_: What about you and math? :) |
| 03:33:24 | <lispy> | SamB: sorry, I don't get the joke |
| 03:33:25 | <rieux_> | Cale: called me a formalist, more or less |
| 03:33:34 | <SamB> | lispy: it's really bad, sorry |
| 03:33:41 | <Cale> | rieux_: ah, we're in good company then :) I'm a formalist too. |
| 03:33:41 | <SamB> | your MS Research |
| 03:33:58 | <lispy> | SamB: well, not microsoft research :) |
| 03:34:01 | <rieux_> | Cale: i don't think i am (i say as i head back to my proof) |
| 03:34:10 | <vixey> | You can reflect computational aspects of your programs into the type system |
| 03:34:32 | <vixey> | that is what dependent product & beta reduction is giving |
| 03:34:38 | <Cale> | rieux_: These guys are all constructivists, so watch out ;) |
| 03:34:49 | <vixey> | I am not constructivist :( |
| 03:34:51 | <roconnor> | GADTs allow you to do a limited form of dependent type theory. |
| 03:34:56 | <SamB> | Cale: well, there's a reason for that |
| 03:35:01 | <NEEDMOAR_> | :-) |
| 03:35:03 | <SamB> | we like our proofs computable ;-P |
| 03:35:05 | <Saizan> | "you are one of those people who believe a math result is true only after someone proves it, and that it wasn't true before the proof." <- i'm not sure if this has to do with being a formalist |
| 03:35:23 | <lispy> | roconnor: I have experienced this aspect of GADTs...otherwise I would not have discovered and read about dependent types |
| 03:35:34 | <Pseudonym> | Saizan: I can read that in two ways, one of which makes sense. |
| 03:35:37 | <rieux_> | Saizon: well, it excludes being a Platonist |
| 03:35:40 | <roconnor> | But true dependent type theory gives you full on dependent products and dependent functions. |
| 03:35:41 | <Pseudonym> | It makes sense not to _believe_ a result before the proof. |
| 03:35:52 | <rieux_> | it makes sense not to believe before |
| 03:35:53 | <Pseudonym> | So the belief may not be true. |
| 03:36:00 | <rieux_> | but afterward, would you still believe that it wasn't true before? |
| 03:36:06 | <roconnor> | and allows you to check any property of your code that can be expressed in the language of mathematics. |
| 03:36:24 | <Saizan> | yeah, but it's not like the theorem were not true before the proof |
| 03:36:31 | <SamB> | roconnor: well, lets you try! |
| 03:36:42 | <roconnor> | SamB: right |
| 03:36:45 | <Saizan> | i.e. you couldn't find a counterexample |
| 03:36:45 | <ksf> | truth is what stays even though you don't believe in it. |
| 03:36:55 | <Cale> | Depends on what you mean by "true". I'm of the opinion that mathematics is an entirely human invention, but it's possible to metamathematically define a set of true statements of a theory via what follows from the axioms. |
| 03:37:02 | <SamB> | Saizan: what do counterexamples have to do with it ? |
| 03:37:25 | <roconnor> | and allows you to valid any provable property of your code that can be expressed in the language of mathematics. |
| 03:37:30 | <roconnor> | validate |
| 03:37:33 | <edwardk> | i figure the truth was there before, its just that we didn't recognize it. i believe there is enough truth out there that there can be quite a bit of room for how that underlying truth can be framed, though, so I figure mathematicians and philosophers have plenty of stuff I can take ownership of in terms of construction. How is that for diplomatic neutral ground? |
| 03:37:39 | <SamB> | Saizan: well, I mean, besides that if you have both a counterexample and a proof, you've got a very big problem ;-P |
| 03:37:52 | <roconnor> | ACTION is an ultrafinitist |
| 03:38:01 | <Cale> | So while theorems don't really exist before we write them down, there's a sense in which they belong to that set. |
| 03:38:19 | <SamB> | Cale: AH! not SETS! |
| 03:38:25 | <rieux_> | my model ain't no set! |
| 03:38:29 | <SamB> | ACTION runs around screaming |
| 03:38:39 | <Saizan> | SamB: that was my point, more or less |
| 03:38:40 | <lispy> | ACTION throws lambdas at SamB |
| 03:38:55 | <SamB> | ACTION licks them |
| 03:38:56 | <vixey> | Cale but when you start to name sets like that everything goes wonky |
| 03:38:59 | <lispy> | SamB: that was a continuation I just passed you... |
| 03:39:06 | <Pseudonym> | I use "collection" if in doubt. |
| 03:39:37 | <roconnor> | <rieux_> does shedskin of a soundness theorem? -- I don't understand the word "shedskin" |
| 03:39:48 | <SamB> | anything that can turn one sphere into to spheres can't be terribly safe! |
| 03:39:48 | <rieux_> | whoa |
| 03:39:52 | <lispy> | roconnor: it's the python to C++ translator |
| 03:39:53 | <Cale> | vixey: I mean, you can take some theory, and formalise it *inside* of another theory, so that it becomes possible to talk about such sets of statements. |
| 03:39:59 | <SamB> | s/to spheres/two spheres/ |
| 03:40:03 | <tiglionabbit_> | argh. These options are in the help message for cabal, so why can't I use them? http://www.friendpaste.com/4rtkmlE1CrMA5vVdqj66uG |
| 03:40:05 | <rieux_> | s/of/have/ |
| 03:40:08 | <Cale> | vixey: You can't really do it for your outermost theory though. |
| 03:40:43 | <hatds> | maybe you could define a theory whose axioms allow you to talk about the statements of itself |
| 03:41:03 | <Cale> | In any case, sets are the right abstraction here, no matter what formalism you're using, and I'm not apologising for it ;) |
| 03:41:07 | <Saizan> | tiglionabbit_: check the spelling of extra |
| 03:41:08 | <lispy> | hatds: I bet it would either be inconsistent or incomplete :) |
| 03:41:20 | <SamB> | lispy: that isn't much of a bet |
| 03:41:38 | <Cale> | In some sense, any system suitable for mathematics can discuss itself. |
| 03:41:40 | <SamB> | that's more-or-less proven |
| 03:41:56 | <hatds> | it's not really pure though |
| 03:42:14 | <SamB> | I mean, there may be a few systems that are all three: self-describing, complete, and consistant |
| 03:42:18 | <Cale> | tiglionabbit_: exttra |
| 03:42:23 | <SamB> | but they're pretty small |
| 03:42:28 | <Cale> | tiglionabbit_: (you misspelled the option) |
| 03:42:34 | <roconnor> | SamB: and undecidable |
| 03:42:40 | <SamB> | and won't talk about any interesting systems ;-) |
| 03:42:45 | <hatds> | everything in set theory is sets, you can't have a set of "first order logic sentences in at most 5 symbols", you can only create a set with N elements and interpret them that way. |
| 03:42:51 | <tiglionabbit_> | oh gosh silly me |
| 03:42:52 | <Cale> | ah, hehe, there's too many conversations getting interleaved here :) |
| 03:43:08 | <SamB> | smaller than TNT, anyway |
| 03:43:18 | <roconnor> | SamB: the true statements of PA form a complete and consistent system that is argubably self-describing. |
| 03:43:20 | <Cale> | hatds: But you can do that, if you define 'first order logic sentences' in the right way :) |
| 03:43:25 | <Cale> | hatds: (as a set) |
| 03:43:26 | <NEEDMOAR_> | Cale: see? We need that channel! |
| 03:43:41 | <Cale> | We have #haskell-in-depth... |
| 03:43:44 | <vixey> | what channel |
| 03:43:54 | <SamB> | roconnor: hmm. maybe a little more interesting than I thought |
| 03:43:54 | <NEEDMOAR_> | Cale: nobody's talking over there! |
| 03:43:57 | <Cale> | NEEDMOAR was asking me to make a #compsci |
| 03:44:00 | <roconnor> | SamB: unless you require a "system" to be (semi-)decidable. |
| 03:44:01 | <vixey> | ugh |
| 03:44:09 | <tiglionabbit_> | Cale: thanks for that. Unfortunately, it's still not using the libraries I want it to. How can I make it compile with the right version of openssl? |
| 03:44:14 | <Cale> | actually people do talk in #haskell-in-depth regularly enough |
| 03:44:16 | <vixey> | every 'programmers' or computerology channel miserably fails |
| 03:44:34 | <SamB> | roconnor: hmm. I don't think I do. |
| 03:44:37 | <Gracenotes> | except those which turn into social channels |
| 03:44:37 | <Cale> | tiglionabbit_: I'm not sure. Remove the other version of openssl? :) |
| 03:44:43 | <NEEDMOAR_> | vixey: it was more theoretical comp. sci., logic, type theory, universal algebra, category theory, etc. |
| 03:44:46 | <tiglionabbit_> | Cale: I'm pretty sure it's part of my OS |
| 03:44:49 | <Cale> | tiglionabbit_: I'm not sure how it decides which to link in. |
| 03:44:55 | <SamB> | roconnor: I don't remember TNT being! |
| 03:45:07 | <tiglionabbit_> | I guess I could remove it temporarily, but that seems dangerous |
| 03:45:12 | <Gracenotes> | ##programming is actually pretty successful |
| 03:45:14 | <vixey> | ##algorithms is specific enough to not become tedious nonsense abotu godel |
| 03:45:20 | <edwardk> | well, there is #oasis floating around here which is basically just a 'programming semantics' channel |
| 03:45:28 | <Gracenotes> | except it's more of a social channel, and hard to start a real compsci discussion |
| 03:45:36 | <SamB> | vixey: are you talking about me? |
| 03:45:37 | <Cale> | tiglionabbit_: maybe dcoutts would know |
| 03:45:38 | <Gracenotes> | vixey: yeah, but it's dead. :. |
| 03:45:57 | <vixey> | SamB: no -- did you mention Godel? |
| 03:46:06 | <SamB> | vixey: not by name |
| 03:46:45 | <SamB> | also isn't there supposed to be, er, dots above that o? |
| 03:46:57 | <SamB> | ACTION can't seem to type them at the moment |
| 03:47:03 | <roconnor> | Goedel |
| 03:47:05 | <SamB> | ACTION also needs to go to bed now... |
| 03:47:10 | <Gracenotes> | girdle! |
| 03:47:11 | <roconnor> | or with an umlut |
| 03:47:14 | <Cale> | I already have enough channels that I miss people's PMs. |
| 03:47:38 | <lispy> | Cale: you just made me think of a bad joke |
| 03:47:50 | <Gracenotes> | tell it :, |
| 03:48:12 | <lispy> | Gracenotes: not really #haskell appropriate |
| 03:48:30 | <rieux_> | in #badjokes then |
| 03:49:29 | <vixey> | edwardk: (it's too bad I'm mostly into syntatic approach to programming languages..) |
| 03:49:36 | <vixey> | stuff like type systems etc |
| 03:49:57 | <hatds> | types rule so you are in good company |
| 03:50:10 | <vixey> | ACTION lacks years of domain theory and topology to study semantics |
| 03:50:25 | <edwardk> | vixey: i'm in the same boat alas |
| 03:50:38 | <edwardk> | vixey: i mostly just go in there to talk syntax and piss them off =) |
| 03:50:42 | <lispy> | vixey: hmm..you put types in a the syntatic category? But, types are related to the evaluation right? so does that mean types bridge syntax and semantics? |
| 03:51:00 | <koninkje> | a good deal of semantics is actually syntactic (in the way types are)... |
| 03:51:04 | <rieux_> | a type system is a denotational semantics... |
| 03:51:15 | <rieux_> | the domain is just less scary than P_\omega |
| 03:51:20 | <vixey> | edwardk: (I know they really just mean "don't go on about lisp vs XML" but I am being picky :p) |
| 03:51:37 | <edwardk> | heh |
| 03:52:08 | <roconnor> | I'm a quite hesitant to put types in the semantics category. |
| 03:52:27 | <rieux_> | really? it meets the definition |
| 03:52:37 | <rieux_> | people also say "static semantics," so it's not far from actual usage |
| 03:53:12 | <koninkje> | lispy: I'd say so. But then I'm a morphologist instead of a grammarian or semanticist |
| 03:53:18 | <Cale> | ACTION sets out to devise a semantics for Haskell which associates individual terms with Hausdorff topological spaces. ;) |
| 03:53:25 | <vixey> | morphologist sounds really cool :p |
| 03:53:33 | <roconnor> | the fact that types are preserved during reduction is usually a difficult theorem. |
| 03:53:44 | <edwardk> | I've always hated semantics. I mean look at it! its a plural pretending to be singular. Its clearly just making this up as it goes along and no one calls it on its hypocrisy. |
| 03:53:46 | <roconnor> | (and doesn't even hold in Coq ... grrrr) |
| 03:53:54 | <rieux_> | roconnor: really? maybe in denotational semantics it is |
| 03:54:01 | <vixey> | lol |
| 03:54:05 | <lispy> | roconnor: heh, really? So Coq lacks that part of type safety? |
| 03:54:06 | <rieux_> | but wright and felleisen made it easy |
| 03:54:24 | <vixey> | lispy: convertability checking of infinite objects is undecidable |
| 03:54:42 | <vixey> | so if you don't put any coinductive data into the type system you're ok |
| 03:54:42 | <Cale> | roconnor: What makes it challenging? |
| 03:54:44 | <roconnor> | I think denotational semantics is independent of type theory. |
| 03:54:48 | <koninkje> | The semantics I've liked are all, on some level, just type theory or transformations of interesting grammars |
| 03:54:57 | <lispy> | vixey: ah |
| 03:55:12 | <edwardk> | koninkje: morphology is tough because you have to deal with all the crap that the phonology folks don't want to think about or that the syntax folks think should already be taken care of for them. ;) |
| 03:55:17 | <roconnor> | Cale: I'm not entire sure. I've never done a proof. Heck, I've never even managed to follow an existing proof. |
| 03:55:28 | <lispy> | vixey: I've read just enough of sigfpe's blog to grok that but no more |
| 03:55:56 | <mmorrow> | , "[0..]" == "[0..]" |
| 03:55:57 | <lunabot> | True |
| 03:55:58 | <vixey> | roconnor: You haven't read TAPL? they cover progress ever 5 pages! |
| 03:56:23 | <hatds> | TAPL is a great book |
| 03:56:31 | <koninkje> | edwardk: tis true. Both sides want to pretend it doesn't exist (or is the other side's problem, to the extent it does exist) |
| 03:56:43 | <Saizan> | btw TAPL you just need subtyping to lose preservation of types |
| 03:56:58 | <ksf> | denotional semantics, as opposed to operational semantics, is what you get when you suddenly realise that you can do stuff with the stuff that you made out of stuff. |
| 03:57:19 | <Twey> | , [0..] == [0..] |
| 03:57:25 | <lunabot> | Killed. |
| 03:57:42 | <mmorrow> | omg lunabot can't decide! |
| 03:57:45 | <Twey> | @src [a] (==) |
| 03:57:46 | <lambdabot> | Source not found. It can only be attributed to human error. |
| 03:57:51 | <Twey> | @src [] (==) |
| 03:57:51 | <lambdabot> | [] == [] = True |
| 03:57:51 | <lambdabot> | (x:xs) == (y:ys) = x == y && xs == ys |
| 03:57:51 | <lambdabot> | _ == _ = False |
| 03:58:14 | <rieux_> | roconnor: have you tried to read "A Syntactic Approach to Type Soundness": http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.44.5122 ? |
| 03:58:22 | <Saizan> | (\x::{a:Int} -> x) {a = 1,b = 2} :: {a:Int} but that reduces to {a=1,b=2} :: {a:Int,b:Int} |
| 03:58:23 | <roconnor> | rieux_: nope |
| 03:58:26 | <vixey> | Saizan: but you can change the relation to like is more specific instead of equal and it goes ok? |
| 03:58:38 | <rieux_> | roconnor: no guarantees, but if you care, its designed to be comprehensible |
| 03:58:42 | <Saizan> | vixey: yeah |
| 03:59:00 | <roconnor> | rieux_: I take soundness on faith. |
| 03:59:13 | <rieux_> | roconnor: don't use ocaml then :) |
| 03:59:39 | <roconnor> | because type systems are proof systems, they could potentially be inconsistent. |
| 04:00:07 | <rieux_> | what does it mean for a type system to be inconsistent? |
| 04:00:29 | <vixey> | ocaml is not sound? |
| 04:00:35 | <rieux_> | vixey: now and then |
| 04:00:44 | <vixey> | I thought there was a problem with mutable references but it got fixed ? |
| 04:00:45 | <rieux_> | neither is GHC haskell, of course |
| 04:01:03 | <vixey> | oh yeah I ignore Obj.magic and unsafeCoerce |
| 04:01:03 | <roconnor> | hmm, maybe inconsistent isn't the right word here |
| 04:01:03 | <rieux_> | if you're referring to the value restriction in ML, yeah, that got fixed in the 90s |
| 04:01:09 | <roconnor> | unsound is probably better. |
| 04:01:44 | <roconnor> | So you could have unsound type systems, although people strive to avoid this. |
| 04:01:59 | <roconnor> | But I'd still call an unsound type system a type system. |
| 04:02:05 | <roconnor> | but it would be a bad type system |
| 04:02:09 | <rieux_> | vixey: more like, ive several times encountered type system extensions in minor releases that they retract in the next release |
| 04:02:11 | <roconnor> | even worse than an untyped system. :) |
| 04:02:19 | <rieux_> | roconnor, sure it's a type system |
| 04:02:29 | <rieux_> | but the theorems it proves aren't very interesting |
| 04:02:39 | <rieux_> | possibly |
| 04:02:49 | <roconnor> | this may illustrate the difference between denotational semantics (or any semantics) and type systems. |
| 04:02:59 | <rieux_> | why is that? |
| 04:03:27 | <Cale> | @quote inconsistent |
| 04:03:27 | <lambdabot> | <roconnor> says: I have a proof that Ultrafinitism is inconsistent, but the universe is too narrow to contain it. |
| 04:03:30 | <Cale> | @quote inconsistent |
| 04:03:30 | <lambdabot> | <roconnor> says: I have a proof that Ultrafinitism is inconsistent, but the universe is too narrow to contain it. |
| 04:03:35 | <Cale> | @quote intuitionist |
| 04:03:36 | <lambdabot> | Cale says: But in another sense, functional programmers are applied logicians who spend all their time proving trivial theorems in interesting ways in an inconsistent intuitionist logic. |
| 04:03:44 | <roconnor> | because I can take an untyped langauge with semantics on it, and slap an unsound type system that has nothing to do with it's semantics on top. |
| 04:03:59 | <rieux_> | sure, but no one cares if you do that |
| 04:04:13 | <rieux_> | you can also slap a different semantics on it that's inadequate with respect to the first one |
| 04:04:16 | <roconnor> | heh, I like that quote of mine. |
| 04:04:46 | <roconnor> | rieux_: but if denotational semantics were related to the type system, then this would be impossible. |
| 04:04:59 | <Cale> | roconnor: Seems lambdabot does too :) |
| 04:05:06 | <rieux_> | well, the theorem you need to prove that makes anyone care about the type system is that the two are related |
| 04:05:13 | <roconnor> | right |
| 04:05:21 | <roconnor> | that is probably soundness and completeness |
| 04:05:46 | <rieux_> | usually nothing very much like completeness. |
| 04:05:48 | <roconnor> | so I perhaps I can agree that semantics and sound type systems are related. |
| 04:06:20 | <rieux_> | well, i should take that back. you might make two versions of your type system and prove that one is complete for the other. |
| 04:06:28 | <rieux_> | that's pretty common, actually |
| 04:06:40 | <vixey> | completeness is harder to prove than soundness? |
| 04:06:56 | <rieux_> | vixey: for what? |
| 04:07:11 | <rieux_> | or: i dont know what it means to say a type system is complete. |
| 04:07:19 | <rieux_> | do you mean: "all programs that don't go wrong have a type?" |
| 04:07:24 | <Cale> | ACTION opens an orphanage for unsound and incomplete type systems who have nobody else to care for them. |
| 04:07:24 | <rieux_> | that's usually not a theorem. |
| 04:07:53 | <Twey> | ACTION laughs. |
| 04:08:20 | <Twey> | Cale's Home for Outdated Typesystems |
| 04:08:38 | <rieux_> | ACTION is sorry for suggesting he doesn't care |
| 04:09:01 | <roconnor> | vixey: I'm trying to understand the comments in your LtU thread. |
| 04:09:14 | <Saizan> | well, you can't have an interesting type system that's both consistent and complete, so you've to make a choice |
| 04:09:21 | <roconnor> | vixey: Some seem to think there is a difference between "dynamic types" and tags |
| 04:09:27 | <roconnor> | but I don't really get it |
| 04:09:35 | <roconnor> | ... although I suppose you don't either |
| 04:10:10 | <Cale> | Saizan: Only if the system can discuss the truth of universally quantified statements about arithmetic... |
| 04:10:56 | <roconnor> | @kind * -> * -> * + * -> * |
| 04:10:57 | <lambdabot> | parse error on input `*' |
| 04:11:12 | <vixey> | roconnor: I just think "confused people" and ignore it |
| 04:11:31 | <vixey> | roconnor: but it was funny that someone really mixed up what was going on in that code |
| 04:11:33 | <Cale> | which ltu thread? |
| 04:11:45 | <roconnor> | http://lambda-the-ultimate.org/node/3298 |
| 04:12:32 | <Saizan> | Cale: it also has to do with the semantics of the underlying language i guess |
| 04:12:48 | <roconnor> | > let f x = case x of { Left _ -> True } in f Right () |
| 04:12:49 | <lambdabot> | Couldn't match expected type `Either t t1' |
| 04:12:56 | <rieux_> | oy. you have summoned sam and paul |
| 04:12:57 | <roconnor> | > let f x = case x of { Left _ -> True } in f (Right ()) |
| 04:13:00 | <lambdabot> | * Exception: /tmp/1780029698889346754:71:42-69: Non-exhaustive patterns in ... |
| 04:13:08 | <roconnor> | look, a run-time type error!! |
| 04:13:10 | <roconnor> | :D |
| 04:13:25 | <vixey> | if null xs then head x ... |
| 04:13:30 | <vixey> | if null xs then head xs* ... |
| 04:13:33 | <rieux_> | > 1 `div` 0 |
| 04:13:34 | <lambdabot> | * Exception: divide by zero |
| 04:14:28 | <lispy> | > 1 `div` 0 :: Expr |
| 04:14:28 | <lambdabot> | 1 `div` 0 |
| 04:14:36 | <lispy> | yay! I fixed divide by 0. |
| 04:14:50 | <roconnor> | lispy: you should publish in a paper |
| 04:14:56 | <roconnor> | such as the Guardian |
| 04:15:04 | <rieux_> | @info Expr |
| 04:15:04 | <lambdabot> | Expr |
| 04:15:06 | <lispy> | roconnor: yeah, like that one guy |
| 04:15:10 | <rieux_> | @source Expr |
| 04:15:11 | <lambdabot> | Expr not available |
| 04:15:13 | <rieux_> | grrr |
| 04:15:42 | <roconnor> | > simplify (1 `div` 0) |
| 04:15:43 | <lambdabot> | Not in scope: `simplify' |
| 04:15:48 | <roconnor> | > simpl (1 `div` 0) |
| 04:15:49 | <lambdabot> | Not in scope: `simpl' |
| 04:15:58 | <roconnor> | @hoogle Expr -> Expr |
| 04:15:59 | <lambdabot> | Warning: Unknown type Expr |
| 04:15:59 | <lambdabot> | Prelude id :: a -> a |
| 04:15:59 | <lambdabot> | Data.Function id :: a -> a |
| 04:16:26 | <hatds> | someone stole all the expressions |
| 04:16:35 | <lispy> | I forgot which guy, but the one that said he came up with a new number system by adding a symbol to represent divison by 0 |
| 04:17:00 | <rieux_> | Leibniz? |
| 04:17:05 | <lispy> | nah, recent guy |
| 04:17:05 | <roconnor> | > reduce (1 `div` 0) |
| 04:17:07 | <lambdabot> | * Exception: divide by zero |
| 04:17:18 | <hatds> | :t reduce |
| 04:17:19 | <lambdabot> | Expr -> Expr |
| 04:17:20 | <rieux_> | Abraham Robinson? |
| 04:17:32 | <rieux_> | hmm. or IEEE? |
| 04:17:33 | <lispy> | The nullity guy |
| 04:17:36 | <lispy> | not IEEE |
| 04:17:39 | <rieux_> | oh, that was lame |
| 04:17:53 | <rieux_> | > 1 / 0 |
| 04:17:54 | <lambdabot> | Infinity |
| 04:17:56 | <Cale> | The media coverage of it was lamer than his actual paper. |
| 04:18:07 | <roconnor> | http://en.wikinews.org/wiki/British_computer_scientist's_new_"nullity"_idea_provokes_reaction_from_mathematicians |
| 04:18:18 | <lispy> | http://en.wikipedia.org/wiki/James_Anderson_(computer_scientist)#Transreal_arithmetic |
| 04:18:44 | <Cale> | If you read what it was that he actually did, it was not still not all that exciting, but it seemed worthwhile that someone would go to the trouble of doing it. |
| 04:19:34 | <Cale> | Basically, it's an IEEE-floating-point-like extension of the reals. He and a couple other guys set out to prove what they could about it. |
| 04:19:34 | <vixey> | is it an different from R U {infinity} ? |
| 04:19:34 | <roconnor> | hmmm |
| 04:19:37 | <roconnor> | ``− NaN = NaN (i.e. applying unary negation to NaN yields NaN) |
| 04:19:52 | <Twey> | Oh, he's the guy who came up with ‘nullity’ |
| 04:19:53 | <Cale> | It has +Infinity, -Infinity and NaN |
| 04:19:59 | <rieux_> | \Phi = \Phi ==> True |
| 04:20:00 | <Cale> | (or nullity) |
| 04:20:04 | <rieux_> | makes me wonder if it's consistent |
| 04:20:05 | <vixey> | oh right |
| 04:20:08 | <roconnor> | let nan = read "NaN" in - nan == (nan :: Double) |
| 04:20:10 | <roconnor> | > let nan = read "NaN" in - nan == (nan :: Double) |
| 04:20:12 | <lambdabot> | False |
| 04:20:18 | <rieux_> | if he went with false like IEEE, then it's just bottom |
| 04:20:28 | <Cale> | He wouldn't want to... |
| 04:20:41 | <rieux_> | right. so is it consistent? still reading... |
| 04:20:43 | <Twey> | "If anyone doubts me I can hit them over the head with a computer that does it." |
| 04:20:45 | <Cale> | He's inheriting the usual notion of mathematical equality |
| 04:20:47 | <Twey> | Hahaha |
| 04:20:47 | <roconnor> | I guess that's why they have the comment. |
| 04:20:51 | <Cale> | It's consistent, but it's not a ring. |
| 04:20:57 | <roconnor> | god, IEEE makes a mess out of = |
| 04:21:08 | <rieux_> | hm. no more additive inverse. |
| 04:21:11 | <roconnor> | > let nan = read "NaN" in nan + 1 == (nan :: Double) |
| 04:21:12 | <lambdabot> | False |
| 04:21:16 | <Cale> | right |
| 04:21:23 | <roconnor> | > let nan = read "NaN" in 0/0 == (nan :: Double) |
| 04:21:24 | <lambdabot> | False |
| 04:21:54 | <Twey> | NaN != NaN |
| 04:21:54 | <lispy> | "Anderson has been trying to market his ideas for transreal arithmetic and "Perspex machines" to investors. In this process, he has founded a British company called Transreal Computing Ltd. which is attempting to get funding to build a transreal computer capable of dividing by zero,[7][12] a capability already possessed by contemporary computers using the IEEE arithmetic model." |
| 04:21:58 | <ksf> | If you ask me, division by zero has one or two results, either 0 or (+inf,-inf) |
| 04:22:01 | <rieux_> | i was about to paste that same thing |
| 04:22:14 | <lispy> | I love the conclusion. |
| 04:22:14 | <Cale> | lispy: Yes, his other work is very very quackish. |
| 04:22:24 | <rieux_> | so... if we wrote a Haskell module, think we could get investors too? |
| 04:22:31 | <Twey> | Haha, I can't honestly believe he's serious |
| 04:22:39 | <Twey> | It's got to be a stunt |
| 04:22:41 | <roconnor> | oh god Transreal Computing Ltd. |
| 04:22:43 | <Cale> | Actually, I wonder how that can work as a physical device. |
| 04:22:46 | <Pseudonym> | ksf: Except that 0/0 is NaN. |
| 04:22:55 | <Cale> | His addition isn't even a continuous map. |
| 04:23:00 | <hatds> | I hate to say if, but if he really did quit his job to start a company around this idea, then maybe he is getting what he deserves |
| 04:23:05 | <hatds> | *if=this |
| 04:23:09 | <Cale> | Well... |
| 04:23:09 | <Twey> | Haha |
| 04:23:20 | <lispy> | Cale: well, you can think of the adder circuit in hardware as just one big lookup table |
| 04:23:38 | <lispy> | Cale: so non-continuous shouldn't be an issue |
| 04:23:40 | <Pseudonym> | IEEE floating point numbers are finite domains. |
| 04:24:02 | <Cale> | lispy: But the idea in his case I think was to represent numeric quantities with physical quantities, like perhaps the angle at which a beam of light was travelling, or something. |
| 04:24:39 | <ksf> | weren't analog computers abandoned for good? |
| 04:24:40 | <Pseudonym> | Analogue computers, woo. |
| 04:24:51 | <Pseudonym> | ksf: Yes and no. |
| 04:25:01 | <Pseudonym> | Technically, they still exist. |
| 04:25:01 | <lispy> | Cale: well it may pose an issue for libraries that do arbitrary precision reals, but I think for the hardware it's like Pseudonym points out, the domains are finite |
| 04:25:04 | <Twey> | Analogue computers may be the future. Some day. |
| 04:25:08 | <augustss> | mmmm, dividing by 0 |
| 04:25:10 | <Pseudonym> | If you count certian types of music synthesizer, for example. |
| 04:25:19 | <Cale> | lispy: The transreals are not finite. |
| 04:25:30 | <Cale> | lispy: They're the reals adjoined with some extra elements. |
| 04:25:38 | <lispy> | Cale: no, but the # of bit patterns that you can represent with a fixed set of bits is :) |
| 04:25:44 | <Cale> | sure |
| 04:25:51 | <Twey> | So what exactly *is* a Perspex Machine? |
| 04:25:54 | <Cale> | But that's... I don't know where you're getting that. |
| 04:26:01 | <Adamant> | Analog computers still exist. |
| 04:26:02 | <Cale> | Twey: I don't really know. |
| 04:26:02 | <Pseudonym> | Twey: Like a normal machine, only you can see through it. |
| 04:26:07 | <Cale> | hehehe |
| 04:26:07 | <Twey> | ACTION laughs. |
| 04:26:13 | <Twey> | That's exactly what I thought |
| 04:26:13 | <augustss> | Twey: if you pay, perhaps you can find out :) |
| 04:26:14 | <Adamant> | they are still used for a handful of problems. |
| 04:26:18 | <Twey> | Haha |
| 04:26:19 | <ksf> | anyway, all you get is great precision and fuzzyness, both for free, as physics is still discrete. |
| 04:26:29 | <Pseudonym> | I still use a slide rule on occasion. |
| 04:26:29 | <lispy> | Cale: well, I mean, you'd just implement IEEE with a few modifications and you could have perspex machine |
| 04:26:41 | <vixey> | ACTION divides augustss by 17 |
| 04:26:48 | <Cale> | Turns out that Anderson was really just wanted to come up with a cool case mod and get university funding to do it. |
| 04:26:54 | <Cale> | -was |
| 04:26:54 | <Twey> | ACTION laughs. |
| 04:26:57 | <Pseudonym> | Who can blame him? |
| 04:26:58 | <Adamant> | the development of memresistors may set off a burst of new research into analog computing. |
| 04:26:58 | <lispy> | Cale: hehe |
| 04:27:28 | <augustss> | I remember doing a control theory lab on an analog computer. It was really cool. |
| 04:27:41 | <Pseudonym> | Adamant: I've thought for a while that, say, LDPC decoding might be better done in analogue hardware. |
| 04:27:48 | <Adamant> | LDPC? |
| 04:27:55 | <Pseudonym> | Low density parity check. |
| 04:27:58 | <Adamant> | ah |
| 04:28:08 | <wli> | Depletion of rare earth elements is probably going to throw most computing into the dustbin. |
| 04:28:11 | <Pseudonym> | Or difference map-type optimisation. |
| 04:28:14 | <Pseudonym> | Actually... |
| 04:28:28 | <Pseudonym> | Woah. You COULD do a difference map optimisation in analogue hardware. |
| 04:28:35 | <Pseudonym> | Sudoku solver in analogue components. |
| 04:28:40 | <augustss> | Pseudonym: but is it really analog, and not multilevel digital? |
| 04:28:41 | <ksf> | well, i might trust an analogue adder with physics calculations, but it's going to be a hard sell if i'm supposed to do array indexing with it. |
| 04:28:43 | <Pseudonym> | ACTION rushes off to the patent office |
| 04:29:50 | <wli> | I'm not entirely sure what all can survive it. I'm pretty sure not most recent VLSI. |
| 04:30:13 | <Pseudonym> | They also used to use analogue computers for economical modelling. |
| 04:30:19 | <roconnor> | wli: dude, the ocean is full of stuff! |
| 04:30:30 | <Adamant> | we need our Mr. Fusion |
| 04:30:55 | <ksf> | afaik, you can synthesise each and every single element. |
| 04:31:09 | <roconnor> | ACTION breaks out the carbon nano rod computing. |
| 04:31:14 | <wli> | roconnor: I guess there are a large number of assumptions involved. |
| 04:31:19 | <scutigera> | wli: there are also organic semiconductors which are improving rapidly |
| 04:31:20 | <Pseudonym> | ACTION breaks out the technetium-plutonium magnets |
| 04:31:42 | <Pseudonym> | My boss invented a semiconductor made out of carbon, yes. |
| 04:31:46 | <Pseudonym> | Former boss. |
| 04:31:55 | <roconnor> | oh right that too |
| 04:32:01 | <roconnor> | I was thinking of rod logic |
| 04:32:25 | <Pseudonym> | Rod Logic: Private Investigator |
| 04:32:35 | <scutigera> | Pseudonym: all you need is a switch |
| 04:32:36 | <ksf> | hmm. What if our whole existence is just a quickcheck case to test the universe? |
| 04:32:55 | <wli> | scutigera: Those could help, depending on a lot of factors. |
| 04:32:56 | <Pseudonym> | ksf: Then I'm a failing test case. |
| 04:33:14 | <augustss> | ksf: I think we're the real run |
| 04:33:30 | <ksf> | well, the trick would be to find a bug without failing the test. |
| 04:33:39 | <Pseudonym> | At the very least, we owe it to the Developer to test the system to breaking point. |
| 04:33:51 | <scutigera> | wli: the energy required to make modern semi's is the real problem, not so much the materials, IMHO. |
| 04:34:23 | <wli> | scutigera: It's a more immediate problem; however, the materials are also problematic. |
| 04:34:24 | <rieux_> | hmm... i remember nick bostrom arguing that we ought to try to be interesting enough that our simulators won't want to shut us off. |
| 04:34:47 | <ksf> | that's a healthy attitude. |
| 04:34:52 | <Cale> | I wonder if our simulators have even noticed us. |
| 04:35:03 | <Cale> | Supposing that they exist. |
| 04:35:25 | <rieux_> | I kind of hope they do, because if they don't, we probably won't get a chance to try it either. |
| 04:35:40 | <roconnor> | rieux_: good thing we have 4chan |
| 04:35:55 | <ksf> | you can assume that if we're running in a metaverse, it's an unsanctioned side-project running on spare time on a mainframe allotted for finance calculations. |
| 04:36:01 | <Cale> | Imagine running a massive universe-sized version of Conway's game of life with all sorts of random crap going on, and trying to find the most interesting parts of it. |
| 04:36:12 | <scutigera> | Cale: please- this lunatic asylum called planet earth, who wouldn't be entertained and horrified all at once |
| 04:36:16 | <rieux_> | you'd look at the edges |
| 04:36:22 | <vixey> | Cale, just use grep :p |
| 04:36:37 | <sjanssen> | ACTION wonders if he's stumbled into #haskell-blah |
| 04:37:32 | <Pseudonym> | Cale: More like Core War than Conway's Life, I suspect. |
| 04:37:35 | <wli> | scutigera: Ore yields are rather dire across the board. Almost the only things not facing instant problems from energy/liquid fuel depletion are iron and aluminum. |
| 04:38:01 | <Pseudonym> | Uhm... did anyone just smell a wumpus? Or was it just me? |
| 04:38:03 | <Pseudonym> | Spooky. |
| 04:38:14 | <Cale> | Pseudonym: well, with core war, you at least know what programs are running... |
| 04:38:33 | <Cale> | (or, where the execution pointers are anyway) |
| 04:38:47 | <Pseudonym> | Yeah, you know how many programs are running. |
| 04:38:52 | <roconnor> | wli: other than uranium, we generally don't use up matterial. We just simply make it expensive to recover. |
| 04:39:10 | <ksf> | hmmmmm... does the universe really run on multiple cores, or is the plank scale just small enough to squeeze every local update into a big update loop? |
| 04:39:16 | <Pseudonym> | roconnor: There's no reason why you couldn't make uranium from waste plutonium. |
| 04:39:24 | <roconnor> | :) |
| 04:39:26 | <wli> | roconnor: s/expensive/infeasible/ |
| 04:39:31 | <roconnor> | or gold from lead |
| 04:39:36 | <scutigera> | wli: don't think the problems is instant, but it's on the way, but I'm a doomer so don't listen to me :-) |
| 04:39:48 | <Pseudonym> | roconnor: OK, we could run out of philosopher's stone. |
| 04:39:51 | <dons> | mux: around? |
| 04:39:52 | <roconnor> | scutigera: wli is a doomer |
| 04:40:00 | <Twey> | Pseudonym: I smelt a Wonko the Sane |
| 04:40:04 | <ksf> | duh, we can't run out of energy, as there's a fixed amount of it. |
| 04:40:19 | <hatds> | that's a relief |
| 04:40:23 | <Twey> | Phew |
| 04:40:27 | <Twey> | Energy crisis over |
| 04:40:29 | <scutigera> | Pseudonym: heard of Thorium cycle ? |
| 04:40:31 | <Twey> | Let's all go back to bed |
| 04:40:51 | <hatds> | good meeting everyone |
| 04:40:52 | <roconnor> | Twey: we have a new Negentropy crisis. |
| 04:40:56 | <vixey> | @remember <ksf> duh, we can't run out of energy, as there's a fixed amount of it. |
| 04:40:57 | <lambdabot> | Done. |
| 04:40:58 | <Cale> | That's a relief! I'm tired from all that worrying about running out of energy. |
| 04:41:03 | <Pseudonym> | scutigera: Have now. |
| 04:42:03 | <wli> | roconnor: More accurate, sure. |
| 04:42:24 | <scutigera> | Pseudonym: interesting stuff. Don't think there is a commercial demonstration, but I believe there are a couple of research reactors. i think they are run using haskell...(just trying to stay on topic) |
| 04:42:24 | <vixey> | :( |
| 04:42:31 | <vixey> | ACTION can't get away with not install cabal |
| 04:42:47 | <Cale> | But as long as we have the sun, we could power the entire world with a handful of metropolis-sized solar collectors if things got really tough. |
| 04:42:55 | <ksf> | cabal install fusion-reactor |
| 04:42:57 | <scutigera> | Cale: truly |
| 04:43:14 | <scutigera> | Cale: should, even if things don't get tough |
| 04:43:18 | <Cale> | scutigera: yes |
| 04:43:25 | <ksf> | we need that package. |
| 04:43:30 | <Cale> | scutigera: Though it's probably easier to spread them out. |
| 04:43:47 | <scutigera> | now where did I put that antimatter generator monad...it's around here somewhere |
| 04:43:54 | <Twey> | Cale: I like the sound of that |
| 04:44:03 | <ksf> | connect a magnet donut to your usb port and you're done. |
| 04:44:08 | <Twey> | I think New York should be converted to a solar panel. |
| 04:44:17 | <Pseudonym> | The thing that shocks me is that fusion reactors are shockingly easy to build. |
| 04:44:21 | <scutigera> | Twey: how about DC ? |
| 04:44:28 | <Pseudonym> | It's just that getting them to output more energy than you put in is hard. |
| 04:44:31 | <hatds> | solveEnergyCrisis :: World -> World |
| 04:44:32 | <Twey> | They have nice cherry trees |
| 04:44:41 | <Twey> | Hahaha |
| 04:44:49 | <scutigera> | solveEnergyCrisis :: Sun -> Joules |
| 04:44:50 | <Twey> | Pseudonym: *nods* |
| 04:45:03 | <Cale> | I think that guy from the Google talk may well have had a good point about recirculating spherical reactors. |
| 04:45:06 | <ksf> | there's a lot of feasible fusion and fission technologies, the main problem is that most can't be used to build nukes, and thus aren't researched. |
| 04:45:21 | <Twey> | Ha |
| 04:45:34 | <Pseudonym> | Cale: There's some physical limit which fusion researchers mention which he hasn't mentioned in any of his talks. |
| 04:45:37 | <Pseudonym> | I forget the name of it. |
| 04:46:01 | <copumpkin> | the zomg limit |
| 04:46:04 | <Cale> | Pseudonym: Well, he does mention the traditional reason that sort of reactor doesn't work. |
| 04:46:07 | <copumpkin> | I think |
| 04:48:13 | <scutigera> | Cale: electrostatic confinement? |
| 04:48:17 | <ksf> | ...don't forget http://en.wikipedia.org/wiki/Cold_fusion |
| 04:48:26 | <Cale> | scutigera: yeah, that's the idea |
| 04:48:35 | <Pseudonym> | Oh, Robert Bussard died. |
| 04:48:44 | <Pseudonym> | A couple of years ago. |
| 04:48:47 | <Cale> | Pseudonym: he did, but his company still exists |
| 04:48:58 | <Cale> | and I think they did get the research grant he wanted |
| 04:49:16 | <Cale> | http://en.wikipedia.org/wiki/File:Breakdown_of_the_incoming_solar_energy.svg -- Average human consumption is only about 15 TW. |
| 04:50:33 | <scutigera> | Cale: as I'm sure you know solar works. It's a false cost issue because fossil fuels are subsidized. There is a storage issue, but that's what electric cars are for :-) |
| 04:50:46 | <Cale> | scutigera: yeah |
| 04:51:15 | <scutigera> | Cale: US consuption is just under 1 TW ? |
| 04:52:13 | <Cale> | "In 2005, total worldwide energy consumption was 500 Exajoules (= 5 x 10^20 J) with 80-90% derived from the combustion of fossil fuels.[1] This is equivalent to an average energy consumption rate of 16 TW (= 1.6 x 10^13 W)" |
| 04:52:43 | <Cale> | Let's see... |
| 04:52:55 | <scutigera> | US Electricity consumption is 1 TW-Hr per year. |
| 04:53:16 | <Cale> | Yeah, this number includes apparently all energy usage. |
| 04:53:21 | <luqui> | what a... difficult unit of power |
| 04:53:21 | <Cale> | Not just electricity |
| 04:53:32 | <scutigera> | I think I calculated about 25 mi x 25 mi of solar cells to power us for electric only |
| 04:53:45 | <Cale> | luqui: that would be energy rather than power |
| 04:53:52 | <Cale> | TW/Hr would be power :) |
| 04:53:58 | <luqui> | no, that would be power per time |
| 04:54:09 | <Cale> | uh, oh, right |
| 04:54:16 | <Cale> | TW is power :) |
| 04:54:20 | <luqui> | :-) |
| 04:54:32 | <Cale> | I thought you were referring to TW hr |
| 04:54:43 | <scutigera> | he-man has the power, or was that skeletor ? |
| 04:55:06 | <copumpkin> | she-man? |
| 04:55:20 | <scutigera> | well, really it's THE MAN |
| 04:55:38 | <mmorrow> | this sight is pretty neat http://www.sq.ro/ |
| 04:55:41 | <mmorrow> | site |
| 04:55:46 | <Cale> | TW hr/year is a strange unit of power |
| 04:55:48 | <mmorrow> | well, freudian slip |
| 04:56:06 | <copumpkin> | Cale: indeed! |
| 04:56:06 | <scutigera> | Cale: I calculated US $1 trillion to install solar for US electrical capacity at $5/W |
| 04:56:35 | <roconnor> | oh, so that is like a day in Iraq |
| 04:56:52 | <Cale> | 1 ((terawatt hour) / year) = 0.000114079553 terawatts |
| 04:57:17 | <roconnor> | @go 1 terawatt hour / year |
| 04:57:18 | <lambdabot> | http://en.wikipedia.org/wiki/Watt-hour |
| 04:57:18 | <lambdabot> | Title: Kilowatt hour - Wikipedia, the free encyclopedia |
| 04:57:21 | <scutigera> | showEFloat |
| 04:57:22 | <luqui> | Man, that car is going well over 15 kilometers squared per mile-second! |
| 04:57:24 | <roconnor> | oh right, that doesn't work anymore |
| 04:57:33 | <copumpkin> | lol |
| 04:57:34 | <Cale> | @go 1 terawatt hour / year in terawatts |
| 04:57:35 | <lambdabot> | http://en.wikipedia.org/wiki/Watt-hour |
| 04:57:35 | <lambdabot> | Title: Kilowatt hour - Wikipedia, the free encyclopedia |
| 04:57:37 | <Cale> | pff |
| 04:57:38 | <Cale> | yeah |
| 04:58:02 | <Cale> | Also, google calculator doesn't appear to know what TW is. |
| 04:58:24 | <Cale> | You have to write terawatt apparently. |
| 04:59:04 | <Cale> | luqui: haha |
| 04:59:11 | <hatds> | or just ask for hours per year |
| 04:59:26 | <Cale> | which also doesn't work... |
| 04:59:28 | <luqui> | @go convert 1 terawatt hour / year to terawatts |
| 04:59:30 | <lambdabot> | http://en.wikipedia.org/wiki/Watt-hour |
| 04:59:30 | <lambdabot> | Title: Kilowatt hour - Wikipedia, the free encyclopedia |
| 04:59:32 | <luqui> | oh lame |
| 04:59:38 | <hatds> | "how many hours per year" |
| 04:59:50 | <scutigera> | hey, isn't there a units/dimensions hackage ? |
| 04:59:57 | <luqui> | it's 0.000114 |
| 05:00:01 | <luqui> | says google |
| 05:00:15 | <luqui> | really, @go ought to extract that, no? :-) |
| 05:00:24 | <luqui> | (yes yes, patches welcome, i know ;-) |
| 05:00:25 | <Cale> | 15 km^2 / (mi s) is about 33554 km/h |
| 05:00:30 | <rieux_> | > 1 / (24 * 365) :: Double |
| 05:00:31 | <lambdabot> | 1.1415525114155251e-4 |
| 05:00:39 | <luqui> | well, that's why I was surprised! |
| 05:00:47 | <ksf> | there's going to be wolfram alpha soon, no need to hack something up. |
| 05:01:15 | <luqui> | yeah, lambda bot will have to get on that quick! |
| 05:01:30 | <copumpkin> | @alpha male |
| 05:01:30 | <lambdabot> | Unknown command, try @list |
| 05:01:42 | <Cale> | But that's 3.10 * 10^-5 in the one true unit. |
| 05:01:56 | <Cale> | Er, closer to 3.11 * 10^-5 |
| 05:02:21 | <copumpkin> | what's the "standard" second? |
| 05:02:27 | <vixey> | 1 |
| 05:02:33 | <luqui> | Cale, what is that in scalar? |
| 05:02:35 | <copumpkin> | :) |
| 05:02:41 | <luqui> | (if I calculate correct) |
| 05:02:48 | <scutigera> | 1 :+ 0 |
| 05:02:52 | <roconnor> | 1 pound pound per pound in U.S. Dollar meters per second squared |
| 05:02:53 | <copumpkin> | what is 1 second defined as, I mean |
| 05:03:07 | <Cale> | The second is the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom. |
| 05:03:17 | <scutigera> | don't forget about furlongs per fortnight... |
| 05:03:26 | <copumpkin> | Cale: wow, ok :) |
| 05:03:30 | <hatds> | .002 cents in dollars |
| 05:03:53 | <Cale> | This definition refers to a cesium atom at rest at a temperature of 0 K (absolute zero), and with appropriate corrections for gravitational time dilation. The ground state is defined at zero magnetic field. |
| 05:03:54 | <roconnor> | ((1 pound force) divided by (1 pound)) times (1 British pound) = 14.7776409 m U.S. Dollars / s2 |
| 05:03:56 | <rieux_> | copumpkin: it used to be defined in terms of the speed of light and a particular (steel?) cube in paris |
| 05:04:20 | <luqui> | Cale, which is the speed in sqrt(Joules/kilogram) ;-) |
| 05:04:21 | <hatds> | you mean the unit mass? |
| 05:04:22 | <copumpkin> | how did that cube interact with the speed of light? |
| 05:04:24 | <Cale> | rieux_: You're thinking of the kilogram? |
| 05:04:29 | <rieux_> | no, the unit length |
| 05:04:30 | <scutigera> | wasn't that a steel rod which was 1 meter |
| 05:04:32 | <luqui> | er rather, i'm asking, I guess... |
| 05:04:32 | <copumpkin> | ah :P |
| 05:04:37 | <rieux_> | rod, orry |
| 05:04:47 | <quicksilver> | but they turned it all around. |
| 05:04:57 | <scutigera> | hey I'm installing brainf*ck, is that a good idea ? |
| 05:05:00 | <quicksilver> | now a metre is defined to be the length light travels in (1/c) of a second. |
| 05:05:01 | <copumpkin> | and did the hokey pokey? |
| 05:05:05 | <quicksilver> | and c is defined as a fixed constant. |
| 05:05:10 | <hatds> | number of horns on a unicorn acre in tea spoons per light year |
| 05:05:15 | <hatds> | google that :) |
| 05:05:15 | <luqui> | scutigera, provided that you understand that the name is referring to a transition in brain state |
| 05:05:26 | <scutigera> | a transition to... |
| 05:05:28 | <quicksilver> | and the poor steel rod is out of a job. |
| 05:05:32 | <Cale> | (metre) In 1983, it was redefined by the International Bureau of Weights and Measures (BIPM) as the distance travelled by light in free space in 1⁄299,792,458 of a second. |
| 05:05:35 | <ksf> | it's made of http://en.wikipedia.org/wiki/Constantan |
| 05:05:58 | <quicksilver> | won't somebody *please* think of the steel rods? |
| 05:05:59 | <rieux_> | platinum! |
| 05:06:02 | <scutigera> | no brainf*ck for me, readline-1.0.1.0 failed during the configure step. |
| 05:06:17 | <Twey> | How on Earth does that work? |
| 05:06:21 | <Cale> | and iridium :) |
| 05:06:26 | <roconnor> | Cale: ya, someone was asking if the speed of light was uncomputable. I said that it was not only computable, but rational. |
| 05:06:34 | <Twey> | A teaspoon is a measurement of volume |
| 05:06:39 | <Cale> | roconnor: hehe |
| 05:06:42 | <Twey> | Light-years are a measurement of distance |
| 05:06:49 | <Twey> | And acres are a measurement of area |
| 05:06:55 | <luqui> | brainfsck: corrupted filesystem |
| 05:06:55 | <Cale> | Of course, the number 1 is computable! |
| 05:07:02 | <roconnor> | > 1 |
| 05:07:02 | <Twey> | 1, 2, and 3 dimensions |
| 05:07:03 | <lambdabot> | 1 |
| 05:07:08 | <roconnor> | yep |
| 05:07:14 | <Twey> | Haha |
| 05:07:19 | <Twey> | It makes no sense |
| 05:07:19 | <luqui> | Cale, that depends on your observation coalgebra |
| 05:07:23 | <edwardk> | ok. all MTL types converted. http://comonad.com/haskell/monad-ran/dist/doc/html/monad-ran/Control-Monad-Ran.html |
| 05:07:53 | <david_> | I have a predicate function which I'd like to run on a infinite long list of numbers (which of course will stop when the function returns true and thus keep running only when returning false) |
| 05:08:22 | <Twey> | david_: (head .) . filter |
| 05:08:39 | <david_> | hmmmm |
| 05:08:39 | <Twey> | Laziness FTW |
| 05:08:51 | <david_> | what are those dots? |
| 05:08:52 | <vixey> | head . filter p |
| 05:08:58 | <Twey> | Composition |
| 05:08:59 | <Twey> | Yeah |
| 05:09:02 | <vixey> | p is the predicate |
| 05:09:03 | <Cale> | "only certain molten salts and halogens are corrosive to solid iridium" :) |
| 05:09:05 | <david_> | ah okay |
| 05:09:29 | <luqui> | > head . filter (> 1000) $ [1..] |
| 05:09:30 | <lambdabot> | 1001 |
| 05:09:47 | <Twey> | ((head .) . filter) p l ≡ (head . filter p) l ≡ head $ filter p l |
| 05:09:58 | <luqui> | ACTION has started thinking that other languages are lazy, and writing way too many infinite loops |
| 05:10:03 | <vixey> | > head . filter (liftA2 (&&) (> 1000) ((== 0) . (`mod` 7))) $ [1..] |
| 05:10:05 | <lambdabot> | 1001 |
| 05:10:11 | <vixey> | :D |
| 05:10:39 | <vixey> | > head . filter (liftA2 (&&) ((==)`ap`reverse) (liftA2 (&&) (> 1000) ((== 0) . (`mod` 7)))) $ [1..] |
| 05:10:40 | <lambdabot> | No instance for (Integral [a]) |
| 05:10:40 | <lambdabot> | arising from a use of `mod' at <i... |
| 05:10:50 | <copumpkin> | oh my |
| 05:11:06 | <luqui> | > 7 * ceil(1000/7) |
| 05:11:07 | <lambdabot> | Not in scope: `ceil' |
| 05:11:11 | <luqui> | > 7 * ceiling(1000/7) |
| 05:11:12 | <lambdabot> | 1001 |
| 05:11:27 | <copumpkin> | zomg this is haskell! |
| 05:11:40 | <mmorrow> | haha, i always do that with ceil(ing) |
| 05:12:11 | <david_> | what is the '$'? |
| 05:12:15 | <copumpkin> | @src $ |
| 05:12:15 | <lambdabot> | f $ x = f x |
| 05:12:27 | <luqui> | it's just a low precedence form of function application |
| 05:12:27 | <Cale> | david_: $ is function application but with very low precedence |
| 05:12:35 | <luqui> | i win |
| 05:12:45 | <mmorrow> | and one way to go insane in the code in C and Haskell in parallel where the Haskell is using sizeOf a lot |
| 05:12:51 | <mmorrow> | s/in/is/ to |
| 05:13:21 | <Cale> | f . g . h $ x y z is the same as (f . g . h) (x y z), which is the same as f (g (h (x y z))) |
| 05:13:29 | <ksf> | >>= shouldn't bind tighter than $ |
| 05:13:33 | <david_> | oh ok |
| 05:13:52 | <luqui> | and one way to go is tosane in the code in C and Haskell in parallel where the Haskell is using sizeOf a lot |
| 05:13:55 | <vixey> | > 1001`div`7 |
| 05:13:56 | <lambdabot> | 143 |
| 05:14:01 | <vixey> | > 143*7 |
| 05:14:03 | <lambdabot> | 1001 |
| 05:14:03 | <vixey> | impossible |
| 05:14:10 | <Twey> | ksf: Practically speaking, I find it useful |
| 05:14:12 | <Twey> | Anyway, to bed |
| 05:14:15 | <Twey> | 'night |
| 05:14:27 | <copumpkin> | ACTION doesn't like using >>= |
| 05:14:36 | <copumpkin> | I much prefer =<< most of the time |
| 05:14:44 | <luqui> | vixey, impossible? |
| 05:14:49 | <Cale> | =<< works really well in do-blocks :) |
| 05:15:03 | <luqui> | ACTION never uses >>= |
| 05:15:08 | <ksf> | I rather read my functions left to right |
| 05:15:08 | <luqui> | it's either =<< or do notation |
| 05:15:17 | <scutigera> | cabal readline install failed, can't seem to find install dir, anyone know where it should be hiding ? |
| 05:15:23 | <ksf> | but, actually, we should have it switchable. |
| 05:15:29 | <copumpkin> | I prefer reading my functions right to left, and as luqui does, I'll use a do block otherwise |
| 05:15:43 | <Cale> | scutigera: somewhere under ~/.cabal ? |
| 05:15:44 | <luqui> | data flows right to left and top to bottom |
| 05:15:52 | <luqui> | =) |
| 05:15:56 | <copumpkin> | damn right! |
| 05:16:08 | <scutigera> | Cale: did a find looking for config.log and none shows up (??) |
| 05:16:16 | <sclv> | but functions should be read like books -- left to right, and top to bottom. |
| 05:16:20 | <copumpkin> | combining a fancy chain of composed functions with >>= means switching directiongs a lot |
| 05:16:23 | <luqui> | yep :-) |
| 05:16:30 | <blackh> | good advice - I was never sure about >>= and =<< |
| 05:16:36 | <copumpkin> | how about we replace all uses of . with >>> |
| 05:16:40 | <copumpkin> | and then we can use >>= too |
| 05:16:43 | <sclv> | yech!!! |
| 05:16:46 | <copumpkin> | :P |
| 05:16:47 | <ksf> | usually, it's just one bind and one <$>. |
| 05:16:51 | <copumpkin> | then we can read everything left to right |
| 05:17:01 | <luqui> | well if the emphasis is on the data, then yeah |
| 05:17:14 | <ksf> | I usually don't use more than one bind on a line. |
| 05:17:19 | <luqui> | but usually it isn't, because haskell is a *function*al language :-) |
| 05:17:41 | <sclv> | I don't mind more than one bind, as long as they're not inside a do block to begin with. |
| 05:17:59 | <copumpkin> | > filter (> 1000) >>> head $ [1..] |
| 05:18:01 | <lambdabot> | 1001 |
| 05:18:09 | <copumpkin> | that isn't so bad is it? :P |
| 05:18:10 | <luqui> | i'm still enough of a perler that I like lots of syntactic choices, in order to convey my intent the most clearly |
| 05:18:20 | <luqui> | ew |
| 05:18:29 | <Gracenotes> | you means <<< |
| 05:18:32 | <Gracenotes> | shirley |
| 05:18:36 | <copumpkin> | :P |
| 05:18:41 | <luqui> | > ($ [1..]) >>> filter (>1000) >>> head |
| 05:18:42 | <sclv> | ACTION really wants a $ that is of higher precedence than =<< but lower precedence than everything else. |
| 05:18:43 | <lambdabot> | Overlapping instances for Show (([t] -> [a]) -> a) |
| 05:18:43 | <lambdabot> | arising from ... |
| 05:18:50 | <copumpkin> | well, if we want our functions to work from left to right |
| 05:18:53 | <copumpkin> | we gotta use >>> |
| 05:19:01 | <luqui> | oh whoops |
| 05:19:13 | <luqui> | man, what's the best way to get the data on the left? |
| 05:19:16 | <copumpkin> | hmm |
| 05:19:30 | <Gracenotes> | eek |
| 05:19:32 | <quicksilver> | a low precedence flipped ($) ? |
| 05:19:33 | <vixey> | > (const 3 >> (*5))() |
| 05:19:35 | <lambdabot> | No instance for (Num ()) |
| 05:19:35 | <vixey> | > (const 3 >>> (*5))() |
| 05:19:37 | <lambdabot> | arising from the literal `5' at <intera... |
| 05:19:39 | <lambdabot> | 15 |
| 05:19:43 | <copumpkin> | > ($ [1..]) $ filter (>1000) >>> head |
| 05:19:44 | <lambdabot> | 1001 |
| 05:19:50 | <Gracenotes> | ewwwwwwwwwww |
| 05:19:52 | <copumpkin> | how bout that ? |
| 05:19:57 | <luqui> | oh that's what I meant |
| 05:20:06 | <luqui> | composition confusion, what's your fusion? |
| 05:20:09 | <copumpkin> | mmm beauty |
| 05:20:21 | <copumpkin> | now let's start throwing Kleisli in thre |
| 05:20:52 | <copumpkin> | we can send it straight to print |
| 05:20:55 | <Cale> | :t (<=<) |
| 05:20:57 | <lambdabot> | forall b (m :: * -> *) c a. (Monad m) => (b -> m c) -> (a -> m b) -> a -> m c |
| 05:21:51 | <luqui> | > ($ [1..5]) $ map (\x->[x,2*x]) >=> map (\x->[x,x+1]) |
| 05:21:53 | <lambdabot> | [[1,2],[2,3],[2,3],[4,5],[3,4],[6,7],[4,5],[8,9],[5,6],[10,11]] |
| 05:22:27 | <sclv> | foo . bar . baz =<< qux . garply $ zed -- i really heat that this doesn't work as it reads. |
| 05:23:01 | <sclv> | s/heat/heat/ |
| 05:23:07 | <luqui> | sclv, huh? |
| 05:23:07 | <sclv> | erm. s/heat/hate/ that is |
| 05:23:20 | <luqui> | sclv, do you mean <=< instead? |
| 05:23:40 | <hatds> | (foo . bar . baz =<< qux . garply) $ zed |
| 05:23:46 | <hatds> | is that it? |
| 05:23:54 | <luqui> | > ?foo . ?bar <=< ?baz . ?qux $ ?zed |
| 05:23:55 | <lambdabot> | Unbound implicit parameters (?foo::b -> m c, |
| 05:23:55 | <lambdabot> | ... |
| 05:23:58 | <physique> | haskell is too complicated |
| 05:23:59 | <luqui> | :t ?foo . ?bar <=< ?baz . ?qux $ ?zed |
| 05:24:00 | <lambdabot> | forall b b1 (m :: * -> *) c b2 a. (?zed::a, Monad m, ?qux::a -> b2, ?baz::b2 -> m b1, ?bar::b1 -> b, ?foo::b -> m c) => m c |
| 05:24:10 | <sclv> | luqui: I just mean that it works as hatds describes, but I end up writing it when I mean: foo . bar . baz =<< (qux . garply $ zed ) |
| 05:24:25 | <luqui> | physique, i would totally recommend you not ever looking at another language then... |
| 05:24:28 | <luqui> | (except maybe forth?) |
| 05:24:41 | <Cale> | physique: hehe |
| 05:25:10 | <physique> | don't take offense |
| 05:25:12 | <david_> | is there a way of tracing/printing which number/item in the list I'm currently on? |
| 05:25:13 | <physique> | i'd love to learn it |
| 05:25:15 | <sclv> | and I write things like this quite a bit, so the extra parens bug me because the precedence of =<< is too high or $ is too low or a bit of both. |
| 05:25:38 | <physique> | but i have a fear of it just by looking at that code |
| 05:25:43 | <Cale> | physique: It's really not so bad, the people here are trying hard to make it confusing ;) |
| 05:25:45 | <rieux_> | physique: it's not always as complicated as all this :) |
| 05:27:06 | <hatds> | david_: a few choices: 1) make your function carry an extra parameter that gets updated with each recrusion, 2) use mapAccumL, 3) change the [x] argument to a [(int,x)] and call it as foo $ zip [1..] xs |
| 05:27:48 | <edwardk> | ugh, well i now know a name for the class of grammars i was parsing with parsimony. they are tree adjoining grammars |
| 05:28:00 | <sclv> | whyz that an ugh? |
| 05:28:05 | <luqui> | Cale, that's not necessarily true... the recent code hasn't been that complicated; it's just definitely doesn't look like other languages |
| 05:28:11 | <edwardk> | sterling clover the asymptotics =) |
| 05:28:37 | <luqui> | except for vixey's pointfree stuff :-) |
| 05:28:59 | <sclv> | i musta missed that discussion. they're bad? |
| 05:29:17 | <edwardk> | http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.52.1908 talks about it a bit |
| 05:29:25 | <Cale> | luqui: Well, ($ x) $ <some function> is certainly not aiming for clarity... |
| 05:29:39 | <edwardk> | i'm not yet entirely sure that i fall into the full parsing algorithm class they describe, but its close |
| 05:29:41 | <copumpkin> | edwardk: omg you reinvented the wheel? |
| 05:29:46 | <luqui> | Cale, okay fair enough :-) |
| 05:29:48 | <hohoho> | is there good document about extention of haskell type system? |
| 05:29:57 | <edwardk> | copumpkin: happens a lot |
| 05:30:03 | <copumpkin> | eww, it's one of them blurry pdfs |
| 05:30:19 | <hatds> | hohoho: ghc user manual? |
| 05:30:21 | <rieux_> | hohoho: http://www.haskell.org/ghc/docs/latest/html/users_guide/ghc-language-features.html |
| 05:30:30 | <edwardk> | copumpkin: what i do is whenever i tackle a new discipline i use the age of the papers i'm reinventing as a benchmark of how far i have to go |
| 05:30:40 | <edwardk> | copumpkin: so i'm now 15 years behind in NLP ;) |
| 05:30:41 | <sclv> | if you reinvent a round one, that's a win. |
| 05:30:44 | <copumpkin> | lol |
| 05:30:52 | <rieux_> | hohoho: especially sections 8.4 - 8.8 |
| 05:31:25 | <edwardk> | copumpkin: i'm close to current on most haskelly things, and ~25-30 years behind in some areas of category theory. |
| 05:31:30 | <hohoho> | thanks so much |
| 05:31:53 | <edwardk> | copumpkin: the worst was as a computational geometer i wound up rederiving and appealing to a 120 year old coordinate system by eduard study |
| 05:32:06 | <edwardk> | copumpkin: at least there i had something to contribute |
| 05:32:09 | <hohoho> | its a only docmunt ? is ther any paper ? |
| 05:32:16 | <copumpkin> | lol |
| 05:32:22 | <sclv> | hohoho: many papers |
| 05:32:25 | <sclv> | many many |
| 05:32:31 | <copumpkin> | hohoho: are you santa claus? |
| 05:32:56 | <copumpkin> | ホほホ |
| 05:33:08 | <sclv> | edwardk: that metric only works if you think the field is on the right track. :-) |
| 05:33:22 | <david_> | Is it impossible to make a function do two things? Like "print this and return that"? |
| 05:33:26 | <luqui> | edwardk, ummm.... |
| 05:33:30 | <luqui> | edwardk, now i'm depressed |
| 05:33:32 | <copumpkin> | david_: you can sort of :P |
| 05:33:36 | <hohoho> | hehe |
| 05:33:39 | <luqui> | edwardk, ixi and combinator calculus is from the 60s |
| 05:33:48 | <copumpkin> | a -> (IO (), b) or something :P |
| 05:33:57 | <edwardk> | luqui: yeah but the IXi stuff you're doing is cool =) |
| 05:34:09 | <luqui> | =) |
| 05:34:14 | <copumpkin> | david_ but if you're just printing stuff, you're wasting the output of the IO computation anyway |
| 05:34:16 | <hatds> | a -> IO b sounds more like what you want |
| 05:34:19 | <copumpkin> | so you might as well merge it into one |
| 05:34:19 | <edwardk> | luqui: my last type system wasn't much more recent belnap's display logic was 70s-ish =) |
| 05:34:40 | <luqui> | ooohh something ending in "logic" that i haven't heard of |
| 05:34:49 | <luqui> | *googles ferociously* |
| 05:34:56 | <edwardk> | Its hard to find on the internet |
| 05:34:57 | <copumpkin> | ACTION feels sorry for that logic |
| 05:35:06 | <edwardk> | you can find some papers by greg restall |
| 05:35:17 | <edwardk> | display logic and gaggle theory |
| 05:35:50 | <david_> | copumpkin: yea, but how? |
| 05:36:03 | <edwardk> | luqui: the gist of display logic is quite simple. |
| 05:36:08 | <copumpkin> | david_: f a b = print a >> return b |
| 05:36:21 | <edwardk> | luqui: most of the time when you roll your own logic you spend all your time proving the admissability of cut, no? |
| 05:36:55 | <edwardk> | luqui: you wind up commuting everything over everything to show that you can show the cut down the tree and make it vanish |
| 05:36:59 | <luqui> | edwardk, um, you mean the fact that you can prove lemmas? |
| 05:37:13 | <edwardk> | luqui: as you add connectives the work becomes O(n^2) in the number of connectives in your logic |
| 05:37:17 | <edwardk> | yeah |
| 05:37:41 | <sclv> | edwardk: that paper seems to leave open that you can get really good average case bounds for certain subclasses and clever algorithms tho... |
| 05:37:42 | <luqui> | hmm ok |
| 05:37:48 | <edwardk> | display logic replaces that laborious process by providing a set of 7 local conditions for a connective to satisfy such that if they are all satisfied, then you can add ANY such connective to your logic |
| 05:38:00 | <luqui> | oh neat |
| 05:38:00 | <edwardk> | sclv: good. i hadn't made it that far =) |
| 05:38:05 | <sclv> | which gives hope at the expense of more complex reasoning... |
| 05:38:06 | <copumpkin> | time for bed, g'night :) |
| 05:38:19 | <sclv> | ACTION is a skimmer of all disciplines, master of none. |
| 05:38:32 | <edwardk> | luqui: so what i asked was basically what happens when you take display logic as your basis for the curry howard correspondence |
| 05:38:41 | <edwardk> | because it has a very nice framework for mixing various modal logics |
| 05:38:55 | <edwardk> | since S4, etc. all provide connectives that satisfy the laws! |
| 05:39:14 | <luqui> | oh sweet |
| 05:39:56 | <edwardk> | but in essence the display property is that you can shove everything to either side of the turnstile, leaving one value 'on display' for cut to apply |
| 05:41:55 | <edwardk> | anyways, since i generally hate semantics, what i love about display logic is the process of generating the display of a variable is basically just a syntactic operation of 'zipping' through your logical connectives |
| 05:42:11 | <edwardk> | its a logical zipper |
| 05:42:31 | <edwardk> | or rather it treats the turnstile as one |
| 05:42:33 | <luqui> | oh yeah, i can see that. cool! |
| 05:43:01 | <edwardk> | you'll never hear it said by anyone else that way, but thats my personal take on display logic |
| 05:43:02 | <mofmog> | ACTION wrote a brainf*ck compiler |
| 05:43:03 | <luqui> | and then the thing to the right is the focus |
| 05:43:10 | <edwardk> | yep |
| 05:43:55 | <edwardk> | so you a single element focus on the right, and a single element focus on the left by focusing on a root of a tree and you can graft |
| 05:44:35 | <edwardk> | on paper you spend a ton of time farting around with polarity, etc. but in a computer its all fairly elegant |
| 05:44:52 | <edwardk> | you just run out of symbols ;) |
| 05:46:19 | <luqui> | um. kind of lost me there |
| 05:46:34 | <luqui> | you mean there aren't enough letters? |
| 05:46:34 | <edwardk> | well, i mean physical ones to type with |
| 05:46:36 | <edwardk> | =) |
| 05:46:41 | <edwardk> | yeah |
| 05:46:58 | <edwardk> | the type system that emerged wasn't something i'd wish on my worst enemy |
| 05:47:05 | <edwardk> | well maybe if he wanted a break from DDC. |
| 05:47:16 | <luqui> | lol |
| 05:48:17 | <edwardk> | sclv: yeah i noticed that it said these were larger than cfgs, and fortunately my grammars should be the same size |
| 05:48:41 | <edwardk> | sclv: i just use the bottom up parsing technique, so i'm hunting to find what they''ve figured out about my asymptotics |
| 05:48:59 | <edwardk> | sclv: the nice thing is i seem to already be doing most of the optimizations they mention |
| 05:50:09 | <sclv> | i guessed with a monoidal approach lots of those would come by construction... |
| 05:51:01 | <david_> | copumpkin: I can't seem to get it working http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4634#a4634 |
| 05:51:17 | <edwardk> | sclv: yeah basically what it looks like is that i generate via 'concatenation and complemention' in their terminology, and then perform adjunction between separate parallel parses |
| 05:51:50 | <edwardk> | concatenation and completion |
| 05:52:05 | <edwardk> | actually all 4 steps fall into my process |
| 05:52:22 | <edwardk> | its like someone wrote the paper in my head ;) |
| 05:52:28 | <edwardk> | i love when that happens |
| 05:52:56 | <sclv> | an elegant rendition of a known algorithm is always a win |
| 05:52:56 | <edwardk> | i partition differently than they do though |
| 05:53:16 | <luqui> | david_, wrapper is not a pure function; it does I/O |
| 05:53:22 | <luqui> | david_, so you are not allowed to pass it to filter |
| 05:53:24 | <edwardk> | i chunk on arbitrary terminals, not on some mythical local tree boundary |
| 05:53:44 | <david_> | luqui: I see |
| 05:54:01 | <luqui> | david_, if it's just for debugging, there's a hack you can do |
| 05:54:12 | <david_> | mkay, and that is? |
| 05:54:14 | <luqui> | david_, but, the right way to do this would be filterM I think |
| 05:54:26 | <luqui> | i've never used filterM before |
| 05:54:28 | <luqui> | :t filterM |
| 05:54:29 | <lambdabot> | forall a (m :: * -> *). (Monad m) => (a -> m Bool) -> [a] -> m [a] |
| 05:54:32 | <edwardk> | sclv: i'm ok with stealing terminology and optimizations from known literature =) |
| 05:54:41 | <edwardk> | right now its still a pretty cool applicative parser |
| 05:54:57 | <luqui> | edwardk, yeah, replacing filter with filterM and changing main to monadic style should do the trick |
| 05:55:19 | <edwardk> | i'll get right on that |
| 05:55:26 | <luqui> | lol |
| 05:55:33 | <luqui> | i'm sure david_ would appreciate it |
| 05:55:39 | <sclv> | ACTION idly wonders if memotables would do anything interesting. |
| 05:55:53 | <edwardk> | luqui is a busy man. glad he figured out delegation =) |
| 05:56:01 | <edwardk> | sclv: heh actually they DO! |
| 05:56:08 | <edwardk> | that was why i wrote the LZ78 stuff! |
| 05:56:13 | <dons> | The Haskell Platform is live: http://hackage.haskell.org/platform/ |
| 05:56:20 | <luqui> | w00t |
| 05:56:21 | <dons> | go get haskell for your system (and report bugs!) |
| 05:56:34 | <dons> | install it on your friends' windows machines |
| 05:56:37 | <edwardk> | i can use it to improve any expensive monoid over a fairly redundant source |
| 05:56:53 | <luqui> | ah man, no support for ubuntu |
| 05:57:01 | <edwardk> | basically dictionary based data compression algorithms give rise to data structures for me |
| 05:57:13 | <edwardk> | sclv: did you see the lz78 code? |
| 05:57:23 | <sclv> | edwardk: this vaguely reminds me of an icfp challenge a few years back on simplifying the representation of structured text, is how the association came to mind. |
| 05:57:24 | <dons> | luqui: its not too late to package it for ubuntu :) |
| 05:57:28 | <sclv> | didn't see the code yet |
| 05:57:31 | <david_> | how do I make the main "monadic style"? |
| 05:57:32 | <sclv> | link ? |
| 05:57:46 | <edwardk> | http://comonad.com/haskell/monoids/dist/doc/html/monoids/Data-Generator-Compressive-LZ78.html |
| 05:58:17 | <edwardk> | basically i 'decompress' in the monoid instead of the original alphabet |
| 05:58:29 | <edwardk> | it works a bit better with LZAP instead of LZ78 |
| 05:58:40 | <luqui> | david_, the easiest way is to put it in a do block, and use <- for everything that comes from a monad |
| 05:58:41 | <edwardk> | and Bentley-McIlroy gets you sharing in the large |
| 05:58:51 | <dons> | platform on reddit, mod up! http://www.reddit.com/r/programming/comments/8i7vq/the_haskell_platform_is_live_a_single_standard/ |
| 05:59:06 | <luqui> | david_, oh, i just realized something |
| 05:59:31 | <luqui> | david_, this isn't going to work at all! IO is not lazy enough |
| 05:59:50 | <luqui> | :t dropWhileM |
| 05:59:51 | <lambdabot> | Not in scope: `dropWhileM' |
| 05:59:56 | <luqui> | :t takeWhileM |
| 05:59:57 | <lambdabot> | Not in scope: `takeWhileM' |
| 06:00:00 | <luqui> | hmmm |
| 06:00:19 | <edwardk> | sclv: basically as long as adjunction isn't appreciably more expensive than concatenation the LZ(78|W|AP)/Bentley-McIlroy/RLE/etc, stuff can be a big win |
| 06:00:21 | <david_> | Oh well.. I'm off for a while.. |
| 06:00:46 | <sclv> | dons: awesome! |
| 06:00:49 | <luqui> | david_, oh that's too bad, because i just thought of a neat way to do it |
| 06:01:33 | <dons> | the one click windows installer is a bit of a game changer (and the Mac OS X one is a day or so away) |
| 06:01:37 | <luqui> | > splitAt (> 10) [1..20] |
| 06:01:38 | <lambdabot> | The section `(> 10)' takes one argument, |
| 06:01:38 | <lambdabot> | but its type `Int' has none |
| 06:01:41 | <luqui> | er |
| 06:01:46 | <luqui> | > split (> 10) [1..20] |
| 06:01:47 | <lambdabot> | Couldn't match expected type `[t1] -> t' |
| 06:01:47 | <dons> | now the fun task of adding new libraries and making things work :) |
| 06:01:50 | <luqui> | daft! |
| 06:01:57 | <sclv> | edwardk: that's nice code! i had to look closely to even see where the compression was happening at all. |
| 06:02:00 | <ivanm> | dons: why isn't gentoo listed under distros? |
| 06:02:11 | <tiglionabbit_> | weird, I just did emerge cabal on gentoo and it didn't put a cabal command anywhere |
| 06:02:15 | <luqui> | @hoogle (a -> Bool) -> [a] -> ([a],[a]) |
| 06:02:15 | <lambdabot> | Prelude break :: (a -> Bool) -> [a] -> ([a], [a]) |
| 06:02:15 | <lambdabot> | Prelude span :: (a -> Bool) -> [a] -> ([a], [a]) |
| 06:02:15 | <lambdabot> | Data.List break :: (a -> Bool) -> [a] -> ([a], [a]) |
| 06:02:17 | <dons> | ivanm: url please! |
| 06:02:24 | <ivanm> | http://code.haskell.org/gentoo/gentoo-haskell/dev-haskell/haskell-platform/haskell-platform-2009.0.0.ebuild |
| 06:02:24 | <dons> | ivanm: if you've got a url pointing to the gentoo package |
| 06:02:27 | <dons> | thanks |
| 06:02:27 | <edwardk> | sclv: =) |
| 06:02:34 | <ivanm> | In the Haskell overlay |
| 06:02:36 | <dons> | is there a sexier page? |
| 06:02:44 | <ivanm> | dons: I doubt it ;) |
| 06:02:47 | <dons> | http://code.haskell.org/gentoo/gentoo-haskell/dev-haskell/haskell-platform/ ? |
| 06:02:55 | <ivanm> | Or that |
| 06:03:04 | <ivanm> | depends if you want the specific version or not |
| 06:03:09 | <QtPlaty[HireMe]> | @hoogle [a] -> [(a,a)] |
| 06:03:09 | <lambdabot> | Test.QuickCheck two :: Monad m => m a -> m (a, a) |
| 06:03:09 | <lambdabot> | Prelude zip :: [a] -> [b] -> [(a, b)] |
| 06:03:09 | <lambdabot> | Data.List zip :: [a] -> [b] -> [(a, b)] |
| 06:03:13 | <dons> | ok. |
| 06:03:21 | <tiglionabbit_> | dons and ivanm: what am I supposed to do with this? |
| 06:03:36 | <edwardk> | sclv: i like the fact that both the encoder and the decoder would fit on a coffee cup |
| 06:03:44 | <tiglionabbit_> | oh I should use this ebuild instead? |
| 06:03:56 | <dons> | ivanm: updated. |
| 06:04:14 | <ivanm> | \o/ |
| 06:04:30 | <ivanm> | ACTION joined IRC just to complain about that |
| 06:04:38 | <ivanm> | since IIRC, kolmodin put that together at hac5 |
| 06:04:52 | <dons> | yes. he was quick off the block. |
| 06:05:05 | <ivanm> | well, AFAIK all the ebuilds were already there ;-) |
| 06:05:09 | <dons> | i asked him for a url earlier, but he wasn't around |
| 06:05:13 | <ivanm> | just needed the meta one |
| 06:05:15 | <luqui> | dons, HP is GHC only, right? |
| 06:05:17 | <ivanm> | dons: *nod* |
| 06:05:39 | <ivanm> | luqui: it will presumably work with any other full-featured haskell compiler |
| 06:05:46 | <luqui> | ivanm, where full-featured means what? |
| 06:05:52 | <dons> | luqui: it could ship with hugs, but that'd suck. |
| 06:06:11 | <dons> | i could actually imagine shipping with hugs (but not putting all the libraries through hugs) |
| 06:06:15 | <luqui> | i rather mean, if i want the platform libraries to work with *my* compiler, what do I need to support? |
| 06:06:17 | <ivanm> | luqui: implements H98 fully for a start... which AFAIK removes the others from the list |
| 06:06:21 | <ivanm> | dons: yeah |
| 06:06:28 | <Apocalisp> | is there a utility to see how types line up? |
| 06:06:41 | <luqui> | (this compiler of mine is hypothetical :-) |
| 06:06:42 | <ivanm> | Apocalisp: hmmm? |
| 06:06:48 | <ivanm> | luqui: heh |
| 06:06:53 | <sclv> | nhc supports 98 too! |
| 06:06:59 | <sjanssen> | ivanm: I don't think there are any compilers that implement Haskell '98 fully |
| 06:07:16 | <dons> | luqui: http://trac.haskell.org/haskell-platform/ticket/2 |
| 06:07:20 | <ivanm> | sjanssen: well, close enough ;-) |
| 06:07:39 | <luqui> | dons, okay, thanks :-) |
| 06:07:41 | <edwardk> | sjanssen: you couldn't tell by listening to o'keefe on the cafe about n+k =) |
| 06:07:47 | <dons> | the next (?) edition of the platform will list the accepted (so far) language extensions. it's possible packages will be ruled out from inclusion if they use something weird |
| 06:07:47 | <Apocalisp> | ivanm: to trace the type inference. "a in f unified with b in g", etc. |
| 06:07:48 | <ivanm> | but is there any specific ghc-isms in those packages (because I can't think of any...)? |
| 06:07:51 | <luqui> | i have packaged a thunk |
| 06:07:52 | <ivanm> | maybe some extensions? |
| 06:08:07 | <sjanssen> | ivanm: hierarchical modules extension at least |
| 06:08:17 | <dons> | there's a fair bit of Haskell Prime in the spec, i reckon. |
| 06:08:18 | <sjanssen> | (everybody seems to forget that isn't in Haskell '98) |
| 06:08:20 | <edwardk> | dons: have any benchmarks for monad transformers handy? |
| 06:08:22 | <ivanm> | sjanssen: duh, I keep forgetting that's not standard... |
| 06:08:25 | <dons> | edwardk: nope |
| 06:08:28 | <luqui> | oh yeah, hierarchical modules are basically a given nowadays |
| 06:08:41 | <edwardk> | dons: damn. i now have the ran library written, but nothing to really benchmark it =) |
| 06:08:58 | <luqui> | edwardk, kan extensions? |
| 06:09:09 | <edwardk> | luqui: yeah |
| 06:09:24 | <edwardk> | luqui: was that asking what the library was, or what they are? |
| 06:09:27 | <dons> | edwardk: that would be a good thiiing to have, given all the performance claims flying around :) |
| 06:09:28 | <luqui> | hmmm... maybe i'll understand them. oh wait, it's your code =p |
| 06:09:36 | <luqui> | edwardk, about the library |
| 06:10:00 | <ivanm> | ACTION sometimes idly wishes for Java-style "foo.bar.*" imports... then he remembers that modules can re-export other modules, and just creates a meta-module instead |
| 06:10:06 | <luqui> | reading your code is like reading a math textbook, and i was never any good at that either |
| 06:10:09 | <edwardk> | dons: hah, the only claim i have is that it beat mmorrow on his own benchmark. and that dolio mentioned that my CPS'd ST s seemed to beat out ST s on his little microbenchmark |
| 06:10:28 | <ivanm> | edwardk: which benchmakrs are these? |
| 06:10:43 | <luqui> | ivanm, yeah, but qualified exports would be nice |
| 06:10:50 | <edwardk> | luqui: basically you just use your existing monad transformers and wrap the whole ball with 'Ran' and forget that you did it |
| 06:10:59 | <Ziban|afk> | http://change.menelgame.pl/change_please/2688554/ |
| 06:11:01 | <edwardk> | you might need to liftRan or lowerRan occasionally |
| 06:11:08 | <Apocalisp> | @type \h -> (fmap.fmap.fmap) (uncurry h) |
| 06:11:09 | <lambdabot> | forall (f :: * -> *) (f1 :: * -> *) (f2 :: * -> *) a b c. (Functor f2, Functor f1, Functor f) => (a -> b -> c) -> f (f1 (f2 (a, b))) -> f (f1 (f2 c)) |
| 06:11:15 | <Apocalisp> | @type \h -> (fmap.fmap.fmap) (uncurry h) zip |
| 06:11:17 | <lambdabot> | forall c a b. (a -> b -> c) -> [a] -> [b] -> [c] |
| 06:11:26 | <Apocalisp> | What's f, f1, and f2? |
| 06:11:30 | <luqui> | edwardk, ah. is it basically like applying codensity stuff? |
| 06:11:46 | <edwardk> | luqui: sort of but not directly |
| 06:11:54 | <edwardk> | the result on IO isn't Codensity IO |
| 06:12:14 | <edwardk> | its forall o. (a -> State# RealWorld -> o) -> State# RealWorld -> o |
| 06:12:19 | <luqui> | oh. hm. well the code will be interesting to ponder at least. |
| 06:12:24 | <edwardk> | in otherwords, Codensity (State# RealWorld) |
| 06:12:38 | <luqui> | oh huh. |
| 06:12:43 | <edwardk> | er Codensity ((->) (State# RealWorld)) |
| 06:13:02 | <edwardk> | so basically it permutes all the monad transformers into the form |
| 06:13:17 | <edwardk> | forall o. (a -> f o) -> g o |
| 06:13:26 | <edwardk> | which is all i mean by 'right kan extension' |
| 06:13:56 | <luqui> | and this is like myelin for monad transformers? |
| 06:14:02 | <ivanm> | dons: are all platform libs BSD3? |
| 06:14:05 | <dons> | 5 windows.exe downloads :) |
| 06:14:21 | <dons> | ivanm: that's not been decided, but is the case so far. |
| 06:14:33 | <ivanm> | *nod* that's what I meant ;-) |
| 06:14:47 | <edwardk> | Identity: (a -> o) -> o, Writer: (a -> w -> o) -> o State: (a -> s -> o) -> s -> o |
| 06:15:22 | <ivanm> | anyway, I only came in here to bitch about Gentoo's exclusion from the list... |
| 06:15:26 | <ivanm> | ACTION -> home |
| 06:15:28 | <luqui> | so you're killing tuple allocations at least |
| 06:15:38 | <edwardk> | Either: (a -> o) -> (b -> o) -> o, Maybe (a -> o) -> o -> o RWS: (a -> w -> s -> o) -> r -> s -> o |
| 06:15:43 | <edwardk> | luqui: exactly |
| 06:15:58 | <edwardk> | and in general fmap never has to do anything more than partially apply the first arg of that function |
| 06:16:16 | <Saizan> | edwardk: what about Control.Monad.State.Lazy beating your CPS'd unboxed State with a strict replicateM? :) |
| 06:16:17 | <edwardk> | and return and bind have uniform definitions for all of the ones where f = g |
| 06:16:38 | <edwardk> | saizan: i'm willing to get my pajnts handed to me ;) |
| 06:17:17 | <edwardk> | saizan: i'm just saying there is something elegant there, and it seems to be fast on a lot of things and that monad transformers are decidedly not fast on a lot of things =) |
| 06:17:34 | <luqui> | oh so you get fmap fusion at the very least |
| 06:17:45 | <edwardk> | so someone had to do the brute force of thinking through all the liftRan, etc laws for these things so it could even be tested |
| 06:18:15 | <Saizan> | yeah, i was just curious about the particular benchmark :) http://lhc-compiler.blogspot.com/2009/05/constructor-specialization-and-laziness.html |
| 06:20:18 | <edwardk> | saizan: sure |
| 06:22:06 | <dolio> | I didn't quite follow that post. Was that with their lhc work, or just with ghc? |
| 06:22:15 | <Saizan> | just ghc |
| 06:22:34 | <edwardk> | its just the replacing of replicateM with replicateM' there |
| 06:23:01 | <edwardk> | basically he's showing that the benchmark was unfair to the polymorphic code |
| 06:23:09 | <edwardk> | which i totally agree on |
| 06:24:08 | <Saizan> | i don't get why it's so much faster though, it's not like some values are not computed, right? |
| 06:24:11 | <edwardk> | otoh, i there is still a lot of room to play with on my side with the cps, inlining, etc. |
| 06:25:09 | <Saizan> | mtl doesn't have inline annotations i think |
| 06:25:38 | <edwardk> | nice of them to throw in the towel early ;) |
| 06:26:13 | <Saizan> | heh |
| 06:26:34 | <dons> | haha |
| 06:27:28 | <edwardk> | i'm still trying to figure out why the Ran based version is a few percent slower than the directly implemented one |
| 06:27:52 | <dons> | the core knows all |
| 06:28:17 | <edwardk> | dons: i had a bizarre thought and i wanted to pick your brain |
| 06:28:19 | <vixey> | does anyone know the ANSI/VT100/whatever escape/control code which works like hSetBuffering stdin NoBuffering ? |
| 06:28:29 | <vixey> | or where I can find iT? |
| 06:28:42 | <dons> | uh oh |
| 06:28:50 | <edwardk> | what would be the best way to try to get unboxed integers to be captured in an environment as unboxed integers i.e.: |
| 06:29:52 | <edwardk> | newtype Tree = Tree { getTree :: forall o. (Int# -> Int# -> Int# -> Tree -> Tree -> o) -> o } |
| 06:29:56 | <edwardk> | er |
| 06:30:06 | <edwardk> | newtype Tree = Tree { getTree :: forall o. (Int# -> Int# -> Int# -> Tree -> Tree -> o) -> o -> o } |
| 06:30:41 | <dons> | mmm |
| 06:30:43 | <edwardk> | i'd like to 'capture' the Tree with its environment preferrably unboxed so it'll pass them right into the function |
| 06:30:49 | <dons> | yeah, i like that idea :) |
| 06:30:57 | <dons> | but you could just use a regular structure too, i guess |
| 06:31:02 | <edwardk> | if so, then i can work around the unpack problem |
| 06:31:06 | <dons> | rather than implicitly via the unboxed parameters |
| 06:31:12 | <vixey> | ghc -e 'putStr "\ESC#8"' |
| 06:31:13 | <edwardk> | nono |
| 06:31:17 | <edwardk> | there is magic here =) |
| 06:31:23 | <vixey> | this program is ridiculous |
| 06:31:37 | <dons> | its a cool idea. run with it. |
| 06:31:41 | <edwardk> | (Int# -> Newtype (Int# -> Newtype (Int# -> ... --- do you start to see a general framework for an unboxed rep? |
| 06:32:34 | <edwardk> | unfortunately it puts the storage entirely in the hands of the compiler |
| 06:32:41 | <edwardk> | so it'll probably wind up suboptimal |
| 06:32:52 | <edwardk> | and less fortunately its almost completely opaque |
| 06:33:36 | <edwardk> | so i was trying to figure out the way i could generate that value in the way that would do the most unboxing. |
| 06:33:44 | <dons> | yes, you get to reuse the way arguments are unpacked into function closures. i wonder how that's represented. |
| 06:34:18 | <edwardk> | i.e. if you define just: bin :: Int# -> Int# -> Int # -> Tree -> Tree -> Tree -- |
| 06:34:46 | <edwardk> | then the only environment that has to grab onto when its making the Tree is the set of Int#'s so do you think it'd be smart enough to keep them unboxed in the closure? |
| 06:35:57 | <dons> | oh yes. |
| 06:36:50 | <dons> | anyone want to speculate on whether more unix or windows downloads will be made in the next 12 hours? |
| 06:37:33 | <edwardk> | bah, never bet against the dons when a community is involved. he'll just go stir up reddit |
| 06:37:38 | <luqui> | I think it will be NixOS |
| 06:39:19 | <vixey> | looks at this code: |
| 06:39:25 | <vixey> | #define InsCharCost(count) \ |
| 06:39:26 | <vixey> | ((parm_ich != 0) \ |
| 06:39:26 | <vixey> | ? D->_ich_cost \ |
| 06:39:26 | <vixey> | : ((enter_insert_mode && exit_insert_mode) \ |
| 06:39:26 | <vixey> | ? D->_smir_cost + D->_rmir_cost + (D->_ip_cost * count) \ |
| 06:39:30 | <vixey> | it just goes on like that |
| 06:39:33 | <luqui> | oh of course |
| 06:39:41 | <mauke> | looks like curses |
| 06:39:45 | <luqui> | that makes sense |
| 06:39:46 | <vixey> | These guys are doing functional programming |
| 06:39:50 | <vixey> | mauke it is |
| 06:45:39 | <luqui> | ACTION wonders what cpp's rule is that stops nontermination |
| 06:46:57 | <opqdonut> | luqui: limited stack depth |
| 06:47:20 | <luqui> | oh but then it just writes out the name of macros, rather than dying? |
| 06:47:23 | <luqui> | that's weird |
| 06:48:01 | <luqui> | nope that's not it |
| 06:52:03 | <tiglionabbit_> | if you were going to write simple AI for a board game to look a few moves in the future and find a set of possible moves that aren't stupid, what would be a cool way to represent that in haskell? I've heard of doing it by creating a data structure that represents all possible games, and pruning it as players move.. Not sure if that's the best model for a game that's played transactionally with a database and web in |
| 06:52:54 | <Saizan> | you got truncated |
| 06:53:05 | <tiglionabbit_> | ..I've heard of doing it by creating a data structure that represents all possible games, and pruning it as players move.. Not sure if that's the best model for a game that's played transactionally with a database and web interface though |
| 06:53:17 | <luqui> | tiglionabbit_, it could be |
| 06:53:35 | <luqui> | oh i see what you mean, you'd have to recreate it every tie |
| 06:53:40 | <Saizan> | you can keep your infinite tree of possible games lazy even if you have to interact with the external world |
| 06:53:50 | <luqui> | but it won't be stateless |
| 06:54:05 | <luqui> | you'd have to keep the data structure on your webserver between requests |
| 06:54:21 | <tiglionabbit_> | is that okay to do? |
| 06:54:39 | <Saizan> | yeah, you'd need an application server, or fastcgi, so that the process remains alive |
| 06:56:36 | <tiglionabbit_> | is that a good idea, to keep every game in memory at once? |
| 06:56:57 | <opqdonut> | tiglionabbit_: the structure is lazy, all the games aren't in memory |
| 06:57:06 | <tiglionabbit_> | also, might you have multiple copies of the same game when two people are playing and requesting from the server at the same time? |
| 06:57:06 | <Saizan> | depends on how much memory and on how many users :) |
| 06:57:38 | <tiglionabbit_> | opqdonut: I mean every game that people are currently playing would have one of these structures, including more than one copy of a given game |
| 06:57:43 | <opqdonut> | ah |
| 07:01:08 | <tiglionabbit_> | so, because two users playing the same game would not likely have access to the same game in memory... perhaps it is not a good idea to keep the games in memory |
| 07:05:01 | <solidsnack> | tiglionabbit_: I don't see how the database makes any difference. |
| 07:05:28 | <solidsnack> | tiglionabbit_: Presumably, it stores the log of moves; but you'd still want a game tree somewhere. |
| 07:06:15 | <tiglionabbit_> | solidsnack: I know, but do you store this game in memory indefinitely, in case a player comes back to some long-forgotten game? Some time you might have to reconstruct a game from the database |
| 07:07:09 | <solidsnack> | tiglionabbit_: Well, it's easy to do that, right? You just init a fresh session and walk all the way back down the game tree. |
| 07:07:27 | <tiglionabbit_> | I guess so |
| 07:08:01 | <solidsnack> | You can reasonably segregate, I think, the log and the "lookahead cache". |
| 07:08:38 | <solidsnack> | The latter has no durability requirement (in part because it is a constant). |
| 07:11:14 | <tiglionabbit_> | I guess it's a form of caching that I'd keep this game object around waiting for the player to come back, but... |
| 07:11:25 | <tiglionabbit_> | can I use the same game object for multiple players? |
| 07:11:43 | <tiglionabbit_> | er, same instance |
| 07:11:52 | <tiglionabbit_> | thingy |
| 07:12:02 | <tiglionabbit_> | value, I guess? |
| 07:12:21 | <vixey> | yeah not really objects/instances in haskell |
| 07:12:31 | <solidsnack> | tiglionabbit_: Well, it would stand to reason that you can -- however I fear you have a lot of intermediate nodes you want to throw away. |
| 07:13:03 | <tiglionabbit_> | yeah but two players on the same game would see the same pruned version of it |
| 07:13:04 | <solidsnack> | Say you had a top level binding that was all the Fibonacci numbers, for example. |
| 07:13:12 | <tiglionabbit_> | I mean if they were playing this game together |
| 07:13:36 | <Saizan> | well for players playing together i think you should use the same tree |
| 07:13:36 | <solidsnack> | tiglionabbit_: Well, then you maybe have two -- white side and black side? |
| 07:14:07 | <tiglionabbit_> | sure |
| 07:14:16 | <Saizan> | tiglionabbit_: i think you should try implementing the actual structure to get a more concrete idea of what it looks like |
| 07:14:48 | <Saizan> | tiglionabbit_: there's an example for tic-tac-toe in the "Why FP Matters" paper |
| 07:14:55 | <Saizan> | ?where whyfp |
| 07:14:55 | <lambdabot> | http://www.math.chalmers.se/~rjmh/Papers/whyfp.html |
| 07:16:06 | <tiglionabbit_> | what's a good way to implement the structure? Imagine a game on a 2D board like chess. Should game state be a list of pieces with locations, or spaces with pieces on them? And I guess the child game states of this would be a list of game states representing every possible move for the current player... |
| 07:16:34 | <tiglionabbit_> | oh thanks *reads* |
| 07:16:58 | <quicksilver> | I would use a map from locations to pieces |
| 07:17:12 | <quicksilver> | with the convention that, by implication, if a key doesn't appear in the map, that location is empty |
| 07:18:25 | <tiglionabbit_> | it's a 2d board though, so locations are what, tuples like (1,5), chess space names like "B4", or is the 2D-ness represented some other way |
| 07:18:38 | <quicksilver> | that was my suggest, yes |
| 07:18:43 | <quicksilver> | Map (Int,Int) Piece |
| 07:19:42 | <tiglionabbit_> | okay |
| 07:20:39 | <tiglionabbit_> | heh, I just implemented the game of life in javascript using a map to represent 2d locations. Javascript hashes [1,2] as "1,2" |
| 07:21:01 | <tiglionabbit_> | http://nickretallack.com/lifegame/ |
| 07:21:02 | <horms> | *win* |
| 07:21:02 | <solidsnack> | scary |
| 07:21:48 | <tiglionabbit_> | yeah it was a little bothersome that my keys didn't preserve their types. I just wrote an "unhash_point" function though, that splits it up again =] |
| 07:28:45 | <solidsnack> | I've written a fair amount of JavaScript in the past couple of months; I liked it as first (handling the DOM and such) but whenever I have process text I fall back to hating it. |
| 07:29:05 | <solidsnack> | Making and managing intermediate structures is such a hassle in dynamic languages. |
| 07:30:57 | <quicksilver> | yes |
| 07:31:05 | <quicksilver> | for all structures except Map String String |
| 07:31:11 | <quicksilver> | so one just uses that for everything |
| 07:31:14 | <quicksilver> | and suffers. |
| 07:31:50 | <solidsnack> | As I am now :) |
| 07:31:52 | <solidsnack> | :/ |
| 07:31:57 | <solidsnack> | :; |
| 07:32:04 | <solidsnack> | er |
| 07:32:08 | <solidsnack> | ;_; |
| 07:32:56 | <quicksilver> | (incidentally, one probably shouldn't call javascript objects 'hashes') |
| 07:36:31 | <solidsnack> | I mean, who writes a language with join but not map? |
| 07:36:41 | <solidsnack> | What was the thinking that went on here? |
| 07:36:48 | <vixey> | what |
| 07:36:55 | <solidsnack> | JavaScript |
| 07:37:39 | <quicksilver> | yeah, the absence of map in javascript is pretty weird. |
| 07:37:49 | <quicksilver> | jquery ftw. |
| 07:37:54 | <solidsnack> | yeah |
| 07:38:07 | <Raevel> | js 1.6 has map! |
| 07:38:21 | <solidsnack> | Raevel: Yes, but you can't use it in practice. |
| 07:38:45 | <solidsnack> | If I was going to write for a custom platform, I sure as heck wouldn't use JavaScript :) |
| 07:39:07 | <Raevel> | Array.prototype.map = ... |
| 07:39:48 | <quicksilver> | javascript's sufficiently malleable that you can cope with it. |
| 07:40:19 | <quicksilver> | any language with overridable prototypes and reasonable syntax for structured literals is bearable. |
| 07:40:35 | <quicksilver> | that's what I really hate about C / C++ - lack of structured literals. |
| 07:40:46 | <solidsnack> | Structured literals? |
| 07:40:55 | <solidsnack> | Oh, like arrays of arrays and such. |
| 07:41:01 | <solidsnack> | Yeah, that's pretty insane. |
| 07:42:20 | <rieux_> | the right people on the committee have their way, the next javascript could be pretty nice. they have some functional programmers who understand types, too. |
| 07:42:25 | <luqui> | heh... haskell doesn't have anything but structured literals :-) |
| 07:42:32 | <rieux_> | if |
| 07:42:49 | <solidsnack> | rieux_: I believe the next JavaScript was killed. |
| 07:42:57 | <solidsnack> | MSFT pulled out of the committee. |
| 07:43:01 | <luqui> | solidsnack, what do you mean by "join" in "join but not map" |
| 07:43:05 | <luqui> | concat? |
| 07:43:20 | <solidsnack> | ["a", "b"].join(" : ") |
| 07:43:27 | <luqui> | oh intercalate... |
| 07:43:34 | <rieux_> | solidsnack: really? i remember back in september they were talking about something like that, but i didnt believe it would happen |
| 07:43:36 | <solidsnack> | yeah |
| 07:43:38 | <luqui> | (i like join as a name for that) |
| 07:44:20 | <solidsnack> | luqui: Haskell has certainly changed my sensibilities about how things should be named :) |
| 07:44:41 | <luqui> | > let (.) = flip ($) in ["a", "b"].intercalate(" : ") |
| 07:44:43 | <lambdabot> | "a : b" |
| 07:45:03 | <solidsnack> | oh good lord |
| 07:45:07 | <luqui> | ;-) |
| 07:45:26 | <luqui> | perl programmers aren't the only ones who get to play tricks on our eyes |
| 07:45:35 | <luqui> | though.. they're the only ones who want to |
| 07:46:21 | <solidsnack> | luqui: I fear that accommodations like that would only delay the OMGWTFBBQ moment for new Haskell programmers. |
| 07:47:06 | <luqui> | yeah, not to mention attracting countless inane questions on our mailing lists |
| 07:47:43 | <solidsnack> | I do remember a mailing list post where some guy had figured that out and was trying to get everyone to switch. |
| 07:47:45 | <luqui> | As different as haskell is, you'd think we'd get more "why can't I" questions than we already do... |
| 07:47:58 | <opqdonut> | indeed |
| 07:47:58 | <solidsnack> | hash tables have shown up a lot |
| 07:48:06 | <Cale> | Plus it takes that away from function composition which is by far the most important infix operator. |
| 07:48:26 | <luqui> | if i had a unicode keyboard then we could reclaim dot |
| 07:48:28 | <luqui> | for... something |
| 07:48:39 | <luqui> | i'd probably put it after the lambda instead of -> |
| 07:48:44 | <luqui> | but.. that's just e |
| 07:48:45 | <luqui> | me |
| 07:48:47 | <Cale> | Only if it had a whole key for it... |
| 07:49:10 | <luqui> | maybe we should go the way of the concatenative folks and make composition juxtaposition |
| 07:49:19 | <Cale> | I can type ∘ but it's a few annoying keystrokes :) |
| 07:49:28 | <luqui> | i only know the vim digraph... |
| 07:49:36 | <luqui> | so i open vim, type it, copy, and paste :-) |
| 07:50:56 | <luqui> | I'm having a lot of trouble imagining what application would look like if juxtaposition were composition |
| 07:51:05 | <luqui> | probably a category theorist would be able to tell me |
| 07:51:27 | <quicksilver> | f g h @ 1 |
| 07:51:28 | <quicksilver> | ? |
| 07:51:41 | <luqui> | that would be f . g . h . (@) . 1 |
| 07:51:49 | <luqui> | and i don't know if such an @ exists |
| 07:52:24 | <luqui> | (at least, that's what it would mean as related to the question i'm asking) |
| 07:52:56 | <quicksilver> | well I think you can have juxtaposition as composition and still have binary operators |
| 07:52:59 | <quicksilver> | if you choose to. |
| 07:53:10 | <luqui> | yeah true |
| 07:53:52 | <quicksilver> | if the only thing you have is composition, then everything is a function. |
| 07:53:52 | <luqui> | so I have f : a -> (b -> c), x : (1 -> a), how do I get g : (b -> c) ? |
| 07:54:02 | <quicksilver> | so you'd need to represent literals as functions |
| 07:54:07 | <quicksilver> | constant functions, perhaps. |
| 07:54:17 | <luqui> | functions from unit |
| 07:54:22 | <Cale> | luqui: well, you could make application into composition as well |
| 07:54:40 | <luqui> | Cale, yes, that's probably what i'm asking. what do you mean by that? |
| 07:55:24 | <Cale> | ah, yeah, you do need the exponential unlifting which is inconvenient |
| 07:55:38 | <rieux_> | i'm trying to think how APL does it |
| 07:56:04 | <Cale> | That is, a way to take an element of (b -> c), which is 1 -> (b -> c), and turn it into a function b -> c |
| 07:56:05 | <rieux_> | but it doesn't seem to translate |
| 07:57:19 | <luqui> | 1 -> (b -> c) =uncurry=> (1,b) -> c =(. snd)=> b->c |
| 07:57:36 | <Cale> | It's possible that it wouldn't be too much of a pain if we had a suitably comfortable name for (1 -> (a -> b)) -> a -> b |
| 07:57:39 | <luqui> | but uncurry is still a functor that needs to be *applied*, no? |
| 07:57:50 | <Cale> | Let's call it @ |
| 07:57:54 | <luqui> | lol |
| 07:58:20 | <Cale> | (or it could be new $ ;) |
| 07:58:40 | <luqui> | so from above, it would be: @ f x ? |
| 07:58:42 | <yitz> | what's wrong with the constant function, like quicksilver said? |
| 07:59:15 | <Cale> | You represent literals as functions from 1 |
| 07:59:27 | <dmwit> | yitz: You get out another constant function. =/ |
| 07:59:34 | <dmwit> | yitz: When what you really want is the actual function. |
| 07:59:52 | <Cale> | But there's the problem of turning a function 1 -> (a -> b) into a proper function a -> b |
| 08:00:13 | <dmwit> | yitz: i.e. f : a -> b -> c, x : 1 -> a; then f x : 1 -> b -> c instead of f x : b -> c like you want. |
| 08:00:16 | <heltav> | anyone compiled gsl? it ran the whole night for me then finally hang up and never finished |
| 08:00:39 | <heltav> | unless the solve quadratic takes hours and hours to compile |
| 08:00:41 | <luqui> | you would need a name for that though, because we want a CCC |
| 08:00:50 | <Cale> | In category theory notation, this is associating an element of B^A (which is an arrow 1 -> B^A) with an arrow A -> B |
| 08:00:52 | <solidsnack> | heltav: Compile on what? |
| 08:01:47 | <luqui> | how do you get back? |
| 08:01:55 | <luqui> | from (a -> b) to 1 -> (a -> b) ? |
| 08:01:57 | <Cale> | There's that too |
| 08:02:04 | <luqui> | that seems harder |
| 08:02:05 | <rieux_> | are we limited to changing syntax? why not just allow the two types to unify? they're isomorphic already (in haskell) |
| 08:02:06 | <Cale> | You'd need both directions, I suppose |
| 08:02:16 | <Cale> | But const does that currently |
| 08:02:20 | <luqui> | because if you compose, you only have the a or the b to work with |
| 08:02:30 | <luqui> | yeah, but as an *application*, not as a composition |
| 08:02:48 | <luqui> | ohoh but we could use our new @ operator :-) |
| 08:02:57 | <Cale> | rieux_: I wonder... however, the interactions with that and type inference will be interesting. |
| 08:03:08 | <rieux_> | Cale: yeah, i'm not sure where it breaks |
| 08:03:13 | <ziman> | :t (. const id) |
| 08:03:14 | <lambdabot> | forall c a a1. ((a -> a) -> c) -> a1 -> c |
| 08:03:37 | <luqui> | :t (. const) |
| 08:03:38 | <lambdabot> | forall c a b. ((b -> a) -> c) -> a -> c |
| 08:03:51 | <luqui> | this is hard on my brain |
| 08:03:53 | <ziman> | hm, this is not wha i wanted... |
| 08:04:05 | <rieux_> | Cale: well i supppose if you try to unify (a -> b) with c, you don't know whether you should let a be 1 and unify b with c or not |
| 08:04:09 | <rieux_> | ick |
| 08:04:16 | <yitz> | dmwit? |
| 08:05:28 | <dmwit> | er, yes? |
| 08:06:04 | <luqui> | i'm stumped. what do you compose with a -> b to get to 1 -> (a -> b) |
| 08:06:09 | <luqui> | is that even possible? |
| 08:06:23 | <solidsnack> | Would it be compose? |
| 08:06:30 | <solidsnack> | Wouldn't you wrap it? |
| 08:06:32 | <luqui> | it would have to be, that's all we have |
| 08:06:37 | <solidsnack> | Oh, right. |
| 08:06:43 | <yitz> | dmwit: -> #xmonad |
| 08:07:10 | <quicksilver> | luqui: well, if you precompose you get something ->b , and if you postcompose something a -> |
| 08:07:26 | <luqui> | yeah it would have to be both sides, if it exists |
| 08:07:40 | <quicksilver> | I don't think it does |
| 08:07:54 | <luqui> | i mean, that makes sense, because composition has less structure than application |
| 08:07:59 | <rieux_> | before: 1 -> a. after: b -> (a -> b) |
| 08:08:00 | <luqui> | so you'd need to encode it somehow |
| 08:08:03 | <luqui> | but you're probably right |
| 08:08:05 | <rieux_> | highly magical |
| 08:08:23 | <quicksilver> | 1 -> a requires choosing an elemetn of a |
| 08:08:27 | <quicksilver> | that seems unlikely. |
| 08:08:40 | <ziman> | but you ave f :: a |
| 08:08:51 | <ziman> | the `f' is what you may choose |
| 08:08:56 | <rieux_> | that's why it's magical |
| 08:09:23 | <RayNbow> | :t undefined -- ? |
| 08:09:24 | <lambdabot> | forall a. a |
| 08:09:26 | <luqui> | oh it's a pair |
| 08:09:27 | <luqui> | i see |
| 08:09:40 | <luqui> | that's no good, they are working together... |
| 08:09:42 | <luqui> | :-( |
| 08:09:50 | <luqui> | and... you're right, they would have to |
| 08:10:06 | <luqui> | there would be a different pair of morphisms for every f |
| 08:10:25 | <rieux_> | you can do it in an impure language with call/cc |
| 08:11:05 | <luqui> | (a -> b) -> b ~~ 1 -a |
| 08:11:07 | <luqui> | oops |
| 08:12:10 | <rieux_> | though you have to allocate a cell every time you want a before/fater pair |
| 08:14:27 | <heltav> | is caml not used anymore? |
| 08:14:47 | <quicksilver> | sure. |
| 08:14:50 | <quicksilver> | it's widely used. |
| 08:18:12 | <solidsnack> | What is meant by "composition has less structure than application" ? |
| 08:18:53 | <solidsnack> | Oh, heck; luqui left. |
| 08:19:33 | <solidsnack> | @tell luqui What does it mean that "composition has less structure than application" ? |
| 08:19:33 | <lambdabot> | Consider it noted. |
| 08:21:09 | <dolio> | I don't know, but you have to be careful when comparing haskell types to category theory types. |
| 08:21:27 | <dolio> | Like, in "1 -> (a -> b)", the two arrows are different. |
| 08:23:07 | <dolio> | If you're working with application-is-composition, you represent values of a type T as arrows 1 -> T. |
| 08:23:30 | <vixey> | sure elements 1 -> T generalized elements X -> T |
| 08:24:07 | <dolio> | Then if you have an arrow f : T -> U, and x : 1 -> T, then f x : 1 -> U is an element of U. |
| 08:24:20 | <dolio> | Where juxtaposition means composition. |
| 08:25:05 | <dolio> | But, if you want higher order functions, it doesn't make sense to talk about applying a function to the above function f. |
| 08:25:35 | <dolio> | You need some way to denote the corresponding element of the exponential object: f' : 1 -> U^T, or some such. |
| 08:26:01 | <heltav> | quick I meant is ocaml used instead? |
| 08:26:02 | <dolio> | Then you can write g f' : V, where g : U^T -> V. |
| 08:26:33 | <dolio> | Yeah, I don't think there's much use of the predecessors of OCaml. |
| 08:26:41 | <dolio> | If there is, I'm not aware of it. |
| 08:27:39 | <dolio> | Oh, aside from ML and suchlike. |
| 08:27:56 | <ski> | (itym SML) |
| 08:27:58 | <dolio> | Previous Caml stuff. |
| 08:28:25 | <dolio> | Lisp is still in use, too. :) |
| 08:28:30 | <ziman> | you'd need a way to convert functions (T -> U) <-> (1 -> U^T), too, wouldn't you? |
| 08:28:57 | <ski> | dolio : 1.5 ? :) |
| 08:30:54 | <quicksilver> | heltav: ocaml is caml. |
| 08:30:54 | <dolio> | ziman: Yeah, in essence you'd need some separate-from-composition method of going between functions as arrows and functions as elements of an exponential object. |
| 08:31:07 | <quicksilver> | heltav: ocaml is an implementation of caml - the most popular one by far. |
| 08:31:34 | <dolio> | You could say if f : (1x)T -> U, then curry_f : 1 -> U^T. |
| 08:32:22 | <ziman> | currying cannot be accomplished using composition, can it? |
| 08:33:32 | <dolio> | Well, you can have a related curry arrow, curry : C^(AxB) -> (C^B)^A. |
| 08:34:06 | <dolio> | And then curry_curry : 1 -> (C^B^A)^(C^(AxB))... |
| 08:35:20 | <dolio> | But in category theory, things like curry_f are defined using existence/uniqueness properties in diagrams involving f. |
| 08:35:32 | <dolio> | So they don't have to do with composing arrows per se. |
| 08:38:51 | <dolio> | Maybe you could try saying that whether 'f' means an arrow or the corresonding element of an exponential object depends on context, but that seems like it'd be too tricky. |
| 08:41:08 | <dolio> | Or work just with exponential objects in conjunction with an arrow apply : (B^A x A) -> B. |
| 08:42:59 | <dolio> | Then f applied to x looks like: apply <f, x>, where g : A -> B, h : A -> C means <g, h> : A -> B x C. |
| 08:44:44 | <dolio> | Then f : 1 -> B^A, x : 1 -> A, so <f, x> : 1 -> (B^A x A), and apply <f, x> : 1 -> B. But then you're probably better off writing "apply <f, x>" as "f x", and you're back at juxtaposition as application. |
| 08:53:59 | <mux> | dons: hey |
| 08:58:51 | <fasta> | When I run a test using a.o. monadicIO (from QuickCheck-2) in ghci it is working as it should, but when I run the same program in compiled state, it just seems to hang (without using CPU). Does this behavior ring any bells? |
| 09:04:09 | <scriptdevil> | Tackling the Awkward Squad is seriously one of the best reads :D |
| 09:04:10 | <scriptdevil> | I finally started understanding what being functional actually means... |
| 09:04:10 | <scriptdevil> | (Purely) |
| 09:04:11 | <quicksilver> | fasta: threaded RTS required? |
| 09:04:11 | <fasta> | quicksilver: yes, maybe. But I don't know, I do know that it is horrible that interpretation semantics != compilation semantics. |
| 09:11:31 | <quicksilver> | fasta: well it would be interesting to know if it is -threaded or not. |
| 09:11:41 | <quicksilver> | fasta: it is no surprised that -threaded has different semantics. |
| 09:11:49 | <quicksilver> | if it's something else - well, maybe it's a bug. |
| 09:12:25 | <fasta> | quicksilver: yes, it was. It was my first thought too, but since unsafePerformIO is used in monadicIO I thought it might be something else, like an inline bug in quickCheck. |
| 09:13:24 | <fasta> | quicksilver: why is there a threaded and a non-threaded RTS? Better performance for non-threaded applications? |
| 09:14:09 | <Botje> | no scheduler for non-threaded RTS |
| 09:14:24 | <Botje> | so single-threaded apps don't need to be interrupted by the scheduler |
| 09:14:58 | <fasta> | Then I think the threaded RTS should be the default, since it is something which at least always works. People who care for performance should use the short term hack. |
| 09:15:04 | <quicksilver> | fasta: initially, conservatism, I think, keeping the old non-threaded RTS when the threaded one was new. |
| 09:15:11 | <quicksilver> | I would support -threaded being default. |
| 09:15:47 | <Botje> | wouldn't a single-threaded app still benefit from concurrent GC? |
| 09:16:04 | <fasta> | Botje: probably program dependent. |
| 09:18:14 | <Ferdirand> | hello #haskell |
| 09:18:24 | <heltav> | anyone know the LOC of House? im downloading it now but.... |
| 09:18:31 | <heltav> | hello Ferdirand |
| 09:20:19 | <heltav> | so to write a kernel in ghc you need to bootstrap right, you compile it in a standard OS then boot of the binary? |
| 09:22:48 | <Ferdirand> | does it make sense to define: data (Monad m1, Monad m2) => DM m1 m2 a = DM (m1 a, m2 a) |
| 09:23:08 | <Ferdirand> | and instance (Monad m1, Monad m2) => Monad (DM m1 m2) ? |
| 09:23:55 | <Ferdirand> | or does this matches an Arrow definition already ? |
| 09:25:45 | <quicksilver> | Ferdirand: hmm. I've never wanted that. |
| 09:25:48 | <quicksilver> | what do you want it for? |
| 09:26:51 | <Botje> | i don't think you can combine two monads that easilyy |
| 09:26:58 | <glguy> | ACTION wonders how bind would be implemented |
| 09:27:08 | <Ferdirand> | i have an implementation that compiles |
| 09:27:40 | <Ferdirand> | I have monadic code that can be used in two different monads to give different results |
| 09:28:03 | <Ferdirand> | for now, these functions use a typeclass whose my two monadic types are also member |
| 09:28:25 | <Ferdirand> | i wondered if i could get rid of the typeclass by exploiting lazyness with this device |
| 09:29:02 | <Ferdirand> | i don't even know if it is really a good idea to do so |
| 09:29:27 | <glguy> | it is much more common to put your operations in a typeclass and write generic functions on those typeclasses |
| 09:29:33 | <quicksilver> | glguy: pointwise. |
| 09:29:39 | <quicksilver> | oh |
| 09:29:44 | <glguy> | like monadstate |
| 09:29:50 | <quicksilver> | hmm yes |
| 09:29:53 | <quicksilver> | you're right, bind doesn't work :) |
| 09:30:04 | <heltav> | so you can't build House on windows? |
| 09:30:11 | <glguy> | well, he is just binding the two separately |
| 09:30:13 | <glguy> | and picking one later |
| 09:30:20 | <glguy> | dragging the unneeded one along for the ride |
| 09:30:51 | <Ferdirand> | i haven't checked if it obeys the monad laws |
| 09:31:11 | <Ferdirand> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4639#a4639 |
| 09:31:45 | <glguy> | using a typeclass for your common operations is a better solution than performing all of the binds you might ever want every time |
| 09:31:56 | <Krintus> | íà ôîðóì http://forum.forok.ru òðåáóþòñÿ admin è ìîäåðàòîðû ðàçäåëîâ. Âñå êòî çàèíòåðåñîâàí ïèøèòå â ëè÷êó |
| 09:32:15 | <quicksilver> | hah. two barrels. |
| 09:32:31 | <Ferdirand> | well, a few people here tend to bash on typeclass overuse i think :) |
| 09:32:56 | <scriptdevil> | /leave |
| 09:32:58 | <glguy> | Ferdirand, well, in your case you actually have a good case for them |
| 09:33:10 | <glguy> | Ferdirand, I suspect people are more likely bashing gratuitous use |
| 09:33:22 | <quicksilver> | it's mainly me that bashes typeclass overuse, in my experience |
| 09:33:34 | <quicksilver> | however your use case sounds like exactly what they are correctly used for :) |
| 09:33:46 | <Ferdirand> | ah, good :) |
| 09:34:05 | <Ferdirand> | now for the second weird idea i had during sleeping |
| 09:34:41 | <Ferdirand> | on the well-known problem of restricted monads |
| 09:35:11 | <Ferdirand> | i was trying to build something like pfp (weighted list monad), but backed by a map instead of a tuple list |
| 09:35:26 | <Ferdirand> | of course this does not work, as map requires Ord |
| 09:37:57 | <Ferdirand> | so, is there a way to build a Map k a where k is not in Ord, by providing a function (k -> Ordering) at build time only ? |
| 09:38:11 | <glguy> | You can always use the rebindable syntax to define your own Monad class |
| 09:38:21 | <glguy> | one that let's you add the constraints you want |
| 09:38:26 | <Ferdirand> | right |
| 09:38:28 | <quicksilver> | Ferdirand: only by creating a newtype |
| 09:38:34 | <quicksilver> | or a data |
| 09:38:43 | <Ferdirand> | but then, if i use rebindable |
| 09:38:46 | <ski> | (hm .. i think Ferdirand's `Dual' reminds somewhat of a monad construction i did ..) |
| 09:38:48 | <quicksilver> | data Ordered k = Ordered !k (k -> Ordering) |
| 09:39:00 | <Ferdirand> | i have to give up on applicative notation to compose my monad |
| 09:39:06 | <quicksilver> | instance Ord (Ordered k) where compare (Ordered k f) = f k |
| 09:39:18 | <Ferdirand> | so i wanted to avoid using a restricted monad |
| 09:39:35 | <quicksilver> | that's not entirely right. |
| 09:39:41 | <quicksilver> | and it's potentialy unsafe, but that's the idea |
| 09:40:25 | <Ferdirand> | quicksilver: ah, yes, makes sense |
| 09:41:42 | <Ferdirand> | but <$> and <*> are nice... I don't want to give them up :( |
| 09:48:20 | <heltav> | applicatives right |
| 09:48:25 | <heltav> | @type <$> |
| 09:48:26 | <lambdabot> | parse error on input `<$>' |
| 09:48:30 | <heltav> | @type <*> |
| 09:48:31 | <lambdabot> | parse error on input `<*>' |
| 09:48:36 | <heltav> | is <$> == $ ? |
| 09:48:40 | <Ferdirand> | no |
| 09:48:43 | <Ferdirand> | <$> is fmap |
| 09:48:44 | <heltav> | function applciation? |
| 09:48:46 | <mux> | @type (<$>) |
| 09:48:48 | <lambdabot> | forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b |
| 09:48:53 | <heltav> | exactly fmap? |
| 09:48:55 | <mux> | @type (<*>) |
| 09:48:56 | <lambdabot> | forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b |
| 09:49:20 | <heltav> | > <$> (+1) (Just 5) |
| 09:49:21 | <lambdabot> | <no location info>: parse error on input `<$>' |
| 09:49:30 | <heltav> | > (+1) <$> (Just 5) |
| 09:49:32 | <lambdabot> | Just 6 |
| 09:49:35 | <mux> | > (+1) <$> Just 5 |
| 09:49:37 | <lambdabot> | Just 6 |
| 09:49:38 | <heltav> | > (+1) <*> (Just 5) |
| 09:49:39 | <lambdabot> | Couldn't match expected type `(a -> b) -> a' |
| 09:49:44 | <heltav> | > (+) <*> (Just 5) |
| 09:49:45 | <Ferdirand> | > (*) <$> [1,2] <*> [1,3] |
| 09:49:45 | <lambdabot> | Couldn't match expected type `a -> a' |
| 09:49:46 | <lambdabot> | [1,3,2,6] |
| 09:49:49 | <heltav> | > (+) <*> (Just 5) (Just 6) |
| 09:49:50 | <lambdabot> | Couldn't match expected type `t -> a -> a' |
| 09:50:09 | <Ferdirand> | > (+) <$> Just 5 <*> Just 6 |
| 09:50:11 | <lambdabot> | Just 11 |
| 09:50:21 | <burp_> | why use this instead of fmap? :> |
| 09:50:26 | <mux> | > Just [+1) <*> Just 3 |
| 09:50:27 | <lambdabot> | <no location info>: parse error on input `)' |
| 09:50:36 | <mux> | > Just (+1) <*> Just 3 |
| 09:50:38 | <lambdabot> | Just 4 |
| 09:51:06 | <Ferdirand> | because it's prettier |
| 09:51:21 | <Ferdirand> | but the point is that i want my monad to work with partially applied functions |
| 09:51:37 | <Ferdirand> | so a restricted monad on ord won't cut it |
| 09:51:54 | <heltav> | i think fmap is cleaner |
| 09:52:03 | <heltav> | idotn want haskell to look like Perl |
| 09:52:31 | <mux> | > getZipList $ (\x y z = x + y + z) <$> ZipList [1..3] <*> ZipList [2..5] <*> ZipList [1..] |
| 09:52:32 | <lambdabot> | <no location info>: parse error on input `=' |
| 09:52:33 | <burp_> | lol |
| 09:52:34 | <burp_> | same |
| 09:52:41 | <ski> | ACTION . o O ( type Foo m n a = (m a,Either (m a) (n a)) ) |
| 09:52:44 | <mux> | > getZipList $ (\x y z -> x + y + z) <$> ZipList [1..3] <*> ZipList [2..5] <*> ZipList [1..] |
| 09:52:45 | <lambdabot> | [4,7,10] |
| 09:55:26 | <araujo> | ACTION fighting with compota |
| 09:55:53 | <roadwarrior> | hm has ghc become more lazy since 6.8? :p |
| 09:56:33 | <roadwarrior> | something works in 6.8 but not in 6.10 when tryin to do thing lazy |
| 09:57:51 | <quicksilver> | you may need to give more details, roadwarrior |
| 09:57:54 | <quicksilver> | what kind of thing |
| 10:02:36 | <roadwarrior> | well its this snippet of code: http://www.haskell.org/pipermail/haskell-cafe/2009-May/061010.html |
| 10:03:00 | <roadwarrior> | why has the behavior changed since 6.8 ? |
| 10:04:55 | <quicksilver> | well, judging by the email thread it looks like a bug. |
| 10:04:58 | <fasta> | If I set +RTS -N4 -RTS the program hangs. Without any RTS options with a threaded RTS, it does work. Great... |
| 10:05:52 | <roadwarrior> | :/ |
| 10:06:15 | <quicksilver> | roadwarrior: you are given some incorrect advice in that thread, though |
| 10:06:39 | <quicksilver> | the strict and lazy variants of ST have identical semantics except where they trip over 'error' values |
| 10:07:10 | <quicksilver> | if a program runs under strict and doesn't throw an exception, it should run under lazy with the same semantics. |
| 10:07:39 | <trez> | in 6.8 it doest that, but not in 6.10 :( |
| 10:07:58 | <quicksilver> | you should file a bug on GHC. |
| 10:09:39 | <zcvvc> | ghci 6.10.2 after pressing ctrl-c gives segfault. ctrl-d quits normally. Possible causes? I'm running ubuntu 9.04 |
| 10:10:26 | <yitz> | zcvvc: ghc 6.10.3 is now being release just to fix that bug |
| 10:10:41 | <yitz> | it was introduced only in that version of ghc |
| 10:10:49 | <zcvvc> | thanks |
| 10:14:42 | <roadwarrior> | I see, thanks quicksilver |
| 10:23:09 | <RayNbow> | hmm |
| 10:23:37 | <RayNbow> | anyone tried installing the Haskell platform in Arch? |
| 10:25:06 | <quicksilver> | you would imagine that dons has |
| 10:26:35 | <RayNbow> | on my Arch machine, it cannot find haskell-cabal on AUR :p |
| 10:26:51 | <Alpounet> | RayNbow, it has worked for dons and some others. |
| 10:31:31 | <RayNbow> | @seen dons |
| 10:31:31 | <lambdabot> | dons is in #haskell-soc, #haskell-in-depth, #gentoo-haskell, #concatenative, #arch-haskell, #darcs, #yi, #xmonad, #ghc and #haskell. I last heard dons speak 3h 10m 6s ago. |
| 10:48:09 | <mreh> | with this data type for example: Nats = Zero | Suc Nats, how could I quickly nest constructors to make arbitary size data structures |
| 10:49:04 | <mreh> | foldl? with a list [1..n] |
| 10:49:23 | <Botje> | iterate Suc Zero !! n |
| 10:49:36 | <mreh> | :t !! |
| 10:49:37 | <lambdabot> | parse error on input `!!' |
| 10:49:41 | <RayNbow> | :t (!!) |
| 10:49:43 | <mornfall> | :t (!!) |
| 10:49:43 | <lambdabot> | forall a. [a] -> Int -> a |
| 10:49:43 | <lambdabot> | forall a. [a] -> Int -> a |
| 10:50:13 | <mreh> | mmmmm functional programming |
| 10:51:11 | <mreh> | @src iterate |
| 10:51:11 | <lambdabot> | iterate f x = x : iterate f (f x) |
| 10:52:12 | <mreh> | iterate Maybe "hello" !! 3 |
| 10:52:19 | <mreh> | > iterate Maybe "Hello" !! 3 |
| 10:52:20 | <lambdabot> | Not in scope: data constructor `Maybe' |
| 10:52:24 | <RayNbow> | Just |
| 10:52:29 | <mreh> | > iterate Just "Hello" !! 3 |
| 10:52:30 | <lambdabot> | Occurs check: cannot construct the infinite type: a = Maybe a |
| 10:52:30 | <lambdabot> | Ex... |
| 10:52:54 | <heltav> | > (Just 5) (+) <*> (Just 3) |
| 10:52:55 | <lambdabot> | Couldn't match expected type `t -> f (a -> b)' |
| 10:52:58 | <heltav> | > (Just 5) (+1) <*> (Just 3) |
| 10:52:59 | <lambdabot> | Couldn't match expected type `t -> f (a -> b)' |
| 10:53:01 | <RayNbow> | the problem is that the type of Just x is different from the type of Just (Just x) |
| 10:53:11 | <mreh> | yeah |
| 10:53:21 | <mreh> | ill do it on my own computer :) |
| 10:53:33 | <heltav> | > (Just +5) <*> (Just 3) |
| 10:53:34 | <lambdabot> | Couldn't match expected type `a -> b' |
| 10:53:40 | <heltav> | > (Just + 5) <*> (Just 3) |
| 10:53:41 | <lambdabot> | Couldn't match expected type `a -> b' |
| 10:53:54 | <mreh> | how does one upload a file to lamdabot? |
| 10:54:00 | <heltav> | > Just (+ 5) <*> (Just 3) |
| 10:54:02 | <lambdabot> | Just 8 |
| 10:54:13 | <heltav> | > Just (+ 5) <$> (Just 3) |
| 10:54:14 | <lambdabot> | Couldn't match expected type `a -> b' |
| 10:54:19 | <heltav> | > (Just 5) <$> (Just 3) |
| 10:54:21 | <lambdabot> | Couldn't match expected type `a -> b' |
| 10:54:24 | <RayNbow> | :t let ntimes n f = foldl (.) id (replicate n f) in ntimes |
| 10:54:24 | <heltav> | > (+) (Just 5) <$> (Just 3) |
| 10:54:26 | <lambdabot> | forall a. Int -> (a -> a) -> a -> a |
| 10:54:26 | <lambdabot> | No instance for (Num (Maybe t)) |
| 10:54:26 | <lambdabot> | arising from a use of `+' at <in... |
| 10:54:46 | <heltav> | > (+5) <$> (Just 3) |
| 10:54:48 | <lambdabot> | Just 8 |
| 10:54:52 | <RayNbow> | *Main> ntimes 3 Succ Zero |
| 10:54:52 | <RayNbow> | Succ (Succ (Succ Zero)) |
| 10:55:00 | <RayNbow> | ^ from a local ghci session |
| 10:56:49 | <dabbler> | how can i specify my own function for showing lists of lists? |
| 10:57:58 | <mux> | dabbler: either write a custom function, or use a newtype for your list of lists type and write a Show instance for it |
| 10:59:41 | <dabbler> | mux: so if i use a newtype, can i still use: list !! index ? |
| 10:59:46 | <mreh> | :t foldl |
| 10:59:47 | <lambdabot> | forall a b. (a -> b -> a) -> a -> [b] -> a |
| 11:00:00 | <mux> | dabbler: nope, unfortunately you can't |
| 11:00:33 | <mux> | thanks to generalized newtype deriving, you can get class instances for free, but since (!!) is a function only operating on [a] types, it won't work for your type |
| 11:00:49 | <mux> | however, it's just a matter of unwrapping the newtype and then calling (!!) on the list |
| 11:01:06 | <mux> | which should have 0 performance impact in the generated code |
| 11:01:37 | <dabbler> | oh, how do you unwrap a newtype? |
| 11:02:31 | <mux> | by pattern matching on it |
| 11:02:41 | <mux> | like if you have newtype Foo = Bar Int |
| 11:02:56 | <mux> | you'd write: f (Bar x) = someotherfunction x |
| 11:03:34 | <mux> | or, to stick to your case more closely, if you have newtype Foo = Bar [Int] |
| 11:04:00 | <mux> | you can write myShow (Bar xs) = ... |
| 11:04:07 | <mux> | and since xs is a list here, you can use (!!) on it |
| 11:04:08 | <mreh> | You remember what I was doing with Nats = Zero | Suc Nats... I came up with this makeN n = foldr (\a b -> Suc b) Zero [1..n] |
| 11:04:21 | <mreh> | that's more idiomatic to me |
| 11:04:25 | <quicksilver> | dabbler: but that's a whole lot of work just to write a different show-like function. |
| 11:04:32 | <mux> | ACTION nods at quicksilver |
| 11:04:33 | <quicksilver> | dabbler: simpler just to write a function with a different name |
| 11:04:35 | <quicksilver> | 'myShow' |
| 11:04:38 | <quicksilver> | 'prettyPrint' |
| 11:04:48 | <quicksilver> | the show instance for lists of lists is the 'Right' one anyway. |
| 11:04:49 | <mux> | an ad-hoc function sounds more appropriate here |
| 11:05:03 | <dabbler> | man, i'm confused |
| 11:05:07 | <mreh> | :D |
| 11:05:10 | <mux> | just like there is showap and showTree |
| 11:05:22 | <mux> | dabbler: good, haskell is getting into you :-) |
| 11:05:30 | <Alpounet> | :-) |
| 11:05:41 | <dabbler> | well, i wrote a general nxnxn Rubik's cube program |
| 11:05:46 | <mreh> | makeN n = foldr (\a b -> Suc b) Zero [1..n] <- is this good Haskell? |
| 11:06:03 | <Alpounet> | btw, what's the usual way to use Either ? How do we know when to use Left or Right ? |
| 11:06:04 | <dabbler> | but i'm starting to think getting it to display prettily is going to be harder than programming the cube and the moves |
| 11:06:23 | <mux> | mreh: it's nice |
| 11:06:26 | <Deewiant> | Alpounet: Generally, Right is for the 'right' result ;-) |
| 11:06:27 | <Alpounet> | dabbler, it won't, don't worry. |
| 11:06:33 | <Deewiant> | With Left being used for error values |
| 11:06:51 | <Alpounet> | Ok, is it really the "standard" way ? |
| 11:06:57 | <quicksilver> | dabbler: no, that's fine. |
| 11:07:01 | <quicksilver> | dabbler: just don't use 'show' |
| 11:07:04 | <quicksilver> | that's not what it's for |
| 11:07:05 | <mreh> | mux: could do better? |
| 11:07:08 | <quicksilver> | show is not intended to be pretty. |
| 11:07:11 | <mux> | mreh: however you don't really needs the numbers here |
| 11:07:16 | <quicksilver> | use prettyDisplayRubiksCube |
| 11:07:23 | <quicksilver> | or whatever name you favour |
| 11:07:37 | <litb> | oh |
| 11:07:38 | <dabbler> | can i get that to fire whenever a function returning a cube is called? |
| 11:07:40 | <mux> | mreh: you'd write (\_ b -> Suc b) thus; it tells the compiler you don't use the first variable |
| 11:07:57 | <Deewiant> | Alpounet: Yes, it's quite standard: the Error instance for Either, for instance, considers Left an error |
| 11:08:06 | <mux> | mreh: so actually you don't need a fold |
| 11:08:14 | <mux> | mreh: you need the nth element of an iterate call |
| 11:08:23 | <dabbler> | quicksilver: in the interpreter i mean |
| 11:08:25 | <mux> | makeN n = iterate Suc Zero !! n |
| 11:08:31 | <Alpounet> | Deewiant, ok, thanks. |
| 11:08:46 | <mux> | mreh: that should work too and is nicer |
| 11:08:53 | <quicksilver> | dabbler: No. |
| 11:08:58 | <mreh> | mux: can you put some brackets around that, i cant parse it |
| 11:09:08 | <quicksilver> | dabbler: but it's not hard to put "pp (...)" around your expressions. |
| 11:09:18 | <mux> | mreh: makeN n = (iterate Suc Zero) !! n |
| 11:09:19 | <quicksilver> | which is what I generally call a pretty print function. |
| 11:09:20 | <mux> | mreh: better? |
| 11:09:28 | <mreh> | mux: yes, thanks |
| 11:09:37 | <mreh> | !! is infix |
| 11:09:47 | <dabbler> | quicksilver: oh, that makes sense i guess, and i'm glad i dont have to mess around with show |
| 11:11:31 | <mux> | mreh: remember that function application binds tightest than anything else |
| 11:11:32 | <mreh> | hehe, Germans pronounce "Nats" like "Nuts" |
| 11:11:50 | <mreh> | mux: i need to brush up on my fixity |
| 11:12:01 | <mreh> | $ is the lowest is it not? |
| 11:12:26 | <quicksilver> | yes, it is the lowest |
| 11:12:32 | <mux> | $ associates to the right and has lowest fixity |
| 11:12:35 | <quicksilver> | although you can define other things with the same, lowest |
| 11:12:41 | <quicksilver> | "precedence" is the word, not fixity. |
| 11:12:45 | <mux> | right |
| 11:12:48 | <quicksilver> | fixity is {left,right,neither |
| 11:12:50 | <quicksilver> | } |
| 11:13:07 | <mreh> | how do you define precedence in haskell? |
| 11:13:11 | <yitz> | hmm macports can't build ghc 6.10.2 - it fails to download a patch it thinks it needs |
| 11:13:26 | <mux> | mreh: with the infix, infixr and infixl keywords |
| 11:13:28 | <yitz> | a patch having to do with the testsuite no less |
| 11:16:57 | <mreh> | java generics is parametric polymorphism? |
| 11:17:13 | <mreh> | no... |
| 11:17:18 | <mreh> | overloading |
| 11:17:39 | <mux> | it's parametric polymorphism I think, except it's explicit |
| 11:17:54 | <mux> | haskell figures types out alone, which is nice |
| 11:18:07 | <mux> | at least most of the time anyway :) |
| 11:18:09 | <yitz> | yeah, the patch it's looking for doesn't exist on macports.org. |
| 11:18:23 | <mreh> | im having one of those days where I can concentrate |
| 11:18:27 | <mreh> | cant |
| 11:18:32 | <mreh> | CANT CONCENTRATE |
| 11:20:21 | <Alpounet> | mreh, Java generics is very very very restricted parametric polymorphism |
| 11:20:27 | <Alpounet> | C++'s is better |
| 11:20:36 | <Alpounet> | and Haskell's is two times better :p |
| 11:22:18 | <ibid> | C++'s are more powerful |
| 11:22:30 | <ibid> | whether that's better is a different qusestion :) |
| 11:22:35 | <Asztal> | the thing with C++'s is that a template can't be type-checked until it is instantiated, which can lead to fun things |
| 11:22:56 | <ibid> | i understand C++0x is planning to change that |
| 11:25:12 | <mreh> | c++ is ******* **** anyway |
| 11:27:08 | <ibid> | ACTION is currently writing a large thingy in C++ |
| 11:27:29 | <mreh> | how large is your thingy |
| 11:27:49 | <dabbler> | @quote C++ |
| 11:27:49 | <lambdabot> | glguy says: run-time really is the best time to find out about scope problems |
| 11:27:50 | <ibid> | not large yet |
| 11:28:03 | <Alpounet> | hmm |
| 11:28:23 | <ibid> | but probably going to grow to multi-dozen kilolines |
| 11:28:28 | <ibid> | eventually :) |
| 11:28:29 | <mreh> | has anyone investigated the speed and efficiency of haskell against others |
| 11:28:39 | <ibid> | yes |
| 11:28:45 | <Alpounet> | ibid, I've done a lot of metaprogramming in C++, I've played quite much with C++'s templates. I really appreciate them, but Haskell and OCaml's parametric polymorphism is smarter IMO. |
| 11:28:51 | <ibid> | for some values of "investigated" |
| 11:28:57 | <ibid> | Alpounet: agreed |
| 11:29:16 | <mornfall> | mreh: If you are in for semi-meaningless benchmarks, try http://shootout.alioth.debian.org/ |
| 11:29:19 | <litb> | hmm |
| 11:29:28 | <litb> | i felt like in ##c++ for half a second |
| 11:29:46 | <ibid> | how does it feel like in there? |
| 11:29:51 | <litb> | until i saw them prising ocaml and haskell oO |
| 11:30:16 | <Asztal> | lambdabot << 2 << 3+4; |
| 11:30:42 | <mreh> | actions speak louder than words |
| 11:30:42 | <litb> | ibid: feels fresh |
| 11:30:42 | <Alpounet> | ibid, C++'s templates do things we can't do in Haskell exactly because Haskell's parametric polymorphism and more generally Haskell's type system is better. Defining types / data structures in Haskell is more practical than the C++ way, and templates had to deal with that. |
| 11:31:09 | <Alpounet> | That's my poitn of view. (I've been a C++ developer before discovering FP's magic) |
| 11:31:13 | <litb> | c++ templates rocks all |
| 11:31:21 | <yitz> | urgh. haskell.org down? anyone getting responses? |
| 11:31:31 | <mreh> | Alpounet: actions speak louder than words? |
| 11:31:31 | <ibid> | Alpounet: agreed. why are you telling me this? :) |
| 11:31:46 | <Alpounet> | mreh, hmm ? |
| 11:31:56 | <mreh> | nothing |
| 11:32:30 | <Alpounet> | ibid, I was answering to "C++'s are more powerful" |
| 11:32:45 | <Alpounet> | yitz, down for me too :/ |
| 11:33:14 | <Alpounet> | not down anymore. |
| 11:33:53 | <ibid> | Alpounet: and did you see 14:22 <ibid> whether that's better is a different qusestion :) |
| 11:33:56 | <ibid> | ? |
| 11:33:58 | <ibid> | :) |
| 11:33:59 | <mreh> | are there any serious game devs using haskell |
| 11:34:16 | <ibid> | Alpounet: nevermind |
| 11:34:48 | <Alpounet> | ibid, oh... So I've lost something like 30secs of my life. |
| 11:36:05 | <ibid> | Alpounet: a tragedy, that |
| 11:36:35 | <ibid> | Alpounet: i agree with you on the matter, i was just confused as to whether i had miscommunicated my position |
| 11:41:54 | <Bacta> | How is babby formed? |
| 11:42:39 | <yitz> | anyone else notice that Peaker (PeakerWork)'s MList is just ListTDoneRight? |
| 11:43:01 | <EvilTerran> | ... it is? |
| 11:43:13 | <yitz> | i believe so |
| 11:44:40 | <yitz> | data Monad m => MListItem m a = MNil | MCons a (MList m a) |
| 11:44:47 | <yitz> | newtype Monad m => MList m a = MList { unMList :: m (MListItem m a) } |
| 11:45:12 | <EvilTerran> | ACTION thought the first "m" in "m (MListItem m a)" made for something different |
| 11:45:24 | <Ferdirand> | is there a significant difference between using RWS with R == (), and stacking a WriterT and a State ? |
| 11:45:37 | <EvilTerran> | no. |
| 11:45:38 | <yitz> | no you need that in ListTDoneRight also, that's actually the whole point |
| 11:46:20 | <EvilTerran> | ... so ListT can't actually be written in terms of []? |
| 11:46:31 | <EvilTerran> | (when dun right) |
| 11:46:41 | <yitz> | not if you want it to satisfy the monad laws |
| 11:46:48 | <yitz> | and hence work right |
| 11:46:58 | <quicksilver> | ListTDoneRight is a slightly odd monad though |
| 11:47:02 | <EvilTerran> | ACTION enlightenment |
| 11:47:10 | <quicksilver> | arguably LogicT is a better kind of ListT done right. |
| 11:47:28 | <yitz> | I hate LogicT, it's CPS |
| 11:47:44 | <yitz> | that makes it a lot odder |
| 11:48:25 | <Bacta> | How is babby formed? |
| 11:48:35 | <yitz> | @ops |
| 11:48:36 | <lambdabot> | Maybe you meant: docs oeis pl |
| 11:48:42 | <yitz> | @where ops |
| 11:48:42 | <lambdabot> | shapr Cale glguy dons sjanssen sorear dcoutts Saizan allbery_b dibblego conal Phillipa bos arjanb psnl lispy xerox vincenz davidhouse Heffalump kosmikus wli Pseudonym Igloo musasabi quicksilver |
| 11:48:42 | <lambdabot> | mauke |
| 11:48:47 | <wli> | LogicT CPS how? |
| 11:48:51 | <QtPlaty[HireMe]> | expn cps |
| 11:49:25 | <Bacta> | How is babby formed??? |
| 11:49:32 | <dcoutts_> | Bacta: please stop |
| 11:49:47 | <Bacta> | o = k |
| 11:49:56 | <dcoutts_> | thanks |
| 11:50:25 | <wli> | ACTION vaguely wonders why this one thing isn't running in constant space. |
| 11:50:56 | <heltav> | how do you et into contact with a channel admin? |
| 11:51:23 | <heltav> | mreh: you heard of Frag? it is a game written by someone as a thesis. dont know of anything more than that,. |
| 11:51:33 | <mreh> | heltav: year |
| 11:51:40 | <Bacta> | People ... write games in Haskell? :x |
| 11:51:48 | <Alpounet> | yeah |
| 11:51:57 | <mreh> | @faq Can I write gamez in Haskell? |
| 11:51:57 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:52:11 | <Bacta> | masochists |
| 11:52:20 | <mreh> | hmm |
| 11:53:06 | <heltav> | http://www.youtube.com/watch?v=0jYdu2u8gAU |
| 11:53:14 | <mreh> | frag is pretty impressive |
| 11:53:22 | <Bacta> | Yeah was just working |
| 11:53:24 | <wli> | It seems to need a lot of stack space. |
| 11:53:25 | <Bacta> | *watching |
| 11:53:32 | <mreh> | all game do |
| 11:53:37 | <mreh> | all games do* |
| 11:53:46 | <Bacta> | but seriously ... just because you can do something doesn't mean you should |
| 11:53:53 | <Bacta> | right tool for the right job |
| 11:54:00 | <mreh> | Bacta: what is your objection exactly |
| 11:54:03 | <araujo> | mreh, interesting in gaming on haskell? |
| 11:54:09 | <araujo> | er, interested |
| 11:54:11 | <mreh> | arajo: aye |
| 11:54:23 | <Bacta> | mreh: It must be painful |
| 11:54:24 | <tombom> | @faq can I kill babies in haskell? |
| 11:54:24 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:54:26 | <quicksilver> | haskell's a great tool for game writing in many ways. |
| 11:54:34 | <quicksilver> | there are shortcomings, of course. |
| 11:54:48 | <mreh> | araujo: yes |
| 11:54:50 | <quicksilver> | but it's very efficient in terms of getting complex stuff written quickly + correctly. |
| 11:54:58 | <araujo> | mreh, nice, we need more of those :) |
| 11:55:04 | <mreh> | and the ability to write your own languages |
| 11:55:12 | <araujo> | ACTION fears dcoutts_ with the @ |
| 11:55:20 | <dabbler> | and its so much more fun |
| 11:55:22 | <kosmikus> | araujo!!!!! |
| 11:55:26 | <araujo> | kosmikus!!!! |
| 11:55:28 | <araujo> | hah |
| 11:55:32 | <araujo> | kosmikus, how are you? |
| 11:55:35 | <araujo> | long time |
| 11:55:37 | <araujo> | :) |
| 11:55:38 | <kosmikus> | indeed |
| 11:55:44 | <kosmikus> | I'm fine, hope you are too |
| 11:55:49 | <mreh> | get a room |
| 11:55:57 | <araujo> | kosmikus, yeah, I am fine, thanks ... :) |
| 11:56:12 | <kosmikus> | araujo: I'm currently co-writing a game in Haskell |
| 11:56:20 | <kosmikus> | araujo: but it's not yet released |
| 11:56:29 | <mreh> | kosmikus: can we see? |
| 11:56:43 | <Bacta> | @faq can I use Haskell to commit a felony? |
| 11:56:43 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:56:48 | <araujo> | kosmikus, wow |
| 11:56:51 | <araujo> | kosmikus, really??? |
| 11:56:59 | <wli> | kosmikus: What kind of game? |
| 11:57:00 | <kosmikus> | soon, soon. nothing really special though, 2D space shooter |
| 11:57:08 | <araujo> | kosmikus, not even a link briefly explaining what it is about? :) |
| 11:57:18 | <kosmikus> | using OpenGL/SDL |
| 11:57:18 | <araujo> | kosmikus, 2D space shooter ++ |
| 11:57:20 | <mreh> | kosmikus: haskell is space? |
| 11:57:22 | <Bacta> | @faq can Haskell get me a hooker? |
| 11:57:22 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:57:37 | <mreh> | i think you're worked out how it works Bacta |
| 11:57:47 | <araujo> | kosmikus, I would definitely be interested on playing with that :) |
| 11:57:52 | <mreh> | @faq I can Haskell Cheezburger? |
| 11:57:52 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:58:01 | <Bacta> | @faq can Haskell get me ops in this channel? |
| 11:58:01 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:58:07 | <araujo> | kosmikus, let us know as soon as you have something up! |
| 11:58:29 | <kosmikus> | araujo: will do. it will be on Hackage ultimately. |
| 11:58:44 | <dabbler> | can Haskell fail? |
| 11:58:54 | <dabbler> | @faq can Haskell fail? |
| 11:58:54 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:58:59 | <Bacta> | @fag can Haskell fail? |
| 11:58:59 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:59:02 | <araujo> | kosmikus, great :) |
| 11:59:12 | <Bacta> | @fag works |
| 11:59:12 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 11:59:20 | <Alpounet> | a chapter in RWH about "Writing a game in Haskell" would have been fine. |
| 11:59:21 | <Bacta> | @dyke |
| 11:59:21 | <lambdabot> | Maybe you meant: dice type |
| 11:59:29 | <araujo> | kosmikus, is this an academic project or for industry ? , if i may know |
| 11:59:41 | <heltav> | how you list admins for a channel? |
| 12:00:06 | <araujo> | something like, /msg chanserv #channel access list |
| 12:00:08 | <araujo> | i think |
| 12:00:23 | <yitz> | ACTION is impressed that quicksilver withstood the temptation to answer my troll about CPS. |
| 12:00:26 | <dabbler> | @faq can haskell make iphone apps? |
| 12:00:27 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 12:00:35 | <dcoutts_> | heltav: I've no idea, is there something in particular you'd like to discuss with them? |
| 12:00:40 | <heltav> | yes |
| 12:00:42 | <earthy> | kosmikus is not in industry afaik |
| 12:01:02 | <wli> | There's a tremendous amount of graphic design in games. |
| 12:01:03 | <Bacta> | @faq Blah'); drop table students; -- |
| 12:01:03 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 12:01:37 | <mreh> | was that an SQL injection? |
| 12:01:51 | <Bacta> | ;) |
| 12:02:19 | <kosmikus> | araujo: it's a hobby project |
| 12:02:32 | <araujo> | kosmikus, cool :) |
| 12:02:41 | <mreh> | in any normal channel Bacta would have been kicked age ago |
| 12:02:43 | <araujo> | kosmikus, we definitely need more games in haskell :P |
| 12:02:50 | <yitz> | good thing freenode isn't using SQL. |
| 12:02:57 | <Bacta> | Yeah you guys are fairly tolerant of me :) |
| 12:03:16 | <mreh> | that would have been the optimum moment for a kick |
| 12:03:18 | <Bacta> | It's not my fault I'm Jewish but you guys have been really good to me about it |
| 12:03:38 | <araujo> | ACTION looking forward for that game |
| 12:04:30 | <mreh> | haskell in space is a good place to start if you want to do gamez |
| 12:04:46 | <mreh> | it's a paper by c luth |
| 12:06:48 | <Alpounet> | http://alexicalmistake.com/2008/10/haskell-and-game-development/ |
| 12:06:51 | <Alpounet> | interesting |
| 12:06:56 | <Alpounet> | (particularly the comments) |
| 12:07:21 | <mreh> | read that |
| 12:07:26 | <mreh> | worth reading |
| 12:08:05 | <mreh> | how NOT to write a game in haskell |
| 12:10:26 | <Bacta> | LETS GET PHYSICAL! PHYSICAL! |
| 12:11:02 | <mreh> | he'll get tired soon |
| 12:11:15 | <Bacta> | yeah I'm about to goto bed actually |
| 12:11:15 | <mreh> | im just going to stop paying attention to him |
| 12:12:06 | <dabbler> | @quote troll |
| 12:12:06 | <lambdabot> | qwe1234 says: stfu, troll. |
| 12:12:40 | <Bacta> | I am not a troll (done in his best Nixon voice) |
| 12:12:50 | <osfameron> | ACTION hugs irssi |
| 12:14:53 | <Asztal> | I can't find anything about ListTDoneRight, except for links to a long-gone haskell wiki page :( |
| 12:15:22 | <dabbler> | @quote listdoneright |
| 12:15:22 | <lambdabot> | No quotes match. |
| 12:18:39 | <mreh> | how does one get a quote? |
| 12:18:43 | <mreh> | @quote mreh |
| 12:18:43 | <lambdabot> | No quotes match. Sorry about this, I know it's a bit silly. |
| 12:18:46 | <mreh> | :( |
| 12:19:02 | <EvilTerran> | @help remember |
| 12:19:02 | <lambdabot> | quote <nick> |
| 12:19:02 | <lambdabot> | remember <nick> <quote> |
| 12:19:02 | <lambdabot> | Quote somebody, a random person, or save a memorable quote |
| 12:19:12 | <EvilTerran> | @quote EvilTerran |
| 12:19:12 | <lambdabot> | EvilTerran says: Hylo morphism batman! |
| 12:19:37 | <EvilTerran> | Asztal, http://www.haskell.org/haskellwiki/ListT_done_right should have it, although it doesn't seem to be working for me at the moment |
| 12:19:54 | <mreh> | @quote trippy |
| 12:19:54 | <lambdabot> | Pseudonym says: Lazy evalution is really, really trippy. |
| 12:20:09 | <arjanb> | haskell.org seems very slow atm |
| 12:20:29 | <Asztal> | EvilTerran: ah, thanks. Yeah, I heard someone say haskell.org wasn't responding before |
| 12:20:56 | <mreh> | @quote l33t_h4x0r |
| 12:20:57 | <lambdabot> | l33t_h4x0r says: maybe if uve had some professor teach u bullshit in uni yea \n i learned on my own.. k.. i dun give a shit bout terms :p i just code |
| 12:21:10 | <Workybob> | is it just me or is h.o down? |
| 12:21:25 | <EvilTerran> | Asztal, http://www.google.com/search?q=cache:www.haskell.org/haskellwiki/ListT_done_right |
| 12:21:41 | <mreh> | @quote lol |
| 12:21:41 | <lambdabot> | qwe1234 says: lol, thanks for the pointless offtopic post |
| 12:21:53 | <mreh> | @quote lolol |
| 12:21:53 | <lambdabot> | No quotes match. My pet ferret can type better than you! |
| 12:23:32 | <litb> | where can i ask about bottom type? |
| 12:23:49 | <litb> | i wonder what "void" is? bottom type or unit type? is it the right channel? |
| 12:23:57 | <dabbler> | @remember dabbler @quote dabbler |
| 12:23:57 | <lambdabot> | It is forever etched in my memory. |
| 12:24:08 | <EvilTerran> | litb, well, C etc's "void" is analogous to (), the unit type, in haskell |
| 12:24:14 | <mreh> | @quote dabbler |
| 12:24:14 | <lambdabot> | dabbler says: @quote dabbler |
| 12:24:20 | <Tobsan> | w 20 |
| 12:24:22 | <Tobsan> | oops |
| 12:24:32 | <litb> | EvilTerran: i wonder since in the Standard, it says a value of type void does not exist |
| 12:24:39 | <litb> | but wikipedia says a unit type has exactly one value |
| 12:24:49 | <Asztal> | Unit is a type with one value, Void is the type with no values |
| 12:24:55 | <EvilTerran> | void isn't exactly a type in C, it's a bit weird |
| 12:25:07 | <Botje> | data Unit = Unit vs data Void |
| 12:25:15 | <Botje> | Unit has Unit and _|_ |
| 12:25:21 | <EvilTerran> | but you return void in C when you'd return () in haskell |
| 12:25:23 | <Botje> | Void can only have _|_ |
| 12:25:31 | <EvilTerran> | by the conventional ordering of types, the "bottom type" in haskell would be (forall a. a) |
| 12:25:32 | <litb> | Asztal: but wikipedia says void is unit type with one value. but the c++ standard says a void value does not exist |
| 12:25:39 | <litb> | so im confused |
| 12:25:44 | <EvilTerran> | litb, that's because C is silly. |
| 12:25:51 | <EvilTerran> | or indeed c++. |
| 12:25:59 | <Alpounet> | EvilTerran, the second use vase in C is void*... Not used anymore in C++ (except by beginners or bad C++ developers) |
| 12:26:26 | <EvilTerran> | Alpounet, yeah, well, void* is a type, but void isn't really, as i see it. |
| 12:26:42 | <Alpounet> | EvilTerran, yes, void* is totally apart of the void type. |
| 12:26:53 | <litb> | EvilTerran: void is a void-type, of course |
| 12:26:56 | <Alpounet> | They just saved time to find a new keyword... |
| 12:27:10 | <EvilTerran> | C's type system predates modern programming language theory, so it inevitably looks incoherent when you try to mesh the two |
| 12:27:48 | <quicksilver> | if there's only one value, it might as well not exist |
| 12:27:52 | <quicksilver> | form the point of view of a C programmer |
| 12:28:00 | <litb> | hmm |
| 12:28:01 | <quicksilver> | there's really no difference between () and Void |
| 12:28:13 | <quicksilver> | (...from the point of view of a C programmer, that is) |
| 12:28:15 | <EvilTerran> | litb, taking the usual ordering of types (s >= t iff (x :: t) => (x :: s)), the bottom type in haskell would be (forall a. a) |
| 12:28:52 | <EvilTerran> | the only value that's an inhabitant of all types is _|_, so that's the only value in (forall a. a) |
| 12:28:55 | <Botje> | C pretty much predates modern everything >:) |
| 12:29:21 | <litb> | where (forall a. a) are all values? |
| 12:29:29 | <Asztal> | Fun fact: "A program can convert a pointer to any type of data to a pointer to void and back to the original type without losing information" isn't true in C++. Pointer-to-member functions don't necessarily fit in a void*. |
| 12:29:40 | <EvilTerran> | litb, no, (forall a. a) is the type that only contains values that can be in any type. |
| 12:29:46 | <litb> | oh ok |
| 12:30:05 | <wjt> | Asztal: rly |
| 12:30:09 | <EvilTerran> | "x :: forall a. a" means "for all types a, x is of type a" |
| 12:30:09 | <EvilTerran> | so x = _|_ |
| 12:30:33 | <mreh> | i feel like i've missed something, i'm 22, and all I've learned is alot of Java, and some C |
| 12:30:41 | <mreh> | and now I'm on to Haskell |
| 12:30:46 | <EvilTerran> | (ignoring any dubious semantics-breaking involving unsafeCoerce and seq) |
| 12:30:49 | <litb> | EvilTerran: oh |
| 12:32:42 | <EvilTerran> | litb, the "top" type, as it were, would be "exists a. a" (if "exists" were actually a keyword) |
| 12:33:15 | <Deewiant> | It is in UHC |
| 12:33:17 | <EvilTerran> | because "x :: exists a. a" would mean "there exists a type 'a' such that x is of type a", which clearly applies to all well-typed values. |
| 12:34:05 | <Asztal> | can you actually do anything useful with that, though? |
| 12:34:25 | <EvilTerran> | Asztal, not with (exists a. a), no, because you don't actually know anything about a value of that type |
| 12:34:54 | <kalven> | Asztal: you can put a pointer-to-pointer-to-member function in a void* though :) |
| 12:35:22 | <EvilTerran> | Asztal, but you could use the methods of Foo on a value of type (exists a. Foo a => a), for instance |
| 12:35:25 | <Asztal> | I supposes there's exists a. Num a => a |
| 12:35:55 | <litb> | kalven: you can't reliably. trying it will result in undefined behavior. so better don'T do it ahaha |
| 12:35:56 | <Asztal> | actually, I want that now :) |
| 12:36:23 | <EvilTerran> | Asztal, and you could apply the fst to the snd of a value of type (exists a. (a -> Foo, a)) |
| 12:36:42 | <kalven> | litb: says who? |
| 12:37:22 | <litb> | kalven: i've kept the standard open all times on my desk. so it's easy to prove ppl wrong :D |
| 12:37:48 | <heltav> | is it possible to download a ghc binary for linux to windows, store it on USB and then install it on linux? |
| 12:38:03 | <mathijs> | heltav, sure you can |
| 12:38:03 | <EvilTerran> | heltav, i don't see why not. |
| 12:38:41 | <kalven> | litb: give me a section then :) |
| 12:39:04 | <mathijs> | heltav: But it's generally easier just to get it from your OS package system |
| 12:39:18 | <mathijs> | if you don't need the latest and greatest |
| 12:39:20 | <heltav> | not without internet |
| 12:39:25 | <mathijs> | aha |
| 12:40:17 | <mathijs> | In that case, make sure you grab all the required libs too and put them on the same usb disk ;) |
| 12:42:01 | <litb> | kalven: first 5.2.10 terms any other cast not explicitly listed done using reinterpret_cast ill-formed. so you would need to type-pun an lvalue of type void* to an lvalue of type ptr-member-function-pointer and write. but that yields to UB according to 3.10/15. |
| 12:43:04 | <litb> | kalven: so you are out of luck, until you write a wrapper function and get a pointer-to-function and write that to a void*. but that's equally not allowed in c++03, and only conditionally supported in c++1x, so you either get a diagnostic, or you get what you want. not good :( |
| 12:43:14 | <litb> | ahaha, but i guess this is offtopic in here |
| 12:43:25 | <kalven> | yeah, let's take it to ##c++ |
| 12:45:36 | <litb> | just to let all know i was wrong. it's a pointer to it, so it can be stored in void* of course :D |
| 12:50:05 | <heltav> | uh, is .tar.bz2 (70 MB) a binary or not? |
| 12:51:29 | <EvilTerran> | ACTION tries to work out how to do unification of terms expressed in the I Am Not A Number paper style |
| 12:52:44 | <EvilTerran> | (http://portal.acm.org/citation.cfm?id=1017477) |
| 12:53:27 | <pozic> | How can I see which module imports a certain identifier? |
| 12:53:46 | <EvilTerran> | pozic, :i(nfo) at the ghci prompt should do it |
| 12:53:56 | <pozic> | EvilTerran: that only shows where the function is defined. |
| 12:54:12 | <pozic> | EvilTerran: not which import module statement imports it. |
| 12:55:13 | <davidL> | do all the haskore modules need to be imported individually? "import Haskore" doesn't work |
| 12:55:55 | <quicksilver> | pozic: you can't. |
| 12:56:05 | <quicksilver> | pozic: you could be getting it from more than one source. |
| 12:56:08 | <quicksilver> | annoying. |
| 12:57:06 | <BONUS> | i was thinking. should Data.Monoid have KleisliEndo? |
| 12:57:14 | <BONUS> | a -> m a |
| 12:57:37 | <BONUS> | it's useful for making a foldM that works on any Foldable |
| 12:57:58 | <Axman6> | BONUS: i was in the comp labs at uni yesterday, and one of the tutors for a course i did last year in haskell was reading lyah. he said the applicative functor chapter was really good |
| 12:58:06 | <pozic> | quicksilver: how could it be coming from multiple sources? |
| 12:58:09 | <quicksilver> | indeed, it could be WrappedArrowEndo, couldn't it? |
| 12:58:19 | <BONUS> | really? wow, that's pretty awesome to hear |
| 12:58:20 | <Axman6> | ACTION though he should mention it while you were around |
| 12:58:35 | <quicksilver> | pozic: modules A and B could both import foo and re-export it |
| 12:58:47 | <quicksilver> | pozic: then you are getting 'foo' from both "import A" and "import M" |
| 12:58:57 | <pozic> | quicksilver: but those are not understood to be the same foo by GHC. |
| 12:59:01 | <quicksilver> | yes they are. |
| 12:59:10 | <quicksilver> | as long as they are, in fact, the same foo. |
| 12:59:16 | <BONUS> | WrappedArrowEndo huh? what would be the declaration for that |
| 12:59:46 | <quicksilver> | BONUS: newtype WrappedArrowEndo arr a = WrappedArrowEndo (arr a a) |
| 13:00:06 | <pozic> | quicksilver: in my experience that doesn't work; you get at the very least that you are importing foo two times. |
| 13:00:12 | <BONUS> | ah so you could then use Kliessli m b as arr |
| 13:00:14 | <quicksilver> | pozic: no, you don't. |
| 13:00:27 | <quicksilver> | pozic: for example, if you use Data.List, you are getting 'map' form Prelude and Data.List |
| 13:00:45 | <quicksilver> | pozic: if you import Control.Monad and Control.Monad.State, you are getting e.g. mapM_ from both those places |
| 13:01:44 | <quicksilver> | instance Arrow arr => Monoid (WrappedArrowEndo arr) where mempty = WrappedArrowEndo (pure id); mappend (WAE a) (WAE b) = WAE (a >>> b) |
| 13:01:54 | <quicksilver> | I got bored of typing the long constructor name :P |
| 13:02:04 | <BONUS> | haha |
| 13:02:33 | <quicksilver> | BONUS: still, "yes, it would be useful" |
| 13:02:39 | <quicksilver> | I bet edwardk already has it. |
| 13:02:46 | <quicksilver> | although it probalby has an absurd name :) |
| 13:03:13 | <pozic> | quicksilver: in the simple example I tried, you are right, but in more complicated situations I really seem to recall that GHC gave this warning. |
| 13:03:38 | <BONUS> | haha, i'll have to ask him. and yeah, his CT names own |
| 13:04:37 | <quicksilver> | pozic: if it somehow can't tell they are the same foo |
| 13:04:48 | <quicksilver> | pozic: but, afaik, that would only be the case if they were actually different. |
| 13:04:53 | <dmorti> | newbie question: in ghci, how does one define a datatype? |
| 13:05:02 | <quicksilver> | (like the same named functions in bytestring and bytestring.lazy which actually *are* different) |
| 13:05:11 | <BONUS> | dmorti: you don't, define it in a .hs file and then :load that file in |
| 13:05:16 | <EvilTerran> | dmorti, by putting it in a file and loading that file |
| 13:05:20 | <dmorti> | cheers. thought that might be the case |
| 13:05:24 | <pozic> | quicksilver: yes, I understand what it is supposed to do. |
| 13:05:28 | <quicksilver> | pozic: I think if you find a case, you have found a ghc bug, at least :) |
| 13:06:54 | <McManiaC> | hey, whats that error? |
| 13:07:00 | <McManiaC> | [ 5 of 21] Compiling System.Posix.Process.Internals ( System/Posix/Process/Internals.hs, dist/build/System/Posix/Process/Internals.o ) |
| 13:07:03 | <McManiaC> | System/Posix/Process/Internals.hs:10:17: Module `GHC.Conc' does not export `Signal' |
| 13:07:06 | <McManiaC> | cabal: Error: some packages failed to install: |
| 13:07:08 | <McManiaC> | [list of packages] |
| 13:07:22 | <McManiaC> | im running debian lenny with ghc 6.10.1 |
| 13:09:10 | <EvilTerran> | ACTION blinks |
| 13:09:12 | <quicksilver> | taht version of System.Posix must be incomptaible with your version of GHC.Conc |
| 13:09:14 | <quicksilver> | I suppose. |
| 13:09:30 | <EvilTerran> | I Am Not A Number, I Am A Free Variable mentions Huet's zippers... |
| 13:10:03 | <EvilTerran> | ... and a cursory googling for "higher-order unification" turns up a paper by Huet. i wonder if that'll work. |
| 13:10:04 | <McManiaC> | quicksilver: so what can i do? |
| 13:10:14 | <quicksilver> | McManiaC: why are you trying to compile system.posix anyway? |
| 13:10:17 | <quicksilver> | what problem are you trying to solve here |
| 13:10:46 | <McManiaC> | "cabal update postmaster" wants to do that |
| 13:10:48 | <McManiaC> | not me :) |
| 13:10:59 | <dcoutts_> | McManiaC: try install instead of update |
| 13:11:03 | <McManiaC> | upgrade |
| 13:11:16 | <McManiaC> | ok |
| 13:11:33 | <dcoutts_> | McManiaC: and use --dry-run to see what it'll install |
| 13:11:41 | <quicksilver> | cabal update tries to update all depended packages. |
| 13:11:42 | <McManiaC> | and this package seems to be missing a library to register - is this the devs fault? |
| 13:11:45 | <quicksilver> | This is actually not a good idea :( |
| 13:13:51 | <EvilTerran> | ACTION notes that he doesn't seem to be going for higher-order unification proper, which is just as well, seeing as that's undecidable |
| 13:14:26 | <Alpounet> | any impl. of Huet's Zipper in Haskell ? |
| 13:14:57 | <Axman6> | there's zipper's, not sure if they the same thing |
| 13:15:44 | <EvilTerran> | http://www.haskell.org/haskellwiki/Zipper |
| 13:16:07 | <EvilTerran> | mentions Huet's paper under "further reading" |
| 13:16:58 | <lukeo05> | Hi, real basic problem.. I can't figure out the simplest IO... Why can't I use multiple putStr's in a function?! |
| 13:19:22 | <Jedai> | lukeo05: You can, you have to use operators to combine IO actions though |
| 13:19:51 | <Jedai> | lukeo05: myIOAction = putStr "hello " >> putStrLn "world !" |
| 13:20:25 | <Jedai> | lukeo05: myEcho = getLine >>= (\line -> putStr line) |
| 13:21:16 | <Jedai> | lukeo05: This use the IO Monad, since monads are used everywhere in Haskell, the language has syntax sugar for this : the do-notation |
| 13:21:37 | <Jedai> | lukeo05: do { putStr "hello "; putStrLn "world !" |
| 13:21:43 | <Jedai> | } |
| 13:21:45 | <EvilTerran> | lukeo05, I found http://blog.sigfpe.com/2007/11/io-monad-for-people-who-simply-dont.html very useful when i was just getting started and didn't want to have to think about all this "monads" stuff |
| 13:22:20 | <Jedai> | lukeo05: myEcho = do { line <- getLine; putStr line } |
| 13:22:55 | <Jedai> | lukeo05: And of course you can use layout instead of explicit {} and ; |
| 13:23:00 | <lukeo05> | Thanks a lot :) Are the braces and colon whats needed? Cause my lecture notes don't have that! |
| 13:23:09 | <lukeo05> | oh... hmm |
| 13:23:21 | <Jedai> | myEcho = do |
| 13:23:21 | <Jedai> | line <- getLine |
| 13:23:21 | <Jedai> | putStr line |
| 13:24:00 | <EvilTerran> | lukeo05, the braces and semicolons can be inferred from indentation and newlines according to the so-called "layout rules", or you can put them in explicitly if you want |
| 13:24:44 | <edwardk2> | lukeo05: haskell has this nice rule called 'layout' which says that after a 'do, let, of, or where' you can omit the curly brace and it'll implicitly put ;'s as long as you keep indenting to the same level after that |
| 13:24:57 | <edwardk2> | lukeo05: outdenting will end the layout rule. |
| 13:25:24 | <lukeo05> | ahah, yeah it looks like there is something wrong with my layout... it works with braces and semi colon. Though the layout looks fine... I must have done something wrong! |
| 13:25:55 | <edwardk2> | lukeo05: remove tabs and make sure line <- getLine and putStr line are lined up on the same column |
| 13:26:11 | <edwardk2> | tabs are always worth 8 spaces |
| 13:26:30 | <edwardk2> | er is it they align to 8 columns, i can never remember which language does which |
| 13:26:50 | <lukeo05> | does do have to be on its own line? That fixed it for me... |
| 13:28:06 | <edwardk2> | lukeo05: you can put stuff after the do on the same line: i.e. do foo\n... and then indent to where the _foo_ is, and continue |
| 13:28:27 | <ManateeLazyCat> | How to customize GTK widget with Haskell? (I mean in gtk2hs). Thanks |
| 13:28:44 | <Jedai> | lukeo05: Nope, do don't have to be on its own line but it's a good rule to respect since it avoids lots of easy mistake if you use tabs and space (I strongly recommend you just use space) |
| 13:28:48 | <edwardk2> | lukeo05: personally i find that putting do, let, of or where on their own line makes my spacing less 'brittle' |
| 13:29:25 | <BONUS> | hey edwardk, we were just wondering if one of your libraries already has WrappedArrowEndo arr a = WrappedArrowEndo (arr a a). cause you can then make that a monoid with arrow composition and then with that and Kleisli you can make a foldM that works on all foldables |
| 13:29:31 | <BONUS> | *inhales* |
| 13:29:32 | <edwardk2> | i.e. if i change the text on the line containing the do, i no longer have to respace everything below it |
| 13:29:47 | <edwardk2> | bonus: its in monoids =) |
| 13:29:54 | <lukeo05> | Right, will do. Thanks a lot man. I think it was space/tab errors. |
| 13:30:02 | <BONUS> | haha |
| 13:30:02 | <edwardk2> | Data.Monoid.Categorical iirc |
| 13:30:34 | <edwardk2> | http://comonad.com/haskell/monoids/dist/doc/html/monoids/Data-Monoid-Categorical.html |
| 13:30:36 | <edwardk2> | GEndo |
| 13:30:39 | <quicksilver> | edwardk2: the kleisli version, or the arrow one? |
| 13:30:40 | <BONUS> | ah, you called it GEndo |
| 13:30:52 | <quicksilver> | ACTION nods |
| 13:30:56 | <quicksilver> | the arrow one, essentially |
| 13:31:06 | <quicksilver> | edwardk2: do you have a list of the major enhancements / bug fixes? |
| 13:31:18 | <edwardk2> | bug fixes? |
| 13:31:25 | <edwardk2> | as in what monoids does? |
| 13:31:35 | <quicksilver> | edwardk2: between edwardk and edwardk2 |
| 13:31:49 | <Badger> | what do monoids do? :P |
| 13:31:56 | <edwardk2> | oh the old me is a ghost so he's clearly inferior =) |
| 13:31:59 | <quicksilver> | associate. |
| 13:32:21 | <fasta> | Alpounet: the wiki page has some information about Zippers, the xml package also contains zippers, xmonad contains a zipper. I can continue, but I have yet to find an actual application of zippers, since the last time I thought I needed them, it turned out that the functional solution was a factor log n too slow. There are no 'zippers' with an unbounded number of holes, AFAIK. |
| 13:32:36 | <edwardk> | quicksilver: they also have a nice unit... er wait that sounds dirty |
| 13:32:37 | <BONUS> | monoids are basically like socks, you have two of them and then suddenly there's only one |
| 13:33:26 | <osfameron> | can you mix and match monoids like socks? |
| 13:33:38 | <dcoutts_> | only socks of the same type |
| 13:33:44 | <osfameron> | "Ah, that monoid is roughly the same colour and material as the other one... it'll do" ? |
| 13:33:56 | <edwardk> | bonus: anyways the foldM like thing is already there its called mapM_ but it doesn't work quite like you think |
| 13:34:24 | <Badger> | BONUS: that needs to go in lyah :P |
| 13:34:42 | <BONUS> | haha. edwardk you mean the regular mapM_? |
| 13:34:43 | <edwardk> | as for the monoid for (>>) thats also in monoids |
| 13:34:43 | <quicksilver> | edwardk: do you mean it's there as runStateT . mapM_ . StateT \s -> ? |
| 13:35:05 | <quicksilver> | (with a relaxed interpretation of what '.' means) |
| 13:35:36 | <edwardk> | http://comonad.com/haskell/monoids/dist/doc/html/monoids/Data-Monoid-Monad.html describes the 'Action' monoid |
| 13:36:16 | <edwardk> | where is also the 'Mon' monoid which wraps a monoid in a monad |
| 13:36:37 | <Alpounet> | fasta, thanks. |
| 13:37:38 | <fasta> | Alpounet: a zipper really is just remembering the path it followed when it zips open and unzips again when you go up. |
| 13:38:15 | <edwardk> | so it seems my parser combinator set can recognize TIGs |
| 13:38:34 | <edwardk> | which places its asymptotics around O(n^4) worst case |
| 13:39:21 | <fasta> | edwardk: and what are TIGs? |
| 13:39:24 | <edwardk> | http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.14.7116 |
| 13:39:37 | <edwardk> | TIGs are TAGs limited to CFG stuff basically |
| 13:39:42 | <edwardk> | how is that for vague ;) |
| 13:40:22 | <edwardk> | and the parsing algorithm i'm using is basically equivalent to one of the TAG algorithms restricted to the TIG case which speeds it up from O(n^6) to O(n^4) |
| 13:41:47 | <fasta> | edwardk: I know the Chomsky hierarchy. You can parse CFGs in O(n^3), so I don't really see why you would settle for O(n^4) for some limited CFG. |
| 13:41:53 | <edwardk> | what i'm looking to do is decide whether i should use the smart left to right version or the general version based on the generator being used |
| 13:42:43 | <wli> | GLR is pretty nasty to implement. |
| 13:42:55 | <edwardk> | fasta: TAGs subsume CFGs, TIGs are weakly equivalent, but have a algorithms for solving that O(n^4) in parallel |
| 13:43:46 | <edwardk> | er TIGs are weakly equivalent to CFGs, you can parse a TIG in O(n^3) using a earley-style parser |
| 13:44:18 | <edwardk> | fasta: so i trade off some worst case performance for the ability to throw more hardware at the problem |
| 13:44:42 | <fasta> | edwardk: and what is a TAG? |
| 13:45:02 | <edwardk> | TAG = tree adjoining grammar, its a slightly context-sensitive grammar type |
| 13:45:36 | <fasta> | Never heard of it. Congratulations :) |
| 13:45:52 | <edwardk> | general TAG parsing is O(n^6) or somewhere between n and n^9 depending on the algorithm used |
| 13:46:03 | <edwardk> | fasta neither had I until I reinvented it |
| 13:46:11 | <Deewiant> | That's quite a between :-P |
| 13:46:21 | <Deewiant> | n to n^9 |
| 13:46:24 | <edwardk> | er depending on the grammar i mean |
| 13:46:31 | <Deewiant> | Thought so ;-) |
| 13:47:03 | <edwardk> | its a nL^2 where L specifies the presence of a certain kind of dependencies and can be up to n^4 |
| 13:47:37 | <edwardk> | but many grammars have a very small L, so that algorithm can be more efficient for those |
| 13:47:43 | <Igloo> | So where did n^6 come from? |
| 13:48:15 | <ManateeLazyCat> | If i want to customize widget in gtk2hs, i need implement in C then export with Haskell? Or just implement Haskell? |
| 13:48:32 | <dcoutts_> | ManateeLazyCat: depends what you want exactly |
| 13:48:44 | <edwardk> | igloo: there is an algorithm for parsing TAGs in O(n^6) from the original paper |
| 13:49:01 | <dcoutts_> | ManateeLazyCat: it's possible to implement completely custom widgets by drawing them yourself |
| 13:49:30 | <edwardk> | it was a later improvement to find the O(nL^2) algorithm which is a huge win for some grammars |
| 13:49:55 | <fasta> | edwardk: what applications does it have? |
| 13:49:57 | <ManateeLazyCat> | dcoutts_: Example, in gtk2hs have textbuffer for text edit, but i want implement synchronous buffers, if i type somet text in one buffer, others buffer will synchronous this buffer content. |
| 13:50:06 | <edwardk> | fasta: NLP folks like it |
| 13:50:15 | <fasta> | edwardk: I don't really believe in NPL with a static grammar. |
| 13:50:20 | <heltav> | bah! linux slinux |
| 13:50:21 | <fasta> | er NLP* |
| 13:50:25 | <edwardk> | fasta: me neither |
| 13:50:41 | <ManateeLazyCat> | dcoutts_: And now i use textBufferGetText get text and textBufferSetText with other buffers. |
| 13:50:46 | <edwardk> | fasta: my main use for it is that its a larger set of grammars i could extend my parser combinator set to cover ;) |
| 13:51:02 | <ManateeLazyCat> | dcoutts_: But it's ineffective and slow if buffer's content is huge. |
| 13:51:24 | <fasta> | edwardk: bragging rights is a good reason :P |
| 13:51:27 | <edwardk> | i had noticed i could fit certain kinds of context sensitivity, the TAG stuff provides me with a body of knowledge as to how sensitive i can be |
| 13:51:46 | <RayNbow`> | @seen dons |
| 13:51:46 | <lambdabot> | dons is in #haskell-soc, #haskell-in-depth, #gentoo-haskell, #concatenative, #arch-haskell, #darcs, #yi, #xmonad, #ghc and #haskell. I last heard dons speak 5s ago. |
| 13:52:49 | <ManateeLazyCat> | dcoutts_: So i want those synchronous buffers just contain *one* text object, i just modified this text object whatever i type string in any buffers, then those buffers just show it, and not copy content with `afterBufferChanged` |
| 13:53:08 | <dcoutts_> | ManateeLazyCat: you can have multiple views share the same buffer |
| 13:53:24 | <dcoutts_> | ManateeLazyCat: and you do not need to copy and set the entire buffer at once |
| 13:53:58 | <edwardk> | hrmm http://www.aclweb.org/anthology-new/J/J94/J94-2002.pdf provides a nice reductio on what improvements in general purpose tag parsing would entail for boolean matrix multiplication, which you could work backwards to get a pretty good practical floor on the complexity of TAG parsing |
| 13:54:43 | <ManateeLazyCat> | dcoutts_: multiple views share the same buffer? Can you more details? |
| 13:56:22 | <dcoutts_> | ManateeLazyCat: set the views to use the same buffer object, it's designed to work that way |
| 13:57:21 | <ManateeLazyCat> | dcoutts_: Thanks, i will try it. |
| 13:58:01 | <edwardk> | hrmm working that backwards you'd probably get something like O(5.61 log^14 n) for general TAG as a practical floor using those silly fast boolean matrix multipliers but have ridiculous constants |
| 13:58:19 | <edwardk> | er O(n^5.61 log^14 n) |
| 13:58:38 | <ManateeLazyCat> | dcoutts_: Can you describe "depends what you want exactly"? Such as example, when time implement in C, and when time just implement in Haskell? Thanks |
| 13:58:38 | <Axman6> | not log_14 n? |
| 13:59:08 | <edwardk> | nope |
| 13:59:21 | <Axman6> | ACTION has never seen a log to a power :o |
| 13:59:42 | <dcoutts_> | ManateeLazyCat: well for example if you were asking how to set the general theme for the widgets then you'd do that completely differently from say just setting the background of a text field to be green. |
| 13:59:54 | <dcoutts_> | ManateeLazyCat: I wasn't really sure what question you were asking initially. |
| 14:00:22 | <Deewiant> | The AKS primality test is O(log^12 n) IIRC |
| 14:00:52 | <paolino> | could someone show me the translation from existentials to rank2 of http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4647#a4647, please |
| 14:01:42 | <edwardk> | in any event: Õ(n^5.61) |
| 14:02:11 | <heltav> | bah being on windows makes me wanna killmyself |
| 14:02:14 | <fasta> | paolino: data R = R (forall a. a -> Int) (+ context) |
| 14:02:22 | <heltav> | but getting onto linux wants to killmyself eve n more |
| 14:02:33 | <heltav> | maybe i should just bu a computer wiht linux installed already |
| 14:02:48 | <ManateeLazyCat> | dcoutts_: Example, i want implement a new Paned that support vertically and horizontally split both, and not HPaned, VPaned. So i can just implement this customize widget in Haskell *completely*? |
| 14:02:48 | <Axman6> | you get a mac and stop messing around ;) |
| 14:02:50 | <edwardk> | axman: it usually means you had to appeal to some polylogarithmic algorithm in the process: http://en.wikipedia.org/wiki/Polylogarithmic |
| 14:02:59 | <Axman6> | uh, s/you/or |
| 14:03:08 | <dcoutts_> | ManateeLazyCat: in theory, yes. |
| 14:03:52 | <Axman6> | edwardk: i'm sure what you just said was very interesting, but i'm so sleep deprived at the moment i can't keep track of sentenses, let alone thing about their meanings atm :( |
| 14:04:04 | <paolino> | fasta, I'm not smart enogh :) to appreciate |
| 14:05:03 | <fasta> | paolino: existentials have forall before the constructor. Rank2 and higher have them inside the fields of the constructor. |
| 14:05:12 | <paolino> | and I thought R was disappearing actually |
| 14:05:46 | <ManateeLazyCat> | dcoutts_: That's perfect if i can use Haskell implement customize widget base on gtk2hs libraries, it's trouble that i need code in C and binding in Haskell again. |
| 14:06:12 | <ManateeLazyCat> | dcoutts_: in theory? Have you do those work before? |
| 14:07:15 | <ManateeLazyCat> | dcoutts_: Or still need use C sometimes? |
| 14:07:18 | <dcoutts_> | ManateeLazyCat: people have implemented custom widgets, though not so many that look like standard widgets, you may find you need a couple more C functions to be bound |
| 14:08:06 | <paolino> | fasta, is there something I can read about rank2 ? |
| 14:08:27 | <fasta> | dcoutts_: I thought you had a compiler to compile the C version automatically to Haskell? |
| 14:08:47 | <fasta> | dcoutts_: (+ some hand work) |
| 14:08:49 | <dcoutts_> | fasta: semi-automatically, yes. That doesn't mean everything is bound. |
| 14:09:46 | <fasta> | paolino: the standard paper is the arbitrary rank polymorphism paper, which is "tutorial style", which you should read. |
| 14:09:56 | <fasta> | paolino: after that it is just getting used to them. |
| 14:10:09 | <ManateeLazyCat> | dcoutts_: Can you give me some link that use Haskell customize widget? I haven't found those in "Gtk2hs Tutorial". Thanks |
| 14:11:00 | <dcoutts_> | ManateeLazyCat: at the simplest level it's just about using a draw window and connecting to specific events like keyboard entry or mouse events. |
| 14:11:14 | <dcoutts_> | ManateeLazyCat: see the demos that use a draw window |
| 14:11:23 | <ManateeLazyCat> | dcoutts_: Thanks |
| 14:11:32 | <paolino> | fasta: the paper from spj on research.microsoft.com ? |
| 14:11:48 | <fasta> | Haskell is starting to look like C++ more by the day... I got a segmentation fault, OTOH, it is probably from a binding. |
| 14:11:56 | <feinaa> | te kaads no LV? :D |
| 14:12:07 | <fasta> | paolino: yes |
| 14:13:03 | <fasta> | Is there any way to debug core dumps? I never actually needed to do that. |
| 14:13:09 | <wjt> | dcoutts_: but ISTR you can't make new GObject classes with gtk2hs, righT/ |
| 14:13:28 | <dcoutts_> | wjt: right, but that's not strictly necessary |
| 14:13:33 | <wjt> | dcoutts_: oh, sure |
| 14:13:46 | <fasta> | I guess gdb could work, but I am not sure whether my program would still be recognizable. |
| 14:14:02 | <ManateeLazyCat> | dcoutts_: Can you compare "gtk2hs" and "X11" with Haskell? "Gtk2hs" is advanced but more limit, "X11" is lower but less limit.... |
| 14:14:15 | <paolino> | mhh, research.microsoft.com is down from here |
| 14:15:12 | <dcoutts_> | ManateeLazyCat: yep that's a reasonable way of putting it. |
| 14:15:57 | <dcoutts_> | ManateeLazyCat: building something equivalent to Gtk+ on top of X11 would take you many man years but you'd have the opportunity to make different design decisions. |
| 14:17:10 | <paolino> | and make haskell famous |
| 14:18:08 | <Baughn> | ..I never thought I'd go "squee" over a CS paper, but the Sinfonia one just did it. Must.. implement... |
| 14:18:29 | <Jebdm> | Baughn: link? |
| 14:18:48 | <ManateeLazyCat> | dcoutts_: Now i'm developing Haskell editor or web-browser, i have use gtk2hs some weeks. I found gtk2hs have more limit, such as C implement style, binding IO-action with some function.... So i think whether implement Graphics Userface base on X11.... |
| 14:18:50 | <Baughn> | Jebdm: gogle.scholar://sinfonia |
| 14:19:19 | <dcoutts_> | ManateeLazyCat: that'd be a lot of work. You might start with Cairo however. |
| 14:20:01 | <fasta> | ManateeLazyCat: Slava Pestov did that for Factor. |
| 14:20:12 | <Jebdm> | this one? http://portal.acm.org/citation.cfm?id=1323293.1294278 |
| 14:20:40 | <ManateeLazyCat> | dcoutts_: You mean it's will save much time if i base on Cairo? |
| 14:21:00 | <dcoutts_> | ManateeLazyCat: yep |
| 14:21:21 | <ManateeLazyCat> | dcoutts_: Thanks for your suggestions, i will look it. :) |
| 14:21:44 | <dcoutts_> | ManateeLazyCat: you might want to use it with gtk2hs anyway |
| 14:21:47 | <wjt> | i think you'd save even more time by writing a more functional layer around gtk2hs |
| 14:22:04 | <Baughn> | Jebdm: Yes. There are non-acm pdfs around, mind you. |
| 14:22:11 | <Baughn> | Jebdm: Google should give you a bunch |
| 14:22:32 | <Baughn> | ..it just tends to default to acm.. but click the princeton.edu link next to it |
| 14:22:42 | <Jebdm> | Ah, it's no problem though, I can access it. |
| 14:23:49 | <ManateeLazyCat> | dcoutts_: It's unavoidable that use IORef with gtk2hs? Such as `onKeyPress` function.. |
| 14:24:02 | <quicksilver> | ManateeLazyCat: sure, but it's not hard to hide that. |
| 14:24:11 | <quicksilver> | ManateeLazyCat: you will find X11 much much worse |
| 14:24:12 | <quicksilver> | not better. |
| 14:25:14 | <ManateeLazyCat> | quicksilver: Yep, i have read many resource about X11, and i find X11 have much disadvantage, such as too long function parameter... |
| 14:25:31 | <dmorti> | Can anyone explain to me why: > do {n <- readLn ; print (n^2)} works, but >do {n <- readLn; print n} throws the error (Prelude.readIO: no parse) ? |
| 14:26:19 | <dmorti> | (or point me to a reference explaining it to dummies! :) ) |
| 14:26:32 | <EvilTerran> | dmorti, i suspect type defaulting may be at fault; try adding an explicit type signature somewhere that'll fix the type of n |
| 14:26:42 | <paolino> | n is less typed than n^2 |
| 14:26:45 | <dmorti> | ahh ok. |
| 14:26:55 | <Axman6> | :t (n) |
| 14:26:56 | <lambdabot> | Expr |
| 14:26:58 | <dmorti> | so n^2 allows ghc to infer that n is Numeric? |
| 14:26:59 | <EvilTerran> | do { n <- readLn; print (n :: Integer) }, say |
| 14:27:02 | <dmorti> | cheers |
| 14:27:03 | <Deewiant> | > n < n^2 |
| 14:27:04 | <Axman6> | :t (?n)^2 |
| 14:27:06 | <lambdabot> | forall a. (Num a, ?n::a) => a |
| 14:27:07 | <lambdabot> | True |
| 14:28:37 | <ManateeLazyCat> | Anyway, i found gtk2hs is easiest way to build Haskell GUI program. Thanks all for help! :) |
| 14:28:39 | <BONUS> | hmm. which extensions could we use to make Show a => (a -> r) -> r an instance of Show |
| 14:29:41 | <paolino> | TypeInstances ? |
| 14:30:03 | <paolino> | TypeSynonymInstances |
| 14:30:29 | <EvilTerran> | BONUS, how would you show a value of that type? |
| 14:30:31 | <BONUS> | still you get bitten by the lack of generality |
| 14:30:52 | <BONUS> | showCPStransformed a = a show |
| 14:32:43 | <edwardk> | bonus: actually you need a function of (a -> r) to apply that type |
| 14:33:00 | <edwardk> | bonus: i think you mean forall r. (a -> r) -> r |
| 14:33:12 | <BONUS> | ah. right |
| 14:33:25 | <edwardk> | bonus: then you can feed it an id |
| 14:34:21 | <edwardk> | basically all that is saying is that you can derive an instance Show (f a) => Show (Yoneda f a) -- which iirc i've actually got implemented somewhere ;) |
| 14:34:42 | <BONUS> | haha awesome |
| 14:35:07 | <bastl> | hiho. Can I somehow simplify the predicate in " listify (\a -> (typeOf (undefined::MethodBody))==(typeOf a)) ast " ? |
| 14:35:24 | <bastl> | @h listify |
| 14:35:24 | <lambdabot> | Maybe you meant: hackage help hitchcock hoogle hoogle+ . ? @ v |
| 14:35:33 | <bastl> | @hoogle listify |
| 14:35:33 | <lambdabot> | Data.Generics.Schemes listify :: Typeable r => (r -> Bool) -> GenericQ [r] |
| 14:35:43 | <ManateeLazyCat> | fasta: "Slava Pestov did that for Factor"? Factor is Haskell Graphics Toolkit base on X11? |
| 14:36:21 | <edwardk> | hrmm: I don't have the generic one on Yoneda, just instance Show a => Show (Ran Identity a) where showsPrec d (Ran f) = showParen (d > 10) $ showString "return " . showsPrec 11 (runIdentity (f Identity)) |
| 14:36:36 | <edwardk> | i'll add it |
| 14:36:43 | <fasta> | ManateeLazyCat: no, he wrote a GUI using Factor (another programming language) based on a binding to some X11 library. |
| 14:36:44 | <BONUS> | where do you have that |
| 14:36:49 | <edwardk> | monad-ran |
| 14:37:13 | <edwardk> | http://comonad.com/haskell/monad-ran/dist/doc/html/monad-ran/ |
| 14:37:29 | <edwardk> | its buried in the monolithic module that makes up that lib |
| 14:37:40 | <BONUS> | ooh, cool |
| 14:38:03 | <edwardk> | i think I want to rename Ran in there to 'CPS' or something |
| 14:38:12 | <edwardk> | since the notation is wrong slightly |
| 14:38:36 | <ManateeLazyCat> | fasta: And? |
| 14:39:01 | <ManateeLazyCat> | fasta: I never heard Factor. |
| 14:39:05 | <ManateeLazyCat> | fasta: :) |
| 14:39:42 | <ManateeLazyCat> | http://factorcode.org/ ? |
| 14:41:11 | <edwardk> | bonus: i'll add the Show instance for Yoneda and Codensity in there. i have ones or Ran Maybe, Ran (Either e), etc. |
| 14:42:37 | <BONUS> | cool. looking at the source atm, nice stuff |
| 14:44:49 | <adrian___> | hello |
| 14:45:11 | <adrian___> | I'm trying to prove the fusion law for unfold, but I'm stuck |
| 14:45:20 | <adrian___> | can anybody help me a bit? |
| 14:45:20 | <edwardk> | @hpaste |
| 14:45:20 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 14:46:05 | <edwardk> | BONUS: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4648#a4648 |
| 14:47:00 | <fasta> | Can I build a cabal package containing a binding to a C library with all debugging symbols still there? |
| 14:47:25 | <dcoutts_> | fasta: hmm, try --gcc-options=-g |
| 14:47:50 | <dcoutts_> | fasta: I mean when you do cabal configure |
| 14:48:23 | <BONUS> | aah, i sort of get it :) nice |
| 14:49:00 | <mxc> | i love this channel: proving the fusion law followed by GCC options |
| 14:49:11 | <quicksilver> | dcoutts_: you're spreading misinformation about hdbc and utf8 :P |
| 14:49:17 | <heltav> | @type (->) |
| 14:49:19 | <lambdabot> | parse error on input `->' |
| 14:49:27 | <dcoutts_> | quicksilver: am I? |
| 14:49:27 | <heltav> | @type (>>>) |
| 14:49:28 | <lambdabot> | forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a c d -> a b d |
| 14:49:32 | <mxc> | adrian__ sorry, as much as I respect type theory, category theory, etc.. i wont be much help |
| 14:49:33 | <fasta> | dcoutts_: it's not in .cabal/config. Can I also put it there? |
| 14:49:48 | <quicksilver> | dcoutts_: you're right that a UTF8 .hs file will get you a proper unicode String with an umlaut in it |
| 14:49:51 | <dcoutts_> | fasta: um, no, not yet. |
| 14:49:53 | <quicksilver> | dcoutts_: but that's not what HDBC wants/expects. |
| 14:49:56 | <heltav> | > (1+) <$> Just 5 |
| 14:49:58 | <lambdabot> | Just 6 |
| 14:50:03 | <dcoutts_> | quicksilver: John said it was. |
| 14:50:03 | <heltav> | > (3*) <$> Just 5 |
| 14:50:04 | <quicksilver> | dcoutts_: HDBC is wanting a UTF8-where-Chars-are-really-Word8s |
| 14:50:05 | <lambdabot> | Just 15 |
| 14:50:11 | <heltav> | > (3*) <*> Just 5 |
| 14:50:12 | <lambdabot> | Couldn't match expected type `(a -> b) -> a' |
| 14:50:15 | <quicksilver> | dcoutts_: HDBC doesn't encode Char to UTF8. |
| 14:50:21 | <mxc> | so, whats the current state of affair for marshalling/demarshalling values? |
| 14:50:26 | <heltav> | > <*> (+3) (Just 6) (Just 5) |
| 14:50:27 | <lambdabot> | <no location info>: parse error on input `<*>' |
| 14:50:28 | <quicksilver> | dcoutts_: it expects them to be pre-encoded, i.e. really Word8s |
| 14:50:38 | <heltav> | > <*> (+3) (Just 6) |
| 14:50:39 | <lambdabot> | <no location info>: parse error on input `<*>' |
| 14:50:44 | <dcoutts_> | quicksilver: oh so HDBC is wrong then |
| 14:50:45 | <quicksilver> | dcoutts_: it comes from a terrible old world before utf8-string was on hackage :) |
| 14:50:48 | <heltav> | @type <$> |
| 14:50:49 | <fasta> | dcoutts_: what would also be nice is to have the concept of "debug-builds" and "release-builds". |
| 14:50:49 | <lambdabot> | parse error on input `<$>' |
| 14:50:53 | <heltav> | @type (<$>) |
| 14:50:54 | <lambdabot> | forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b |
| 14:50:56 | <dcoutts_> | quicksilver: that's not at all what I gathered from what John said |
| 14:50:57 | <quicksilver> | dcoutts_: yes, it predates the existence of good encoding libraries. I think. |
| 14:50:58 | <heltav> | @type (<*>) |
| 14:50:59 | <lambdabot> | forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b |
| 14:51:05 | <Jebdm> | Perhaps less channel spam? |
| 14:51:10 | <heltav> | > (3*) <*> Just 5 |
| 14:51:11 | <lambdabot> | Couldn't match expected type `(a -> b) -> a' |
| 14:51:17 | <quicksilver> | dcoutts_: the possibility remains that my interpretation is wrong and yours is right ;) |
| 14:51:20 | <Ferdirand> | heltav: lambdabot answers in private if you want |
| 14:51:26 | <dcoutts_> | fasta: we can make configure -O0 also mean -g for C code |
| 14:51:28 | <heltav> | > (1+) <$> Just 5 |
| 14:51:29 | <lambdabot> | Just 6 |
| 14:51:40 | <heltav> | > (3*) <$> Just 5 |
| 14:51:41 | <lambdabot> | Just 15 |
| 14:51:44 | <quicksilver> | dcoutts_: John said "Then you will get a String which is supposed to have decoded Unicode data, instead having encoded UTF-8 data. |
| 14:52:11 | <heltav> | > (<$> (+1) (Just 5) |
| 14:52:12 | <lambdabot> | <no location info>: parse error on input `;' |
| 14:52:16 | <edwardk> | heltav: /msg lambdabot > (1+) <$> Just 5 -- is your friend ;) |
| 14:52:17 | <heltav> | > <*> (+1) (Just 5) |
| 14:52:18 | <lambdabot> | <no location info>: parse error on input `<*>' |
| 14:52:19 | <dcoutts_> | quicksilver: right, I interpret that to mean String as a proper Unicode string. |
| 14:52:26 | <quicksilver> | dcoutts_: and I interpret that to mean, he's expecting the String to be treated as [Word8] with UTF8 pre-encoded. Which is consistent with my belief that HDBC predates us getting sensible answers to all this encoding lark. |
| 14:52:28 | <heltav> | > <*> (+) Nothing (Just 5) |
| 14:52:29 | <lambdabot> | <no location info>: parse error on input `<*>' |
| 14:52:37 | <heltav> | > (+) <*> Nothing (Just 5) |
| 14:52:38 | <lambdabot> | Couldn't match expected type `Maybe t -> a -> a' |
| 14:52:40 | <dcoutts_> | quicksilver: "encoded UTF-8 data" would be using [Char] as [Word8] |
| 14:52:46 | <heltav> | > Nothing (+) <*> (Just 5) |
| 14:52:47 | <lambdabot> | Couldn't match expected type `(a1 -> a1 -> a1) -> f (a -> b)' |
| 14:52:55 | <heltav> | > Nothing <*> (+) (Just 5) |
| 14:52:56 | <lambdabot> | Couldn't match expected type `Maybe a' |
| 14:52:59 | <heltav> | ? |
| 14:53:00 | <edwardk> | > (+) <$> Nothing <*> (Just 5) |
| 14:53:02 | <lambdabot> | Nothing |
| 14:53:05 | <dcoutts_> | quicksilver: we've managed to read the same text is exactly the opposite ways :-) |
| 14:53:08 | <dcoutts_> | is/in |
| 14:53:08 | <quicksilver> | dcoutts_: yes, and that's what HDBC wants. Well, that's how I read him. |
| 14:53:10 | <quicksilver> | dcoutts_: agreed ;) |
| 14:53:26 | <heltav> | > (+) <$> Nothing (Just 5) |
| 14:53:27 | <lambdabot> | Couldn't match expected type `Maybe t -> f a' |
| 14:53:34 | <heltav> | > (+) <$> Nothing <*> (Just 5) |
| 14:53:35 | <lambdabot> | Nothing |
| 14:53:37 | <edwardk> | ^- that is the er 'idiom' i think you were looking for |
| 14:53:42 | <heltav> | > (+) <$> (Just 2) <*> (Just 5) |
| 14:53:44 | <lambdabot> | Just 7 |
| 14:53:49 | <heltav> | > (+) <$> (Just 2) <*> Nothing |
| 14:53:50 | <lambdabot> | Nothing |
| 14:53:56 | <heltav> | why Nothing? |
| 14:53:56 | <dcoutts_> | quicksilver: which just goes to show how confusing this thing is, that we can't even describe it properly |
| 14:53:58 | <edwardk> | no need for the parentheses in there on (Just 2) |
| 14:54:10 | <quicksilver> | dcoutts_: Hmm. His later message suggests your version. In which case sorry for my confusion ;) |
| 14:54:18 | <quicksilver> | "the SqlByteString is assumed to be in UTF-8, and |
| 14:54:19 | <quicksilver> | is decoded when converted to a String" |
| 14:54:35 | <edwardk> | because Nothing `ap` x = Nothing. and x `ap` Nothing = Nothing |
| 14:54:55 | <edwardk> | Nothing is mzero, mzero laws kick in basically |
| 14:55:29 | <edwardk> | or in applicative terms Nothing = empty for the Maybe Alternative. |
| 14:56:17 | <edwardk> | > ((+) <$> pure 12 <*> empty) :: Maybe Int |
| 14:56:18 | <lambdabot> | Ambiguous occurrence `pure' |
| 14:56:18 | <lambdabot> | It could refer to either `Control.Appl... |
| 14:56:35 | <edwardk> | > ((+) <$> Control.Applicative.pure 12 <*> empty) :: Maybe Int |
| 14:56:36 | <lambdabot> | Ambiguous occurrence `empty' |
| 14:56:36 | <lambdabot> | It could refer to either `Text.Pretty... |
| 14:56:41 | <edwardk> | suck |
| 14:56:50 | <edwardk> | > ((+) <$> Control.Applicative.pure 12 <*> Control.Applicative.empty) :: Maybe Int |
| 14:56:51 | <lambdabot> | Nothing |
| 14:56:56 | <edwardk> | better =) |
| 15:04:51 | <heltav> | damn i still love coding but computer games dont really interest me anymore. music does but there already is last.fm and winamp. i love photography but there already is Flickr. |
| 15:05:01 | <heltav> | what the hell should I program? im tyring to come up with somethin cool |
| 15:05:14 | <heltav> | what kind of cell-phone app would you peoplelike? |
| 15:05:35 | <edwardk> | heltav: a lambdabot iphone plugin =) |
| 15:05:43 | <leadnose> | one that makes farting noises |
| 15:06:07 | <The-Kenny> | leadnose: That exists already :D |
| 15:06:09 | <DBAlex> | askell |
| 15:06:13 | <DBAlex> | oops |
| 15:06:23 | <DBAlex> | how can I define this using map: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4649#a4649 |
| 15:06:35 | <quicksilver> | DBAlex: you can't. |
| 15:06:38 | <leadnose> | The-Kenny, I know :( |
| 15:06:56 | <DBAlex> | yeah |
| 15:06:57 | <edwardk> | dbalex: you can't |
| 15:06:57 | <quicksilver> | it takes a list of length 10 to a list of length 5, for example |
| 15:07:03 | <quicksilver> | map always preserves length. |
| 15:07:14 | <DBAlex> | can I use foldl ? |
| 15:07:16 | <DBAlex> | or something else |
| 15:07:21 | <edwardk> | dbalex: you can make it into a fold if you want to turn your brain inside out |
| 15:07:25 | <edwardk> | i'd recommend foldr |
| 15:07:29 | <The-Kenny> | An application to talk to other people would be really cool, I really miss that ;) :p You could assign every client a special number, which you have to type in to talk to this person. |
| 15:07:30 | <EvilTerran> | or an unfold |
| 15:07:30 | <DBAlex> | ok |
| 15:07:33 | <The-Kenny> | ;) |
| 15:07:39 | <DBAlex> | is it easier just to leave it as it is? |
| 15:07:43 | <edwardk> | an unfold is easier |
| 15:07:46 | <quicksilver> | it's not worth turning it into a fold except for the intellectual exercise. |
| 15:08:01 | <edwardk> | yeah |
| 15:08:03 | <quicksilver> | hint - there are two possible states, starting a new pair and finishing the last pair |
| 15:08:08 | <quicksilver> | yoru fold has to flip-flop between them |
| 15:08:09 | <edwardk> | though you're partial |
| 15:08:19 | <sm> | ooh! Platform release! |
| 15:08:19 | <edwardk> | what do you do with ltotable [x] ? |
| 15:08:45 | <DBAlex> | edwardk: eturn $ ltotable $ lines f |
| 15:08:50 | <DBAlex> | edwardk: return $ ltotable $ lines f |
| 15:09:11 | <DBAlex> | f is something like "Coffee\n1.00\nTea\n2.00" etc |
| 15:09:21 | <DBAlex> | > lines "Coffee\n1.00\nTea\n2.00" |
| 15:09:23 | <lambdabot> | ["Coffee","1.00","Tea","2.00"] |
| 15:09:30 | <DBAlex> | yup :) |
| 15:09:34 | <edwardk> | dbalex: i'm just poinging out that you get screwed if you have: |
| 15:09:41 | <edwardk> | > lines "Coffee\n1.00\nTea\n2.00\n" |
| 15:09:43 | <lambdabot> | ["Coffee","1.00","Tea","2.00"] |
| 15:09:53 | <edwardk> | > lines "Coffee\n1.00\nTea\n2.00\n " |
| 15:09:54 | <lambdabot> | ["Coffee","1.00","Tea","2.00"," "] |
| 15:09:59 | <edwardk> | there =) |
| 15:10:03 | <DBAlex> | yeah but it won't happen |
| 15:10:09 | <DBAlex> | unless someone messes with the database file... ;P |
| 15:10:15 | <DBAlex> | then thats there issue ;) |
| 15:10:32 | <edwardk> | dbalex: just pointing out that your method was partial is all |
| 15:10:38 | <DBAlex> | yup |
| 15:10:51 | <DBAlex> | I don't think I have to do extensive error checking |
| 15:11:21 | <DBAlex> | so yeah, is it not easy to define that using fold? |
| 15:11:35 | <edwardk> | nope, unfold is easy, fold is hard |
| 15:11:43 | <edwardk> | fold can only see a level at a time basically |
| 15:12:22 | <david_> | I'm doing a problem on projecteuler and I've tried running my solution for about 7 hours now and it hasn't completed yet. Is there a way of "profiling" my code (see for example what Ordo it is)? |
| 15:13:17 | <edwardk> | dbalex: there is a way to encode it as a nice futumorphism, but that is a lesson for another day ;) |
| 15:13:29 | <DBAlex> | ok |
| 15:13:42 | <byorgey> | david_: there are ways to do profiling, but that's more for fine-tuning performance. I'd suggest just coming up with a more efficient algorithm. |
| 15:13:46 | <DBAlex> | just seems silly, I thought it would be easy to wrap that up in a nice map or fold |
| 15:13:47 | <DBAlex> | :'( |
| 15:14:02 | <Berengal> | > let itotable = uncurry zip . (map snd***map snd) . partition (odd.fst) . zip [1..] in itotable [1..10] |
| 15:14:03 | <lambdabot> | [(1,2),(3,4),(5,6),(7,8),(9,10)] |
| 15:14:16 | <byorgey> | david_: you probably won't be able to get more than, say, a 2x or 3x speedup from taking advantage of the profiling info. |
| 15:14:36 | <david_> | byorgey: mkay |
| 15:15:24 | <dbueno> | byorgey: if there are several algorithms involved, it might help pinpoint the one which ought to be made asymptotically faster, though. |
| 15:15:38 | <edwardk> | > let f (x:y:ys) = Just ((x,y),ys); f _ = Nothing in unfoldr f [1,2,3,4] |
| 15:15:39 | <lambdabot> | [(1,2),(3,4)] |
| 15:15:57 | <byorgey> | dbueno: well, I suppose that's true. |
| 15:16:32 | <byorgey> | hmm, is haskell.org down? |
| 15:16:40 | <quicksilver> | david_: the basic point of project euler is that you need a little mathematical thought ot think of a slightly cleverer way to do it. |
| 15:16:56 | <byorgey> | I guess it's just really slow. |
| 15:16:59 | <wli> | I'm still bombing problem #216. |
| 15:17:00 | <quicksilver> | david_: if your program takes longer than a few seconds, then you have missed a better way. |
| 15:17:03 | <Zao> | byorgey: Seems somewhat unresponsive. |
| 15:17:19 | <edwardk> | > unfoldr (\x -> do (x:y:ys) <- return x; return ((x,y),ys)) [1,2,3,4] |
| 15:17:20 | <lambdabot> | [(1,2),(3,4)] |
| 15:17:30 | <edwardk> | yay obfuscation |
| 15:21:12 | <edwardk> | , unfoldr (\(return -> f) -> do (x:y:ys) <- f; return ((x,y),ys)) [1,2,3,4] -- worse with view patterns |
| 15:21:13 | <lunabot> | luna: parse error (possibly incorrect indentation) |
| 15:21:43 | <edwardk> | , unfoldr (\(return -> f) -> do (x:y:ys) <- f; return ((x,y),ys)) [1,2,3,4] |
| 15:21:45 | <lunabot> | [(1,2),(3,4)] |
| 15:22:26 | <Berengal> | luna doesn't handle comments? |
| 15:22:32 | <edwardk> | apparently |
| 15:22:40 | <edwardk> | , 1 -- why luna? |
| 15:22:41 | <lunabot> | luna: parse error (possibly incorrect indentation) |
| 15:23:25 | <EvilTerran> | , () {- but this should work -} |
| 15:23:26 | <lunabot> | () |
| 15:24:43 | <lukeo05> | Is there an opposite to show. As in, once I have called show on an expression, can I "unshow" the string to get the expression back? |
| 15:24:59 | <edwardk> | so i just need to make my parenthetical asides more parenthetica |
| 15:25:05 | <Berengal> | lukeo05: read |
| 15:25:07 | <edwardk> | > read "12" :: Int |
| 15:25:08 | <lambdabot> | 12 |
| 15:25:24 | <DBAlex> | by the way, with something like this: x /= Nothing = snd $ fromJust $ x |
| 15:25:31 | <edwardk> | i always thought the inverse of show would be something more like "hide" =) |
| 15:25:32 | <DBAlex> | why do I have to use $ instead of . ? |
| 15:25:53 | <edwardk> | x /= Nothing = snd . fromJust $ x -- will work |
| 15:26:06 | <edwardk> | x is an argument, not a function in the chain |
| 15:26:07 | <lukeo05> | Berengal: Nice one. Will this work with more complicated types like a list of tuples? |
| 15:26:34 | <edwardk> | but there you could simplify that down since the last $ is silly |
| 15:26:36 | <DBAlex> | ok |
| 15:26:37 | <Berengal> | lukeo05: It should, but not all types. It depends on how they've defined read and show |
| 15:26:37 | <edwardk> | x /= Nothing = snd $ fromJust x |
| 15:26:42 | <david_> | quicksilver: easier said than done :) |
| 15:26:44 | <zcvvc> | > read "(2,3)" :: (int, Int) |
| 15:26:45 | <lambdabot> | Could not deduce (Read int) from the context () |
| 15:26:45 | <lambdabot> | arising from a u... |
| 15:26:49 | <zcvvc> | > read "(2,3)" :: (Int, Int) |
| 15:26:50 | <lambdabot> | (2,3) |
| 15:27:16 | <lukeo05> | Excellent. Thanks! |
| 15:27:43 | <Berengal> | > read.show $ [1..10] :: [Int] |
| 15:27:44 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10] |
| 15:27:59 | <edwardk> | lukeo05: this leads to an important rule, when defining your instances of Show, they should (almost) always generate haskell source, so that you could generate a version of Read for them to match |
| 15:28:47 | <edwardk> | some instances violate this guideline, i.e. ParseError in Parsec, etc. but think hard before you do |
| 15:28:50 | <Berengal> | deriving (Show, Read) always produces compatible instances, no? |
| 15:28:58 | <edwardk> | Berengal: yeah |
| 15:31:15 | <Jebdm> | Is there a version of filter in the standard library/prelude that returns a pair of lists (a, b) where a is the list of those that matched the predicate and b is the list of those which didn't? |
| 15:31:36 | <EvilTerran> | ?hoogle partition |
| 15:31:36 | <lambdabot> | Data.ByteString partition :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) |
| 15:31:37 | <lambdabot> | Data.IntMap partition :: (a -> Bool) -> IntMap a -> (IntMap a, IntMap a) |
| 15:31:37 | <lambdabot> | Data.IntSet partition :: (Int -> Bool) -> IntSet -> (IntSet, IntSet) |
| 15:31:39 | <edwardk> | > partition (>4) [1,5,12,2] |
| 15:31:40 | <lambdabot> | ([5,12],[1,2]) |
| 15:31:49 | <Berengal> | @type partition |
| 15:31:50 | <lambdabot> | forall a. (a -> Bool) -> [a] -> ([a], [a]) |
| 15:32:03 | <Jebdm> | ah, thanks. |
| 15:32:41 | <edwardk> | this channel is funny, ask a question, get 3 answers each covering the type, a use case and other functions like it ;) |
| 15:33:23 | <Jebdm> | Where's the generic one defined? |
| 15:33:27 | <fasta> | edwardk: ok, let's test that. |
| 15:33:33 | <fasta> | What's omega for Haskell? |
| 15:33:33 | <edwardk> | Data.List |
| 15:33:44 | <Jebdm> | Danke schön |
| 15:33:55 | <Berengal> | They're all equally generic... |
| 15:34:18 | <Berengal> | Well, IntMap is anyway |
| 15:35:02 | <edwardk> | fasta: clearly http://hackage.haskell.org/packages/archive/control-monad-omega/0.3/doc/html/Control-Monad-Omega.html |
| 15:35:04 | <edwardk> | =) |
| 15:38:06 | <Neun> | /msg lambdabot @type all |
| 15:49:58 | <billls> | If anyone would be kind enough to take a look at my code and throw me some pointers, i'd be very greatful. Highlighted parts don't work/don't work properly http://foxyurl.com/1Gg |
| 15:52:40 | <mxc> | billls - get my msgs? |
| 15:52:47 | <billls> | nope |
| 15:52:56 | <neurocyte> | can anyone explain to me why this is true: show (fromJulian 2009 01 01) == "2009-01-14" |
| 15:53:44 | <beelsebob> | because julian dates are 13 days out of sync with gregorian? |
| 15:53:51 | <billls> | mxc: no. just now or yesterday ? |
| 15:54:03 | <mxc> | just resent |
| 15:54:04 | <Jebdm> | neeurocyte: http://en.wikipedia.org/wiki/Julian_calendar#From_Julian_to_Gregorian |
| 15:54:20 | <Jebdm> | "During this time the Julian calendar continued to diverge from the Gregorian. In 1700 the difference became 11 days; in 1800, 12; and in 1900, 13, where it will stay until 2100." |
| 15:54:51 | <beelsebob> | the julian calendar gets leap years wrong neurocyte |
| 15:54:58 | <beelsebob> | this causes it to drift a day every hundred years |
| 15:55:09 | <Deewiant> | Except every 400 years |
| 15:55:12 | <beelsebob> | yep |
| 15:55:42 | <quicksilver> | @hoogle fromJulian |
| 15:55:43 | <lambdabot> | Data.Time.Calendar.Julian fromJulian :: Integer -> Int -> Int -> Day |
| 15:55:43 | <lambdabot> | Data.Time.Calendar.Julian fromJulianYearAndDay :: Integer -> Int -> Day |
| 15:58:42 | <int-e> | what's up with code.haskell.org? |
| 16:01:14 | <ScriptDevil> | Is it recommended to name the constructor of a data type with only one member like data Foo = Foo String ? |
| 16:01:31 | <Jebdm> | yup |
| 16:02:11 | <EvilTerran> | well, it's a matter of personal style, context, etc |
| 16:02:23 | <quicksilver> | some people opt for data Foo = MkFoo String |
| 16:02:38 | <Jebdm> | at the very least, it's very common. |
| 16:02:40 | <EvilTerran> | if you think it makes sense in your situation, go for it, we're not gonna lynch you for it or anything ;) |
| 16:02:50 | <quicksilver> | but I would say "most" people use data Foo = Foo String |
| 16:03:30 | <paolino> | uhm question was data Foo = Foo String | Base , i think |
| 16:03:40 | <saml> | can i write a function f that takes a function g and converts g so that it'll be evaluated eagerly? |
| 16:03:57 | <saml> | let f g = f $! g only does eager evaluation on 1st argument |
| 16:04:09 | <leimy> | > cycle [1,2,3] |
| 16:04:11 | <lambdabot> | [1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,... |
| 16:04:19 | <EvilTerran> | saml, why do you want this? |
| 16:04:35 | <quicksilver> | saml: "so g will be evaluated eagerly" ? |
| 16:04:39 | <quicksilver> | saml: what does this mean, exactly. |
| 16:04:42 | <saml> | EvilTerran, for fun |
| 16:04:49 | <quicksilver> | saml: functions are in WHNF as long as they have a visible lambda |
| 16:04:50 | <QP> | hey Evil |
| 16:04:56 | <quicksilver> | so functions are generally evaluated. |
| 16:05:01 | <EvilTerran> | Control.Parallel.Strategies has some cunning trickery for forcing things in various way |
| 16:05:02 | <EvilTerran> | s |
| 16:05:05 | <EvilTerran> | o hai QP |
| 16:05:11 | <saml> | let g a b c = ...; (f g) should be eager version of g |
| 16:05:20 | <quicksilver> | saml: No. |
| 16:05:51 | <quicksilver> | although if you fix the number of parameters, you could say |
| 16:05:57 | <QP> | general question: what graphics packages would people recommend for ghc with the ubuntu linux distribution? |
| 16:06:05 | <quicksilver> | f g a b c = a `seq` b `seq` c `seq` g a b c |
| 16:06:46 | <ScriptDevil> | QP: you mean like hopengl? |
| 16:06:57 | <ScriptDevil> | or is it hgl?.. :-/ |
| 16:07:18 | <saml> | :t sqe |
| 16:07:19 | <lambdabot> | Not in scope: `sqe' |
| 16:07:30 | <ScriptDevil> | :t seq |
| 16:07:31 | <lambdabot> | forall a t. a -> t -> t |
| 16:07:36 | <QP> | i just switched from windows. I was using opengl and GLUT |
| 16:07:39 | <quicksilver> | but that only reduces a b and c to WHNF |
| 16:07:45 | <quicksilver> | and really, I don't know what you meant by 'eager' |
| 16:08:10 | <ScriptDevil> | quicksilver: !lazy ;) |
| 16:08:43 | <quicksilver> | that's not very meaningful. |
| 16:08:52 | <EvilTerran> | ScriptDevil, eh, there's a universe of evaluation semantics that're neither strict nor lazy, iirc |
| 16:09:02 | <quicksilver> | if my program crashes every time wiht (error "my hovercraft is full of eels") |
| 16:09:08 | <quicksilver> | then that is certainly *not* lazy evaluation. |
| 16:09:15 | <quicksilver> | however, I don't that's what saml meant. |
| 16:09:27 | <fasta> | saml: rnf is probably what you want. |
| 16:09:53 | <EvilTerran> | QP, well, you can def keep using openGL. i don't know if GLUT'll still work, although it probably will |
| 16:10:31 | <roconnor> | > error "my hovercraft is full of eels" |
| 16:10:31 | <EvilTerran> | IIRC, glut isn't really being developed any more; you can use gtk (via gtk2hs) to make a window to put your openGL graphics in, though |
| 16:10:32 | <lambdabot> | * Exception: my hovercraft is full of eels |
| 16:11:46 | <dbueno> | question: is there any way to use the latest QuickCheck (2) to run tests without printing all that junk on stdout? |
| 16:12:02 | <quicksilver> | glut works fine under linux. |
| 16:12:54 | <QP> | well, I haven't been able to get glut to work so far... |
| 16:13:24 | <quicksilver> | what problem have you had? |
| 16:13:30 | <quicksilver> | probably you just need to install it :P |
| 16:13:35 | <quicksilver> | freeglut3-dev |
| 16:13:39 | <quicksilver> | or some similar package name. |
| 16:14:07 | <heltav> | no cool software is needed anymore :( |
| 16:14:26 | <saml> | > fix ($!) 1 |
| 16:14:29 | <QP> | i don't recall needing to install it for windows... sorry I'm not very good with graphics stuff. |
| 16:14:41 | <lambdabot> | thread killed |
| 16:15:05 | <quicksilver> | QP: it might have been bundled with your windows installer. |
| 16:15:09 | <QP> | em, it sounds like gtk+ is the standard GUI interface type thing for linux? |
| 16:15:24 | <quicksilver> | QP: whether you can install a package or not has nothing to do with whether you are good with graphics stuff. |
| 16:15:36 | <quicksilver> | however, I woudl say, you are not going to manage to do anything at all with linux |
| 16:15:41 | <quicksilver> | if you don't know how to install packages. |
| 16:15:45 | <ScriptDevil> | Is there any way of declaring variables in ghci without lets.... and can one declare data types there at all? |
| 16:15:48 | <QP> | yes, but knowing which package it is is |
| 16:15:51 | <quicksilver> | ScriptDevil: no. |
| 16:15:57 | <quicksilver> | QP: freeglut3-dev maybe. |
| 16:16:11 | <quicksilver> | alternatively, use your distributions search tool to search for pacakges with glut in the name. |
| 16:16:14 | <quicksilver> | which distribution is it? |
| 16:17:18 | <QP> | i told you, ubuntu... anyway the reason i'm asking what people recommend is because i don't want to install glut if there is an option that works better with linux |
| 16:17:51 | <saml> | glwf? |
| 16:17:56 | <quicksilver> | QP: glut is a good option. |
| 16:18:05 | <quicksilver> | QP: especially if you have already used it in windows. |
| 16:18:06 | <quicksilver> | you will know what you're doing. |
| 16:18:17 | <QP> | in a manner of speaking.. |
| 16:18:26 | <QP> | :-) |
| 16:18:46 | <quicksilver> | under ubuntu you shoul dbe able to just install libghc6-glut-dev |
| 16:18:52 | <quicksilver> | and that will pull in the dependencies for you |
| 16:22:14 | <ScriptDevil> | ScriptDevil: Cant one declare a new data type in ghci? I am sorry I am re-asking. But I am unsure if the no was for both the questions or only the first one |
| 16:24:46 | <saml> | > data X = X |
| 16:24:47 | <lambdabot> | <no location info>: parse error on input `data' |
| 16:24:55 | <saml> | it doesn't work yet |
| 16:25:40 | <Saizan> | ScriptDevil: ghci doesn't accept declarations, you've to put those in a file |
| 16:25:59 | <Saizan> | ScriptDevil: you can use :r to reload the loaded files if you modify them |
| 16:29:26 | <ScriptDevil> | Saizan: Ok :) |
| 16:36:45 | <edwardk> | i think i have a selling point for the TIG parser |
| 16:38:02 | <edwardk> | it should do reparsing after local updates in a fingertree in O (log (nL^2)) where L is between n and n^4 -- but regardless thats O(log n) |
| 16:38:47 | <edwardk> | hrmm, that should probably be bigger, thats strange |
| 16:39:15 | <edwardk> | ugh it may be O (L^2 log n) n/m =) |
| 16:39:56 | <edwardk> | but that does mean for some grammars it can reparse after local update in O(n log n) |
| 16:40:31 | <roconnor> | is this for yi? |
| 16:40:49 | <edwardk> | and that L can be pretty small for practical grammars since its proportional to the 'if you started at a random point in the file, what states could you be in now' |
| 16:41:07 | <edwardk> | nah, its for my parsing lib |
| 16:41:49 | <edwardk> | whoa big split |
| 16:42:21 | <ScriptDevil> | edwardk: yeah, I thought I was kicked |
| 16:43:17 | <edwardk> | roconnor: basically i've got a parser combinator set for recognizing CFGs/TIGs that could be extended to a parser combinator set for TAGs |
| 16:44:16 | <Berengal> | @users |
| 16:44:16 | <lambdabot> | Maximum users seen in #haskell: 658, currently: 386 (58.7%), active: 9 (2.3%) |
| 16:44:37 | <mornfall> | Berengal: Freenode fell apart. |
| 16:44:45 | <Berengal> | I noticed... |
| 16:44:47 | <edwardk> | man, haskell is really losing popularity these days. It must be Harrop. |
| 16:45:08 | <mornfall> | (Like, totally. At least 3 servers lost connectivity to main network, it seems...) |
| 16:46:08 | <nominolo> | @seen swiert |
| 16:46:08 | <lambdabot> | I saw swiert leaving #haskell 3m 16d 1h 19m 49s ago, and . |
| 16:46:18 | <nominolo> | hm... |
| 16:47:01 | <edwardk> | hrmm. never saw this one before http://portal.acm.org/citation.cfm?id=991794 |
| 16:48:00 | <edwardk> | oh nevermind: Our parsing scheme can handle the most general class of context free grammars except cyclic grammars -- nevermind |
| 16:52:43 | <ksf> | ACTION wants better errors on nearly-correctly spealed identifiers |
| 16:53:00 | <copumpkin> | eww: http://www.justsoftwaresolutions.co.uk/files/designing_mt_programs.pdf |
| 16:56:32 | <ksf> | Error: Could not locate module "Control.applicativ". Did you mean "import Control.Applicative"? |
| 16:58:21 | <ksf> | once in a century i want to open a ghc ticket, and ever single time trac is so sluggish it could as well be down. |
| 16:59:02 | <omnihil> | every single time? how many centuries have you been using ghc now? |
| 16:59:28 | <ik> | That means if it takes less than a hundred years to load, it's workable :) |
| 17:02:02 | <GoodBye> | Hello DCC SEND "0101010101010101" 0 0 0 |
| 17:04:05 | <Zao> | ?where ops |
| 17:04:06 | <lambdabot> | shapr Cale glguy dons sjanssen sorear dcoutts Saizan allbery_b dibblego conal Phillipa bos arjanb psnl lispy xerox vincenz davidhouse Heffalump kosmikus wli Pseudonym Igloo musasabi quicksilver |
| 17:04:06 | <lambdabot> | mauke |
| 17:04:11 | <ksf> | code.haskell.org seems down, too. |
| 17:16:09 | <DBAlex> | lol |
| 17:16:18 | <DBAlex> | ACTION looks at scrollback |
| 17:16:23 | <DBAlex> | freenode borked? |
| 17:18:11 | <edwardk> | hrmm |
| 17:18:33 | <edwardk> | playing with how my parser combinators work if i limited myself to LL(k) |
| 17:18:45 | <gio123> | does this snetence wrt english looks OK? |
| 17:18:55 | <gio123> | where $t2$ is a term without variables (ground term) |
| 17:19:19 | <gio123> | ... where $t2$ is a term without variables (ground term)... |
| 17:19:50 | <edwardk> | gio123: that sentence fragment is fine, though perhaps replacing without with 'that does not contain' |
| 17:20:44 | <DBAlex> | btw |
| 17:20:49 | <DBAlex> | has anyone here played with F#? |
| 17:21:01 | <DBAlex> | looks to me just like a diluted version of haskell |
| 17:21:14 | <orbitz> | DBAlex: dilued Ocaml |
| 17:21:20 | <DBAlex> | ah ok |
| 17:21:25 | <DBAlex> | and that list formatting is odd :S |
| 17:21:25 | <glguy> | as FP languages go, it is nothing like Haskell |
| 17:21:31 | <orbitz> | neil mitchel has soem decent posts about ti |
| 17:21:42 | <orbitz> | ask Jon Harrop about it |
| 17:21:42 | <DBAlex> | does he have a blog or something? |
| 17:21:44 | <orbitz> | :) |
| 17:21:46 | <DBAlex> | :P |
| 17:21:48 | <orbitz> | yes |
| 17:22:06 | <DBAlex> | I heard Jon Harrop doesn't care much for haskell ;P |
| 17:22:20 | <dons> | he doesn't care much for your language :) |
| 17:22:23 | <orbitz> | I don't nkow his complete opinion, last i heard he found it lackign in areas he was interested in |
| 17:22:28 | <edwardk> | f# is basically ML without modules bolted onto .NET. its great if thats what you're looking for. |
| 17:22:29 | <DBAlex> | well from his stack overflow postsings anyways ;) |
| 17:22:33 | <DBAlex> | *postings |
| 17:22:43 | <edwardk> | the 'without modules' makes it a bit of a non-starter for me though |
| 17:23:02 | <DBAlex> | ok |
| 17:23:13 | <orbitz> | edwardk: so no Functors? |
| 17:23:15 | <DBAlex> | does it have nice intergration with e.g. WinForms etc? |
| 17:23:25 | <DBAlex> | do you think it would be easy to pick up if I only know haskell? |
| 17:23:27 | <DBAlex> | and worth it...? |
| 17:23:28 | <edwardk> | orbitz: nada |
| 17:23:37 | <orbitz> | DBAlex: the chagnes they have made to Ocaml facilitate integrating with teh rest of teh CLR or wahtever easily |
| 17:23:52 | <DBAlex> | ok |
| 17:24:05 | <orbitz> | F# reminds meof Scala, in the senseof: if you are stuck on tha tplatform, it's probably better than your alternatives, but i probably wouldn't write my own projects in it |
| 17:24:07 | <edwardk> | dbalex: its good if you want to do .net things like write a desktop app or build a asp.net web page, etc. and you really really want a language with pattern matching |
| 17:24:14 | <heltav> | intellectual honesty: |
| 17:24:15 | <heltav> | <honest discussion is here> <here be middle> <here be liars,lawyers and other scum> <here be jon harrop> |
| 17:24:25 | <orbitz> | heltav: haha |
| 17:24:39 | <DBAlex> | edwardk: ok |
| 17:24:46 | <edwardk> | heltav nice map. i notice you drew it on a log scale ;) |
| 17:24:50 | <DBAlex> | edwardk: but haskell has modules for most things |
| 17:24:50 | <orbitz> | is harrop known for being dishonest? he always just struck me as incredibly pedantic to the poitn of imrpacticality |
| 17:24:55 | <DBAlex> | just I can't get them working! :P |
| 17:24:59 | <DBAlex> | (wxWidgets) |
| 17:25:16 | <edwardk> | DBAlex:haskell modules are not modules, they are basically a namespacing convention. ML modules are what ML uses to get 'typeclass' like stuff |
| 17:25:32 | <DBAlex> | ok |
| 17:26:05 | <edwardk> | DBAlex: F# modules are as crippled as Haskell modules, but without ML modules to reclaim the missing power of typeclasses its a painful loss |
| 17:26:08 | <DBAlex> | so is ML a lot different to haskell? |
| 17:26:24 | <DBAlex> | does ML use lazy evaluation? |
| 17:26:25 | <orbitz> | which ML? |
| 17:26:35 | <DBAlex> | oh :( |
| 17:26:36 | <orbitz> | all of teh ML's i have used are strict |
| 17:26:37 | <edwardk> | dbalex: ML is defined by strict semantics usually |
| 17:26:39 | <orbitz> | and allow side effects |
| 17:26:46 | <Berengal> | sml has lazy structures last I checked |
| 17:26:55 | <edwardk> | DBAlex: there are of course toy researchy lazy ml's out there |
| 17:27:00 | <DBAlex> | ok |
| 17:27:05 | <Berengal> | Well, lazy if you declare them as such |
| 17:27:18 | <edwardk> | Berengal: having a delay and force around isn't really 'lazy' as haskellers would think it |
| 17:27:20 | <rieux_> | beregnal: SML/NJ has lazy datatypes. SML just has force and delay |
| 17:27:21 | <lament> | toy researchy lazy ml's, like haskell ;) |
| 17:27:22 | <leadnose> | what would be the main differences between lazy ML and Haskell? |
| 17:27:43 | <DBAlex> | btw |
| 17:27:44 | <edwardk> | leadnose: elegance |
| 17:27:50 | <DBAlex> | if a language isn't lazy |
| 17:27:56 | <saml> | ghc can't compile ml |
| 17:28:02 | <DBAlex> | does that mean you can't have (potentially) infinite lists? |
| 17:28:07 | <edwardk> | leadnose: ml has a ton of distinctions like fun vs. val that aren't needed once you are lazy |
| 17:28:20 | <DBAlex> | and isn't that a pain |
| 17:28:21 | <edwardk> | DBAlex: not without using a lazy data type or an explicit delay/force |
| 17:28:41 | <DBAlex> | :( |
| 17:28:46 | <edwardk> | DBAlex: people lived with it for decades before the learned haskell ;) |
| 17:28:51 | <edwardk> | er they |
| 17:28:53 | <orbitz> | DBAlex: most langauges aren't lazy |
| 17:29:01 | <Berengal> | You could always code the lazyness explicitly... |
| 17:29:03 | <DBAlex> | I know ;P |
| 17:29:21 | <edwardk> | Berengal: and i could always write everything in assembly =) |
| 17:29:25 | <rieux_> | edwardk: in SML/NJ you can actually declare you constructors to be lazy, so you then don't need force/delay: http://www.cs.cmu.edu/~rwh/introsml/core/lazydata.htm |
| 17:29:29 | <Berengal> | For some reason strict functional languages irk me somewhat |
| 17:29:30 | <saml> | > [1 ..] ! 2381923749781238946134891736412789346981784195423142 |
| 17:29:31 | <lambdabot> | Couldn't match expected type `Array i e' |
| 17:29:37 | <Berengal> | edwardk: People used to do that, you know... |
| 17:29:45 | <edwardk> | rieux_: yeah hence my 'or' in that statement =) |
| 17:29:54 | <edwardk> | Berengal: yeah i was one of them, i grew up |
| 17:30:10 | <rieux_> | edwardk: missed that |
| 17:31:08 | <DBAlex> | some guy I know still writes x86 assembly... |
| 17:31:28 | <DBAlex> | although i'm starting to wonder whether he just doesn't trust compilers for some odd reason |
| 17:32:11 | <wli> | Eh? Kernel hackers have to write asm all the time. |
| 17:32:15 | <leadnose> | I'm k |
| 17:32:21 | <leadnose> | oops |
| 17:32:24 | <rieux_> | and compiler back-end writers |
| 17:32:38 | <DBAlex> | yeah but he's neither |
| 17:32:39 | <Deewiant> | I guess it was more about writing "everything" in assembly |
| 17:32:48 | <Deewiant> | Than just the bits that need to be :-) |
| 17:32:48 | <TomMD> | Does HUnit have no test vector generation capability (like QuickCheck Arbitrary) |
| 17:32:58 | <wli> | Compilers don't emit privileged instructions (and nothing corresponds to them in most/all programming languages, too). |
| 17:33:12 | <p_l> | Well, I heard that some projects profit heavily from hand-optimized assembly |
| 17:33:35 | <DBAlex> | whats the point in writing a compiler tho, probably easier to translate to asm then let something like gas do the compilation |
| 17:34:07 | <pejo> | (General comment about infinite lists, etc) Many of the strict fp's have extensions that give some of the power of laziness. |
| 17:34:14 | <rieux_> | DBAlex: that's called a compiler |
| 17:34:24 | <dev312> | can anyone recommend a good learning resource, tutorial, ebook on HDBC? |
| 17:34:26 | <DBAlex> | rieux_: ? really |
| 17:34:35 | <edwardk> | The Koan of Lazy Evaluation: Michel Mauny was giving a guest lecture to new computer science students. After the students were seated, Michel pronounced “Today’s lecture will be about Lazy Evaluation”, he paused for a moment then concluded with, “Are there any questions?” |
| 17:34:46 | <DBAlex> | rieux_: I thought real compilers did the last bit too |
| 17:35:12 | <DBAlex> | hehe |
| 17:35:23 | <mle> | DBAlex: compilers only transform from one language to another. Though obviously that last step can be integrated. |
| 17:35:25 | <dev312> | hello :) |
| 17:35:32 | <saml> | hi dev312 |
| 17:35:37 | <dev312> | hi saml |
| 17:35:45 | <wli> | DBAlex: It depends. A fair number just invoke assemblers through a pipe, though. |
| 17:35:50 | <rieux_> | DBAlex: no, i don't think anyone cares whether your compiler uses an assembler or not. real compilers today often use someone else's intermediate language, but they're still compilers. |
| 17:36:15 | <DBAlex> | mle: yup... |
| 17:36:26 | <DBAlex> | wli: ah... see this was bugging me for a while |
| 17:36:26 | <dev312> | saml, know much about HDBC? |
| 17:36:32 | <DBAlex> | I didn't realise that compilers cheated too then |
| 17:36:37 | <saml> | dev312, just googling it up. |
| 17:36:41 | <saml> | http://software.complete.org/software/wiki/hdbc/ ? |
| 17:36:45 | <elias`> | edwardk: Philip Wadler actually begins his lectures that way (at least tends to), just doesn't conclude them like that |
| 17:37:07 | <DBAlex> | rieux_: aren't those more like languages that use the jvm or clr though? |
| 17:37:25 | <DBAlex> | like boo, groovy etc |
| 17:37:30 | <wli> | DBAlex: Some of them (MIPSpro IIRC) even separate out phases of translation/compilation into different programs that pass data to each other over pipes. |
| 17:37:48 | <rieux_> | DBAlex: there are those, sure. but also, you could compile to an intermediate language like LLVM or Cmm, which you immediately translate to native code |
| 17:37:53 | <dev312> | sam, yeah thats it |
| 17:37:55 | <rieux_> | DBAlex: or C, for that matter |
| 17:38:19 | <DBAlex> | ok |
| 17:38:24 | <DBAlex> | see I want to write a compiler |
| 17:38:28 | <DBAlex> | maybe for my 3rd year project? |
| 17:38:30 | <ksf> | oh, the joy. Error 500. |
| 17:38:32 | <dev312> | ahh they have some example source code |
| 17:38:36 | <dev312> | I think ill browse that |
| 17:38:36 | <dev312> | thanks |
| 17:38:36 | <rieux_> | have you written a compiler before? |
| 17:38:41 | <DBAlex> | I don't know whether thats too ambitious |
| 17:38:51 | <DBAlex> | I've written a logo interpreter |
| 17:38:52 | <ksf> | ACTION thinks trac should be scrapped and replaced with a haskell solution |
| 17:38:53 | <DBAlex> | thats about it |
| 17:39:03 | <DBAlex> | and a semi-complete basic interpreter |
| 17:39:03 | <rieux_> | i don't know how long you have to spend on it, but it really depends on what kind of language you want to handle, and how well you want to do it |
| 17:39:21 | <ksf> | DBAlex, c to redcode compiler? |
| 17:39:31 | <ksf> | ...people would hate you, it'll be fun. |
| 17:39:43 | <DBAlex> | heh |
| 17:39:58 | <edwardk> | ksf: there is already a forth one iirc |
| 17:39:59 | <ksf> | do we have a redcode backend for haskell? |
| 17:40:02 | <DBAlex> | I was thinking more a subset of python compiler or something |
| 17:40:14 | <DBAlex> | or create a simple language of my own then create a compiler |
| 17:40:21 | <rieux_> | you could do that. |
| 17:40:28 | <p_l> | hmm.. here, a compiler writing course is 3rd year thing |
| 17:40:33 | <ksf> | you could add some jitting to an existing bytecode interpreter. |
| 17:40:33 | <edwardk> | python is annoying to compile because too much is dynamic |
| 17:40:54 | <DBAlex> | p_l: yeah we have something like it in the 2nd year, but it uses haskell... |
| 17:40:58 | <edwardk> | i agree with ksf, jitting has a lot of the same flavor and is more immediately rewarding |
| 17:41:14 | <edwardk> | look at the work on tracing jits, they are fun |
| 17:41:18 | <DBAlex> | maybe haskell is good for writing compilers though |
| 17:41:18 | <mauke> | the only compiler I've written translates brainfuck to OISC :/ |
| 17:41:21 | <DBAlex> | just seems daunting hehe |
| 17:41:21 | <edwardk> | and they are straightforward to implement |
| 17:41:27 | <rieux_> | DBAlex: it certainly is |
| 17:41:30 | <edwardk> | and you only ever have to deal with a single superblock when compiling |
| 17:41:37 | <DBAlex> | rieux_: even more so in haskell though |
| 17:41:45 | <DBAlex> | i'd prefer to write mine in c |
| 17:41:54 | <ksf> | you could work on lhc's grin backends. |
| 17:42:03 | <p_l> | DBAlex: The most important thing is the theoretical part - you can write compiler in any language you want after you learn how to write them at all |
| 17:42:28 | <ksf> | ...which basically means "write a quine generator, then get started" |
| 17:42:30 | <pejo> | DBAlex, haskell is very nice for writing compilers. I don't understand why you want to write it in C though. |
| 17:42:33 | <rieux_> | edwardk: do you mean writing a source language to bytecode compiler, or writing the JIT compiler? the latter leaves out a lot of the fun stuff, IMO |
| 17:42:43 | <edwardk> | ksf: heh, i took a look at it then realized i'd be better off trying to jit ghc's bytecode than to start over with lhc's grin |
| 17:42:50 | <DBAlex> | pejo: because i'm crap at haskell... |
| 17:43:17 | <ksf> | well, from all i could tell skimming the stuff, grin's a really fine thing to deal with. |
| 17:43:18 | <DBAlex> | haskell takes me way longer to write than c etc |
| 17:43:25 | <edwardk> | rieux_: yes but it lets you start generating results you can execute immediately which provides a nice feedback loop |
| 17:43:30 | <rieux_> | DBAlex: that means you need practice |
| 17:43:42 | <ksf> | as in no higher-order functions. |
| 17:43:54 | <mauke> | just learn how to write C in Haskell :-) |
| 17:44:08 | <edwardk> | ksf: unfortunately the STG-like calls are actually one of my best optimizations when doing a tracing jit ;) |
| 17:44:10 | <DBAlex> | lol |
| 17:44:19 | <mauke> | it's not that complicated, actually |
| 17:44:24 | <DBAlex> | rieux_: yes, but where do I get the practice? |
| 17:44:26 | <edwardk> | ksf: so grin defunctionalizing them removes a lot of the benefit i can provide |
| 17:44:30 | <ksf> | DBAlex, you could also do me a favour and replace trac.haskell.org with a tracker implemented in haskell. |
| 17:44:32 | <rieux_> | DBAlex: by writing a compiler |
| 17:44:36 | <DBAlex> | are there any open source haskell projects that need helpers? |
| 17:44:53 | <DBAlex> | they don't need to be compilers... i'm willing to work on anything... I have about 3 months off in the summer... |
| 17:44:59 | <edwardk> | at the cost of closing the world, which i don't need. one nice thing about a jit is it helps iteratively approximate a 'closed world' compilation in an open world setting |
| 17:45:09 | <ksf> | DBAlex, yi, leksah? |
| 17:45:12 | <DBAlex> | maybe I could just do some of my own projects maybe |
| 17:45:20 | <DBAlex> | ksf: leksah? |
| 17:45:23 | <ksf> | or, preferrably, both, that is include yi into leksah |
| 17:45:25 | <ksf> | haskell ide. |
| 17:45:40 | <ksf> | then, get hare working again. |
| 17:45:50 | <DBAlex> | ksf: hmmm ok |
| 17:45:55 | <c_wraith> | you could make gtk2hs easy to install. That would be astounding |
| 17:45:56 | <pejo> | DBAlex, all haskell projects need helpers, basically. I think there's a lot of open improvement requests for cabal for example, or cabal-install. |
| 17:46:10 | <rieux_> | edwardk: closed world? |
| 17:46:13 | <ksf> | gtk2hs is easy to install, if you happen to be using gentoo. |
| 17:46:25 | <DBAlex> | pejo: ok |
| 17:46:35 | <pejo> | edwardk, you mean by specializing things that are known? |
| 17:46:45 | <DBAlex> | pejo: would the code be understandable to someone who's only been programming haskell for about 2 months? |
| 17:46:57 | <edwardk> | rieux_: grin requires that every function that can exist is known so it can define a closed 'eval' function |
| 17:47:22 | <rieux_> | oh, okay. i thought you were speaking more generally. |
| 17:47:28 | <pejo> | DBAlex, the project euler problems are popular for practice I think. I really don't know how much one learns in 2 months. |
| 17:47:52 | <dev312> | leksah is nice |
| 17:47:54 | <DBAlex> | pejo: ok |
| 17:47:54 | <edwardk> | rieux_: basically it just defines a huge case over all of the thunk types in the world and specializes it. this is great -- if it can show that only certain kinds of thunks can flow into certain situations the eval is just a quick case discriminating a much smaller set of cases |
| 17:48:05 | <dev312> | learning haskell would be slower for me without it |
| 17:48:12 | <c_wraith> | You can learn a lot of haskell in 2 months. But project euler isn't good for much beyond wrapping your head around the syntax. |
| 17:48:28 | <DBAlex> | maybe I should buy real world haskell |
| 17:48:28 | <c_wraith> | Working on a real live system, which is what you're asking about, is a lot better. |
| 17:48:31 | <rieux_> | edwardk: does it do CFA for that? (i can't find what grin is) |
| 17:48:43 | <rieux_> | found |
| 17:48:46 | <DBAlex> | if I do all of the projects in there it could help with next years compilers stuff |
| 17:48:52 | <edwardk> | rieux_: look up Urban Boquist's thesis |
| 17:49:17 | <DBAlex> | ah leksah |
| 17:49:19 | <edwardk> | rieux_: GRIN is a first order monadic language used behind LHC, UHC, and JHC. |
| 17:49:22 | <DBAlex> | didn't know haskell had an IDE :) |
| 17:49:49 | <dev312> | best thing about leksah is the library browser and automatic cabal managment |
| 17:49:54 | <dev312> | Well not automatic |
| 17:49:59 | <dev312> | but simplified |
| 17:50:01 | <DBAlex> | did anyone here work on it then? |
| 17:50:11 | <wli> | I have a lot of trouble with the Project Euler problems. |
| 17:50:25 | <edwardk> | basically it can use 0-CFA type analysis to specialize cases, its nice in that it can do a LOT of optimizations because the world is closed |
| 17:50:39 | <mauke> | I only solve the euler problems that can be brute forced |
| 17:50:58 | <arjanb> | edwardk: you could also use a grin variant that has a builtin eval and apply so you don't need a closed world |
| 17:51:03 | <edwardk> | its bad because its flipping expensive because its doing those optimizations everywhere AND it needs the whole world to do it |
| 17:51:16 | <edwardk> | arjanb: actually i did for a while |
| 17:51:30 | <edwardk> | arjanb: but without the primitive eval/apply it doesn't have much to do |
| 17:51:41 | <edwardk> | arjanb: its just c-- with another syntax |
| 17:51:44 | <heltav> | ksf: i could do that |
| 17:51:47 | <wli> | I can't even get through a fair number of the brute-forcible ones. |
| 17:51:47 | <heltav> | is that wanted? |
| 17:51:52 | <heltav> | what does the tracker do? |
| 17:52:18 | <edwardk> | arjanb: the reason why i like a tracing jit for haskell like languages is you can 'build' your eval up at runtime as local polyinline caches |
| 17:52:20 | <ksf> | atm, nothing, it errors out with a 500. |
| 17:52:40 | <edwardk> | arjanb: and get the general efficiency of grin style evaluation with a fast compile and an open world |
| 17:52:41 | <ksf> | in general, tracking bugs and providing per-project wikis, roadmaps etc. |
| 17:52:45 | <Lemmih> | arjanb: JHC does that. |
| 17:53:02 | <ksf> | I don't even know who administers it. |
| 17:53:49 | <edwardk> | i've been poking around with mmorrow trying to see if i can drop in a version of my tracing jit to replace ghc's bytecode interpreter. |
| 17:54:13 | <demolithion> | ls |
| 17:54:14 | <ksf> | you could probably just hack up gitit with some scripting and be done. |
| 17:54:16 | <demolithion> | ups |
| 17:56:59 | <heltav> | ksf: ok but is it a desired project or "just" you who have a little problemr ight now? |
| 17:57:37 | <ksf> | I'd be surprised if it only errors out for me... but no, there hasn't yet been a general outrage. |
| 17:57:39 | <ivan-kanis> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4657 |
| 17:58:02 | <ivan-kanis> | i can't understand why I am getting a compile error when lining up if then else |
| 17:58:25 | <mauke> | ivan-kanis: because there's a ';' before the 'then' |
| 17:58:38 | <mauke> | 'if ... ; then' is a syntax error |
| 17:59:26 | <ivan-kanis> | mauke: i don't see a ; ... |
| 17:59:43 | <mauke> | it's invisible |
| 17:59:51 | <ivan-kanis> | ah ok |
| 17:59:53 | <mauke> | but that's how layout works |
| 18:00:00 | <ksf> | no long-time imperative coders see the ;'s. |
| 18:00:08 | <mauke> | if you start a new line and it's indented more, nothing happens |
| 18:00:09 | <ksf> | they train you to ignore them. |
| 18:00:17 | <mauke> | if it's indented the same, a ';' is inserted |
| 18:00:23 | <heltav> | http://en.wikipedia.org/wiki/Trac |
| 18:00:26 | <mauke> | if it's indented less, a '}' is inserted |
| 18:00:29 | <ksf> | ...in a do block, that is. |
| 18:00:31 | <heltav> | but hmm seems hard to compete with... |
| 18:01:38 | <arjanb> | edwardk: i have experimented with translating grin to the jvm using methods for eval and apply, but many other jvm limitations made it very slow.. |
| 18:01:42 | <mauke> | ivan-kanis: your logic is broken |
| 18:02:02 | <edwardk> | hahah old parser paper on parallel LR using Haskell =) http://www.aclweb.org/anthology-new/C/C90/C90-2053.pdf |
| 18:02:32 | <ivan-kanis> | mauke: i am doing my best... |
| 18:02:49 | <ksf> | heltav, it seems to be easy to compete with it performance-wise. |
| 18:03:18 | <ksf> | and we already got templating and wiki. |
| 18:03:57 | <edwardk> | although they only parallelize shift reduce conflicts |
| 18:04:28 | <ivan-kanis> | ok, i have most examples of if then else all lined up, it shouldn't work? |
| 18:05:31 | <heltav> | ksf: we do? |
| 18:05:41 | <ksf> | we do. |
| 18:05:47 | <heltav> | on hackage? |
| 18:06:05 | <ksf> | gitit, and the happs-tutorial uses some sort of templating. |
| 18:06:17 | <ksf> | gitit is pandoc-based. |
| 18:07:22 | <augustss> | arjanb: I'm pretty sure you can do well with Haskell on the JVM, but I think requires getting rid of almost all h.o. functions. |
| 18:07:58 | <mauke> | ivan-kanis: what do you think about http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4657#a4659 ? |
| 18:08:16 | <leadnose> | getting rid of hof:s in haskell is not doing it well |
| 18:08:24 | <Elrood> | does anybody know if there are binary versions of leksah available somewhere (win32) ? |
| 18:08:35 | <rieux_> | edwardk: okay, this is cool. it's sort of like 0CFA but it doesn't treat the heap as a free-for-all like shivers does. |
| 18:08:48 | <edwardk> | rieux_: yeah |
| 18:09:00 | <augustss> | leadnose: it's doable using whole program optimization (which I'm not a fan of) |
| 18:09:29 | <pejo> | augustss, because of compilation times? |
| 18:09:44 | <augustss> | pejo: yes |
| 18:10:27 | <rieux_> | edwardk: is there any work on opening the world a little bit? i can't see how you'd do that without kind of breaking the whole thing. |
| 18:10:41 | <xUSR> | hello |
| 18:10:45 | <pejo> | augustss, even if that's only necessary for the final binary? |
| 18:10:50 | <edwardk> | i wish there was a nice monoid for control flow analysis. i.e., given this closed world and that closed world here is the smallest closed world containing them but i think the result would be too approximate |
| 18:11:03 | <wli> | augustss: Lambda lifting? |
| 18:11:19 | <edwardk> | rieux_: thats basically why i like the model of just working with a raw 'open world' and then jitting to close it back down |
| 18:11:28 | <xUSR> | hey every one, I am using streamreader to read lines of a text file to a list box. the only problem is it's returning null characters to the listbox before each line. any suggestions? |
| 18:12:04 | <edwardk> | rieux_: where a polyinline cache gets inserted for each eval and expands itself as it accumulates traces once its hot enough to deserve tracing |
| 18:12:50 | <dcoutts_> | pejo: there was someone at FITA yesterday describing their whole-program ada compiler. It can currently cope with programs up to about 50kloc. Bigger and you run out of memory. While you could improve the factors there it's going to be a limitation for any whole program compiler. |
| 18:13:06 | <xUSR> | hey every one, I am using streamreader to read lines of a text file to a list box. the only problem is it's returning null characters to the listbox before each line. any suggestions? |
| 18:13:06 | <rieux_> | edwardk: is that the self stuff? |
| 18:13:10 | <mauke> | xUSR: ECONTEXT |
| 18:13:21 | <xUSR> | whats econtext? |
| 18:13:21 | <edwardk> | rieux_: thats where it originated |
| 18:13:24 | <arjanb> | augustss: getting rid of hofs isn't enough, updating, tail recursion and slow object creation are still a problem |
| 18:13:29 | <pejo> | dcoutts, MLTon claimed to work for 100kloc programs in 2006 (ML workshop, invited talk by Stephen Weeks, but I didn't see the talk). |
| 18:13:38 | <edwardk> | rieux_: but basically the idea comes into its own in a tracing jit |
| 18:13:38 | <mauke> | xUSR: you have provided no context / this is a haskell channel. what are you talking about? |
| 18:13:54 | <xUSR> | oh i thought this was a programming channel, im sorry |
| 18:13:54 | <dcoutts_> | pejo: that's probably a lot better, ml programs tend to be shorter than ada ones :-) |
| 18:14:09 | <pejo> | dcoutts, how many Haskell programs do we have that are a factor 4 larger than what the ada compiler could cope with? |
| 18:14:16 | <mauke> | xUSR: haskell is a programming language |
| 18:14:27 | <edwardk> | xUSR: it is, but its about programming in the Haskell language ;) |
| 18:14:37 | <augustss> | arjanb: tail recursion can be mostly eliminated, I'm not sure why updating has to be a problem, but the slow object creation is a problem |
| 18:14:37 | <xUSR> | oh i am sorry i did not realize |
| 18:14:39 | <dcoutts_> | pejo: well, at least ghc and whatever it is that augustss hacks on |
| 18:14:55 | <edwardk> | xUSR: no problem, common mistake |
| 18:15:06 | <xUSR> | i am trying to complete a project in 2 hours and i cannot find a resolution to my issue so i was looking for real time chats |
| 18:15:16 | <pejo> | augustss, hm, have you already gotten to >200kloc? |
| 18:15:30 | <Berengal> | xUSR: You could just try dropping the null characters... |
| 18:15:46 | <xUSR> | how so? i am using visual studio |
| 18:15:55 | <augustss> | pejo: not at the new place. but we had about 200kloc at the Credit Suisse before I left. |
| 18:16:13 | <pejo> | dcoutts, I agree that long compilation times are a killer though, I was mainly trying to highlight that most of our programs are rather small. |
| 18:16:14 | <dcoutts_> | pejo: also, dons talk the other day gave some figures for galois |
| 18:16:24 | <arjanb> | augustss: updating is a problem because you need extra indirection and the gc can't remove it |
| 18:16:28 | <dcoutts_> | pejo: only when you don't count the base libs :-) |
| 18:16:36 | <edwardk> | rieux_: basically the trace records a path that has been taken through the code that starts and ends at the same instruction, which is basically a superblock. then you optimize just that path, pushing everything off onto side exits that you can. whenever it took an indirect jump you can back up and figure out where it loaded that jump from |
| 18:16:57 | <edwardk> | rieux_: and case on the target using a polyinline cache, falling back on starting another trace from this point |
| 18:17:02 | <augustss> | arjanb: hbc does updating without indirections |
| 18:17:20 | <edwardk> | rieux_: and as it runs you iteratively turn your 'open world' into an 'all but closed world' |
| 18:17:35 | <edwardk> | rieux_: at least for the paths that are hot enough to care about |
| 18:17:40 | <arjanb> | augustss: you can't overwrite object reference in the jvm |
| 18:18:07 | <rieux_> | edwardk: thanks . . . rereading. |
| 18:18:12 | <dcoutts_> | arjanb: how do fields work then? arn't they object references? |
| 18:18:20 | <pejo> | dcoutts, well, I don't have any measurements. Maybe you're right. I hope you're wrong though. :-) |
| 18:18:22 | <augustss> | arjanb: huh? |
| 18:18:59 | <dcoutts_> | pejo: it's probably doable for most progs and systems, just not the big ones |
| 18:19:00 | <arjanb> | dcoutts: you can update fields but you need a wrapper object to create an updatable thunk |
| 18:19:06 | <augustss> | arjanb: I'm not sure you can play the tricks necessary for updating objects in the jvm. not having any control over the gc is a nuisance |
| 18:19:23 | <edwardk> | rieux_: with enough information about thunks in the trace it can do more, i.e. if the thunk is always evaluated on the trace you can evalute it earlier, if no reference escapes the trace you can unbox it into registers |
| 18:19:47 | <dcoutts_> | arjanb: I see |
| 18:20:01 | <edwardk> | rieux_: but without the combinatorial explosion of trying to figure out WHERE to do that at compile time |
| 18:20:15 | <jeffersonheard> | are non power-of-two textures supported in HOpenGL? |
| 18:21:11 | <ksf> | my crystal ball saiz: depends on your gl drivers. |
| 18:22:02 | <rieux_> | edwardk: this sounds like several of the standard static analyses, but done on-line. |
| 18:22:14 | <edwardk> | rieux_: exactly =) |
| 18:22:39 | <edwardk> | rieux_: its just a nice form for figuring out where they should be applied |
| 18:22:50 | <rieux_> | edwardk: like, where they might matter. |
| 18:23:37 | <rieux_> | edwardk: who's using this? |
| 18:23:50 | <edwardk> | rieux_: erm, just me at the moment |
| 18:24:33 | <edwardk> | rieux_: my tracing jit for my kata compiler uses, i'm trying to figure out the right way to hook in to do the same thing to ghc's bytecode directly |
| 18:24:41 | <edwardk> | but i haven't pushed too hard at it yet |
| 18:25:12 | <rieux_> | edwardk: kata? |
| 18:25:37 | <edwardk> | to get good results out of ghc i'll probably have to transcode my tracing x86-64 jit so it can trace through native thunks as well |
| 18:26:10 | <augustss> | edwardk: you can speed up native code by jitting too |
| 18:26:14 | <edwardk> | rieux_: 'toy untyped haskell with other language features' |
| 18:26:35 | <edwardk> | augustss: yeah. thats what i use it for in kata, i can trace right through glibc, etc. |
| 18:27:34 | <edwardk> | augustss: it just has to be sound with respect to the semantics of what it traces, not complete. if it doesn't understand something it can always abort the trace. |
| 18:27:37 | <augustss> | so tracing is probably one of those things where a little hardware support would be good |
| 18:28:34 | <augustss> | edwardk: but completeness is only a matter of hard work |
| 18:28:34 | <edwardk> | augustss: yeah. i do deep magic to start the trace and to result on an arbitrary instruction boundary when i fail to understand an opcode or the trace runs too long |
| 18:28:44 | <edwardk> | augustss: yeah |
| 18:28:47 | <edwardk> | augustss: well |
| 18:29:09 | <edwardk> | augustss: i rely on certain properties of the ABI to do some practical optimizations that aren't even technically sound. ;) |
| 18:29:27 | <augustss> | tsk, tsk :) |
| 18:29:54 | <edwardk> | based on common layout of variables that would be written to the stack, the fact that array accesses are not likely to acces sboth an element in a bounded stack frame and something in another frame, etc. |
| 18:30:03 | <edwardk> | otherwise i'd have to materialize every stack effect |
| 18:30:55 | <edwardk> | without that i can feel free to just place the stuff on the stack during side exit to recover the system to a state that it expects, and i can feel free to shuffle basically anything in the meantime |
| 18:31:33 | <edwardk> | the need for precise control over the stack usage, knowledge of exactly what gets pushed and popped when and where is what basically keeps me from using llvm in the jit |
| 18:32:42 | <edwardk> | i can get some of that out of the 'red zone' used by the x86-64 abi, but its so big that i'd need a really long trace to discover that something really really isn't used |
| 18:33:38 | <edwardk> | nicely since its an 'opt-in' jit that requires a little bit of code insertion to fire off, i get some things for free. i get some registers i know are mine at least at the start of the trace bcause you called a function to start the trace |
| 18:34:00 | <edwardk> | and i get the ability to pass options to this particular jit point. like how paranoid to be ;) |
| 18:35:05 | <edwardk> | it does do some marvellous trace compression on standard library calls though |
| 18:36:31 | <vixey> | @pl (\input -> f input `mplus` g input) |
| 18:36:31 | <lambdabot> | liftM2 mplus f g |
| 18:36:53 | <edwardk> | though, it currently it has a faulty model of what is 'constant' because it can only see the layout of the current process's memory map, it doesn't have a model that someone else can modify the data contained in an area that has been mapped read only into this process, but read/write in another |
| 18:36:57 | <vixey> | @pl on (\input -> (un f) input `mplus` (un g) input) |
| 18:36:57 | <lambdabot> | on (ap (mplus . un f) (un g)) |
| 18:37:01 | <conal> | vixey: maybe even just mplus. |
| 18:37:07 | <edwardk> | otoh, if you need that, throw it a flag not to constant fold |
| 18:37:22 | <conal> | @src IO MonadPlus |
| 18:37:23 | <lambdabot> | Source not found. There are some things that I just don't know. |
| 18:37:23 | <rieux_> | seems like you'd know |
| 18:37:25 | <conal> | @src MonadPlus IO |
| 18:37:25 | <lambdabot> | Source not found. Maybe you made a typo? |
| 18:37:33 | <vixey> | @src mplus (->) |
| 18:37:34 | <lambdabot> | Source not found. Just try something else. |
| 18:37:39 | <vixey> | @src (->) mplus |
| 18:37:39 | <lambdabot> | Source not found. The more you drive -- the dumber you get. |
| 18:37:55 | <roconnor> | @src mplus [] |
| 18:37:55 | <lambdabot> | Source not found. Take a stress pill and think things over. |
| 18:38:00 | <roconnor> | @src [] mplus |
| 18:38:00 | <conal> | oh -- silly me. (IO wtf?) |
| 18:38:00 | <lambdabot> | mplus = (++) |
| 18:38:16 | <vixey> | @src ((->)e) mplus |
| 18:38:16 | <edwardk> | mplus there is m `mplus` n = m `catch` \_ -> n |
| 18:38:16 | <lambdabot> | Source not found. My mind is going. I can feel it. |
| 18:38:24 | <vixey> | @src -> mplus |
| 18:38:24 | <lambdabot> | Source not found. I can't hear you -- I'm using the scrambler. |
| 18:38:37 | <roconnor> | @instances MonadPlus |
| 18:38:38 | <lambdabot> | Either e, ErrorT e m, IO, Maybe, RWST r w s m, ReaderT r m, StateT s m, WriterT w m, [] |
| 18:38:46 | <roconnor> | no (->) |
| 18:38:53 | <edwardk> | with mzero = throw (userError "mempty") -- iirc |
| 18:39:04 | <vixey> | Conal has a point though, what about MonadPlus a => MonadPlus (b -> a) |
| 18:39:22 | <edwardk> | vixey: that should be in Data.Monad.Instances |
| 18:39:28 | <edwardk> | isn't it? |
| 18:39:33 | <edwardk> | er |
| 18:39:37 | <edwardk> | Control.Monad.Instances |
| 18:39:56 | <edwardk> | ah whoa, its not |
| 18:40:01 | <conal> | oops. |
| 18:40:16 | <vixey> | I think that is a valid monad plus though |
| 18:40:47 | <edwardk> | hrmm, wait |
| 18:40:50 | <edwardk> | what is it? |
| 18:40:56 | <edwardk> | i don't see it |
| 18:41:08 | <vixey> | f `mplus` g = \i -> f i `mplus` g i |
| 18:41:11 | <Twey> | @src (->) mplus |
| 18:41:11 | <edwardk> | i don't think it exists |
| 18:41:11 | <lambdabot> | Source not found. Wrong! You cheating scum! |
| 18:41:12 | <vixey> | mzero = const mzero |
| 18:41:16 | <Twey> | Hmnhmn |
| 18:41:23 | <edwardk> | thats for ReaderT |
| 18:41:58 | <edwardk> | that requires the thing on the right hand side of (->) to be a MonadPlus, but the anonymous reader just knows its a value |
| 18:42:25 | <edwardk> | instance MonadPlus ((->)e) where mzero = ?! |
| 18:42:47 | <vixey> | mzero = const mzero .. |
| 18:43:01 | <mauke> | wrong type |
| 18:43:02 | <sinelaw> | @seen Peaker |
| 18:43:02 | <lambdabot> | I saw Peaker leaving #haskell-blah, #haskell-overflow and #haskell 3m 15d 13h 13m 1s ago, and . |
| 18:43:05 | <edwardk> | and it gets the fact that (e -> a) -- that a is a monadplus how? |
| 18:43:09 | <vixey> | :t const mzero |
| 18:43:11 | <lambdabot> | forall (m :: * -> *) a b. (MonadPlus m) => b -> m a |
| 18:43:17 | <sinelaw> | @seen PeakerWork |
| 18:43:17 | <lambdabot> | PeakerWork is in #haskell-blah, #haskell-in-depth and #haskell. I don't know when PeakerWork last spoke. |
| 18:43:23 | <edwardk> | @src ReaderT mplus |
| 18:43:23 | <lambdabot> | Source not found. |
| 18:43:36 | <vixey> | oh yeah thanks mauke |
| 18:44:36 | <roconnor> | I think what you want is to use e -> MonadPlusAsMonoid m a |
| 18:45:05 | <edwardk> | or just wrap in a ReaderT |
| 18:45:36 | <edwardk> | ReaderT (f :: e -> m a) should work just fine |
| 18:45:43 | <roconnor> | do we have a way of wrapping a MonadPlus and a type into a monoid? |
| 18:45:55 | <edwardk> | roconnor: Data.Monoid.Monad.MonadSum |
| 18:46:34 | <roconnor> | @indexData.Monoid.Monad.MonadSum |
| 18:46:34 | <lambdabot> | Unknown command, try @list |
| 18:46:38 | <roconnor> | @index Data.Monoid.Monad.MonadSum |
| 18:46:39 | <lambdabot> | bzzt |
| 18:46:46 | <roconnor> | @docs Data.Monoid.Monad.MonadSum |
| 18:46:46 | <lambdabot> | Data.Monoid.Monad.MonadSum not available |
| 18:46:53 | <edwardk> | http://hackage.haskell.org/packages/archive/monoids/0.1.33/doc/html/Data-Monoid-Monad.html |
| 18:47:36 | <edwardk> | er http://hackage.haskell.org/packages/archive/monoids/0.1.36/doc/html/Data-Monoid-Monad.html even |
| 18:48:03 | <edwardk> | there is a similar one for Alternatives in Data.Monoid.Applicative |
| 18:57:33 | <gOcOOl> | does anyone know if the 'haskell-platform' package is available on Ubuntu yet? |
| 18:58:03 | <ksf> | any vim gurus around? |
| 18:58:12 | <ksf> | _si is working, but _t and _T ain't. |
| 18:58:49 | <wahjava> | ksf: Emacs priest around...;) |
| 18:59:27 | <ksf> | types were the reasons why i finally installed the whole haskellmode... |
| 19:00:26 | <Zao> | ksf: "Double type not known" when _T on a :: Double |
| 19:00:33 | <Zao> | ksf: What's _t and _T supposed to do? |
| 19:01:17 | <ksf> | lookup the type of the expression under the cursor. |
| 19:01:26 | <ksf> | ...resp. insert it. |
| 19:02:53 | <Zao> | It seems to kind of work here. |
| 19:03:32 | <Zao> | Seems to need :make to update cached info, but otherwise it seems to work. |
| 19:03:52 | <Zao> | (vim x64 7.2, Haskell Platform 2009.2.0) |
| 19:04:30 | <zloog> | Hi, I'm getting an uncaught exception in gtk2hs and haven't worked with exceptions before. I'm trying to write and handler and my code snippet is http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4663#a4663 and I was wondering if anyone knew why I was getting an ambiguous type variable error. Thanks |
| 19:05:09 | <nathanic> | ksf: the _t script seems to break for `infix` definitions for me |
| 19:05:46 | <dcoutts_> | zloog: because given that code, there's no way to know which types of exceptions you're trying to catch |
| 19:06:18 | <dcoutts_> | zloog: you need to fix a type of exception you're trying to catch |
| 19:06:55 | <zloog> | dcoutts: Well I just want to see if the exception is happening in haskell so I wanted to try and catch all haskell exceptions and just print out that there was one. Otherwise, is there a way for me to inspect what kind of exception this is? |
| 19:07:40 | <dcoutts_> | zloog: ah, then you need a slightly different handler if you want to catch every exception without knowing the type of the exception you're getting |
| 19:08:02 | <zloog> | dcoutts: And I realize that 6.10's exceptions are different from the exceptions described in RWH but they have generica handlers in the book |
| 19:08:03 | <dcoutts_> | zloog: take a look at the other functions in Control.Exception, it's a variant on handle |
| 19:08:21 | <zloog> | dcoutts: Thanks for the tip |
| 19:08:26 | <dcoutts_> | np |
| 19:08:30 | <dcoutts_> | ACTION disappears |
| 19:26:33 | <azathoth99> | hasekll for system administration bad idea? |
| 19:26:57 | <inimino> | yes |
| 19:27:50 | <inimino> | azathoth99 |
| 19:28:24 | <roconnor> | azathoth99: see nix for an example of a non-haskell but haskelly package manager |
| 19:28:25 | <Cale> | azathoth99: hmm, I don't think it's a bad idea. |
| 19:28:25 | <Nafai> | azathoth99: what do you mean? for scripting and such? |
| 19:28:37 | <roconnor> | @where nix |
| 19:28:37 | <lambdabot> | I know nothing about nix. |
| 19:28:55 | <roconnor> | @where+ nix http://nixos.org/ |
| 19:28:56 | <lambdabot> | I will never forget. |
| 19:28:58 | <roconnor> | @where nix |
| 19:28:59 | <lambdabot> | http://nixos.org/ |
| 19:30:13 | <roconnor> | Oh wow, they have a new continuous build system |
| 19:30:19 | <cypher-> | nix is a nice idea |
| 19:30:58 | <roconnor> | I should download it and use it sometime |
| 19:31:03 | <cypher-> | I have tested it long time ago |
| 19:31:11 | <mauke> | oh, a new one |
| 19:31:19 | <roconnor> | ``Nix is a useful system administration tool for heterogeneous environments and developers who write software supported on different libraries, compilers, or interpreters. |
| 19:31:20 | <cypher-> | didn't push gentoo out of my laptop, but I liked it |
| 19:31:28 | <cypher-> | these day's I'm a mac guy |
| 19:31:36 | <cypher-> | hmm.. maybe I'll try to build it on os x |
| 19:31:54 | <roconnor> | mauke: ? |
| 19:32:06 | <mauke> | roconnor: gavino/protontorpedo |
| 19:32:35 | <roconnor> | @protontorpedo |
| 19:32:35 | <lambdabot> | I hear from an essay by E raymod that perl is shitty for large projects |
| 19:32:53 | <vixey> | mauke you can't just ban someone liek that |
| 19:32:58 | <mauke> | yes, I can |
| 19:33:16 | <vixey> | mauke I'm speaking english not klingon |
| 19:33:19 | <vixey> | mauke it means: You shouldn't have |
| 19:33:23 | <mauke> | why not? |
| 19:33:51 | <vixey> | I meant vulcan not klingon |
| 19:33:56 | <roconnor> | take it to #haskell-ops |
| 19:33:59 | <mauke> | heh |
| 19:34:05 | <demolithion> | sk questions not only about the orientation of a sphere, but also about the rate of change of its orientation. So SO(3) is a differentiable group. The usual name for these is Lie groups, after the mathematician Sophus Lie. |
| 19:34:12 | <demolithion> | ups -.- |
| 19:34:14 | <demolithion> | sry |
| 19:34:15 | <roconnor> | oh wait |
| 19:34:17 | <endojelly> | Map.find: element not in the map |
| 19:34:22 | <roconnor> | vixey isn't an op |
| 19:34:25 | <endojelly> | how can I find out again where that exception is thrown? |
| 19:34:33 | <roconnor> | I take that back, plz continue the discussion |
| 19:35:43 | <Twey> | 21:34:10 < vixey> mauke you can't just ban someone liek that |
| 19:35:47 | <Twey> | No, you can't |
| 19:36:01 | <Twey> | mauke: That was a Mibbit client ID you banned |
| 19:36:20 | <mauke> | Twey: that's a good thing, no? |
| 19:36:22 | <Twey> | If you want to ban the person, /whois them to get their host, then use +d to ban by name |
| 19:36:26 | <mauke> | ah |
| 19:36:32 | <endojelly> | knowing where uncatched exceptions that fell through the runtime originated... how? |
| 19:36:45 | <Twey> | Since Mibbit sets the realname to the person's host |
| 19:36:57 | <flipflap> | Why does haskell still hate me so much? : |
| 19:36:58 | <flipflap> | :(( |
| 19:37:01 | <roconnor> | ACTION doesn't know how to find runtime exceptions either. |
| 19:37:14 | <flipflap> | It just won't let me use "floor" |
| 19:37:15 | <Twey> | flipflap: *grins* It just has to get to know you |
| 19:37:17 | <augustss> | endojelly: you can't, unless it's thrown with that information baked in |
| 19:37:25 | <Twey> | On what datum? |
| 19:37:29 | <endojelly> | augustss, huh. that strikes me as odd. |
| 19:37:32 | <roconnor> | flipflap: you need to understand the type of floor |
| 19:37:38 | <scriptdevil> | flipflap... Show haskell some love... Do things right |
| 19:37:40 | <roconnor> | @type floor :: Double -> Integer |
| 19:37:42 | <lambdabot> | Double -> Integer |
| 19:37:42 | <flipflap> | crates = floor (x / 11) :: Double -> Int |
| 19:37:48 | <Twey> | mauke: *nods* That's it |
| 19:37:56 | <endojelly> | augustss, well can I make ghc bake in that information? |
| 19:38:01 | <roconnor> | flipflap: haskell is just trying to save you from yourself. |
| 19:38:01 | <Twey> | :t floor |
| 19:38:02 | <scriptdevil> | flipflap: :t x |
| 19:38:03 | <lambdabot> | forall a b. (Integral b, RealFrac a) => a -> b |
| 19:38:08 | <augustss> | endojelly: It can be annoying |
| 19:38:15 | <Twey> | Looks OK to me |
| 19:38:18 | <Twey> | What's the error? |
| 19:38:27 | <flipflap> | Couldn't match expected type `Int' |
| 19:38:27 | <flipflap> | against inferred type `Double -> Int' |
| 19:38:29 | <augustss> | endojelly: Only by using CPP and some macro magic |
| 19:38:33 | <Saizan> | flipflap: you missed the argument |
| 19:38:41 | <scriptdevil> | flipflap: What is the type of x? |
| 19:38:41 | <Twey> | Ah, yes |
| 19:38:42 | <DBAlex> | once you get the types right in haskell everything pretty much works :) |
| 19:38:42 | <endojelly> | augustss, wtf |
| 19:38:44 | <flipflap> | Int |
| 19:38:46 | <Twey> | You need to mention x |
| 19:38:49 | <Saizan> | flipflap: crates x = floor (x / 11) :: Double -> Int |
| 19:38:50 | <DBAlex> | the beauty of no side effects eh.. :D |
| 19:38:50 | <roconnor> | flipflap: it is floor that is a Double -> Int, you are claiming "floor (x / 11)" is a Double -> Int |
| 19:38:58 | <endojelly> | augustss, so finding out where that error originated will be hard :( well, I could do some profiling, I guess... |
| 19:39:01 | <Saizan> | orr wait |
| 19:39:02 | <Twey> | When in fact it's just an Int (for example) |
| 19:39:02 | <scriptdevil> | flipflap: x/11 is not double |
| 19:39:06 | <endojelly> | at least then I know where to look for. |
| 19:39:09 | <Saizan> | flipflap: crates x = floor (x / 11) Int |
| 19:39:14 | <endojelly> | or better, where not to look for |
| 19:39:24 | <roconnor> | crates :: Double -> Int |
| 19:39:30 | <flipflap> | No instance for (RealFrac Int) now |
| 19:39:31 | <roconnor> | crates x = floor (x / 11) |
| 19:39:37 | <flipflap> | Wait.. |
| 19:39:45 | <augustss> | endojelly: if you compile for profiling and run with -x you get some information |
| 19:39:56 | <Twey> | That means that x is an Int, and you need to convert it to something that can be divided with / |
| 19:40:03 | <Twey> | Like a Float or a Double |
| 19:40:05 | <augustss> | endojelly: ghci also keeps some history if you run in ghci |
| 19:40:20 | <endojelly> | augustss, oh? how do I access that history? haven't found a lot |
| 19:40:25 | <flipflap> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2348#a2348 |
| 19:40:34 | <flipflap> | I wanted to code.. something.. practical. |
| 19:40:49 | <wh1t3> | thats odd cases :/ |
| 19:40:51 | <roconnor> | flipflap: ah |
| 19:41:00 | <roconnor> | flipflap: x `div` `` |
| 19:41:00 | <augustss> | endojelly: I don't remember. I hardly ever use it |
| 19:41:01 | <roconnor> | er |
| 19:41:03 | <roconnor> | flipflap: x `div` 11 |
| 19:41:13 | <roconnor> | > 24 `div` 11 |
| 19:41:15 | <lambdabot> | 2 |
| 19:41:21 | <roconnor> | > (-24) `div` 11 |
| 19:41:23 | <lambdabot> | -3 |
| 19:41:25 | <povman> | flipflap: Have you scheduled a release date for your application? I'd like to buy it! |
| 19:41:34 | <Berengal> | div automatically floors |
| 19:41:44 | <flipflap> | But I want to manually floor :( |
| 19:41:45 | <Berengal> | Or rounds to zero, I forget... |
| 19:41:46 | <Twey> | :t divMod |
| 19:41:47 | <lambdabot> | forall a. (Integral a) => a -> a -> (a, a) |
| 19:41:49 | <flipflap> | More to learn for me |
| 19:41:52 | <kpreid> | > (-1) `div` 2 |
| 19:41:53 | <lambdabot> | -1 |
| 19:42:05 | <kpreid> | > (-100) `div` 101 |
| 19:42:06 | <lambdabot> | -1 |
| 19:42:07 | <augustss> | endojelly: it's not easy to find where an exception is thrown. furthermore, I'm not even sure what it means |
| 19:42:09 | <roconnor> | > floor (toRational x / 11) |
| 19:42:10 | <lambdabot> | * Exception: not a number |
| 19:42:11 | <kpreid> | that's floor |
| 19:42:22 | <mauke> | flipflap: floor (fromIntegral x / 11) |
| 19:42:28 | <Twey> | flipflap: cratesOfBeer x = x `divMod` 11 |
| 19:42:37 | <flipflap> | Works even |
| 19:42:42 | <roconnor> | flipflap: I strongly recommend div in this case |
| 19:42:42 | <flipflap> | Thankies! |
| 19:42:52 | <flipflap> | :/ |
| 19:42:57 | <Twey> | cratesOfBeer = (`divMod` 11) |
| 19:42:58 | <wh1t3> | why are you dividing by 11? :/ |
| 19:43:04 | <Berengal> | > (-1) `quot` 2 |
| 19:43:05 | <lambdabot> | 0 |
| 19:43:07 | <flipflap> | 11 bottles in a crate |
| 19:43:09 | <roconnor> | flipflap: div and mod go together like bacon and eggs |
| 19:43:12 | <flipflap> | In my case |
| 19:43:14 | <futurestack> | it's a drinker's dozen |
| 19:43:19 | <Twey> | Hehe, aye |
| 19:43:24 | <wh1t3> | hmmm, we get 24 in a crate |
| 19:43:31 | <flipflap> | I wanna move there |
| 19:43:34 | <wh1t3> | :P |
| 19:43:34 | <roconnor> | @hoogle divMod |
| 19:43:34 | <lambdabot> | Prelude divMod :: Integral a => a -> a -> (a, a) |
| 19:43:34 | <lambdabot> | Data.Fixed divMod' :: (Real a, Integral b) => a -> a -> (b, a) |
| 19:43:36 | <scriptdevil> | Do named records use destructive updating? :o Or do they use references |
| 19:43:44 | <roconnor> | oh, there is a divMod |
| 19:43:45 | <povman> | wh1t3: he drinks 13 of them on the way home |
| 19:43:48 | <Twey> | scriptdevil: No, it's non-destructive |
| 19:43:52 | <Twey> | roconnor: Yes. :-P |
| 19:43:57 | <roconnor> | 23 `divMod` 11 |
| 19:44:00 | <flipflap> | It works, yay |
| 19:44:00 | <roconnor> | > 23 `divMod` 11 |
| 19:44:01 | <Twey> | 21:44:13 < Twey> cratesOfBeer = (`divMod` 11) |
| 19:44:02 | <lambdabot> | (2,1) |
| 19:44:02 | <endojelly> | hmm. |
| 19:44:12 | <endojelly> | how do I use cabal to install a version of mtl with profiling enabled? |
| 19:44:13 | <scriptdevil> | Twey: But then x changes |
| 19:44:20 | <Twey> | scriptdevil: It doesn't ‘change’ per se |
| 19:44:33 | <scriptdevil> | endojelly: Use Setup.hs options |
| 19:44:33 | <Twey> | It returns a new record with the specified fields different from the original |
| 19:44:38 | <roconnor> | Twey: ah right, divMod is going to be faster than div and mod |
| 19:44:43 | <Twey> | roconnor: *nod* |
| 19:44:44 | <flipflap> | @src divMod |
| 19:44:44 | <augustss> | and quotRem |
| 19:44:44 | <lambdabot> | Source not found. Where did you learn to type? |
| 19:44:49 | <flipflap> | ACTION slaps lambdabot around a bit with a large trout |
| 19:44:51 | <Twey> | Also neater :) |
| 19:45:19 | <endojelly> | scriptdevil, which Setup.hs? without profiling I just do "cabal install mtl" |
| 19:45:28 | <augustss> | And quotRem is going to be even faster |
| 19:45:31 | <endojelly> | and now I additionally want mtl with profiling |
| 19:45:43 | <Saizan> | endojelly: cabal install mtl -p --reinstall |
| 19:46:03 | <endojelly> | Saizan, that doesn't fuck up the existing mtl package? |
| 19:46:07 | <roconnor> | quotRem is faster than divMod? |
| 19:46:10 | <Twey> | augustss, what is quot? |
| 19:46:15 | <Twey> | Oh, quotient |
| 19:46:22 | <Twey> | :t quot |
| 19:46:23 | <lambdabot> | forall a. (Integral a) => a -> a -> a |
| 19:46:35 | <Saizan> | endojelly: it'll rebuild and reinstall it |
| 19:46:44 | <endojelly> | Saizan, thx! |
| 19:46:49 | <wh1t3> | > quot 3 4 |
| 19:46:51 | <lambdabot> | 0 |
| 19:46:52 | <Saizan> | endojelly: whih might break packages that depend on mtl |
| 19:46:57 | <Twey> | What's the difference between quot and div? |
| 19:47:00 | <xenoblitz> | Hi people. I am using the graphics library HGL. For some reason on one machine I am getting "Could not find module `Graphics.HGL' " while on another I don't have this problem. I am using Windows... any ideas on what might be going on? |
| 19:47:06 | <augustss> | Twey: different behaviour for signed numbers |
| 19:47:08 | <Saizan> | endojelly: however, how did you get the mtl package in the first place? |
| 19:47:10 | <Twey> | Ah |
| 19:47:19 | <augustss> | or negative, i should say |
| 19:47:30 | <Twey> | div rounds towards zero? |
| 19:47:36 | <endojelly> | Saizan, haskell-platform |
| 19:47:38 | <wh1t3> | quot is truncated |
| 19:47:43 | <wh1t3> | div is to negative infinity |
| 19:47:44 | <endojelly> | Saizan, (so via cabal) |
| 19:47:51 | <Twey> | > -7 `div` 2 |
| 19:47:52 | <lambdabot> | -3 |
| 19:47:58 | <Twey> | To zero |
| 19:48:00 | <augustss> | Twey: quot behaves like the hardware does on almost all machines |
| 19:48:10 | <Twey> | > -7 `quot` 2 |
| 19:48:11 | <wh1t3> | quot is truncated to zero, div towards negative infinity |
| 19:48:11 | <lambdabot> | -3 |
| 19:48:13 | <augustss> | > (-7) `div` 2 |
| 19:48:14 | <lambdabot> | -4 |
| 19:48:16 | <Twey> | Huh |
| 19:48:18 | <roconnor> | why is hardware so broken? |
| 19:48:26 | <Twey> | Oh |
| 19:48:28 | <Twey> | Duh |
| 19:48:30 | <Twey> | I hate that |
| 19:48:34 | <Twey> | roconnor: *laughs* |
| 19:48:38 | <Twey> | Yeah |
| 19:48:38 | <Saizan> | endojelly: it's stange that it doesn't also install the profiling libraries, but i've not used it yet |
| 19:48:44 | <augustss> | Twey: you need (-7) |
| 19:48:48 | <Twey> | ACTION nods. |
| 19:48:52 | <endojelly> | Saizan, well it seemed to work... almost: |
| 19:48:53 | <Twey> | Still catches me out |
| 19:48:54 | <Deewiant> | > (-7) `quot` 2 |
| 19:48:56 | <lambdabot> | -3 |
| 19:48:58 | <endojelly> | /usr/bin/ld: cannot find -lHSrts_debug_p |
| 19:49:02 | <augustss> | roconnor: it's not broken, it's different. :) |
| 19:49:06 | <Twey> | (more proof that we need whitespace-sensitivity on operators!) |
| 19:49:11 | <Saizan> | xenoblitz: ghc-pkg list HGL reports anything on that machine? |
| 19:49:23 | <wh1t3> | in this case it will ofcourse never matter... |
| 19:49:29 | <augustss> | roconnor: NS32K is the only hardware I know of that provided both modes. |
| 19:49:58 | <xenoblitz> | Saizan: let me try |
| 19:49:59 | <roconnor> | bah, the Haskell Platform has the mtl. |
| 19:50:27 | <Twey> | Why is that worthy of a ‘bah’? |
| 19:51:10 | <endojelly> | Saizan, so now I compiled my project with profiling but without debug. I guess that's enough. |
| 19:51:20 | <edwardk> | roconnor hates the MonadState instance for ContT |
| 19:51:28 | <Twey> | Ah |
| 19:51:37 | <heltav> | hmm anyone want OpenCV bindings? |
| 19:51:49 | <xenoblitz> | Saizan: it reports just: C:/Compilers/GHC/ghc-6.10.1\package.conf: and nothing else ... is that ok? |
| 19:51:50 | <heltav> | facedetect :: Image -> Maybe Face |
| 19:52:04 | <Saizan> | xenoblitz: no, that means the HGL lib is not installed there |
| 19:52:23 | <xenoblitz> | does HGL come with GHC and/or Hugs? |
| 19:52:29 | <roconnor> | Twey: that and the class members appear to be arbitrary, stupid, and in some cases broken. |
| 19:52:36 | <endojelly> | -xc Show current cost centre stack on raising an exception |
| 19:52:36 | <Saizan> | no, you've to install it from hackage |
| 19:52:39 | <endojelly> | that sounds good |
| 19:52:48 | <edwardk> | roconnor: which other ones are broken? |
| 19:52:51 | <heltav> | hmm anyone want OpenCV(open computer vision) bindings? |
| 19:53:01 | <roconnor> | I applaud the mtl for getting monad transformers rolling, but we need to move on. |
| 19:53:11 | <xenoblitz> | Saizan: would installing it via the HGL website be ok? |
| 19:53:12 | <roconnor> | edwardk: let me check |
| 19:53:45 | <Twey> | Never heard of it |
| 19:53:57 | <augustss> | roconnor: so make something better so we can move on |
| 19:54:00 | <Saizan> | xenoblitz: i'd install it from the tarball here: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HGL |
| 19:54:08 | <Twey> | heltav: That looks cool |
| 19:54:09 | <roconnor> | edwardk: I'm deeply suspicious of pass |
| 19:54:20 | <roconnor> | augustss: I suggest using monadLib |
| 19:54:45 | <roconnor> | but I haven't looked at all of the offerings on hackage yet. |
| 19:55:12 | <augustss> | roconnor: maybe I'll give it a try |
| 19:55:36 | <roconnor> | the mmtl is another potential candidate |
| 19:55:36 | <xenoblitz> | Saizan: its a bit problematic to tell 1st year students to install it via cabal on a windows system (I'm TA-ing) |
| 19:55:42 | <roconnor> | I haven't looked at it much though |
| 19:56:16 | <Twey> | xenoblitz: *shrug* Apply a batch file |
| 19:56:19 | <roconnor> | there is also monad-ran, hot off the presses |
| 19:56:33 | <xenoblitz> | Twey: yeah probably the way to go at this point. Thanks guys |
| 19:56:36 | <Saizan> | xenoblitz: since yesterday you can point them to the haskell platform installer :) |
| 19:56:39 | <augustss> | roconnor: you can't just say that something is bad without giving us an alternative. that will never make people switch |
| 19:56:41 | <roconnor> | oh wait, monad-ran isn't a monad library |
| 19:56:43 | <Saizan> | xenoblitz: which comes with cabal-install |
| 19:56:55 | <edwardk> | roconnor: pass clearly separates two monadic layers |
| 19:56:56 | <xenoblitz> | Saizan: Hmmm I'll look it up :) Thanks guys. |
| 19:57:07 | <roconnor> | augustss: okay. monadLib then. |
| 19:57:21 | <edwardk> | roconnor: monad-ran intentionally duplicates the MTL operations and requires the MTL ;) |
| 19:57:25 | <ksf> | http://pastebin.com/m5be82c98 |
| 19:57:27 | <roconnor> | If I must decide right now. |
| 19:57:40 | <ksf> | ACTION would open a beer if he didn't have to go outside to fetch one to do that. |
| 19:57:44 | <roconnor> | <edwardk> roconnor: pass clearly separates two monadic layers -- what does this mean? |
| 19:58:05 | <edwardk> | @type pass |
| 19:58:06 | <lambdabot> | forall (m :: * -> *) a w. (MonadWriter w m) => m (a, w -> w) -> m a |
| 19:58:57 | <edwardk> | pass takes a monad and generates another, there is containment there. it shouldn't be _necessary_ to be a writer to have pass but its convenient |
| 19:59:21 | <edwardk> | er i mean it shouldn't be necessary to have pass to be a writer |
| 20:00:24 | <edwardk> | so i agree that pass should be split out into its own class. i'm not a big fan of having the modify and rerun Foo like methods like local, etc. baked into the class for having the property |
| 20:01:25 | <roconnor> | edwardk: there is no MonadWriter w (ContT r m) instance because of pass, IIRC |
| 20:01:33 | <edwardk> | yeah |
| 20:01:51 | <roconnor> | hence my dislike of pass being a member of the class. |
| 20:02:09 | <copumpkin> | ACTION slaps pass |
| 20:02:16 | <edwardk> | a valid complaint. i'd like to see the class split, but there is the whole installed base thing |
| 20:02:38 | <edwardk> | my problem with mmtl etc is they are incompatible with the MTL's existence |
| 20:02:42 | <edwardk> | monadLib i like |
| 20:02:49 | <augustss> | I've never used pass. It seems wrong, somehow. |
| 20:03:02 | <Saizan> | ?type listen |
| 20:03:04 | <lambdabot> | forall (m :: * -> *) a w. (MonadWriter w m) => m a -> m (a, w) |
| 20:03:12 | <edwardk> | it doesn't try to use the same module names and force the dilemma on the user of using any module that uses the MTL or using nicer monads |
| 20:03:33 | <edwardk> | listen is also problematic |
| 20:03:59 | <Saizan> | i end up using both most of the times i use Writer though |
| 20:04:06 | <edwardk> | pretty much any method of the m a -> m b -- form in a MonadFoo is doing something wrong =) |
| 20:04:26 | <Saizan> | to extract the slice of monoid produced by a particular region |
| 20:04:27 | <edwardk> | saizan: sure, but they should be factored out into another class that way more things can use tell |
| 20:04:29 | <heltav> | to use BLAS do i need both fortran and c bindings? |
| 20:04:31 | <Gracenotes> | well, w tends be a monoid implicitly |
| 20:04:49 | <Gracenotes> | not required though, and some cases not implicit. |
| 20:05:54 | <Saizan> | it is required |
| 20:06:29 | <edwardk> | sure, you can roll your own MonadWriter forall o. (a -> w -> o) -> w -> o and plumb in a starting state and _any_ binary operation and still be legal |
| 20:06:55 | <edwardk> | thats because the CPS'd writer will reassociate all of your binds to make it legal ;) |
| 20:06:56 | <Gracenotes> | o nos :O fundep |
| 20:07:21 | <vixey> | btw you are using CBV CPS this whole time right? |
| 20:07:27 | <vixey> | What about CBN CPS? |
| 20:08:25 | <edwardk> | vixey: just a swapping of order in all the instances |
| 20:09:00 | <roconnor> | vixey: you need to teach me what this CBV and CBN CPS stuff is. heck I don't even formally understand CPS. I just know it when I see it. |
| 20:09:04 | <edwardk> | i suppose i could go through monad-ran and rename Ran to CBN or CBV and make the opposite set of instances to go along with it, but man thats a lot of work =) |
| 20:09:28 | <Saizan> | how would one look like? |
| 20:09:40 | <vixey> | roconnor: I only know little bites about CBV CPS, but in-depth talked about CBN CPS and I can't stop thinking about it |
| 20:10:04 | <ivan-kanis> | mauke: thanks for the paste, i was away |
| 20:10:21 | <vixey> | roconnor: I learned about CPS for how to compile scheme (and how to get CWCC) -- there's a talk/slides if you want about that |
| 20:10:23 | <Saizan> | ACTION feels guilty for spreading CBN |
| 20:16:00 | <Twey> | Saizan: What is CBN? |
| 20:16:28 | <edwardk> | Twey: call by name |
| 20:16:34 | <Twey> | Ohh |
| 20:16:41 | <Twey> | Not call-by-need? |
| 20:16:45 | <Saizan> | i was referring to the CPS transformation in particular |
| 20:16:49 | <Twey> | We have call-by-name in Haskell? |
| 20:16:50 | <vixey> | what the hell |
| 20:17:00 | <Saizan> | for call-by-need you also need some form of heap |
| 20:17:39 | <edwardk> | Cont f <*> Cont x = Cont (\k -> f (\g -> g x k)) -- should do the trick for CBN applicative. not sure on bind never wrote one. |
| 20:17:57 | <augustss> | Twey: Haskell has CBN semantics, but not necessarily implementation. |
| 20:19:24 | <Saizan> | ?type let Cont f <*> Cont x = Cont (\k -> f (\g -> g x k)) in (<*>) |
| 20:19:26 | <lambdabot> | forall r t t1 a. Cont r (((t -> t1) -> t1) -> (a -> r) -> r) -> Cont t1 t -> Cont r a |
| 20:20:42 | <edwardk> | CBN CPS is ugly iirc |
| 20:21:19 | <Saizan> | yeah, that types is like Cont r (Cont r a -> Cont r b) -> Cont r a -> Cont r b |
| 20:22:09 | <edwardk> | i may have missed a few 'strip the cont constructors' from that |
| 20:22:41 | <Saizan> | ?type let Cont f <*> x = Cont (\k -> f (\g -> runCont (g x) k)) in (<*>) |
| 20:22:42 | <lambdabot> | forall r t a. Cont r (t -> Cont r a) -> t -> Cont r a |
| 20:23:23 | <edwardk> | ?type let cbn f x k = f (\g -> g x k)) in cbn |
| 20:23:24 | <lambdabot> | parse error on input `)' |
| 20:23:35 | <edwardk> | ?type let cbn f x k = f (\g -> g x k) in cbn |
| 20:23:36 | <lambdabot> | forall t t1 t2 t3. (((t -> t1 -> t2) -> t2) -> t3) -> t -> t1 -> t3 |
| 20:25:34 | <edwardk> | http://www.cs.rutgers.edu/~ccshan/tagless/jfp.pdf had both cbn and cbv cps transforms in it iirc |
| 20:27:04 | <cypher-> | is it possible to produce a thread-safe lock-less queue? |
| 20:27:55 | <Botje> | sure, check out mozart's implementation |
| 20:28:05 | <cypher-> | or more general question: is there a short guide for the dummies (i.e. people like me) to lockless data structures? |
| 20:28:12 | <cypher-> | Botje: where do I find it? |
| 20:30:02 | <Botje> | cypher-: http://www.mozart-oz.org/documentation/tutorial/node9.html#section.stateful.clientserver |
| 20:30:26 | <cypher-> | Botje: thanks! |
| 20:31:18 | <roconnor> | @hoogle unS |
| 20:31:18 | <lambdabot> | module Data.ByteString.Unsafe |
| 20:31:19 | <lambdabot> | module System.IO.Unsafe |
| 20:31:19 | <lambdabot> | Language.Haskell.TH Unsafe :: Safety |
| 20:32:58 | <roconnor> | http://lhc-compiler.blogspot.com/2009/05/constructor-specialization-and-laziness.html |
| 20:33:00 | <edwardk> | ?type let Cont f <*> x = Cont (\k -> f (\g -> k (g x))) in (<*>) |
| 20:33:02 | <lambdabot> | forall r t a. Cont r (t -> a) -> t -> Cont r a |
| 20:33:05 | <roconnor> | ^^ can someone explain this post to me? |
| 20:33:07 | <edwardk> | ah woops |
| 20:36:05 | <edwardk> | ?type let Cont f <*> Cont x = Cont (\k -> f (\f' -> x (\x' -> k (f' x')))) in (<*>) |
| 20:36:06 | <lambdabot> | forall r t a. Cont r (t -> a) -> Cont r t -> Cont r a |
| 20:36:15 | <edwardk> | yay |
| 20:36:38 | <leimy> | Continuations in haskell, I'm just not sure I've found the right way to apply them usefully. I've made code very ugly trying to use them :-) |
| 20:36:48 | <edwardk> | leimy: likewise |
| 20:37:13 | <roconnor> | leimy: laziness negates many uses of continuations |
| 20:37:13 | <leimy> | also, lazy evaluation, seems to allow for some form of automagic continuation behavior. |
| 20:37:21 | <leimy> | roconnor: yep :-) |
| 20:37:43 | <roconnor> | I've used Codensity Monad transformations to make my code faster. |
| 20:38:13 | <dolio> | edwardk: That's regular Cont, no? |
| 20:38:33 | <edwardk> | ?type let test1 f x = Cont (\k -> runCont f (\f' -> runCont x (\x' -> k (f' x')))); test2 f x = Cont (\k -> runCont x (\x' -> runCont f (\f' -> k (f' x')))) in (<*>) |
| 20:38:33 | <roconnor> | I think that is all that I've used continuations for so far. |
| 20:38:34 | <lambdabot> | forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b |
| 20:38:53 | <edwardk> | ?type let test1 f x = Cont (\k -> runCont f (\f' -> runCont x (\x' -> k (f' x')))); test2 f x = Cont (\k -> runCont x (\x' -> runCont f (\f' -> k (f' x')))) in (test1, test2) |
| 20:38:54 | <lambdabot> | forall r a a1 r1 a2 a3. (Cont r (a -> a1) -> Cont r a -> Cont r a1, Cont r1 (a2 -> a3) -> Cont r1 a2 -> Cont r1 a3) |
| 20:39:08 | <heltav> | Ill ask again |
| 20:39:11 | <heltav> | hmm anyone want OpenCV(open computer vision) bindings? |
| 20:39:12 | <edwardk> | there are the two cases |
| 20:39:16 | <edwardk> | and yeah it was |
| 20:39:22 | <olsner> | hehe, "I like languages which say, “No, you don't want to write it the way you’re thinking. There’s a vastly better way to solve this whole class of problems.” Me: brain explodes" |
| 20:40:05 | <leimy> | olsner: languages don't say that... :-) |
| 20:40:26 | <olsner> | I think it's a metaphor :-) |
| 20:40:48 | <edwardk> | leimy: are you sure? i thought i heard ghc talking to me on at least one occasion |
| 20:40:56 | <leimy> | heh |
| 20:41:00 | <edwardk> | oh wait. its usually GHC that says "my brain exploded" =) |
| 20:41:04 | <leimy> | right |
| 20:41:09 | <edwardk> | i got that backwards |
| 20:41:26 | <dolio> | @quote exploded |
| 20:41:27 | <lambdabot> | ghc says: My brain just exploded. |
| 20:41:32 | <edwardk> | i used to love that error message, does it still happen? |
| 20:41:56 | <dolio> | I think so. Isn't it for using 'let' with existential types? |
| 20:42:05 | <edwardk> | ah |
| 20:42:27 | <leimy> | Aren't existential types those people who can't figure out their purpose? |
| 20:42:35 | <edwardk> | yeah |
| 20:42:41 | <yitz> | ghc -e 'System.Cmd.system "say The impossible just happened."' |
| 20:43:03 | <leimy> | on a mac... |
| 20:43:09 | <yitz> | yep |
| 20:43:19 | <dolio> | Yep, checked. It still says that. |
| 20:43:24 | <yitz> | use festival on linux if you'd like. |
| 20:43:35 | <edwardk> | the problem with them, like all existentials is you really don't know what to do with them once you have them. you can't get them to do anything |
| 20:44:05 | <edwardk> | you can force them, and pass them on to someone that will accept them but thats about it. |
| 20:44:34 | <[1]dan> | did anyone notice that YAHT is wrong about the combination of regexps and guards? |
| 20:45:00 | <yitz> | regexps and guards? |
| 20:45:11 | <vixey> | [1]dan I think it's just outdated |
| 20:45:42 | <Cale> | [1]dan: What do you mean about regexps? |
| 20:46:06 | <[1]dan> | sorry meant patterns, not regexps. if you have multiple patterns, and the guards are exhausted on the one pattern, then the next patterns ARE attempted as a match |
| 20:46:22 | <[1]dan> | this is against what is written there |
| 20:46:30 | <[1]dan> | (page 94) |
| 20:46:49 | <Cale> | ah |
| 20:46:58 | <Cale> | @where yaht |
| 20:46:59 | <lambdabot> | PDF: http://darcs.haskell.org/yaht/yaht.pdf Wikibook: http://en.wikibooks.org/wiki/Haskell/YAHT |
| 20:47:03 | <saml> | > let f x | x == 1 = 2 | otherwise = 3 in f 1 |
| 20:47:05 | <lambdabot> | 2 |
| 20:47:40 | <Cale> | Guards are applied in conjunction with pattern matching. When a pattern matches, |
| 20:47:41 | <Cale> | all of its guards are tried, consecutively, until one matches. If none match, then pattern |
| 20:47:41 | <Cale> | matching continues with the next pattern. |
| 20:47:53 | <quicksilver> | "If none match, then pattern |
| 20:47:55 | <quicksilver> | matching continues with the next pattern" |
| 20:48:02 | <quicksilver> | that's right |
| 20:48:46 | <saml> | > let f x | x == 1 = 2 | x == 2 = 3; f 3 = 4; f x = x + 1 in f 3 |
| 20:48:48 | <lambdabot> | 4 |
| 20:48:54 | <[1]dan> | this is the text i have: |
| 20:48:55 | <[1]dan> | One thing to note about guards is that they are tested after pattern matching, not in |
| 20:48:55 | <[1]dan> | conjunction with pattern matching. This means that once a pattern matches, if none of |
| 20:48:55 | <[1]dan> | the guards succeed, further pattern matches will not be attempted. |
| 20:49:06 | <[1]dan> | i guess im looking at an outdated version? :) |
| 20:49:12 | <Cale> | yeah |
| 20:49:30 | <Cale> | I don't think that was ever true. |
| 20:49:36 | <Cale> | But I might be wrong. |
| 20:49:57 | <edwardk> | yeah it shouldn't have ever held |
| 20:50:27 | <Cale> | In some sense the whole point of having guards is to make it easy for pattern matching to continue if they fail. |
| 20:50:43 | <[1]dan> | i looked at the version which is the first match in google for "yet another haskell tutorial", which is at |
| 20:50:44 | <[1]dan> | http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf |
| 20:51:31 | <[1]dan> | so I'm guessing I'm not the only one looking at an outdated version |
| 20:52:11 | <tchakkazulu> | ?hoogle (Ix i, Array a e) => (i,i) -> (i -> e) -> a i e |
| 20:52:11 | <lambdabot> | Warning: Unknown class Array |
| 20:52:11 | <lambdabot> | Data.Array.Base ixmap :: (IArray a e, Ix i, Ix j) => (i, i) -> (i -> j) -> a j e -> a i e |
| 20:52:11 | <lambdabot> | Data.Array.IArray ixmap :: (IArray a e, Ix i, Ix j) => (i, i) -> (i -> j) -> a j e -> a i e |
| 20:52:18 | <tchakkazulu> | ?hoogle (Ix i, IArray a e) => (i,i) -> (i -> e) -> a i e |
| 20:52:18 | <lambdabot> | Data.Array.Base ixmap :: (IArray a e, Ix i, Ix j) => (i, i) -> (i -> j) -> a j e -> a i e |
| 20:52:18 | <lambdabot> | Data.Array.IArray ixmap :: (IArray a e, Ix i, Ix j) => (i, i) -> (i -> j) -> a j e -> a i e |
| 20:52:18 | <lambdabot> | Data.Array.Base amap :: (IArray a e', IArray a e, Ix i) => (e' -> e) -> a i e' -> a i e |
| 20:52:18 | <Cale> | It's interesting that he provides a concrete example of that failing. |
| 20:52:27 | <[1]dan> | yup |
| 20:52:57 | <[1]dan> | mm, i guess someone should tell the host to update their version |
| 20:53:32 | <Cale> | Both hugs and ghci fall through, and the standard I'm pretty sure says that they should as well. |
| 20:56:33 | <Cale> | yes... "If all the guards evaluate to False, matching continues with the next alternative." -- Haskell Report |
| 20:57:08 | <povman> | Hi all - I have some interesting behaviour with Reactive! |
| 20:57:10 | <povman> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2349#a2349 |
| 20:58:08 | <Cale> | ACTION looks |
| 20:58:28 | <Cale> | Oh, you're working on an SDL interface? |
| 20:58:46 | <povman> | Is there anything obviously wrong with what I'm doing there? In particular, the program just prints "0.0" at what seems to be arbitrary times, regardless of me pressing keyboard keys |
| 20:58:50 | <povman> | Cale: yes! |
| 20:59:02 | <Cale> | Did you not want to include the rest of your file? |
| 20:59:16 | <povman> | It's split into separate files |
| 20:59:28 | <povman> | that's all i really have at the moment though |
| 20:59:47 | <Cale> | I suppose I can try to guess the imports |
| 20:59:52 | <povman> | ah fine |
| 21:00:21 | <povman> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2349#a2350 |
| 21:00:29 | <Cale> | Thanks :) |
| 21:01:08 | <[1]dan> | well, i sent the author an email so hopefully he updates the version on his site |
| 21:01:27 | <[1]dan> | so more people can enjoy learning haskell as correctly as possible ;) |
| 21:01:41 | <povman> | If I make 'updater' to print the value of boxAccel, it prints -1 and 1 when i press a and s |
| 21:02:04 | <povman> | but with boxVelocity, it randomly prints 0.0 |
| 21:03:19 | <Phyx-> | I'm having a little problem, when i try to use a function that has a certain type signature, it tells me, i'm missing an instance, but it's there. if i add a new one, it tells me error on overlapping instances :S |
| 21:03:39 | <Twey> | Perhaps you're not using the instance you think you're using. |
| 21:03:42 | <Botje> | can you put your code somewhere? |
| 21:03:52 | <Cale> | Well, I'm not sure, but you're calling updater on every time through the quitLoop... |
| 21:04:02 | <povman> | is this bad? |
| 21:04:22 | <Cale> | povman: I'm not sure, but it seems like it might be responsible for that printing? |
| 21:04:22 | <ManateeLazyCat> | Phyx-: Paste your code and error, then people can help you. |
| 21:05:11 | <povman> | The behaviour I expect is that it repeatedly prints decreasing values when i press a |
| 21:05:16 | <Phyx-> | ManateeLazyCat: which is a full page full of instances that need eachother |
| 21:05:45 | <povman> | Phyx-: http://moonpatio.com |
| 21:06:05 | <Leftblank> | Say I want to sort a list of custom data in a non-standard way; I understand I'll probably need to write my own instance Ord - but where do I find a tutorial/manpage to get started with that? |
| 21:06:34 | <Berengal> | @type sortBy |
| 21:06:36 | <lambdabot> | forall a. (a -> a -> Ordering) -> [a] -> [a] |
| 21:06:41 | <Berengal> | Leftblank: ^^ |
| 21:06:52 | <povman> | Cale: is that how you would have written boxVelocity? |
| 21:07:17 | <Twey> | Leftblank: You don't have to |
| 21:07:27 | <Twey> | Leftblank: You can use sortBy, for example |
| 21:08:04 | <Leftblank> | thanks Twey & Berengal, but I can't seem to find a way to combine that with my custom fields and the getter-like methods Haskell generates |
| 21:08:17 | <Twey> | > sortBy (comparing snd) [('a', 2), ('c', 3), ('b', 1)] |
| 21:08:19 | <lambdabot> | [('b',1),('a',2),('c',3)] |
| 21:08:36 | <Twey> | Replace snd with the function of your choice to retrieve the value you want to compare |
| 21:08:41 | <Leftblank> | bingo, thanks Twey |
| 21:08:52 | <Cale> | comparing is defined in Data.Ord |
| 21:08:58 | <lament> | :t comparing |
| 21:08:59 | <Cale> | and sortBy is in Data.List |
| 21:08:59 | <lambdabot> | forall b a. (Ord a) => (b -> a) -> b -> b -> Ordering |
| 21:09:20 | <Twey> | Only use Ord for the main way you'd expect your datatype to be compared |
| 21:09:26 | <mauke> | and if you have multiple sort criteria, see mappend |
| 21:09:33 | <Leftblank> | mk, thanks |
| 21:09:37 | <Leftblank> | I'll dive into that |
| 21:09:43 | <heltav> | so if I do a binding to the OpenComputerVision project via FFI how do I publish it on Hackage? |
| 21:09:51 | <Cale> | povman: It's not far off, but I've only used higher-level interfaces to Reactive without looking at how they're implemented. |
| 21:09:58 | <Phyx-> | where can i find out what "IncoherentInstances" does? the ghc manual only mentions it, doesn't explain it |
| 21:10:07 | <ManateeLazyCat> | How long hpaste.org contain paste? |
| 21:10:21 | <heltav> | just the FFI and OpenCV has to be downloaded separately? |
| 21:11:53 | <povman> | Cale: I haven't tried the other adapters yet - I presume the equivalent of my boxVelocity would work fine on them? |
| 21:12:17 | <povman> | (In which case it is my adapter which is broken, and not reactive) |
| 21:12:25 | <Cale> | Phyx-: it does explain it in the section about overlapping instances |
| 21:12:32 | <Cale> | http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#instance-overlap |
| 21:13:30 | <heltav> | is Reative = event driven programming? |
| 21:13:30 | <heltav> | for GUIs? |
| 21:13:52 | <Phyx-> | Cale: ah, right, thanks, i was looking in the language extensions part |
| 21:14:23 | <Twey> | Not just for GUIs |
| 21:14:25 | <Cale> | povman: yeah... |
| 21:14:40 | <Cale> | povman: Somehow I'd never run into stepper before, but it seems fine |
| 21:15:20 | <ManateeLazyCat> | Bye all, good night! |
| 21:15:24 | <Cale> | heltav: It's more like a combination of event driven and signal processing. |
| 21:16:07 | <Cale> | heltav: You have events, which are like discrete sequences of time/value pairs, and then there are behaviours which are like functions of time. |
| 21:16:35 | <Cale> | Things like mouse clicks are events, things like the location of the mouse are behaviours. |
| 21:18:37 | <monadic_kid> | basically some values are really functions of time, thats what behaviours are |
| 21:19:15 | <heltav> | ok cool |
| 21:19:38 | <heltav> | and it works good? |
| 21:19:46 | <monadic_kid> | they mimick what the actual maths says. We are functional programmers, we program with functions as values, why shouldn't this be the case for values that really are functions! |
| 21:20:04 | <heltav> | for an mp3player this might be good? you could setup a behaviour for songFinished etc |
| 21:20:50 | <Cale> | There might be a behaviour for the time in the track which is currently playing, and an event for when the song finishes. |
| 21:21:28 | <Cale> | Behaviours have a value all the time, and you can always observe it. Events just happen sometimes. |
| 21:21:42 | <monadic_kid> | heltav:when you start to think this "varible" is really a function of time then the most obvious *varibles* are things like displacement, velocity, acceleration |
| 21:21:58 | <monadic_kid> | *variables |
| 21:22:04 | <monadic_kid> | ACTION shots himself |
| 21:22:30 | <Cale> | The idea behind FRP is to allow you to express the output of your program directly in terms of these behaviours and events, and allow the library to handle the task of keeping everything up to date. |
| 21:22:52 | <Cale> | Generally the output of your program is another bunch of behaviours and events. |
| 21:23:03 | <Berengal> | Speaking of reactive, I'm having some trouble cabal-installing it |
| 21:23:29 | <ksf> | has it bit-rotted, by now? |
| 21:23:32 | <Cale> | Berengal: It can be tricky at the moment, the current versions of everything don't agree, you have to take older versions of some things |
| 21:23:50 | <Berengal> | Cale: Yeah, I figured. Stream seems like a likely candidate |
| 21:24:23 | <monadic_kid> | is it a build issue? because all you need to do is get the older version of a particular package then install Stream and then you can update and install the rest |
| 21:24:35 | <monadic_kid> | thats what i had to do |
| 21:24:35 | <Berengal> | Of course, if someone has another suggestion for a good FRP library I could check out, that'd be fine too |
| 21:24:38 | <Cale> | Berengal: I'll make you a paste of what versions of everything I have installed |
| 21:24:47 | <ksf> | Berengal, elerea |
| 21:24:53 | <Cale> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2351#a2351 |
| 21:24:54 | <ksf> | it's the newest of the bunch. |
| 21:25:04 | <ksf> | yampa is the most stable |
| 21:25:11 | <monadic_kid> | Cale: i did it recently, it's an issues with the various dependancies and the version of QuickCheck they & reactive depend on |
| 21:25:21 | <Berengal> | Cale: Thanks |
| 21:26:08 | <Cale> | iirc, it's important that it's vector-space-0.5 |
| 21:26:10 | <Berengal> | ksf: I'll check them out |
| 21:26:28 | <ksf> | packages should be somehow free not to depend on quickcheck if you don't want to test stuff. |
| 21:26:29 | <Jedai> | Berengal: just add -constraint=Stream <= 0.3 or whatever |
| 21:26:42 | <Cale> | and I think the first time I tried to install it, Cabal picked this really old version of reactive-glut to try to install |
| 21:26:46 | <Cale> | So watch out for that |
| 21:26:49 | <Phyx-> | ok, i got my problem worded a better way http://hpaste.org/fastcgi/hpaste.fcgi/save |
| 21:26:50 | <Berengal> | Jedai: Ah, thanks. Looks like it should work. |
| 21:26:52 | <Phyx-> | err |
| 21:27:05 | <Berengal> | i've been given choices now though, so my problem has been replaced by an even bigger one |
| 21:27:17 | <Phyx-> | ok, i got my problem worded a better way http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4668 |
| 21:27:20 | <monadic_kid> | Yampa is stable but it takes the elegance out of FRP |
| 21:27:27 | <Phyx-> | I don't know what might be cauzing that |
| 21:27:29 | <monadic_kid> | it looks brain damaged |
| 21:27:49 | <Cale> | Arrows tend not to be very elegant. |
| 21:28:42 | <Cale> | Phyx-: The problem is that it can't tell that 42 is an Int |
| 21:28:52 | <Cale> | Phyx-: For all it knows, it might be a Double or something else |
| 21:29:09 | <Cale> | Phyx-: Try adding an explicit type signature to the 42 |
| 21:29:14 | <povman> | Berengal: I like Reactive :D |
| 21:29:16 | <comex> | if I have, e.g., 'data SomeType = A Bool | B Int', is there a function that can tell me whether a SomeType is an A or a B? |
| 21:29:29 | <comex> | say, I want to filter out all As |
| 21:29:37 | <mauke> | comex: no, but you can write it yourself |
| 21:29:43 | <monadic_kid> | comex: you can make a function that pattern matches that yourself |
| 21:29:47 | <comex> | okay |
| 21:29:56 | <heltav> | it failed for me to weird dependecnes |
| 21:29:58 | <Phyx-> | Cale: looks like i've been bitten by ghci again :P |
| 21:29:58 | <ksf> | ..or you can just use Either Bool Int |
| 21:30:14 | <Cale> | comex: [x | A x <- myList] |
| 21:30:19 | <Phyx-> | completely forgot that it doesn't type 42 to an Int but a Num |
| 21:30:21 | <Cale> | Is a handy way to do that filtering |
| 21:30:44 | <monadic_kid> | comex: isA (A _ ) = True; isA (B _ ) = False |
| 21:31:00 | <Cale> | Phyx-: It's not just ghci |
| 21:31:01 | <Lemmih> | isA A{} = True; isA _ = False |
| 21:31:17 | <comex> | yeah, I just wanted to avoid a pointless function |
| 21:31:35 | <Cale> | comex: You can do my list comprehension |
| 21:31:36 | <comex> | Cale: thanks |
| 21:31:40 | <monadic_kid> | comex: Lemmih's version is better |
| 21:31:40 | <Phyx-> | Cale: wouldn't ghc normal detect in this case that it should be an Int? |
| 21:32:25 | <tiglionabbit> | for my first ever haskell web application, would you recommend I use happs or something else? |
| 21:32:53 | <Cale> | Phyx-: Only if there's a type signature somewhere. |
| 21:33:22 | <Cale> | Phyx-: And it usually wouldn't default to Int, but Integer, though it doesn't do defaulting when there are non-Prelude typeclasses present. |
| 21:33:27 | <heltav> | why does htis work |
| 21:33:31 | <povman> | tiglionabbit: I could NOT understand happs. The documentation is lacking. IMO you're better off getting a cgi library and doing it yourself |
| 21:33:45 | <heltav> | > [x | Just x <- [Just 5, Just 7, Nothing]] |
| 21:33:46 | <lambdabot> | [5,7] |
| 21:33:53 | <heltav> | > [x | x <- [Just 5, Just 7, Nothing]] |
| 21:33:55 | <lambdabot> | [Just 5,Just 7,Nothing] |
| 21:33:56 | <povman> | (unless it's been given some love in the last year) |
| 21:34:07 | <skorpan> | > map fromMaybe [Just 4, Just 3] |
| 21:34:08 | <lambdabot> | Overlapping instances for Show (Maybe (Maybe t) -> Maybe t) |
| 21:34:08 | <lambdabot> | aris... |
| 21:34:10 | <heltav> | > [x | Nothing <- [Just 5, Just 7, Nothing,Nothing]] |
| 21:34:10 | <skorpan> | darn it |
| 21:34:11 | <lambdabot> | [x,x] |
| 21:34:14 | <skorpan> | :t fromMaybe |
| 21:34:15 | <lambdabot> | forall a. a -> Maybe a -> a |
| 21:34:18 | <skorpan> | :t fromJust |
| 21:34:19 | <lambdabot> | forall a. Maybe a -> a |
| 21:34:21 | <heltav> | > [x | Nothing <- [Just 5, Just 7, Nothing,Nothing]] |
| 21:34:23 | <lambdabot> | [x,x] |
| 21:34:25 | <skorpan> | > map fromJust [Just 4, Just 3] |
| 21:34:26 | <lambdabot> | [4,3] |
| 21:34:28 | <heltav> | eh, x,x? |
| 21:34:37 | <Phyx-> | Cale: yeah, I know it would default to Integer, but didn't know it won't do that when non prelude typeclasses are present. Also good to know, thanks |
| 21:34:42 | <skorpan> | heltav: Nothing matches twice |
| 21:34:50 | <Cale> | heltav: It's the simplereflect package ;) |
| 21:34:50 | <heltav> | yes but x |
| 21:34:54 | <mauke> | > x |
| 21:34:55 | <lambdabot> | x |
| 21:34:57 | <vixey> | > y |
| 21:34:58 | <lambdabot> | y |
| 21:35:01 | <Cale> | > foldr f z [a,b,c] |
| 21:35:03 | <lambdabot> | f a (f b (f c z)) |
| 21:35:03 | <heltav> | shouldnt it cimplan x doesnt exist? |
| 21:35:10 | <skorpan> | heltav: lambdabot "knows" about it |
| 21:35:11 | <skorpan> | :t x |
| 21:35:11 | <mauke> | heltav: yes, but x actually exists here |
| 21:35:12 | <heltav> | > x |
| 21:35:12 | <heltav> | > x+1 |
| 21:35:12 | <saml> | > let isJust Just{} = True; isJust _ = False in isJust (Just 1) |
| 21:35:14 | <lambdabot> | Expr |
| 21:35:15 | <lambdabot> | x + 1 |
| 21:35:15 | <lambdabot> | True |
| 21:35:16 | <lambdabot> | x |
| 21:35:20 | <Cale> | heltav: All the single letter variables are defined as things which print as themselves |
| 21:35:24 | <saml> | what is Just{} ? |
| 21:35:31 | <vixey> | (Just _) |
| 21:35:33 | <saml> | is it same as (Just _) ? |
| 21:35:55 | <Cale> | saml: It's similar, but robust in the face of changes to the number of parameters to Just |
| 21:36:03 | <Cale> | (not that that would ever happen in that case) |
| 21:36:40 | <Cale> | (A {}) works even when A is not defined to use the record syntax |
| 21:36:58 | <skorpan> | that's the best feature ever... |
| 21:37:04 | <Cale> | and matches anything constructed with A without implying anything about the number of parameters |
| 21:38:17 | <saml> | that could be useful for cases where you dont' have to unpack data elements |
| 21:42:57 | <Phyx-> | I have a nother question http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4669 <-- explained more there with the code |
| 21:45:25 | <Cale> | Phyx-: Well, enabling IncoherentInstances is rarely the right answer... |
| 21:45:31 | <Cale> | Phyx-: But I don't know. |
| 21:46:40 | <Phyx-> | Cale: yeah, i don't want to enable it since it could hide possble problems that might come up once i keep adding instances |
| 21:47:44 | <Cale> | What is the idea behind these typeclasses? |
| 21:49:29 | <Phyx-> | Well, this is mostly a uni assignment, why i'm not asking answers but just general ideas. But basically EMGM, where Logic is some kind of fixed point datatype. which is why i need to define (a (Logic a)) aswell when trying to define (Logic a) |
| 21:52:31 | <heltav> | what should FFIs link to? object files? |
| 21:54:08 | <badtruffle> | huh? |
| 21:56:32 | <heltav> | if a C function does side-effects like printing, how does that work with haskell? are all FFI calls in the IO Monad? |
| 21:56:53 | <heltav> | or is it your responsibility to intriduce them correctly to haskell? |
| 21:57:12 | <heltav> | ie can FFI poison the typesystem? |
| 21:57:18 | <heltav> | as in break referential transparency |
| 21:57:36 | <glguy> | ffi calls are in IO if you say they are |
| 21:57:40 | <glguy> | and you should say they are if they are :) |
| 21:58:29 | <mauke> | heltav: yes, FFI can break your program |
| 22:16:34 | <heltav> | why isnt all FFI callsforced into the IO monad? |
| 22:16:43 | <heltav> | convenience? |
| 22:16:50 | <mauke> | some functions are pure |
| 22:16:52 | <Twey> | Because many of them are pure |
| 22:17:01 | <Twey> | That's what unsafePerformIO is for |
| 22:17:21 | <Twey> | It allows the developer to decide what's pure and what isn't, since Haskell obviously can't type-check other languages |
| 22:17:57 | <heltav> | when you malloc and free inside a function do you do them in the io monad then? nothing special else? |
| 22:18:39 | <Cale> | They should be in the IO monad if they have side effects. |
| 22:19:06 | <Cale> | Basically, it's only okay to unsafePerformIO things which compute proper mathematical functions whose results only depend on their inputs. |
| 22:20:19 | <heltav> | yes but mallocing and freeing is no problem? |
| 22:20:22 | <mux> | Cale: even then, I find it more satisfying to use the ST monad and runST if possible |
| 22:20:38 | <Cale> | heltav: if the same function does both. |
| 22:20:59 | <Cale> | heltav: I suppose it's also possible to put the free into a finaliser |
| 22:21:49 | <Cale> | heltav: so you create an opaque value returned from the FFI wrapper which contains the pointer to the allocated memory, and which when garbage collected will call free. |
| 22:21:56 | <ksf> | if someone needs a program to work on, the unix world could use a new xkeycaps. |
| 22:22:02 | <Twey> | heltav: So long as it's semantically pure |
| 22:22:21 | <Twey> | ksf: *nods* I thought of that myself. I don't need it that badly, though. |
| 22:22:39 | <Twey> | heltav: Basically, if the calling code isn't affected by the side effects, they can be ignored |
| 22:23:38 | <heltav> | so I tried to se what happens if I make a pure function do sideeffects |
| 22:23:43 | <heltav> | it seems they were just ignored... |
| 22:24:18 | <nominolo> | @seen ndm |
| 22:24:19 | <lambdabot> | I haven't seen ndm. |
| 22:24:36 | <Twey> | heltav: They'll be performed if you force evaluation, but not otherwise |
| 22:25:20 | <HeavensRevenge> | hello |
| 22:25:55 | <HeavensRevenge> | how can i use a result of a function as the next argument of an itertion... |
| 22:26:19 | <monadic_kid> | HeavensRevenge: accumlator style function i think you want |
| 22:26:33 | <HeavensRevenge> | something like... [x*x | x <- [2,x..]] |
| 22:27:00 | <HeavensRevenge> | im havin a hard time tryin to think this out |
| 22:27:03 | <pshc> | This is weird... I've got myList :: [(String, MyParser ())] in my module which works fine, but when I try to do map fst myList, ghc complains about illegal overloaded type signatures in a binding group that falls under the monomorphism restriction (gasp!) |
| 22:27:14 | <Twey> | HeavensRevenge: Define ‘iteration’ |
| 22:27:24 | <Twey> | Also see iterate |
| 22:27:26 | <Twey> | :t iterate |
| 22:27:27 | <lambdabot> | forall a. (a -> a) -> a -> [a] |
| 22:27:29 | <pshc> | How is it that only asking for the String parts causes this error :( |
| 22:27:30 | <Twey> | e.g. |
| 22:27:36 | <Twey> | > iterate (*2) 1 |
| 22:27:37 | <lambdabot> | [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,... |
| 22:27:50 | <HeavensRevenge> | hmm |
| 22:28:00 | <Berengal> | There's also until |
| 22:28:06 | <Berengal> | > until (==10) (+1) 0 |
| 22:28:07 | <lambdabot> | 10 |
| 22:28:15 | <Twey> | Aye |
| 22:28:55 | <Berengal> | > until ((>20).length) show "" |
| 22:28:56 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\"" |
| 22:29:07 | <HeavensRevenge> | ok, but use the result as the argument, damn close tho!!! |
| 22:29:10 | <monadic_kid> | HeavensRevenge: if you want to know how to write such functions you want read abouve accumlative functions |
| 22:29:36 | <Twey> | HeavensRevenge: Both those functions use the result of the function as the argument to the function to generate the next one |
| 22:29:40 | <HeavensRevenge> | its more of a recursive replacement |
| 22:29:56 | <HeavensRevenge> | every time its recursed, replace the arguments with the result.. |
| 22:30:10 | <HeavensRevenge> | if that makes more sense |
| 22:30:17 | <Twey> | Not much |
| 22:30:29 | <Twey> | Write us some pseudo-code |
| 22:30:44 | <monadic_kid> | i'm sure he just means accumlators |
| 22:30:46 | <HeavensRevenge> | take 4 iterate (*2) 1 |
| 22:30:54 | <HeavensRevenge> | > take 4 iterate (*2) 1 |
| 22:30:55 | <lambdabot> | Couldn't match expected type `[a]' |
| 22:31:00 | <Twey> | > take 4 (iterate (*2) 1) |
| 22:31:02 | <lambdabot> | [1,2,4,8] |
| 22:31:11 | <Twey> | > take 4 $ iterate (*2) 1 -- a.k.a. |
| 22:31:12 | <lambdabot> | [1,2,4,8] |
| 22:31:27 | <HeavensRevenge> | ok that should be [1,2,4,16,256..] |
| 22:31:46 | <HeavensRevenge> | except no 1 at the beginning |
| 22:31:47 | <mauke> | > iterate (^2) 2 |
| 22:31:48 | <HeavensRevenge> | start from 2 |
| 22:31:48 | <lambdabot> | [2,4,16,256,65536,4294967296,18446744073709551616,3402823669209384634633746... |
| 22:32:38 | <HeavensRevenge> | aha!! ok geez... |
| 22:32:43 | <Twey> | The second argument of iterate is an initial value |
| 22:32:52 | <HeavensRevenge> | awesome :P |
| 22:34:53 | <HeavensRevenge> | thank you Twey |
| 22:35:36 | <Twey> | No problem |
| 22:35:39 | <Twey> | Don't forget mauke :-P |
| 22:37:32 | <Berengal> | > iterate (uncurry (*) . join (,)) 2 |
| 22:37:33 | <lambdabot> | [2,4,16,256,65536,4294967296,18446744073709551616,3402823669209384634633746... |
| 22:38:16 | <HeavensRevenge> | haha awesome mauke and Berengal |
| 22:38:24 | <Twey> | Heh |
| 22:38:37 | <hatds> | man I just realized that my school has a pretty cool programming language research group |
| 22:38:50 | <Berengal> | Actually |
| 22:38:51 | <mauke> | > iterate (join (*)) 2 |
| 22:38:52 | <lambdabot> | [2,4,16,256,65536,4294967296,18446744073709551616,3402823669209384634633746... |
| 22:38:56 | <Berengal> | > iterat... |
| 22:38:57 | <lambdabot> | <no location info>: parse error on input `;' |
| 22:39:00 | <Berengal> | I was about to do that |
| 22:39:44 | <hatds> | only downside is that I'm not in the CS department, so I don't have easy ways to mingle |
| 22:39:49 | <Berengal> | (->) r monad is awesome... |
| 22:40:04 | <Zao> | hatds: Determine when they drink coffee, stealth in. |
| 22:40:11 | <hatds> | hehe |
| 22:40:27 | <hatds> | "how about that Haskell' prime guys?" |
| 22:40:36 | <Zao> | "Hello there. I am here to steal all your ideas for my own papers." |
| 22:40:40 | <Berengal> | Haskell' prime is a bit redundant |
| 22:40:40 | <Twey> | ACTION laughs. |
| 22:40:47 | <SubStack> | haskell double prime! |
| 22:40:50 | <Twey> | redundantly redundant. |
| 22:40:52 | <Zao> | Haskell Bis. |
| 22:40:52 | <Berengal> | Haskell" ? |
| 22:40:55 | <hatds> | how about them boxy types? |
| 22:41:12 | <Berengal> | hatds: Why not just ask to be able to join them? |
| 22:41:32 | <SubStack> | chime in with "sup dawg, I heard you like referential transparency" |
| 22:41:39 | <hatds> | Berengal: well, I'm not sure what I can do or where I would go with it |
| 22:41:45 | <Zao> | Cross-departmental participation is probably not a bad thing. |
| 22:42:39 | <Berengal> | hatds: Just say you're interested then |
| 22:42:40 | <hatds> | I'm sure I could sit in on classes, and obviously seminars are publicly open to begin with |
| 22:43:56 | <hatds> | Berengal: I guess, maybe I will try that. It'd be nice to be able to say something beyond "I'm interested" though |
| 22:44:39 | <Twey> | Design a hugely popular programming language and join them as a guest speaker. |
| 22:44:40 | <cypher-> | ACTION likes the idea that at his university a student can attend any lecture he wishes, except very small subset of courses (some medicine-related stuff) |
| 22:45:09 | <hatds> | Twey: I'll wear my SPJ disguise then |
| 22:45:14 | <Twey> | ACTION grins. |
| 22:45:24 | <ksf> | I seriously doubt I would be kicked out of any lecture, even though I'm not rolled in, any more. |
| 22:45:38 | <Berengal> | ksf: "any more"? |
| 22:46:05 | <ksf> | as in "there might be strange stories still being told" |
| 22:46:22 | <Berengal> | Not in here they aren't |
| 22:46:25 | <kerlo> | cypher-: they're not generally allowed to attend those courses? |
| 22:46:35 | <hatds> | I think that's standard really |
| 22:46:57 | <hatds> | *that you can attend any course |
| 22:47:31 | <pastorn> | i will have to do submissions for a summer course in a month or so in C# |
| 22:47:49 | <pastorn> | is it possible to implement monads in C#? |
| 22:47:54 | <kerlo> | At Grand Valley, you're apparently allowed to audit a course, which apparently means that you're simply allowed to show up; you get neither a grade nor credit. The price is the same. |
| 22:48:07 | <pastorn> | (with the new lambda expression addition, or otherwise) |
| 22:48:16 | <curiousfocus> | kerlo: Michigan? |
| 22:48:19 | <kerlo> | Yes. |
| 22:48:29 | <curiousfocus> | kerlo: I goto Central |
| 22:49:09 | <curiousfocus> | cypher-: There were several classes this year that I rarely attended |
| 22:49:45 | <kerlo> | I wonder how expensive it would be to audit every course. |
| 22:49:57 | <curiousfocus> | man, it sucks, but the paper is all that matters |
| 22:50:26 | <hatds> | it is not free? |
| 22:51:09 | <kerlo> | I think it says it's not free. |
| 22:51:41 | <Berengal> | Man, I'm glad I live in a country where higher education is free |
| 22:52:18 | <curiousfocus> | ACTION drools |
| 22:52:40 | <curiousfocus> | I've heard stuff about 'unofficially' auditing courses |
| 22:52:41 | <Twey> | ACTION considers moving to Norway |
| 22:52:47 | <curiousfocus> | you just need to arrange it with the prof |
| 22:52:52 | <hatds> | I think I'd be covered anyway since all my normal grad tuition is paid for |
| 22:53:24 | <kerlo> | Yeah, tuition for auditing is the same as for credit. |
| 22:53:48 | <curiousfocus> | yeah, if you have a prof that really likes you though, I'm sure *in some cases* you could do it 'unofficially' |
| 22:53:52 | <kerlo> | I want to live in a country where higher education is free. |
| 22:54:08 | <curiousfocus> | kerlo: how much is a credit hour at GV? |
| 22:58:11 | <hatds> | no one here would happen to be faculty at upenn would they? :) |
| 23:03:18 | <heltav> | 2type (~~>) |
| 23:03:34 | <heltav> | @type (~~>) |
| 23:03:35 | <lambdabot> | Not in scope: `~~>' |
| 23:04:29 | <kerlo> | A credit hour at GVSU is $256 to $373. |
| 23:04:39 | <kerlo> | For undergrads, that is. |
| 23:04:40 | <heltav> | @type (~) |
| 23:04:41 | <lambdabot> | parse error on input `)' |
| 23:05:01 | <kerlo> | And assuming you're a resident of Michigan. I am. |
| 23:08:45 | <hatds> | thing is that the programming language group looks like a small offshot of the greater CS department, there is only maybe 1 course a semester with relevant theory |
| 23:08:59 | <pshc> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2352#a2353 Combinator library vs. monomorphism restriction... I'm not really sure how the restriction applies or if it's causing this error, though... Thoughts? |
| 23:08:59 | <hatds> | and I think several of the books I've already read |
| 23:12:20 | <pastorn> | @can i use haskell code in my c# project? |
| 23:12:21 | <lambdabot> | Maybe you meant: faq map run wn |
| 23:12:27 | <pastorn> | @faq can i use haskell code in my c# project? |
| 23:12:28 | <lambdabot> | The answer is: Yes! Haskell can do that. |
| 23:12:58 | <lament> | in comments. |
| 23:13:17 | <mauke> | .oO( http://mauke.ath.cx/stuff/poly.poly ) |
| 23:15:31 | <monadic_kid> | pastorn: you can write monads in irtually any programming language (that doesn't necessarily mean it will be nice to do it though). All you need to do is define 2 functins bind and return that obey some axioms and your good to go |
| 23:20:38 | <pshc> | ... anyone? anyone? |
| 23:20:53 | <Saizan> | pshc: those definitions are mutually recursive |
| 23:21:28 | <pshc> | hmm |
| 23:21:41 | <Saizan> | pshc: so they are typechecked together, and the Monomorphism Restriction applies to the ones without a type signature, since they don't take any parameter |
| 23:22:03 | <Saizan> | so the fact that one of those has a polymorphic signature is causing problems |
| 23:22:07 | <pshc> | ok |
| 23:22:15 | <Saizan> | you should give it to all of them |
| 23:22:20 | <pshc> | So either I need to break the cycle or specify types for all eh |
| 23:22:27 | <Saizan> | or use NoMonomoprhimRestriction |
| 23:22:31 | <pshc> | oshi--! |
| 23:22:49 | <pshc> | Great, thanks |
| 23:22:54 | <Saizan> | like {-# LANGUAGE NoMonomorphismRestriction #-} on top of your file |
| 23:22:59 | <pshc> | yeah |
| 23:23:02 | <Twey> | Or add an argument |
| 23:23:11 | <pshc> | ? |
| 23:23:14 | <Saizan> | (it's the first time i see that error btw) |
| 23:23:24 | <Saizan> | adding an argument doesn't make sense there |
| 23:24:30 | <Saizan> | pshc: Twey is referring to the fact that e.g. if you defined reserved as reserved () = P.reserved lexer then the MR wouldn't apply to it |
| 23:25:04 | <Saizan> | but then you'd have to supply that argument when you want to use it |
| 23:25:09 | <pastorn> | monadic_kid: you don't know about any implementation in C#? |
| 23:25:13 | <pshc> | Hoho. |
| 23:25:39 | <pshc> | interesting, guess I'd better learn about the restriction in more depth |
| 23:25:49 | <pshc> | I guess NoMonomorphismRestriction has its downsides too eh |
| 23:25:52 | <Saizan> | the best description is from the haskell report |
| 23:26:06 | <Saizan> | the worst that can happen is that you lose some sharing |
| 23:27:56 | <Saizan> | which is exactly what happens when you add an useless argument |
| 23:28:23 | <Saizan> | then in each place you use (reserved ()) you'll compute a different value for it |
| 23:28:30 | <pshc> | Ah yeah hehe |
| 23:28:53 | <Saizan> | but in this case it won't matter, i think |
| 23:29:46 | <Saizan> | the MR is there so that people don't get surprised by lost sharing due to typeclass polymorphism |
| 23:30:33 | <Saizan> | but it drives mad everyone that indeed want that polymorphism :) |
| 23:30:53 | <monadic_kid> | pastorn: LINQ |
| 23:31:26 | <Twey> | See also http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hs-dotnet |
| 23:32:02 | <monadic_kid> | pastorn: but seriously i'm sure you can easilly find some on the net |
| 23:35:11 | <pastorn> | monadic_kid: thanks :) |
| 23:42:30 | <monadic_kid> | pastorn: the best thing to do is understand that "bind" is kind of composition operator for "actions" and "return" takes some pure value and puts injects into the level of actions |
| 23:43:25 | <dibblego> | pastorn, in C# there is also a semi-colon ; |
| 23:44:10 | <monadic_kid> | haskell has semi-colons too ;) |
| 23:44:20 | <mauke> | · |
| 23:44:51 | <HeavensRevenge> | hello |
| 23:44:53 | <roconnor> | but haskell's semi-colons are basically sugar for bind |
| 23:44:55 | <dibblego> | I mean, as a monad implementation |
| 23:45:10 | <pastorn> | monadic_kid: i know how monads work, i just wondered if there exists an implementation in c# |
| 23:45:14 | <monadic_kid> | roconnor: nothing to do with do notion |
| 23:45:17 | <hatds> | nah, they are a sugar for layout :) |
| 23:45:22 | <hatds> | or vice versa maybe |
| 23:45:40 | <HeavensRevenge> | Twey is there a way.. to allow a 3rd in this- |
| 23:45:46 | <roconnor> | well, semi-colans are used for layout, and the layout in do notation is sugar for bind |
| 23:45:53 | <HeavensRevenge> | iterate (^2) 2 |
| 23:45:55 | <marcusb> | hi, I did a little bit with haskell in 2004, but I am basically a newbie. I have extensive CS and programming background, though. does it matter if I start with hugs or ghc? do I start with the "Learning" section on haskell.org? |
| 23:46:07 | <roconnor> | 3rd? |
| 23:46:09 | <dibblego> | pastorn, the general monad abstraction cannot be written in C#'s type system, but there are many implementations -- see SelectMany from LINQ, there is also the semi-colon and exceptions |
| 23:46:37 | <dibblego> | marcusb, it is strongly recommended to start with GHC |
| 23:46:53 | <dibblego> | marcusb, if you get stuck on anything please feel free to ask for help here |
| 23:46:57 | <ksf> | marcusb, use ghc, and forget everything you know about programming. |
| 23:46:58 | <marcusb> | ok, great |
| 23:47:04 | <Twey> | HeavensRevenge: ‘A third’? |
| 23:47:15 | <marcusb> | ksf: I am familiar with functional programming concepts |
| 23:47:24 | <HeavensRevenge> | like... foldl (2+..) (iterate (^2) 2) |
| 23:47:28 | <ksf> | ...so i thought, too, coming from scheme... |
| 23:47:37 | <roconnor> | marcusb: forget half of what you know about functional programming :) |
| 23:47:37 | <dibblego> | ksf, :) |
| 23:47:38 | <Twey> | foldl? |
| 23:47:39 | <marcusb> | ksf: but I don't know the syntax and I don't know programming concepts for bigger programs. |
| 23:47:39 | <Twey> | map? |
| 23:47:40 | <pastorn> | dibblego: semi-colon and exceptions? |
| 23:47:44 | <HeavensRevenge> | or a+a^a |
| 23:47:44 | <marcusb> | roconnor: ok :) |
| 23:47:48 | <roconnor> | marcusb: in particular forget about tail recuursion |
| 23:47:55 | <pastorn> | dibblego: like java exceptions? |
| 23:47:58 | <Twey> | > map (+2) $ iterate (^2) 2 |
| 23:47:59 | <lambdabot> | [4,6,18,258,65538,4294967298,18446744073709551618,3402823669209384634633746... |
| 23:48:08 | <ksf> | anyway, the royal road de jour to haskell is learn you a haskell -> real world haskell -> typeclassopedia |
| 23:48:08 | <marcusb> | roconnor: hey, that *is* about half I know about it :) |
| 23:48:12 | <Berengal> | > iterate ((+2).(^2)) 2 -- like this? |
| 23:48:14 | <lambdabot> | [2,6,38,1446,2090918,4371938082726,19113842599189892819591078,3653389789066... |
| 23:48:19 | <HeavensRevenge> | or a double iterate? |
| 23:48:22 | <roconnor> | marcusb: I think the remaining half is fine. |
| 23:48:30 | <HeavensRevenge> | lol |
| 23:48:34 | <dibblego> | pastorn, sure, but C# exceptions are unchecked -- notice that the "potential failure" sequences through callers -- like the Either monad (where Left is failure) |
| 23:48:34 | <hatds> | watch "A taste of Haskell" with accompany slides: http://www.haskell.org/haskellwiki/Video_presentations pause the video so you can parse everything that's said and written |
| 23:48:36 | <Twey> | Which do you want? |
| 23:48:56 | <hatds> | that's the best way to grok the basics of do notation and typeclasses |
| 23:48:58 | <ksf> | us haz video? |
| 23:49:04 | <pastorn> | dibblego: oh, cool |
| 23:49:24 | <pastorn> | dibblego: but what does that have to do with semicolon? |
| 23:49:26 | <marcusb> | hatds: a video is a nice introduction to get motivated, thanks |
| 23:49:35 | <dibblego> | pastorn, that's another monad implementation: IO |
| 23:49:36 | <HeavensRevenge> | cool... multiple pipe like arguments inside the operator through an iteration |
| 23:50:02 | <pastorn> | dibblego: ok |
| 23:50:17 | <ksf> | "this guy is really strenuous. From the first minute I had an headake.... oh my god he should'n present anything... not even tv weather...." |
| 23:50:20 | <ksf> | he. |
| 23:50:22 | <dibblego> | pastorn, http://blog.tmorris.net/controlling-effects-with-flatmap/ might help (it's slightly Scala oriented, but mentions >>=) |
| 23:50:24 | <ksf> | that's about spj. |
| 23:50:26 | <mauke> | > iterate (\n -> 3 * n + 1) 1 |
| 23:50:28 | <lambdabot> | [1,4,13,40,121,364,1093,3280,9841,29524,88573,265720,797161,2391484,7174453... |
| 23:50:38 | <pastorn> | dibblego: cool, thanks :) |
| 23:50:41 | <Berengal> | HeavensRevenge: It's called function composition |
| 23:50:42 | <monadic_kid> | pastorn: if i remember correctly I saw some blogs using query keywords, it looks butt ugly though |
| 23:50:44 | <marcusb> | ksf: me thinks somebody doesn't like the british accent. but it's like monty python! |
| 23:50:58 | <roconnor> | > iterate (\n -> if odd n then 3*n+1 else n `div` 2) 1 |
| 23:50:59 | <lambdabot> | [1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,4,2,1,... |
| 23:51:09 | <hatds> | I'm surprised I can't find any SPJ fansites on google :) |
| 23:51:14 | <mauke> | > iterate (\n -> if odd n then 3*n+1 else n `div` 2) 9 |
| 23:51:15 | <lambdabot> | [9,28,14,7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,4,2,1,4,2,1,4,2... |
| 23:51:19 | <marcusb> | > 1 |
| 23:51:21 | <lambdabot> | 1 |
| 23:51:23 | <ksf> | it's the second best english accent there is, just after scandinavian. |
| 23:51:26 | <Twey> | Not just British, but Essex :-P |
| 23:51:27 | <marcusb> | sorry, cnr :) |
| 23:51:46 | <dibblego> | marcusb, a pure lazy language is significantly different to a language like Scheme, more significantly different than Scheme is to traditional imperative languages |
| 23:51:50 | <Twey> | ‘British’ isn't an accent |
| 23:51:54 | <HeavensRevenge> | lol dude spj is one crazy awesome brit! |
| 23:51:56 | <Twey> | Listen to RP, then listen to Glaswegian |
| 23:51:57 | <Twey> | :-P |
| 23:52:10 | <heltav> | > [[Just x | Left 5 <- [Left 5, Right 7, Left 8]] |
| 23:52:11 | <lambdabot> | <no location info>: parse error on input `;' |
| 23:52:15 | <heltav> | > [[Just x | Left x <- [Left 5, Right 7, Left 8]] |
| 23:52:16 | <lambdabot> | <no location info>: parse error on input `;' |
| 23:52:17 | <HeavensRevenge> | lol the xmonad example vid was wonderin what would happen if he decided to jump infront of a bus |
| 23:52:24 | <heltav> | > [Just x | Left x <- [Left 5, Right 7, Left 8]] |
| 23:52:26 | <lambdabot> | [Just 5,Just 8] |
| 23:52:26 | <marcusb> | dibblego: wow, I wouldn't expect that. |
| 23:52:49 | <heltav> | > fmap (+1) $ [Just x | Left x <- [Left 5, Right 7, Left 8]] |
| 23:52:51 | <dibblego> | marcusb, yeah not many people expect that, which is why you're receiving these type of comments :) |
| 23:52:55 | <lambdabot> | No instance for (Num (Maybe t)) |
| 23:52:57 | <lambdabot> | arising from the literal `1' at ... |
| 23:53:01 | <heltav> | > (fmap . fmap) (+1) $ [Just x | Left x <- [Left 5, Right 7, Left 8]] |
| 23:53:03 | <lambdabot> | [Just 6,Just 9] |
| 23:53:07 | <Berengal> | > let loeb x = fmap (\a -> a (loeb x)) x in loeb $ const 0:const 1:[(+1).(!!(if odd n then 3*n+1 else div n 2)) | n <- [2..]] |
| 23:53:12 | <monadic_kid> | pastorn: http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx |
| 23:53:15 | <davidL> | > [[Just x | Left x <- [Left 5, Right 7, Left 8]]] |
| 23:53:17 | <marcusb> | dibblego: and that's why ghc and not hugs, I guess (I just read in google that hugs is not lazy?) |
| 23:53:18 | <lambdabot> | [0,1,2,8,3,6,9,17,4,20,7,15,10,10,18,18,5,13,21,21,8,8,16,16,11,24,11,112,1... |
| 23:53:20 | <lambdabot> | [[Just 5,Just 8]] |
| 23:53:25 | <mauke> | Berengal: needs more fix |
| 23:53:25 | <heltav> | > [Just (x+1) | Left x <- [Left 5, Right 7, Left 8]] |
| 23:53:27 | <lambdabot> | [Just 6,Just 9] |
| 23:53:45 | <dibblego> | marcusb, no GHC is just more mature and well supported -- when you have questions, ask here and most people will be using GHC |
| 23:53:47 | <Gracenotes> | hm. Thanks to Haskell I'm fully spelling out all of my decimal literals in other languages :) 0.5 instead of .5 |
| 23:53:58 | <Twey> | :t fromLeft |
| 23:54:00 | <lambdabot> | Not in scope: `fromLeft' |
| 23:54:02 | <marcusb> | dibblego: ah ok |
| 23:54:05 | <heltav> | @type catMaybe |
| 23:54:06 | <lambdabot> | Not in scope: `catMaybe' |
| 23:54:07 | <Twey> | @hoogle fromLeft |
| 23:54:07 | <lambdabot> | No results found |
| 23:54:20 | <Berengal> | Gracenotes: Thanks to haskell I tend to write my floats without decimals... |
| 23:54:23 | <Gracenotes> | Twey: used to be in the library, apparently, but taken out and not missed |
| 23:54:26 | <pastorn> | Twey: use the function "either" |
| 23:54:38 | <Berengal> | mauke: Please feel free to golf that ;) |
| 23:54:42 | <Twey> | I'd prefer ‘lefts’ here |
| 23:54:42 | <pastorn> | @type either |
| 23:54:43 | <lambdabot> | forall a c b. (a -> c) -> (b -> c) -> Either a b -> c |
| 23:54:52 | <Gracenotes> | lefts is nice |
| 23:55:01 | <dibblego> | @djinn Either a b -> a -> a |
| 23:55:01 | <lambdabot> | f a b = |
| 23:55:01 | <lambdabot> | case a of |
| 23:55:01 | <lambdabot> | Left c -> c |
| 23:55:01 | <lambdabot> | Right _ -> b |
| 23:55:11 | <Gracenotes> | Berengal: :) yeah, that too... |
| 23:55:14 | <Twey> | > lefts [Left 5, Right 7, Left 8] >>= return . (+1) |
| 23:55:15 | <lambdabot> | Not in scope: `lefts' |
| 23:55:18 | <Gracenotes> | so much coercion elsewhere |
| 23:55:19 | <Twey> | Bah |
| 23:55:28 | <Gracenotes> | lefts is not in scope. nor is the amazing function partitionEithers |
| 23:55:50 | <hatds> | sunglass face operator, I've been saying we need to allow infix emoticons |
| 23:56:13 | <pastorn> | @let fromLeft (Left x) = x |
| 23:56:14 | <lambdabot> | Defined. |
| 23:56:16 | <Berengal> | isLeft Left{} = True; isLeft _ = False; partitionEithers = partition isLeft |
| 23:57:09 | <pastorn> | Berengal: what notation is "Left{}"? |
| 23:57:14 | <Twey> | Record notation |
| 23:57:30 | <pastorn> | why not "Left _"? |
| 23:57:30 | <heltav> | ¨p |
| 23:57:38 | <Twey> | *shrugs* Shorter, I guess |
| 23:57:46 | <Berengal> | > let foo Left{} = True in [foo (Left 1), foo (Right "hello")] |
| 23:57:48 | <lambdabot> | [True,* Exception: /tmp/7412987797104020017:71:40-56: Non-exhaustive patter... |
| 23:57:52 | <Twey> | Hehe |
| 23:58:12 | <Berengal> | Left{} matches Left no matter how many arguments it takes |
| 23:58:20 | <Berengal> | Left _ only matches Left if it takes one argument |
| 23:58:26 | <Berengal> | Should the definition of Left ever change... |
| 23:58:32 | <Twey> | Oh don't be daft |
| 23:58:44 | <Berengal> | Also, no need for parenthesis |
| 23:59:12 | <pastorn> | "* Exception: /tmp/7412987797104020017:71:40-56: Non-exhaustive patter..." <-- kinda cool |
| 23:59:43 | <dibblego> | @type either id . const |
| 23:59:44 | <lambdabot> | forall b a. a -> Either a b -> a |
| 23:59:51 | <pastorn> | > 1/0 |
| 23:59:53 | <lambdabot> | Infinity |
Back to channel and daily index: content-negotiated html turtle