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:00 | <Gracenotes> | any other interesting cmm files to browse? |
| 00:00:13 | <thoughtpolice> | especially when you're dealing with 50,000 loc of both C and c-- |
| 00:00:15 | <pumpkin> | take a look at the other .cmm files in the rts |
| 00:00:28 | <thoughtpolice> | well, really, a lot more than that |
| 00:00:42 | <Gracenotes> | can't find many others |
| 00:00:44 | <Gracenotes> | most are .c |
| 00:00:44 | <SamB> | thoughtpolice: such problems as what ? |
| 00:01:17 | <pumpkin> | Gracenotes: there aren't that many |
| 00:01:47 | <thoughtpolice> | SamB: well, |
| 00:01:49 | <pumpkin> | Gracenotes: a lot of the cmm is generated on the fly |
| 00:01:55 | <thoughtpolice> | for example, just the other day I fixed a bug in GHC |
| 00:02:07 | <thoughtpolice> | which lead to compilation failure when trying to do a registered x86_64/darwin build |
| 00:02:13 | <Gracenotes> | it's definitely ugly |
| 00:02:20 | <thoughtpolice> | because the case for x86_64 and darwin was silently ignored |
| 00:02:23 | <pumpkin> | Gracenotes: prettier than raw asm though :) |
| 00:02:25 | <thoughtpolice> | because it's never actually been properly tested |
| 00:02:28 | <SamB> | thoughtpolice: ah. |
| 00:02:39 | <Gracenotes> | well. still. the capitalization.. |
| 00:03:15 | <SamB> | ACTION wishes there were better tools for testing buildability on multiple platforms, but of course in this case GHC'd have to be way easier to port ... |
| 00:03:22 | <Gracenotes> | so. what primop stuff were you doing? |
| 00:03:25 | <thoughtpolice> | SamB: CPP was the culprit; in ./compiler/cmm/CParse.hs:pprDynamicLinkerAsmLabel |
| 00:03:42 | <skorpan> | could someone help me remove the boilerplate here? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5197#a5197 |
| 00:03:51 | <SamB> | or staticly checking things like that, even ... |
| 00:04:09 | <thoughtpolice> | SamB: wolfgang t. added that case to that function nearly 2 years ago, but GHC has never really 'properly' worked on x86_64/darwin, so it was always pretty much silently ignored |
| 00:04:41 | <pumpkin> | Gracenotes: adding a bunch more primops for the gmp integer interface, for Integer... but it turns out we're just about to separate gmp out of GHC so it was kinda pointless... but I might help out with the separation efforts now that I got myself interested in this stuff |
| 00:04:47 | <thoughtpolice> | pumpkin: did that particular bug bite you when e.g. a registered stage1 was trying to compile stuff? because a registered stage1 has the NCG |
| 00:05:11 | <thoughtpolice> | pumpkin: and that function seems fairly specific to the NCG, which would explain why it didn't show up in the unregistered build |
| 00:05:14 | <pumpkin> | Gracenotes: I can now compute factorial of 50000 in 2.3 seconds using a primop instead of the 17 seconds it takes using the native haskell factorial :P |
| 00:05:21 | <Gracenotes> | pumpkin: well, you must blag about it |
| 00:05:39 | <Gracenotes> | so, what does the separation entail? Using a homebrew number library? |
| 00:05:50 | <pumpkin> | Gracenotes: one day I'll get around to making a site of my own with a bloggish thing on it |
| 00:06:05 | <thoughtpolice> | pumpkin: oh, on the replacing gmp note in #ghc, igloo has an integer library that is written mostly in haskell with decent performance |
| 00:06:18 | <pumpkin> | Gracenotes: there are a few proposals... either making another library that's binary compatible with the subset of gmp that we use, or using igloo's replacement pure haskell lib |
| 00:06:21 | <thoughtpolice> | pumpkin: http://darcs.haskell.org/packages/integer-simple/ |
| 00:06:22 | <pumpkin> | thoughtpolice: yeah, saw that :) |
| 00:06:27 | <pumpkin> | there's also a super simple one :P |
| 00:06:28 | <pumpkin> | that's slower |
| 00:06:46 | <thoughtpolice> | pumpkin: we used HIntegerByInt in lhc-0.6.* |
| 00:06:54 | <Gracenotes> | making a library for the purpose of binary compatibility? Sounds painful >_> |
| 00:07:04 | <Gracenotes> | pumpkin: so you used gmp's factorial function directly? |
| 00:07:08 | <thoughtpolice> | pumpkin: which does have pretty decent performance |
| 00:07:08 | <pumpkin> | yeah |
| 00:07:17 | <thoughtpolice> | pumpkin: having LHC use ghc as a frontend now is so much more better. :) |
| 00:07:22 | <Gracenotes> | presumably the Integer constructors are based directly on it? |
| 00:08:19 | <pumpkin> | Gracenotes: yeah, the J# constructor gets broken up and passed almost directly to gmp |
| 00:08:27 | <pumpkin> | thoughtpolice: I bet |
| 00:08:36 | <hatds> | skorpan: I think records are ugly as a rule but this does what you want: data Statement = FunDecl { tokens :: [Token] } | VarDecl { tokens :: [Token] } | etc.. |
| 00:08:39 | <pumpkin> | thoughtpolice: there was a good looking integer library on a .gov site but I forgot its name now |
| 00:08:41 | <Gracenotes> | yes, with (,) |
| 00:08:48 | <pumpkin> | I'd personally love to make the integer-simple ridiculously fast |
| 00:08:49 | <pumpkin> | :P |
| 00:09:12 | <pumpkin> | that seems like the most elegant solution |
| 00:09:15 | <skorpan> | yeah hatds, but as you said that's horribly ugly... however, i think i can solve this by deriving Foldable for each datatype and then making "firstTok x = head $ toList x" |
| 00:09:52 | <pumpkin> | Gracenotes: you can see the semi-front-end functions to gmp in GHC.Integer |
| 00:10:02 | <Gracenotes> | well, GHC.Prim |
| 00:10:14 | <pumpkin> | well, those are direct representations of the cmm code |
| 00:10:29 | <pumpkin> | GHC.Integer acts as the middleman between the S# | J# representation and the cmm |
| 00:10:32 | <Gracenotes> | Integer contains the primitive wrappers |
| 00:10:48 | <Gracenotes> | so, is there a way to make a really-really-fast factorial other than having an explicit low-level function? |
| 00:10:50 | <Gracenotes> | :) |
| 00:11:19 | <pumpkin> | well the issue is that we're constructing and deconstructing gmp ints all over the place when we work with them in haskell |
| 00:11:21 | <hatds> | factorial function of what type? |
| 00:11:27 | <hatds> | Int -> Int ? |
| 00:11:30 | <dmwit> | factorial :: () -> () |
| 00:11:30 | <pumpkin> | Int -> Integer |
| 00:11:44 | <pumpkin> | not much point in doing Integer -> Integer |
| 00:11:50 | <hatds> | hehe |
| 00:11:56 | <Gracenotes> | Int -> Integer, Integer -> Integer if you like >_> |
| 00:12:40 | <dmwit> | Can you just use one of the approximations? |
| 00:12:43 | <dmwit> | They're really quite fast. |
| 00:12:48 | <dmwit> | And very accurate. |
| 00:13:07 | <dmwit> | http://en.wikipedia.org/wiki/Stirling%27s_approximation |
| 00:13:22 | <Gracenotes> | yes, I'm trying to see how big a maxBound factorial would be right now |
| 00:13:32 | <Gracenotes> | exponentiation would be the most expensive part here |
| 00:13:38 | <idnar> | factorial :: Void |
| 00:13:55 | <dmwit> | > (2^29 :: Int) |
| 00:13:56 | <lambdabot> | 536870912 |
| 00:14:14 | <dmwit> | > fromIntegral (2^29 :: Int) / exp 1 |
| 00:14:15 | <lambdabot> | 1.975037710877626e8 |
| 00:14:20 | <dmwit> | :t (**) |
| 00:14:22 | <lambdabot> | forall a. (Floating a) => a -> a -> a |
| 00:14:26 | <thoughtpolice> | pumpkin: with the new lhc, compiling the entire HIntegerByInt external core code generated by GHC (the .hs is ~2,500, the .hcr is ~17,000), takes 30s to complete compilation to GRIN, and according to GHC's RTS "44 MB total memory in use" |
| 00:14:38 | <dmwit> | > (fromIntegral (2^29 :: Int) / exp 1) ** (2^29) |
| 00:14:39 | <lambdabot> | Infinity |
| 00:14:41 | <Gracenotes> | ^^ would be better |
| 00:14:47 | <thoughtpolice> | pumpkin: (resulting grin is about ~27kloc) |
| 00:15:03 | <dmwit> | > ln |
| 00:15:04 | <lambdabot> | Not in scope: `ln' |
| 00:15:07 | <dmwit> | > log (exp 1) |
| 00:15:08 | <lambdabot> | 1.0 |
| 00:15:13 | <thoughtpolice> | pumpkin: this is opposed to taking 5 minutes while using up 600mb of memory on the same exact code :) |
| 00:15:18 | <pumpkin> | nice :P |
| 00:15:20 | <pumpkin> | how fast is it? |
| 00:15:22 | <pumpkin> | the resulting code |
| 00:15:30 | <thoughtpolice> | pumpkin: oh, which generated not working executables for that test on certain inputs |
| 00:15:36 | <thoughtpolice> | it was still a bug |
| 00:15:40 | <thoughtpolice> | pumpkin: it passes the testsuite now |
| 00:15:42 | <thoughtpolice> | but it's quite slow |
| 00:15:49 | <thoughtpolice> | we haven't implemented a backend quite yet |
| 00:15:50 | <dmwit> | > 2^29 * (log (sqrt (2 * pi * 2^29)) + log (2^29 / exp 1)) |
| 00:15:50 | <Gracenotes> | @hoogle CReal |
| 00:15:51 | <lambdabot> | No results found |
| 00:15:51 | <lambdabot> | 1.6144159771912458e10 |
| 00:16:05 | <dmwit> | Gracenotes: Looks like it would have about 1.6e10 digits! |
| 00:16:09 | <dmwit> | That's largish. |
| 00:16:14 | <dmwit> | err |
| 00:16:15 | <thoughtpolice> | lemmih is working on a second stage of grin, kind of like jhc's 'devolved form' (right before turning it to C) which should be easy to compile to LLVM |
| 00:16:23 | <dmwit> | > 2^29 * (logBase 10 (sqrt (2 * pi * 2^29)) + logBase 10 (2^29 / exp 1)) |
| 00:16:24 | <lambdabot> | 7.01131950390604e9 |
| 00:16:34 | <dmwit> | Oh, well! Only 7e9 digits! Much better. |
| 00:16:36 | <thoughtpolice> | i'm working on a dead code removal pass for GRIN/grin2 |
| 00:16:49 | <Gracenotes> | how about logBase 2? |
| 00:16:51 | <thoughtpolice> | because that 27kloc of grin probably isn't all necessary |
| 00:17:01 | <dmwit> | > 2^29 * (logBase 2 (sqrt (2 * pi * 2^29)) + logBase 2 (2^29 / exp 1)) |
| 00:17:02 | <lambdabot> | 2.3291099242257202e10 |
| 00:17:10 | <Gracenotes> | wha |
| 00:17:17 | <Gracenotes> | *is suspicious* |
| 00:17:22 | <dmwit> | Why? |
| 00:17:27 | <dmwit> | That's the number of *digits* remember. |
| 00:17:29 | <Gracenotes> | oh, missed the e |
| 00:17:31 | <dmwit> | Not the actual answer. |
| 00:17:50 | <Gracenotes> | darn notation. don't know why Haskell uses it >_< |
| 00:17:56 | <dmwit> | > 2^29 * ((+) `on` logBase 2) (sqrt (2 * pi * 2^29)) (2^29 / exp 1) |
| 00:17:57 | <lambdabot> | 2.3291099242257202e10 |
| 00:18:01 | <thoughtpolice> | pumpkin: the llvm bindings are annoying on my os x box, so I'm actually thinking about just pretty-printing LLVM-ir directly |
| 00:18:16 | <Gracenotes> | dmwit: so an Integer could store it |
| 00:18:19 | <thoughtpolice> | it would probably make it easier to use what garbage collection facilities are there, anyway |
| 00:18:35 | <Gracenotes> | on a 32-bit machine, at least |
| 00:18:50 | <dmwit> | uh |
| 00:18:56 | <MyCatVerbs> | Gracenotes: please do not be assuming that all the world is a VAX. |
| 00:19:10 | <Gracenotes> | hm. or... could it |
| 00:19:15 | <Gracenotes> | 64-bit definitely |
| 00:19:16 | <dmwit> | > 2.3e10 / (4 {- gigabytes -} * 1024 * 1024 * 1024 * 8) |
| 00:19:17 | <lambdabot> | 0.6693881005048752 |
| 00:19:18 | <MyCatVerbs> | Gracenotes: but an Integer can store any arbitrarily large number. ^^ |
| 00:19:27 | <Gracenotes> | MyCatVerbs: not raly ;_; |
| 00:19:28 | <SamB> | thoughtpolice: yeah, I think dead code removal is a pretty important transformation for grin ... |
| 00:19:31 | <dmwit> | You think you can get 0.7 actual bits per physical bit? |
| 00:19:34 | <dmwit> | I'd be really surprised. |
| 00:20:11 | <SamB> | dmwit: huh ? |
| 00:20:19 | <dmwit> | Did I say that wrong? |
| 00:20:39 | <SamB> | dmwit: no, I just don't understand ... |
| 00:20:49 | <dmwit> | The number takes 2.3e10 bits to store in an ideal world, and you have somewhere around 3e10 actual bits on the machine. |
| 00:20:53 | <dmwit> | Do you really think you can make that fit? |
| 00:20:58 | <dmwit> | Integer has a lot of overhead! |
| 00:21:09 | <thoughtpolice> | SamB: we already have a dead code removal pass for SimpleCore, so we don't create any more GRIN than necessary |
| 00:21:11 | <MyCatVerbs> | 1.6e10 is only about 15 gigabytes. :) |
| 00:21:29 | <thoughtpolice> | because the convesion is fairly expensive |
| 00:21:29 | <MyCatVerbs> | Er, 15 gigabytes long, assuming a compact binary representation. |
| 00:21:35 | <Gracenotes> | I mean, assuming enough memory. An Integer is just a byte array, and the maximum length is the maximum size of Int# on a machine. However, I'm still not sure whether it's used a byte array or an int array |
| 00:21:35 | <idnar> | dmwit: why does integer have so much overhead? |
| 00:21:42 | <Gracenotes> | argh. |
| 00:21:49 | <SamB> | dmwit: sure, if you use a filesystem with extents ... |
| 00:21:55 | <thoughtpolice> | SamB: lemmih has just added sharing analysis to the points-to analysis so after that it should be good to remove a lot of stuff |
| 00:21:56 | <SamB> | and a large enough block size |
| 00:22:05 | <Gracenotes> | it doesn't help that ByteArray# is the generic Haskell unboxed array for all unboxed sizes |
| 00:22:09 | <thoughtpolice> | we'll also want to interleave it after other optimizations naturally |
| 00:22:11 | <dmwit> | idnar: The way I understand it, it's basically a linked list of Ints. |
| 00:22:12 | <MyCatVerbs> | Gracenotes: surely you can come up with 16GB of RAM if you try really, really hard? :3 |
| 00:22:26 | <Gracenotes> | @src Integer |
| 00:22:27 | <lambdabot> | data Integer = S# Int# |
| 00:22:27 | <lambdabot> | | J# Int# ByteArray# |
| 00:22:29 | <idnar> | dmwit: I thought it was an array of Ints |
| 00:22:37 | <idnar> | oh |
| 00:22:40 | <SamB> | or, yeah, if you're using a swap partition that should be good |
| 00:22:42 | <idnar> | of Bytes, I guess |
| 00:22:47 | <dmwit> | Yes, it does seem to be an array. |
| 00:22:51 | <Gracenotes> | idnar: but that's where it gets confusing |
| 00:22:51 | <dmwit> | Therefore, I am very wrong. |
| 00:23:14 | <Gracenotes> | because ByteArrays can be used to store ints, bytes, chars, etc. |
| 00:23:28 | <Gracenotes> | and I'm not sure about the indexing system it uses, the number of bits per entry |
| 00:23:30 | <SamB> | but the real question, IMO, is can you figure out how to COMPUTE the value with that little storage? |
| 00:24:04 | <Gracenotes> | MyCatVerbs: *tries really hard* |
| 00:24:10 | <Gracenotes> | :3 |
| 00:26:55 | <skorpan> | how can i make this prettier? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5198#a5198 |
| 00:27:02 | <skorpan> | without existentials |
| 00:27:08 | <MyCatVerbs> | Gracenotes: Hell, 32GB of DDR3-2000 DIMMs should only cost about... $1350, if you're buying 4GB sticks. :) |
| 00:27:40 | <MyCatVerbs> | Gracenotes: of course you would probably want 48GB instead, to have enough RAM to add three of those numbers together. ;D |
| 00:27:59 | <MyCatVerbs> | skorpan: Maybe monad, probably. |
| 00:28:17 | <skorpan> | i thought about that as well, but how? |
| 00:28:29 | <skorpan> | this isn't Just a or Nothing, this is just True or False |
| 00:28:41 | <MyCatVerbs> | guard |
| 00:28:43 | <Cale> | skorpan: How about logic operators? |
| 00:28:56 | <sclv> | skorpan: are the error messages all difft? |
| 00:29:05 | <Cale> | if hasFailed blk || hasFailed c || hasFailed x |
| 00:29:08 | <Cale> | then error |
| 00:29:10 | <skorpan> | sclv: "error" is not Prelude.error |
| 00:29:13 | <Cale> | else whatever |
| 00:29:15 | <Cale> | er oops |
| 00:29:21 | <Cale> | anyway, you get the idea |
| 00:29:23 | <skorpan> | Cale: oh.. uhm.. :P |
| 00:29:27 | <sclv> | | failureOne = error a | failureTwo = error b | otherwise = passing case! |
| 00:29:46 | <skorpan> | sometimes you can't see the forest for the trees... |
| 00:30:18 | <Cale> | Or instead of whatever representation of failure you're using, you go with Maybe or Either |
| 00:30:32 | <Cale> | and use the fact that it's a monad to combine results |
| 00:30:35 | <skorpan> | neither of them make sense |
| 00:30:56 | <Cale> | What does hasFailed currently do? |
| 00:31:21 | <skorpan> | pattern match on constructors |
| 00:31:28 | <Cale> | Which ones? |
| 00:31:36 | <skorpan> | hasFailed t = case t of |
| 00:31:36 | <skorpan> | ForErr _ -> True |
| 00:31:36 | <skorpan> | _ -> False |
| 00:31:55 | <Cale> | aha, so instead of including ForErr in whatever type t is |
| 00:31:59 | <Cale> | You use Maybe |
| 00:32:06 | <Cale> | (or Either String) |
| 00:32:21 | <skorpan> | i don't follow :\ |
| 00:32:27 | <Cale> | It becomes |
| 00:32:42 | <Cale> | hasFailed (Left _) = True |
| 00:32:49 | <Cale> | hasFailed (Right _) = False |
| 00:33:20 | <Cale> | Where in the case that there's a failure, the argument to Left holds the error information or whatever |
| 00:33:31 | <skorpan> | that doesn't really work well with the rest of my program... |
| 00:33:36 | <Cale> | and if not, then it's Right x, where x is guaranteed not to be a failure |
| 00:33:53 | <Cale> | The nice thing there is that you could then write: |
| 00:33:58 | <skorpan> | i see what you mean, and that makes sense, but unfortunately that doesn't fit into this scenario |
| 00:34:02 | <Cale> | okay |
| 00:34:24 | <Cale> | Another option is to write a function which projects to Maybe |
| 00:35:02 | <Cale> | failed :: Foo -> Maybe Foo |
| 00:35:04 | <skorpan> | actually there's no reason not to use (||) |
| 00:35:11 | <skorpan> | it was just so obvious i never really thought about it |
| 00:35:14 | <Cale> | failed (ForErr _) = Nothing |
| 00:35:20 | <Cale> | failed x = Just x |
| 00:35:27 | <sm> | a question: can the monadic tree builders in Data.Tree help me build trees from pure values more efficiently ? |
| 00:36:02 | <sm> | these: http://hackage.haskell.org/packages/archive/containers/0.2.0.1/doc/html/Data-Tree.html#3 |
| 00:36:16 | <Cale> | More *efficiently*, I doubt it... |
| 00:36:58 | <sm> | so they are for using when you want to build from monadic values. ok, thanks |
| 00:37:04 | <Cale> | But they might give you just the right sort of expression... |
| 00:37:47 | <sm> | I am building a tree from a list of account names, and I sense it's duplicating a lot of work |
| 00:38:28 | <Cale> | I never use Data.Tree by the way. It has a terrible Show instance, and not so much benefit over just writing my own tree datatype. |
| 00:39:00 | <Cale> | But let's see what your code is doing. :) |
| 00:39:28 | <sm> | I made my own show and utils.. working pretty well.. well thanks, let me paste |
| 00:39:44 | <pumpkin> | doesn't Data.Tree have a nice separate pretty printer that its Show instance doesn't use? |
| 00:40:00 | <Cale> | pumpkin: well, it has an ascii-graphical one |
| 00:40:14 | <Hydrant> | hello... any ubuntu users here? I'm trying to install ghc6 from karmic and getting problems.... so hoping someone has gone through this here before |
| 00:40:16 | <pumpkin> | yeah |
| 00:40:19 | <Cale> | But usually I would just prefer the derived one without the record syntax. |
| 00:40:44 | <Cale> | Hydrant: I'm an Ubuntu user. |
| 00:40:50 | <Cale> | Hydrant: What is karmic? |
| 00:41:00 | <sm> | http://gist.github.com/117319 |
| 00:41:02 | <Cale> | Hydrant: In any case, I don't use Ubuntu's version of GHC. |
| 00:41:19 | <Cale> | Hydrant: Because it's over a year out of date. |
| 00:41:27 | <Raynes> | No one should use Ubuntu's version of GHC. |
| 00:41:38 | <Hydrant> | Cale: alpha ubuntu... I'm trying to get ghc6 version ghc6-6.10.3 |
| 00:41:45 | <Cale> | Hydrant: ah |
| 00:41:54 | <Cale> | Hydrant: Well, that would be current then. |
| 00:42:00 | <sm> | while building the tree, subAccountNamesFrom is called (length accts) ^ 2 times.. I'd like to to better |
| 00:42:02 | <sm> | do |
| 00:42:16 | <Cale> | Hydrant: But if you're having trouble with it, the generic linux binary works well. (At least on the release Ubuntu) |
| 00:42:38 | <sm> | ACTION corrects himself: isSubAccountNameOf is called n^2 times |
| 00:42:53 | <Hydrant> | generic linux binary ? |
| 00:43:12 | <Cale> | http://haskell.org/ghc/download_ghc_6_10_3.html#x86linux |
| 00:43:24 | <Hydrant> | In particular I'm attempting to install geordi, C++ bot... I found this one site that says if I don't use ubuntu ghc6 badness happens.. http://jpnurmi.kapsi.fi/blog/2008/01/24/howto-install-geordi-on-ubuntu/ |
| 00:44:01 | <Cale> | Whaaaat... |
| 00:44:02 | <Cale> | hmm |
| 00:44:41 | <Cale> | Oh, but that was written in 2008 anyway, I wonder how correct it is. |
| 00:45:03 | <Hydrant> | yah, I'll try the binaries |
| 00:45:19 | <Cale> | 6.10.1 wasn't even out yet. |
| 00:45:45 | <Cale> | Nor was 6.8.3 |
| 00:46:00 | <Cale> | 6.8.2 was current when that blog post was written :) |
| 00:47:38 | <thoughtpolice> | Cale: 6.8.2 is still current for a few distors (ubuntu/ppc etc.) |
| 00:47:46 | <thoughtpolice> | Cale: at least xmonad works :) |
| 00:48:06 | <Cale> | Well, only because those distributions have terrible Haskell support. |
| 00:48:11 | <thoughtpolice> | hehehe |
| 00:48:25 | <thoughtpolice> | well, arch pretty much has the most amazing haskell support you can get |
| 00:48:53 | <MyCatVerbs> | Yes, Arch has a surprising record for not screwing with upstream packages. |
| 00:49:06 | <thoughtpolice> | also there haven't been any recent linux/ppc bindists (i.e 6.10) i've been able to find |
| 00:49:16 | <thoughtpolice> | and porting has only just recently started working again |
| 00:49:55 | <Cale> | Oh, that seems true. |
| 00:50:20 | <Cale> | I suppose because ppc machines are getting harder to obtain? |
| 00:52:41 | <Cale> | sm: hmm, is it impossible to encode the data in such a way that the subaccounts of an account are accessible more directly? |
| 00:53:46 | <Cale> | sm: The problem is that you're going through all the accounts every time to find the subaccounts, which are presumably the same things, and maybe even disjoint... |
| 00:53:52 | <sm> | right |
| 00:54:23 | <sm> | I've parsed in eg ["assets:bank:checking", "assets", "expenses:food"] and I want to make it a tree for easy access |
| 00:54:36 | <MyCatVerbs> | Cale: you can still buy BlueGenes. :) |
| 00:55:08 | <MyCatVerbs> | Cale: I guess the easiest way to get at a PowerPC chip at the moment is to buy an Xbox360 or a PS3, and dig up the SDKs for each. |
| 00:55:13 | <sm> | it's surprising that this is expensive, but with 600 accounts this seems to allocate near a G of ram |
| 00:55:44 | <sm> | not all at once, but.. so it takes a couple of seconds |
| 00:57:52 | <erikc> | PS3 with linux, yea |
| 00:58:23 | <erikc> | the powerpc element in the ps3 is garbage too |
| 00:58:40 | <pchiusano> | hello |
| 01:00:05 | <Cale> | sm: Is there a guarantee that if foo:bar exists, then so does foo? |
| 01:00:07 | <SamB> | what? why not just buy a used Mac? |
| 01:00:25 | <sm> | no, unless I call expandAccountNames |
| 01:00:30 | <Cale> | okay |
| 01:00:54 | <Cale> | Do you want to be careful not to represent foo when foo:bar exists but foo doesn't? |
| 01:01:07 | <p_l> | SamB: While at it, why not a used IBM machine? :D |
| 01:01:35 | <SamB> | p_l: what OSes did IBM provide for them ??? |
| 01:01:38 | <p_l> | ACTION also recalls that there's quite a lot of embedded stuff with quite nice specs that uses PPC |
| 01:01:43 | <p_l> | SamB: AIX and Linux |
| 01:01:46 | <sm> | eh.. I want foo to appear in the tree, even if it wasn't in the original list. So I think no |
| 01:01:50 | <Cale> | okay |
| 01:01:55 | <SamB> | p_l: oh good, not MVS! |
| 01:01:58 | <p_l> | and on newer, iOS aka AS400 |
| 01:01:59 | <sm> | the tree should contain all accts plus all their parents up to the root |
| 01:02:06 | <sm> | this is all at http://joyful.com/darcsweb/darcsweb.cgi?r=hledger;a=headblob;f=/Ledger/AccountName.hs if it's easier to see. I appreciate the extra eyes! |
| 01:02:11 | <p_l> | SamB: MVS and AIX are different. I know, I have MVS installed :D |
| 01:02:50 | <SamB> | p_l: yeah, I'm a bit foggy on the relationships between POWER, PowerPC, and s/3[69]0 |
| 01:02:59 | <p_l> | ACTION just noticed that he misread "good" as "noes" |
| 01:03:37 | <p_l> | SamB: With newest machines (certain with POWER5 and later), the instruction sets of PowerPC and POWER "merged" |
| 01:03:56 | <p_l> | s390 uses completely different design |
| 01:04:18 | <p_l> | (but zOS is SUS-compliant) |
| 01:04:19 | <SamB> | you mean they reintegrated all of POWER into the PowerPC at that point, and vice-versa? |
| 01:04:38 | <p_l> | something like that, afaik |
| 01:04:39 | <SamB> | p_l: what ??? |
| 01:04:45 | <SamB> | zOS is SUS compliant |
| 01:04:46 | <SamB> | ? |
| 01:04:53 | <SamB> | you can do that with EBCDIC ? |
| 01:05:00 | <p_l> | SamB: Yeah, i heard it passed Single Unix Spec. testing |
| 01:06:03 | <p_l> | and you can certainly do that with EBCDIC |
| 01:08:27 | <p_l> | the funny thing is that nowadays, when you run AIX, it seems to be standard to run two partitions for one instance, with modded AIX managing devices... |
| 01:09:06 | <eden> | any yi users about? I've ust installed it, set up the df |
| 01:09:30 | <Cale> | sm: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5201#a5201 -- maybe try this? |
| 01:10:01 | <Cale> | sm: Oh, apparently that's the wrong order for efficiency. |
| 01:11:29 | <eden> | lets continue that... set up the default emacs mode, but it doesn't recognise the escape key. Alas, the keymap documentation is limited to "hack as needed", which doesn't help.... |
| 01:13:51 | <sm> | Cale: that first builds up a tree with nested maps, one per item, then flattens it ? |
| 01:14:14 | <Cale> | It builds up a bunch of path-shaped trees and merges them |
| 01:14:22 | <Cale> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5201#a5202 |
| 01:14:35 | <Cale> | This seems to have no difficulty with 40000 or so items. |
| 01:15:25 | <Cale> | Just tried it with 362880 = 9! items, and it was okay :) |
| 01:15:37 | <sm> | very cool :) |
| 01:15:48 | <sm> | let's see if I can try this before I must catch the bus |
| 01:16:36 | <Cale> | You'll have to do the colon-splitting up front, but I suspect that you already do. |
| 01:19:18 | <eden> | okay, maybe that was too vague. I'm using yi in vty mode, and the error reported in th bottom line is "Unrecognized input: Esc" |
| 01:19:27 | <shapr> | p_l: Why do you want access to a Cell cpu? |
| 01:20:31 | <p_l> | shapr: I think it was MyCatVerbs who stated that easiest way to get PowerPC is to buy PS3 or XBox360 |
| 01:20:55 | <shapr> | ah, right |
| 01:22:11 | <p_l> | I'm personally more interested in getting POWER6, IA64, MIPS64 or AMD Fusion (and of course any modern Alpha) |
| 01:22:14 | <sbahra> | p_l, except the XBox 360 is not very hackable at the moment. |
| 01:22:27 | <p_l> | sbahra: yeah |
| 01:22:28 | <sbahra> | Yes, I think IA64 is the most interesting out of all of these architectures. |
| 01:22:44 | <sbahra> | You can find PPC Mac Mini on eBay for pretty damn cheap. |
| 01:24:04 | <pejo> | Why is IA64 interesting? It's both expensive and "slow" in practice, unless you're doing numerical computations. |
| 01:24:41 | <pumpkin> | ps3 is best price per flop in theory, isn't it? |
| 01:24:44 | <p_l> | pejo: it had some interesting things - I once heard of a method that gave you closures in assembler code :) |
| 01:24:48 | <pumpkin> | partially because sony's still selling it at a loss |
| 01:25:00 | <p_l> | pumpkin: it's very limited when it comes to memory |
| 01:25:05 | <pumpkin> | yeah |
| 01:25:19 | <pumpkin> | if only they'd given us slots instead of stuck it straight on the board :/ |
| 01:25:28 | <pumpkin> | *sticking |
| 01:25:34 | <p_l> | pumpkin: my friend managed to hit a bottleneck by simple playing with random number generation |
| 01:25:43 | <pumpkin> | that sucks |
| 01:25:51 | <pumpkin> | surely games would like more RAM too, and it's cheap |
| 01:26:06 | <p_l> | pumpkin: console devs are used to much smaller amounts than 256MB :P |
| 01:26:17 | <pumpkin> | yeah, but they could do crazy stuff with more |
| 01:26:21 | <pumpkin> | :P |
| 01:26:47 | <shapr> | pumpkin: ps3 ram isn't that cheap, it's at-cpu-speed RDRAM. |
| 01:26:53 | <pumpkin> | ah |
| 01:27:25 | <p_l> | if you want Cell for HPC, I'd go with IBM blade servers or those PCI-X/PCI-Express SoCs |
| 01:27:28 | <eden> | pumpkin; by the way, I discovered the solution to the parsec problems you tried to help with was to simply "import Text.Parsec", and hide the clashing function names. |
| 01:27:39 | <shapr> | The most recent generation of Cell blades has 1GB of RDRAM for each cell core, and slots for up to 4 or 8 gb DDR2 buffer memory, I forget how much. |
| 01:27:45 | <gwern> | @seen nomeata |
| 01:27:45 | <lambdabot> | I saw nomeata leaving #darcs, #xmonad and #haskell 2h 28m 54s ago, and . |
| 01:27:48 | <sm> | Cale: got to convert this to my tree type.. or convert the app to the new one |
| 01:27:49 | <shapr> | p_l: Those guys are expensive though. |
| 01:27:56 | <shapr> | p_l: And a pain in the butt to run. |
| 01:27:59 | <sm> | I'll let you know when I can compare performance |
| 01:28:04 | <Cale> | sm: Okay |
| 01:28:08 | <p_l> | shapr: if you want speed... |
| 01:28:21 | <sm> | thanks a lot, I'm gone |
| 01:28:31 | <shapr> | For example, I have what appears to be a perfectly sensible partition on this QS20 drive, but it still doesn't talk to the network. |
| 01:28:35 | <gwern> | @tell nomeata might be good to amend the documentation for darcswatch to note that replies-to-emails *must* include the attachment - I've been experimenting and that seems to be the magical sauce I've been forgettting - gmail removes them by default |
| 01:28:36 | <lambdabot> | Consider it noted. |
| 01:28:41 | <shapr> | And I don't have a console cable, so I can't see what's broken. |
| 01:28:41 | <pumpkin> | I'll be back later :) |
| 01:28:53 | <p_l> | shapr: HMC? |
| 01:28:58 | <shapr> | p_l: I found some cheap QS21s, but they're not compatible with the E chassis. |
| 01:29:01 | <shapr> | HMC? |
| 01:29:05 | <shapr> | What's that? |
| 01:29:25 | <p_l> | Hardware Management Console |
| 01:29:49 | <shapr> | The QS20 blades can't talk to the advanced management console for remote control. |
| 01:30:00 | <p_l> | shapr: what about their enclosure? |
| 01:30:06 | <shapr> | Your only option is the $50 hard-to-find serial cable. |
| 01:30:12 | <shapr> | Er, what about their enclosure? |
| 01:30:47 | <shapr> | I really wish I could get my hands on fourteen QS22s for little or no money. Not like that's gonna happen. |
| 01:30:58 | <p_l> | shapr: I think the ones I had seen had Service Processor in chassis which let you talk from HMC to blades |
| 01:31:23 | <shapr> | All the IBM BladeCenter blades except for the QS20s will let you remote control the console. |
| 01:31:38 | <shapr> | And the QS21s only work in an H or T chassis. |
| 01:31:55 | <p_l> | heh |
| 01:31:57 | <shapr> | p_l: I have an E chassis and seven QS20s here in my apartment, want to help me fix them? :-) |
| 01:32:29 | <SamB> | shapr: what is this cable you don't have ...? |
| 01:32:41 | <gwern> | Haskellers! Tonight we write in Malbolge! |
| 01:32:54 | <shapr> | It's some crazy custom order molex cable for the micro-serial plug on the front of the QS20 blades, want me to take a picture? |
| 01:33:01 | <SamB> | gwern: no thanks |
| 01:33:19 | <SamB> | I can't even remember if that's worse than intercal or not ... |
| 01:33:24 | <shapr> | It's also a 24 day lag time cable order, it's frustrating. |
| 01:33:32 | <shapr> | p_l: On the good side, my x86 blades work great :-) |
| 01:33:36 | <p_l> | I have no real experience with them (I wasn't given access to that stuff - I learned about HMC due to being company representative during p560 installation) |
| 01:33:57 | <gwern> | (go, stranger passing by, / and tell the haskellers that / obedient to their types / here we lie) |
| 01:34:18 | <gwern> | SamB: what are you a woman? have you no guts for glory? |
| 01:34:30 | <shapr> | p_l: Recent pix: http://picasaweb.google.com/shae.erisson/UbuntuOnMyBladeCenter# |
| 01:34:33 | <p_l> | gwern: a persian |
| 01:34:46 | <gwern> | p_l: yes, well... |
| 01:34:46 | <SamB> | gwern: I don't like to program in languages where I have to FIGHT just to get a VALID program ... |
| 01:34:50 | <EvilTerran> | SamB, it's substantially worse than intercal, i believe |
| 01:35:05 | <gwern> | SamB: but as a haskeller, you should feel right at home... |
| 01:35:09 | <SamB> | I'd prefer something like Ulambda |
| 01:35:26 | <SamB> | gwern: oh, that's not the same kind of fight at all |
| 01:35:40 | <SamB> | that's where the compiler is seeing that I'm saying stuff that doesn't actually mean anything |
| 01:35:47 | <SamB> | totally different |
| 01:35:48 | <gwern> | eh. it's the same kind of fight in the same way a bar fight's a cat fight |
| 01:35:56 | <gwern> | in mud |
| 01:36:03 | <Gracenotes> | mud, you say |
| 01:36:08 | <p_l> | shapr: hah, system complaining about not connected PSUs... It's one of my favourite messages, ever since commandeering an old proliant in high school :) |
| 01:36:10 | <SamB> | what does any of this have to do with porn ...? |
| 01:36:55 | <eden> | Nope? Oh well, however much nicer the syntax colourisation is in Yi, I can continue with ordinary emacs. |
| 01:36:59 | <byorgey> | @remember gwern bleh. haskell is messing me up. I wondered what operator =) is, before I realized it was a syntax error, before I realized it was an emoticon |
| 01:37:00 | <lambdabot> | It is forever etched in my memory. |
| 01:37:59 | <gwern> | eden: it's kind of hard to debug an error like that. it could be a dozen things - you didn't enable vi mode right, vty doesn't like your terminal, you're using old libraries/yi, etc |
| 01:38:52 | <roconnor> | what is the opposite of a "conservative assumption" ? |
| 01:39:28 | <EvilTerran> | a nservative assumption? :P |
| 01:39:34 | <roconnor> | :P |
| 01:39:34 | <gwern> | a liberal |
| 01:39:46 | <roconnor> | :) |
| 01:41:02 | <SamB> | yeah, I guess a liberal assumption ... |
| 01:41:18 | <SamB> | but you should specify what about when you mention it |
| 01:41:26 | <gwern> | d'oh! |
| 01:41:39 | <EvilTerran> | substantial assumption? |
| 01:41:44 | <gwern> | ACTION just sent an email meant for darcswatch with the cc 'REJECTED', to the patch author |
| 01:41:51 | <gwern> | hope he isn't insulted -_- |
| 01:42:29 | <SamB> | I mean, is it a lot of CPU, loads of RAM, an actual implementation of ISO C99 ? |
| 01:42:31 | <eden> | gwern: For sure. But it's the only error message provided to me.It's most likely to be a configuration mistake. but without configuration documentation, all I can do is hope there's somebody with experience. |
| 01:42:32 | <SamB> | what are you assuming ? |
| 01:42:47 | <gwern> | eden: you could just steal one of the existing configs |
| 01:42:55 | <gwern> | it's fairly safe to assume they work |
| 01:42:57 | <roconnor> | I was going to say "detrimental assumption" |
| 01:43:22 | <gwern> | isn't a conservative one a detrimental one? |
| 01:43:24 | <roconnor> | SamB: I'm ignoring non-jackpot payouts of lotto tickets. |
| 01:43:41 | <roconnor> | gwern: a conservative assumption is a harmless assumption. |
| 01:43:42 | <SamB> | roconnor: they HAVE those ? |
| 01:43:58 | <eden> | gwern: Fine. Where are they? I've looked pretty hard. |
| 01:44:05 | <roconnor> | SamB: you can win like $5 for matching 3 numbers. |
| 01:44:23 | <gwern> | a conservative assumption is that the bridge you are building will receive 10x the expected traffic. and they'll all be carrying elephants. a liberal one is that no one will cross it, except monks who massage the road surface with ghee as they recite hymns in praise of the designer |
| 01:44:32 | <SamB> | roconnor: hmm, doesn't seem like a good one to ignore ... |
| 01:44:34 | <gwern> | eden: in Yi/Users/ |
| 01:44:59 | <SamB> | gwern: wouldn't the glee cause added stress ? |
| 01:45:18 | <SamB> | ACTION also thought road traffic was measured in tons |
| 01:45:19 | <eden> | gwern: Cheers. I take a look there. |
| 01:45:20 | <gwern> | SamB: ghee is the food of the gods! how could you attribute evil effects to it? |
| 01:45:42 | <roconnor> | SamB: Right. I eventually took it into consideration. |
| 01:45:44 | <SamB> | gwern: well, generally people move faster when gleeful |
| 01:45:54 | <gwern> | no no, not 'glee', 'ghee' |
| 01:46:04 | <SamB> | gwern: oh! |
| 01:46:06 | <SamB> | oops |
| 01:46:08 | <SamB> | misread |
| 01:46:23 | <SamB> | so ... you want the bridge to get EATEN ? |
| 01:46:30 | <Hydrant> | I'm trying to build a package, and getting an error: http://rafb.net/p/bNrvGy38.html |
| 01:46:53 | <eden> | Ah, I'm from the West Midlands, the very home of Balti cooking. Ghee is a special |
| 01:46:58 | <gwern> | SamB: no one would eat a bridge. even one dripping with ghee |
| 01:47:07 | <SamB> | gwern: not even a God ? |
| 01:47:17 | <gwern> | gods don't exist, silly |
| 01:47:30 | <SamB> | well then how can you claim that they eat things ? |
| 01:47:43 | <gwern> | can you claim they don't? |
| 01:48:00 | <eden> | some of the brumigham boneheads would try a bridge if it had extra chillii sauce |
| 01:48:01 | <SamB> | dunno! |
| 01:48:16 | <SamB> | but you can't claim that they do, either |
| 01:48:29 | <SamB> | eden: you mean burmingham ? |
| 01:48:42 | <gwern> | I rather think it inherent in the definition of a god that were they to exist, they could eat a bridge |
| 01:49:25 | <SamB> | I was talking about the ghee, actually |
| 01:49:37 | <byorgey> | Hydrant: usually that error is caused by the required package (random in this case) missing from the Build-depends: line in the .cabal file for the package |
| 01:50:04 | <eden> | Yes, Brumigham is the usual British colloquialism for Birmigham. |
| 01:50:16 | <eden> | this get |
| 01:50:32 | <Hydrant> | byorgey: fixed, going now |
| 01:50:37 | <eden> | it gets sortend to "brum" most of the time. |
| 01:50:38 | <byorgey> | Hydrant: great |
| 01:51:33 | <gwern> | yes, that seems very british |
| 01:52:03 | <gwern> | (when I visited london, I was surprised how it struck me as dirty and shabby; and what little I saw of the rest of England wasn't much different) |
| 01:53:26 | <eden> | Did you spend much time in pubs? if so, then impression you got is totally reasonable. |
| 01:54:58 | <p_l> | afk |
| 01:56:24 | <Adamant_> | if you take a train in London, you will almost certainly go through some very crappy areas, but there are plenty of areas that are well taken care of. |
| 01:57:27 | <Adamant_> | the college towns are quite nice for instance. |
| 01:57:36 | <Adamant_> | outside of London. |
| 01:59:16 | <eden> | gwern: youu say Yi/Users. I can't find such a thiing |
| 02:04:49 | <dmwit> | Definitely the shortest doc I ever saw: http://www.haskell.org/ghc/docs/6.10.1/html/libraries/ghc/StrictAnal.html |
| 02:05:26 | <copumpkin> | thing like that don't need an explanation |
| 02:06:11 | <EvilTerran> | o.ó |
| 02:07:33 | <dibblego> | remind me, how is ω pronounced? |
| 02:07:47 | <kpreid> | omega |
| 02:07:58 | <dibblego> | ah yeah ta |
| 02:08:11 | <eden> | I know some SMers that go about with T-shirts with the slogan "#!/usr/bin/perl -s", so I guess that's another way Haskell is more pure... |
| 02:08:37 | <malouin> | dibblego: like a long o as in saw. |
| 02:09:18 | <jrockway> | hey, anyone writing any media-player-related-things in haskell? |
| 02:09:28 | <jrockway> | i am getting kind of fed up with the xmms2 design (and implementation) |
| 02:09:44 | <shapr> | I like mpd |
| 02:09:44 | <jrockway> | (mpd is not much different) |
| 02:09:47 | <jrockway> | heh |
| 02:09:54 | <kpreid> | and malouin provides the *other* answer. |
| 02:10:01 | <jrockway> | both fail at copying the bits from a file to the audio hardware without changing them |
| 02:10:11 | <jrockway> | xmms2 can't even play files with 24-bit samples |
| 02:10:24 | <copumpkin> | can your hardware? |
| 02:10:28 | <jrockway> | yes |
| 02:10:56 | <jrockway> | anyway, just curious |
| 02:11:18 | <jrockway> | a related issue is how vlc, mplayer, etc. crash when they encounter bad data |
| 02:11:34 | <jrockway> | it annoys me, because your program should not die with a memory error because an input file contains an error :) |
| 02:11:58 | <copumpkin> | that is bad |
| 02:11:59 | <dmwit> | Wow, I've never had that happen. |
| 02:12:14 | <dmwit> | What kind of junk are you feeding your poor pet players? |
| 02:12:34 | <alexey23> | jrockway, pure xmms2 from command line is OK for me :-) |
| 02:12:44 | <dmwit> | I feed mine jpgs sometimes by accident, but they don't crash... they just tell me off. |
| 02:13:18 | <jrockway> | yeah, it is usually around corner cases |
| 02:13:30 | <jrockway> | but really, i am just wondering if anyone else is working on this sort of thing |
| 02:14:37 | <dmwit> | I do not SAGN. |
| 02:14:44 | <eden> | Nah. fighting a text editor that claims to be like emacs is too much pain.One to give up as a bad job. |
| 02:14:52 | <dmwit> | mpd just works for music, mplayer just works for video |
| 02:15:20 | <copumpkin> | eden: ? |
| 02:15:25 | <jrockway> | dmwit: i will agree that they work 99% as i'd expect |
| 02:15:35 | <jrockway> | sometimes the 1% annoys me, though :) |
| 02:15:57 | <dmwit> | I would think that if somebody started something new now, it would be more than 1% annoying. =P |
| 02:16:31 | <jrockway> | for mplayer, yes |
| 02:16:40 | <jrockway> | since there are 100 million different codecs to support |
| 02:16:43 | <jrockway> | but for audio, it's simpler |
| 02:16:50 | <jrockway> | mp3, vorbis, flac, wav, and you are done |
| 02:17:32 | <eden> | copukin; I was trying yi.I don't mind tuning an editor, but it needs enough documentation for it to bbe worth the time. |
| 02:17:39 | <dmwit> | What, you're not going to support my huge library of legacy Unix noises in .au format? ;-) |
| 02:17:54 | <jrockway> | you can convert those to flac offline ;) |
| 02:19:02 | <roconnor> | jrockway: awsome. I put all those audio codecs into OS/2. Apparently I'm done. |
| 02:19:18 | <roconnor> | well, except for wav. OS/2 comes with that. |
| 02:22:23 | <thoughtpolice> | eden: yi is still very much a work in progress |
| 02:22:29 | <alexey23> | jrockway, and there is real media / windows media stuff (but it is bad to promote proprietary technology...) |
| 02:22:56 | <thoughtpolice> | eden: there are almost daily fixes/enhancements made to the codebase, especially by jpb |
| 02:23:02 | <roconnor> | is mp3 still proprietary? |
| 02:23:31 | <gwern> | eden: Yi/Users is a directory in the darcs repo; dunno if it's in the hackage tarball |
| 02:23:44 | <gwern> | roconnor: far as I know. it's gif that fell out of patent recently |
| 02:24:05 | <roconnor> | well, gif fell out many years ago |
| 02:24:12 | <alexey23> | roconnor, a sort of. |
| 02:25:18 | <roconnor> | ``The various patents claimed to cover MP3 by different patent-holders have many different expiration dates, ranging from 2007 to 2017 in the U.S. |
| 02:25:21 | <roconnor> | according to wikipedia |
| 02:25:52 | <jrockway> | interesting |
| 02:26:07 | <jrockway> | i am largely migrated to FLAC... except for mp3s that I have downloaded or bought from amazon |
| 02:26:11 | <roconnor> | I expect many of these patents to be questionable |
| 02:26:24 | <jrockway> | i found a record label that will sell me un-DRM'd 192Khz 24-bit FLAC files, though, which i think is awesome |
| 02:26:36 | <roconnor> | that is awesome |
| 02:26:55 | <eden> | thoughtpolice: All software is a work in progress.I like haskell a lot, but is suffers horribly from libraries wit piss poor documentation. A list of type signatures is not documentation. It at least requires examples you can modify. |
| 02:26:59 | <Cale> | I can't hear the difference between flac and ogg -q6 anyway. |
| 02:27:17 | <copumpkin> | eden: types very often are almost as good as documentation |
| 02:27:19 | <Cale> | And since I'm not editing the audio, it just seems like a waste of space to me. :) |
| 02:27:22 | <jrockway> | (http://www.linnrecords.com/) |
| 02:27:23 | <copumpkin> | eden: if not better! ;) |
| 02:27:24 | <alexey23> | jrockway, FLAC is a waste of space. |
| 02:27:29 | <jrockway> | incidentally, they are from glasgow |
| 02:27:29 | <copumpkin> | space is cheap |
| 02:27:30 | <idnar> | alexey23: space is cheap :P |
| 02:27:36 | <jrockway> | alexey23: a 2TB hard drive is like $100 now |
| 02:27:45 | <jrockway> | no need to throw away data to save a penny |
| 02:27:53 | <idnar> | if I use FLAC, I don't need to worry about exactly how much lossiness I can tolerate |
| 02:28:01 | <idnar> | and I can always switch to something better if something better comes along |
| 02:28:04 | <roconnor> | I sort of agree with jrockwell. |
| 02:28:17 | <copumpkin> | me too, I bought craploads of space just for that reason |
| 02:28:21 | <idnar> | incidentally, decoding Ogg Vorbis is horribly computationally expensive, making it a poor choice for portable players and the like |
| 02:28:35 | <roconnor> | I don't think I'd go out of my way to get FLAC, but I wouldn't bother coverting it either. |
| 02:28:37 | <jrockway> | the key is to not leave your house :) |
| 02:28:41 | <eden> | gwern; it's not in hackage. I used cabal to intsall it, which throws |
| 02:28:53 | <Cale> | I don't have any portable computational devices. |
| 02:28:54 | <eden> | ... away the source. |
| 02:28:56 | <jrockway> | but i have rockbox on my ipod, and listening to flac and vorbis still leaves me with 10 hours of battery life |
| 02:28:59 | <copumpkin> | jrockway: is the scottish chamber orchestra any good? |
| 02:29:08 | <gwern> | eden: look into cabal unpack |
| 02:29:16 | <jrockway> | copumpkin: some of it, yes |
| 02:29:28 | <idnar> | Vorbis uses my battery up like 5x faster than anything else |
| 02:29:44 | <idnar> | FLAC is also a bit of a battery hog, but that's mostly just because of the relatively larger filesize, rather than the actual decoding complexity |
| 02:29:45 | <eden> | compukin I disagree. The type signatures are fine as reference material, but no good at all if you're new to something. |
| 02:29:51 | <idnar> | Musepack definitely wins on decoding cost, though |
| 02:30:21 | <alexey23> | jrockway, I don't think that it is practically possible for my hardware or my ears to feel the difference between high quality OGG and FLAC. And space is still important for portable players. |
| 02:30:41 | <jrockway> | yeah, you can always encode to mp3 for use on the portable player |
| 02:30:47 | <Cale> | Besides, the vast majority of the music I listen to was recorded in the 70's with not enough fidelity for it to make a difference anyway :P |
| 02:30:56 | <jrockway> | i think good headphones makes the biggest difference out of anything |
| 02:30:57 | <eden> | gwern I'll give that a try. still seems like a porr substite for actual documentaion. |
| 02:31:00 | <gwern> | alexey23: one of the rare benefits of being hearing impaired! I *know* I can't hear the difference between ogg and flac :) |
| 02:31:15 | <idnar> | jrockway: good headphones make it possible to tell the difference between bad and good encoding :P |
| 02:31:18 | <gwern> | eden: yi's too big and complex and alpha to have good docs like xmonad |
| 02:31:23 | <dmwit> | eden: Have you got a specific library you want more docs on? |
| 02:31:42 | <jrockway> | yeah, i agree |
| 02:31:51 | <jrockway> | i think most people have bad headphones and they say mp3 sounds fine, though |
| 02:32:03 | <jrockway> | or they have bad headphones, and buy a $2000 DAC, and complain that it still sounds bad |
| 02:32:06 | <jrockway> | well, yeah :) |
| 02:32:10 | <idnar> | haha |
| 02:32:12 | <dmwit> | Actually, a recent study showed that with good headphones, a lot of people *preferred* low-quality encodings. |
| 02:32:16 | <idnar> | I wish I had a $2000 DAC :P |
| 02:32:23 | <jrockway> | me too :) |
| 02:32:26 | <dmwit> | Because they were used to the aliasing and stuff, and missed it in the high-quality encodings. |
| 02:32:29 | <idnar> | dmwit: those are the people that turn the Bass knob up to 11 on their hifi, though |
| 02:32:36 | <copumpkin> | ugh |
| 02:32:50 | <gwern> | if I had a 2000USD DAC, I could sell it. that'd be nice |
| 02:33:04 | <jrockway> | i am most annoyed by music that is clipped |
| 02:33:04 | <gwern> | (get a better pair of hearing aids :) |
| 02:33:06 | <eden> | dewit: I have yet to find good documentation for *any* package, so specifics don't make aany difference. |
| 02:33:13 | <jrockway> | i wish i could obtain an un-"enhanced" version |
| 02:33:21 | <jrockway> | since i can just turn up my volume knob to make it sound louder |
| 02:33:25 | <copumpkin> | eden: it's part of the "avoid success at all costs" motto :) |
| 02:33:26 | <dmwit> | eden: Specifics make a difference because there are people here in a position to create better documentation. |
| 02:33:32 | <Cale> | mp3 does sound quite acceptable, but there are cases where I can tell the difference between mp3 and ogg at the same bitrate. They're usually not enough to actually bother me though. |
| 02:33:36 | <dmwit> | eden: In my experience, the docs have been good, so that's why I ask. |
| 02:33:36 | <gwern> | eden: hm. does the set of bad doc'd packages you've seen include xmonad? |
| 02:33:38 | <idnar> | jrockway: clipping (especially frequency clipping) is like nails on a chalkboard to me |
| 02:33:45 | <copumpkin> | eden: specifics also transform your criticism from whining to constructive criticism :) |
| 02:33:50 | <jrockway> | yup, it ruins a lot of excellent music |
| 02:34:02 | <jrockway> | (ok, it is mostly pop, but i do enjoy it from time to time ;) |
| 02:34:35 | <jrockway> | the problem i've had with classical music is an insanely high noise floor |
| 02:34:37 | <idnar> | jrockway: also, listening to low-bitrate encoding through headphones, or even high-bitrate encoding through cheap headphones, gives me a massive headache after like 5 minutes |
| 02:34:53 | <idnar> | for a long time, I thought it was just impossible for me to use headphones / earphones |
| 02:35:05 | <idnar> | then I was eventually introduced to high quality audio equipment :P |
| 02:35:09 | <jrockway> | ahh :) |
| 02:35:16 | <dmwit> | (...and therefore the people who wrote the docs you're complaining about may also think they're good. They can't know any different until someone says a specific library. =) |
| 02:35:20 | <jrockway> | i have always been a headphones person, since good speakers are out of my price range |
| 02:35:44 | <idnar> | bad speakers still sound awful, but at least I don't get headaches |
| 02:35:45 | <jrockway> | my apartment also has concrete floors, which makes for ... interesting ... acoustics |
| 02:36:11 | <dmwit> | idnar: Yeah, I've gotten those headaches, too. It's really annoying. |
| 02:36:24 | <davidL> | if a string with length 2^{|V|+1} can be derived from a context-free grammar whose set of non-terminals is V, is this enough to prove (via the pumping lemma) that the grammar's language is infinite? |
| 02:36:39 | <jrockway> | ok, i am being pulled away for dinner now :) |
| 02:36:48 | <jrockway> | if i write anything haskelly for listening to music, i will report back |
| 02:37:08 | <eden> | copumkin: you're right. But it's hard to provide constructive criticism for something that gives you no idea of exactly hat the problem is. |
| 02:38:01 | <dmwit> | davidL: Definitely not. |
| 02:38:02 | <gwern> | eden: generally, you look at a library and tell the author 'I have problem X, and this library seems to cover it, but after looking through it, I have no idea how to do X' |
| 02:38:15 | <dmwit> | davidL: Consider the CFG S -> "aaaaaaaaaaaa" |
| 02:38:25 | <dmwit> | davidL: It has only one nonterminal, and it derives a longish string... |
| 02:38:37 | <alexey23> | davidL, no. |
| 02:38:44 | <copumpkin> | eden: surely there was something you looked at that you wanted to find more about, but there was crappy documentation. Simply saying specifically which of the things you looked at were unsatisfactory, instead of extrapolating and saying all of haskell documentation is bad, would probably be helpful. Better still would be to contact the maintainers of the packages that have bad documentation to ask them (or provide!) |
| 02:39:18 | <eden> | gwern: does that often work? Every time I've tried that I get pointed here. |
| 02:39:33 | <gwern> | eden: it worked the last time I tried it with tagsoup |
| 02:39:34 | <davidL> | dmwit: hmmm |
| 02:39:35 | <gwern> | ACTION shrugs |
| 02:39:47 | <roconnor> | ugh |
| 02:40:10 | <dmwit> | eden: Perhaps the problems you're having are related to the language, not the libraries. ;-) |
| 02:40:21 | <roconnor> | Anyone asking me to provide documentation, please include a cheque with your request. |
| 02:40:22 | <davidL> | dmwit: the CFG is in CNF, I forgot to mention |
| 02:40:30 | <gwern> | roconnor: that' |
| 02:40:31 | <gwern> | s mean! |
| 02:40:46 | <roconnor> | :) |
| 02:40:59 | <roconnor> | I have better things to do than document my own code. I already know how to use it. :P |
| 02:41:25 | <dmwit> | davidL: In CNF, nonterminals go to pairs of nonterminals or a single terminal, is that right? |
| 02:41:34 | <davidL> | dmwit: so S -> aaaaaaaaaaaaaa will be reduced to a grammar with many nonterminals |
| 02:41:34 | <dmwit> | davidL: If so, then you don't even need the pumping lemma. =) |
| 02:41:57 | <roconnor> | ... |
| 02:42:09 | <davidL> | dmwit: why don't I need the pumping lemma? |
| 02:42:17 | <roconnor> | actually, aside from finishing my thesis, I guess I don't actually have anything better to do. |
| 02:42:38 | <gwern> | ACTION loves thesis deadlines. I love the wooshing sound they make passing by |
| 02:42:57 | <roconnor> | gwern: my deadline was last december |
| 02:43:09 | <gwern> | a fond memory! |
| 02:43:45 | <dmwit> | davidL: I guess it's basically the pumping lemma; but you could also use the pigeon-hole principle to show that you had to derive a "cycle" to get to that string. |
| 02:43:59 | <dmwit> | But yeah, the lemma you're proposing should be true. |
| 02:44:58 | <eden> | dmwit: I'm still learning. As with all languages, learning the language isn't usually the issue, it's learning how to use the libraries that's difficult. Extrapolating from every library I've tried to use to all the libraries that exist is also unfair, but doesn't lead to a way forward either. |
| 02:45:27 | <davidL> | dmwit: I need to prove the language of all PDAs that accept infinite languages is decidable, so my proof was simply to attempt to generate a string that's at least 2^{|V|+1} long |
| 02:46:12 | <dmwit> | You'll also need an upper bound, I think. |
| 02:46:18 | <davidL> | hm, yeah |
| 02:47:19 | <dmwit> | In fact, for decidability proofs, lower bounds usually don't matter. ;-) |
| 02:47:36 | <dmwit> | Your algorithm can be spectacularly inefficient and nobody cares. |
| 02:48:24 | <davidL> | yup |
| 02:49:16 | <eden> | There are also some counter-examples. The parsec documentation is pretty good, even if it's so out of date that if nearly every package has been renamed a couple of times. |
| 02:49:41 | <davidL> | although a simpler method might be to try each derive each terminal in the grammar and see if it ever loops |
| 02:50:18 | <dmwit> | davidL: There could easily be several ways to derive any given terminal. |
| 02:50:28 | <dmwit> | ...or none |
| 02:50:40 | <davidL> | dmwit: errr, I meant nonterminal |
| 02:50:59 | <dmwit> | same complaint |
| 02:51:49 | <davidL> | dmwit: well in CNF, "useless" nonterminals have been removed, so each nonterminal is reachable |
| 02:52:47 | <Axman6> | hmm, i'm confused by http://en.wikipedia.org/wiki/One-way_function . wouldn't const x be a candidate, or (+)? |
| 02:52:48 | <davidL> | and if from one nonterminal, you can get back to itself in any number of steps, the grammar is recurrsive and thus infinite |
| 02:52:53 | <dmwit> | Hm, can it be as easy as cycle detection in the production graph? |
| 02:53:35 | <dmwit> | Axman6: Add "injective" to the definition. ;-) |
| 02:53:42 | <davidL> | dmwit: isn't the cycle the pump? |
| 02:53:44 | <Axman6> | injective? |
| 02:53:51 | <dmwit> | (+) is definitely not one-way, since it's easily invertible. |
| 02:53:53 | <dmwit> | via (-) |
| 02:54:01 | <Axman6> | hmm |
| 02:54:42 | <Axman6> | so the point is not to get the outputs back that you put in from the output of the original function? |
| 02:54:56 | <dmwit> | err... what? |
| 02:55:11 | <Axman6> | yeah, that was difficult enough for me to understand :P |
| 02:55:38 | <dolio> | They have to be injective if you're going to (necessarily) get back what you put in at all. |
| 02:55:58 | <dmwit> | The interesting thing about one-way functions is that, given an output, it's hard to demonstrate *any* input that yields that output. |
| 02:56:08 | <jeffwheeler> | What a difference a small underscore can make . . . |
| 02:56:16 | <Axman6> | hmm |
| 02:56:19 | <dmwit> | So const is a bad example, because given the output "3", I can demonstrate the input (3, ()), which yields that output. |
| 02:56:21 | <dolio> | If you're just hashing, then you don't need injectivity. |
| 02:56:30 | <dolio> | But 'const x' is a pretty bad hash. |
| 02:56:34 | <dmwit> | (+) is also a bad example, because given the output "x", I can demonstrate the input (x, 0). |
| 02:56:41 | <Axman6> | what's injective mean? |
| 02:56:52 | <dmwit> | Injective means any two different inputs yield different outputs. |
| 02:57:04 | <Axman6> | dmwit: so, you're not trying to find the exact input that was used to find the output then |
| 02:57:12 | <Axman6> | ok |
| 02:57:12 | <dmwit> | Not necessarily, no. |
| 02:57:25 | <Axman6> | alright, i see how this is hard then ;) |
| 02:58:16 | <dmwit> | Check the definition: we want that for any easy function A and one-way function f, f(A(f(x))) = f(x) should be unlikely. |
| 02:58:29 | <dmwit> | (any easy, randomized function A) |
| 02:58:46 | <dmwit> | So if A can demonstrate any input to f that gives the same answer as the original input to f... |
| 02:59:21 | <dmwit> | dolio: If you're hashing, do you care about one-way-ness? |
| 02:59:38 | <Axman6> | so a one way function would have to produce a unique output for every input? |
| 02:59:47 | <dmwit> | No, I don't think so. |
| 02:59:53 | <dmwit> | I said it above, but I didn't mean it. |
| 03:00:15 | <dmwit> | It's okay if it gives the same output for several inputs, as long as all of those inputs are hard to find. =) |
| 03:00:17 | <dolio> | dmwit: I don't know. I didn't really think about it. :) |
| 03:00:26 | <Axman6> | heh, i see |
| 03:00:46 | <dolio> | dmwit: If you can compute inverse images of a hash function easily, that'd probably be bad. |
| 03:00:58 | <dmwit> | For hashing, though? |
| 03:01:02 | <dmwit> | I mean, for password stuff, yeah. |
| 03:01:15 | <dmwit> | But for a hashtable, who cares? |
| 03:01:18 | <dolio> | I mean for cryptographic hashes. |
| 03:01:22 | <dmwit> | oooooooooookay |
| 03:01:27 | <dmwit> | Never mind, then. =) |
| 03:02:14 | <Axman6> | so the point isn't that you don't know what was used to find the output, but that you need to find an input that produces that output |
| 03:02:33 | <dmwit> | right |
| 03:02:38 | <Axman6> | ok, excellent |
| 03:02:42 | <Axman6> | thanks dmwit |
| 03:02:50 | <Axman6> | dmwit++ |
| 03:02:52 | <Axman6> | dolio++ |
| 03:02:55 | <dmwit> | Think of it this way: you hacked into somebody's password database, and you have their hashed passwords. |
| 03:03:16 | <dmwit> | You don't care if you get the exact password of the user; if you get some other random string that happens to hash to the same thing, that's fine with you. |
| 03:03:25 | <jeffwheeler> | The whole username++ thing doesn't really make sense in #haskell. |
| 03:03:30 | <dmwit> | eh? |
| 03:03:33 | <dmwit> | ?karma |
| 03:03:34 | <lambdabot> | You have a karma of 2 |
| 03:03:42 | <jeffwheeler> | A global state? |
| 03:03:46 | <dmwit> | You bet! |
| 03:03:57 | <dmwit> | There's lots of global state here! |
| 03:04:09 | <jeffwheeler> | The syntax isn't even coherent in Haskell. :P |
| 03:04:10 | <dmwit> | Like ?quote, ?karma, ?poll, ?seen, ... |
| 03:04:23 | <dmwit> | ?tell jeffwheeler off |
| 03:04:23 | <lambdabot> | Consider it noted. |
| 03:04:25 | <Axman6> | poll? |
| 03:04:29 | <dmwit> | poll! |
| 03:04:30 | <Axman6> | @help poll |
| 03:04:30 | <lambdabot> | poll provides: poll-list poll-show poll-add choice-add vote poll-result poll-close poll-remove |
| 03:04:38 | <Axman6> | ah ha |
| 03:04:50 | <jeffwheeler> | ?help tell |
| 03:04:50 | <lambdabot> | tell <nick> <message>. When <nick> shows activity, tell them <message>. |
| 03:05:17 | <jeffwheeler> | I didn't get my message. :( |
| 03:05:17 | <lambdabot> | jeffwheeler: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 03:05:25 | <jeffwheeler> | Oh, I see; it can't be a message to lambdabot. |
| 03:07:20 | <jeffwheeler> | It doesn't interpret its own output, does it? |
| 03:07:42 | <jeffwheeler> | > print $ "dmwit" ++ "++" |
| 03:07:43 | <lambdabot> | <IO ()> |
| 03:07:50 | <jeffwheeler> | > "dmwit" ++ "++" |
| 03:07:51 | <lambdabot> | "dmwit++" |
| 03:08:05 | <Apocalisp> | heh |
| 03:08:23 | <jeffwheeler> | ?karma dmwit |
| 03:08:24 | <lambdabot> | dmwit has a karma of 2 |
| 03:08:40 | <Apocalisp> | first time with lambdabot, jeffwheeler? |
| 03:08:51 | <jeffwheeler> | Apocalisp: not at all |
| 03:09:11 | <Apocalisp> | Didn't think so. |
| 03:09:24 | <jeffwheeler> | Just playing about . . . #yi is being lame. |
| 03:09:37 | <Apocalisp> | How is yi? |
| 03:09:57 | <jeffwheeler> | I love it, although I've been trying to get tabs working in the Pango (GTK) UI all day, without much success . . . |
| 03:10:27 | <jeffwheeler> | And we've also fallen from around 30 people in the room around the last release to 15. |
| 03:10:40 | <Apocalisp> | why's that? |
| 03:10:43 | <jeffwheeler> | no idea |
| 03:10:54 | <Apocalisp> | I tried yi for a bit. Liked it quite a lot. |
| 03:10:59 | <dmwit> | I've found a few ways to increase my own karma. |
| 03:11:10 | <jeffwheeler> | Trick others? |
| 03:11:10 | <dmwit> | It's not that hard... but not that useful, either. =) |
| 03:11:32 | <Apocalisp> | thanks for pointedlist, by the way, jeffwheeler |
| 03:11:51 | <Apocalisp> | Useful stuff. |
| 03:11:51 | <jeffwheeler> | Apocalisp: your welcome; what'd you use it for? |
| 03:12:09 | <jeffwheeler> | Much of the original source was from Yi, actually |
| 03:12:20 | <jeffwheeler> | it had been in there for ages, and really didn't belong |
| 03:12:25 | <jeffwheeler> | so I stripped it out and organized it a bit |
| 03:12:32 | <eden> | To draw a provocative example, perl is horrible, huge ugly and ad-hoc lanugage, whereas haskel is beautiful small and coherent language. The documentation for packages in each is the other way round. Perl docs nearly always give you enough examples to go from a standing start, Haskell docs usually give you nothing to work from. This is a cultural problem, not a language problem. Haskell culture is also friendlier than Perl cu |
| 03:12:32 | <eden> | lture, but the differences make it easier to give up and for perl, rather than do thebetter thing and go for haskell. |
| 03:12:42 | <Apocalisp> | I ported it to Scala and Java, that's what. :) |
| 03:13:07 | <jeffwheeler> | Apocalisp: hehe, sweet :) |
| 03:13:21 | <Apocalisp> | Oh, and I sent you a patch for find. |
| 03:13:34 | <jeffwheeler> | Oh, that was you a while back? |
| 03:13:40 | <Apocalisp> | yea |
| 03:13:47 | <jeffwheeler> | :) |
| 03:14:18 | <QtPlaty[HireMe]> | eden: I find myself in aggrement with you. |
| 03:14:20 | <Apocalisp> | Saw that you changed it a bit. Mine worked for infinite lists, you know. :) |
| 03:14:30 | <jeffwheeler> | Ha, what?! |
| 03:14:39 | <Berengal> | eden: Agreed here as well |
| 03:14:58 | <jeffwheeler> | I didn't realize any of the stuff would work for infinite lists. |
| 03:15:01 | <Berengal> | Except for the last bit about giving up |
| 03:15:29 | <Apocalisp> | jeffwheeler: With a bit of modification, pointedlist should work just fine for infinite lefts and rights. |
| 03:15:43 | <jeffwheeler> | Apocalisp: I suppose it could; yes |
| 03:15:45 | <QtPlaty[HireMe]> | eden: I don't know what you mean by "make it easier to give up and for perl" |
| 03:17:32 | <roconnor> | eden: Intresting comment. Are the perl package writers documenting their own work? |
| 03:18:05 | <roconnor> | eden: I wonder if it is an effect of perl packages being older? Hackage is relatively young. |
| 03:18:41 | <eden> | Thanks from the both of you. It's nice to know it's not gust me.and Begegal, I don't intend to give up either. For QPlaty, I mean that many people interested in haskell do give it up. |
| 03:18:48 | <jeffwheeler> | Apocalisp: oh, I get the difference; I'll upload the better version |
| 03:19:01 | <Apocalisp> | yay, I win :) |
| 03:19:10 | <MyCatVerbs> | roconnor: probably not. More that Perl has a really, really strong documentation culture. |
| 03:19:21 | <roconnor> | MyCatVerbs: interesting |
| 03:19:41 | <jeffwheeler> | Apocalisp: yeah, that was clever; I remember wondering why you did that |
| 03:20:02 | <jeffwheeler> | Probably should have asked. ;) |
| 03:20:05 | <MyCatVerbs> | roconnor: I bet that when you get right down to it, at least half of languages' usefulness is really community culture. |
| 03:20:15 | <roconnor> | actually, I haven't really had a problem with lack of documentation. However, it does seem to be pretty bad when other people point out examples. |
| 03:20:48 | <copumpkin> | Monoid up until recently had particularly terrible documentation |
| 03:20:50 | <MyCatVerbs> | You may have set your standards for documentation too low as a result of being used to what's available to you. |
| 03:20:52 | <gwern> | MyCatVerbs: in the trivial sense that libraries and tool support is determined by community... |
| 03:21:00 | <Cale> | http://www.flickr.com/photos/thisdude62/908235443/sizes/o/ -- hehehe |
| 03:21:05 | <walter_> | I am quite green on Haskell, a simple question, how to write a [string] to a file with writeFile |
| 03:21:10 | <MyCatVerbs> | gwern: no, in the nontrivial sense too. |
| 03:21:12 | <copumpkin> | lol |
| 03:21:19 | <MyCatVerbs> | walter_: put it through concat or unlines first. |
| 03:21:22 | <copumpkin> | :t writeFile |
| 03:21:24 | <lambdabot> | FilePath -> String -> IO () |
| 03:21:32 | <roconnor> | MyCatVerbs: perhaps. OTOH, I'm used to reading papers to understand haskell packages. Are other people not doing this? |
| 03:21:51 | <walter_> | <MyCatVerbs>, thanks |
| 03:21:56 | <Apocalisp> | jeffwheeler: Thanks, no worries. |
| 03:22:00 | <gwern> | walter_: hoogle is your friend |
| 03:22:01 | <copumpkin> | most other common languages don't have PDF documentation, let alone papers explaining them |
| 03:22:07 | <gwern> | @hoogle [String] -> String |
| 03:22:07 | <lambdabot> | Prelude unlines :: [String] -> String |
| 03:22:07 | <lambdabot> | Prelude unwords :: [String] -> String |
| 03:22:07 | <lambdabot> | Data.List unlines :: [String] -> String |
| 03:22:17 | <MyCatVerbs> | roconnor: That is not what most programmers tend to call "good" documentation. I mean I suppose it's great in one sense, but you'll notice that a lot of these papers drift away from the practical implementations in small details. |
| 03:22:21 | <gwern> | copumpkin: they'd argue they don't *need* academic papers explaining them... |
| 03:22:26 | <copumpkin> | yup |
| 03:22:28 | <jeffwheeler> | @hoogle [String] -> IO () |
| 03:22:29 | <lambdabot> | Distribution.Make defaultMainArgs :: [String] -> IO () |
| 03:22:29 | <lambdabot> | Distribution.Simple defaultMainArgs :: [String] -> IO () |
| 03:22:29 | <lambdabot> | Distribution.Simple.Command noExtraFlags :: [String] -> IO () |
| 03:22:36 | <jeffwheeler> | @hoogle String -> IO () |
| 03:22:37 | <lambdabot> | Prelude putStr :: String -> IO () |
| 03:22:37 | <lambdabot> | Prelude putStrLn :: String -> IO () |
| 03:22:37 | <lambdabot> | System.IO putStr :: String -> IO () |
| 03:22:37 | <copumpkin> | in some cases, I'd rather have good reference documentation than a paper |
| 03:22:44 | <jeffwheeler> | Forget it . . . |
| 03:22:44 | <copumpkin> | but papers do serve a very important purpose in many cases |
| 03:22:55 | <gwern> | jeffwheeler: you have to piecewise with hoogle |
| 03:22:55 | <Berengal> | roconnor: I too read papers to understand packages, but papers really suck at being references |
| 03:22:59 | <gwern> | *to go |
| 03:23:13 | <jeffwheeler> | gwern: indeed |
| 03:23:19 | <walter_> | gwern, thanks, hoogle great! |
| 03:23:39 | <hatds> | plus, not every package is worthy of an academic paper ;) |
| 03:24:00 | <MyCatVerbs> | But Perl has a culture of good documentation, I guess because Larry and friends act like documentation is important. |
| 03:24:00 | <Berengal> | Papers are good at explaining what some piece of code does, why it's useful and the various use-cases, but it's not indexed |
| 03:24:19 | <MyCatVerbs> | Haskell has a culture of being as helpful as possible to the newbies. That seems to come down from the top, too. |
| 03:24:20 | <roconnor> | MyCatVerbs: I sort of understand what you are saying. It is a bit odd because I read papers to understand fundamental concepts about new idea, then I have an idea about how I expect the interface to be, and it is usually pretty close. |
| 03:25:09 | <MyCatVerbs> | roconnor: That might work great for Control.Arrow, perhaps, but it really is not how I want to learn to use Data.Graph or Graphics.OpenGL. :/ |
| 03:25:14 | <Berengal> | I'm delighted when I come across a package written in literate style |
| 03:25:32 | <eden> | Papers (which I also enjoy reading) are good at giving the rationale for programmin ideas, but their examples are usually very artificial, and give you little idea of how to put them into practice. |
| 03:25:37 | <roconnor> | For example, when I got how lens's work, I then had no problem learning how to use Data.Accessor (a great package btw) |
| 03:26:27 | <copumpkin> | fgl is particularly painful |
| 03:26:29 | <roconnor> | MyCatVerbs: oh, there is a nice paper on how inductive graphs work. |
| 03:26:34 | <copumpkin> | because there is no documentation and the paper about it is ancient |
| 03:26:41 | <copumpkin> | and doesn't correspond to the current library |
| 03:26:42 | <roconnor> | MyCatVerbs: that's what Data.Graph is right? |
| 03:26:53 | <copumpkin> | roconnor: I think you're talking about fgl |
| 03:27:02 | <roconnor> | oh okay |
| 03:27:07 | <roconnor> | what is Data.Graph? |
| 03:27:23 | <copumpkin> | a less ambitious graph library that's also less daunting to get started with :P |
| 03:27:30 | <roconnor> | bah |
| 03:27:31 | <walter_> | <lambdabot>, thanks |
| 03:27:35 | <roconnor> | go read the paper :) |
| 03:27:42 | <copumpkin> | roconnor: I have read the fgl papers |
| 03:27:52 | <walter_> | hoogle makes haskell more charming |
| 03:28:08 | <hackagebot> | pointedlist 0.3.4 |
| 03:28:24 | <MyCatVerbs> | roconnor: yes, I was referring to fgl. |
| 03:28:28 | <jeffwheeler> | Woah, that's neat. |
| 03:28:30 | <copumpkin> | roconnor: they explain how inductive graphs work, but not how to use the library... there's a paper on how to use the library from a few years ago, but a lot of the API has changed so the paper is out of date |
| 03:29:09 | <Cale> | I dislike both Data.Graph and the fgl, sadly. I always end up representing graphs using something like Map Vertex (Set Vertex) (where Vertex is whatever appropriate type) |
| 03:29:13 | <Berengal> | copumpkin: There's another point. Papers aren't updated, usually |
| 03:29:30 | <eden> | copumpkin:You've de |
| 03:29:32 | <MyCatVerbs> | walter_: lambdabot is unlikely to appreciate your gratitude, as heartfelt as it may be. ;) |
| 03:29:37 | <copumpkin> | yeah... it's easier to keep documentation in sync when it's just comments next to the code |
| 03:29:51 | <MyCatVerbs> | copumpkin: \begin{code} and \end{code}! :D |
| 03:29:56 | <copumpkin> | or that :) |
| 03:30:02 | <Cale> | That's why papers should be written in literate Haskell :) |
| 03:30:03 | <Berengal> | I'd also like to think literate comments are easy to keep up to date |
| 03:30:16 | <MyCatVerbs> | You can compile LaTeX to HTML as well, right? |
| 03:30:29 | <MyCatVerbs> | I mean, reasonably nice looking HTML? |
| 03:30:41 | <copumpkin> | yeah, as long as people don't lamely patch .lhs files without paying attention to the flow |
| 03:31:03 | <MyCatVerbs> | ACTION lames all over copumpkin's .lhs. |
| 03:31:07 | <eden> | copumpkin:You've described the an instance of the very problem I've been complaining about. |
| 03:31:09 | <copumpkin> | lol |
| 03:31:14 | <Berengal> | Literate comments are more likely to explain what and why, not how, so changing the how doesn't invalidate the comments |
| 03:31:18 | <copumpkin> | eden: yup :) I definitely acknowledge that it's a problem |
| 03:31:37 | <walter_> | <MyCatVerbs> , :) |
| 03:31:49 | <copumpkin> | but having to figure out documentationless libraries is good for the soul |
| 03:31:52 | <SamB> | see, this is why they ought to include the source to their papers in their library distributions ;-P |
| 03:32:02 | <copumpkin> | back when I was a young haskell neophyte, I had to walk uphill both ways |
| 03:32:16 | <SamB> | copumpkin: with wolverines strapped to your back? |
| 03:32:21 | <copumpkin> | absolutely |
| 03:32:32 | <dmwit> | Does anybody have some free time and wants to make a Haskell binding to GEGL? |
| 03:32:33 | <copumpkin> | ACTION is a child of the 6.10.1 era |
| 03:32:36 | <dmwit> | That would be pretty awesome... |
| 03:32:51 | <gwern> | what is GEGL and why do we want it? |
| 03:32:57 | <SamB> | ACTION thinks he started with 6.4 |
| 03:33:00 | <copumpkin> | :o |
| 03:33:12 | <copumpkin> | ACTION bows to the master |
| 03:33:18 | <Berengal> | ACTION started at 6.8.2 |
| 03:33:21 | <gwern> | I remember worrying about 6.6 compatibility, but that's as far back as I go :) |
| 03:33:34 | <dmwit> | http://gegl.org/ It's a library for modifying large images (maybe bigger than can fit in memory) in a space-efficient way, by lazily loading the parts you're modifying and lazily applying transformations, etc. |
| 03:33:56 | <MyCatVerbs> | dmwit: it's also a cow to build. x_x |
| 03:34:00 | <dmwit> | I bet. |
| 03:34:04 | <dmwit> | It looks like a complicated library. |
| 03:34:09 | <MyCatVerbs> | dmwit: oh and the documentation makes me want to hurt people with hammers. |
| 03:34:17 | <MyCatVerbs> | Spiky hammers. |
| 03:34:20 | <gwern> | dmwit: is it c++? |
| 03:34:25 | <Berengal> | MyCatVerbs: It says "go hurt people with hammers"? |
| 03:34:36 | <MyCatVerbs> | gwern: no, it's straight C, IIRC. That much, I like about it. |
| 03:34:38 | <Berengal> | "Hurting people with hammers is fun" |
| 03:34:45 | <Berengal> | "I once hurt someone with a hammer. It was a great time" |
| 03:34:51 | <dmwit> | gwern: I don't know, but the docs say its got a C API. |
| 03:34:57 | <gwern> | mm |
| 03:34:58 | <dmwit> | And I guess that's the part that really matters. |
| 03:35:12 | <Berengal> | "You know, hammers are enviromental, unlike lead bullets and guns" |
| 03:35:19 | <MyCatVerbs> | Berengal: "On the applicativity of hammers to faces and the fun to be experienced therein." |
| 03:35:50 | <Berengal> | "When all you've got is a hammer, everyone looks like a nail" |
| 03:36:18 | <idnar> | ACTION hammers Berengal's nails in |
| 03:36:40 | <gwern> | when all you have is birth control, everything looks like something you can safely have sex with. |
| 03:36:56 | <Cale> | "Face-smashing monads on the category of injuries." |
| 03:37:04 | <MyCatVerbs> | Berengal: "A User-Centric Extrospective Study on Hammers and their Impact on Modern Society." |
| 03:37:23 | <MyCatVerbs> | (Extrospective because we did our research on other people.) |
| 03:37:24 | <Berengal> | MyCatVerbs: "[...] and faces" |
| 03:37:40 | <MyCatVerbs> | Hahaha, I have a better on. |
| 03:37:58 | <MyCatVerbs> | s/Modern Society/the Market Price of Reconstructive Surgery/ |
| 03:38:03 | <MyCatVerbs> | *one |
| 03:38:29 | <roconnor> | I wonder what it is like to have a desire to document. |
| 03:38:45 | <eden> | I can't help thinking hat it's a better idea to focus of how we go about improving things than making jokes about hammering, bet there we go, it might be just me |
| 03:39:06 | <roconnor> | maybe I could somehow learn to appreciate it |
| 03:39:07 | <MyCatVerbs> | roconnor: "Hot diggity! The code I just wrote is awesome on toast. I must write about it! Otherwise nobody will realise how awesome my code is. Yesyesyesyesyes MANPAGES." |
| 03:39:26 | <MyCatVerbs> | roconnor: I have a vague suspicion that it might be very similar to the driving force behind blogging. |
| 03:39:43 | <MyCatVerbs> | eden: but hammers are fun. :( |
| 03:39:44 | <roconnor> | MyCatVerbs: I can imagine being like that. |
| 03:40:00 | <MyCatVerbs> | roconnor: I need to trick myself into being like that more often. :) |
| 03:40:00 | <Berengal> | roconnor: I never consider my code complete until I've thoroughly commented it. It's the best way to understand just what it is I've written as well |
| 03:40:19 | <roconnor> | MyCatVerbs: but does that produce good documentation. I usually find it hard to imagine what it is like to not understand my code. |
| 03:40:21 | <eden> | MyCatverbs: and jokes absolve you of any responsbl |
| 03:40:28 | <MyCatVerbs> | Berengal: bah. The *code* isn't complete until any given comment you might care to make is redundant, because it reads like prose. |
| 03:40:30 | <Berengal> | And yes, the need to comment is very much similar to the need to blog |
| 03:40:46 | <Berengal> | At least for me |
| 03:40:50 | <MyCatVerbs> | Berengal: the *prokect* isn't complete until it's documented well enough that anyone else who needs to pick it up won't have trouble. :) |
| 03:40:58 | <MyCatVerbs> | *project |
| 03:41:02 | <roconnor> | eden: hey, do you have a moment to look at my documentation, and maybe critique it? |
| 03:41:53 | <MyCatVerbs> | eden: please lighten up a little. The world probably won't end for at least another five minutes. |
| 03:42:06 | <Berengal> | I've noticed that I sometimes tend to comment in a stream of consciousness style... |
| 03:42:41 | <MyCatVerbs> | Berengal: I've given presentations in stream of consciousness style. |
| 03:42:51 | <dolio> | So your comments read like Ulysses? |
| 03:42:56 | <hatds> | I can always tell later when I've done that, because it will be full of spelling errors |
| 03:42:58 | <MyCatVerbs> | Berengal: unfortunately my consciousness can be very depressing indeed. Didn't make for a particularly fun presentation. =D |
| 03:43:01 | <eden> | roconnor: Ooh. A challenge. Since I've been complaining, I guesss I'm onour boundto say yes.Give me the link. |
| 03:43:27 | <roconnor> | eden: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/colour |
| 03:43:55 | <roconnor> | eden: I'm not much into documentation culture, so the docs probably suck |
| 03:44:17 | <roconnor> | eden: OTOH, I did write this to be used, so I kinda tried. |
| 03:45:15 | <Berengal> | > {- Yeah, right so I need this fibs thing -}let fibs = {- they start with a 0, then a 1 -} 0:1 {- and then continues on... -} : {- but how to do the rest of the fibs? I need to somehow match up two and two previous fibs, like zip, except zip only creates tuples. I could use zipWith (+) -} zipWith (+) fibs {- And then I need to get the second element. tail should do it I think -} (tail fibs) {- yeah, that looks about right -} in fibs |
| 03:45:17 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946... |
| 03:45:40 | <copumpkin> | lol |
| 03:45:51 | <MyCatVerbs> | Berengal: oh my dear eyeparsers. |
| 03:45:57 | <Berengal> | :P |
| 03:46:08 | <copumpkin> | -} : {- is awesome |
| 03:46:17 | <eden> | MyCatVerbs. No, I won't lighten up. Asking people to do so is usually a good indicator of dismissing ideas people are uncomfortable with. |
| 03:46:19 | <roconnor> | Berengal: presumably eden is talking about package documentation rather than code documentation? |
| 03:46:24 | <MyCatVerbs> | It looks unmentionable. |
| 03:46:28 | <copumpkin> | o.O |
| 03:46:52 | <eden> | Berangal, roconorr: Berngal is right. |
| 03:47:01 | <Berengal> | roconnor: Aren't they the same? |
| 03:47:01 | <MyCatVerbs> | eden: I'm not dismissing your ideas. You are right, our documentation needs improving more than we need hammer jokes. |
| 03:47:06 | <Berengal> | Especially with haddock |
| 03:47:20 | <roconnor> | Berengal: nope |
| 03:48:01 | <Berengal> | roconnor: You mean like the overarching goal of the package? |
| 03:48:14 | <roconnor> | Berengal: I mean like the public interface |
| 03:48:22 | <roconnor> | rather than implementation details. |
| 03:48:47 | <Berengal> | roconnor: That's the exported functions and types, which are code, and can be haddocked |
| 03:49:12 | <roconnor> | Berengal: yes, but your fib example was mostly about implementation details. |
| 03:49:41 | <copumpkin> | eden: I don't think anyone will deny that documentation in haskell is lacking, but we're also all in this for the fun of it and many packages are written by people for their own needs, and then released for general consumption... and no one likes writing documentation :) some packages are written specifically for public release in mind, but many aren't, and are thus lacking documentation |
| 03:49:49 | <Berengal> | roconnor: My fib example was an example of stream of conciousness style commenting. Something, I should probably add, I don't think is a good idea in general :P |
| 03:50:10 | <roconnor> | Berengal: okay. |
| 03:50:16 | <roconnor> | Berengal: I mean I know you were not serious |
| 03:50:49 | <roconnor> | Berengal: but I thought it was a sort of comment on eden's comments, but I see now that it wasn't really related. |
| 03:52:46 | <copumpkin> | eden: but I don't think being so serious about the issue will change anyone's mind, especially if you act like "ooh I've struck a nerve, I'll keep at it". We've acknowledged that it's a problem but most of us don't get paid to promote haskell and I think most people enjoy trying new ideas than documenting existing ones |
| 03:53:50 | <copumpkin> | ACTION shrugs |
| 03:54:05 | <copumpkin> | I feel the internet is getting rather full of "pop psych" these days |
| 03:54:31 | <Berengal> | roconnor: I also believe it's important to document the implementation as well, especially for open-source packages like the ones on hackage. If a package almost does what I want but not quite, I'm much more likely to write my version from scratch than modify the existing package if the implementation details are lacking |
| 03:54:47 | <roconnor> | Berengal: true. |
| 03:56:38 | <eden> | copumkin: Well, I'd hope I would change people mind, but that's nearly always a losing battle. However, it wuld be nice to less serious about it, but that will take some programmers doing the right thing, and actually tackling the issue. |
| 03:57:10 | <copumpkin> | well, for what it's worth, the first thing I did when I started working on an existing library I enjoyed, was write documentation for it :) |
| 03:57:20 | <copumpkin> | it helped me get to know the internals better, and was a benefit to other people too |
| 03:57:36 | <copumpkin> | well, it's not fully public yet, but it will help people eventually |
| 03:57:37 | <roconnor> | eden: What would help me is to understand how the perl people are motivated. |
| 03:58:04 | <Berengal> | roconnor: Otherwise unintelligeble code? |
| 03:58:14 | <roconnor> | Berengal: possibly |
| 03:58:30 | <roconnor> | Berengal: if so, that will make it more difficult to motivate Haskellers |
| 03:59:08 | <Berengal> | What I'd like, as a first step at least, is for people to understand that type variables are no different than normal variables: Giving them longer names won't kill you |
| 03:59:37 | <Berengal> | The only reason single-letter type variables work is because type expressions are usually short and very isolated |
| 03:59:49 | <roconnor> | Berengal: my type variable are as long as my normal variables :P |
| 04:00:04 | <Berengal> | but with multi-param typeclasses and other funky type stuff going on, that changes quickly |
| 04:00:37 | <eden> | roconnor: Interesting question. I think it's just plain consideration for people who are in the same situation as the writer once was. |
| 04:01:50 | <copumpkin> | it's a bit like hazing |
| 04:02:03 | <copumpkin> | you might hate it while you go through it, but you still inflict it on others :P |
| 04:02:27 | <eden> | Hazing is a bit |
| 04:02:33 | <copumpkin> | (just kidding, but not compeltely) |
| 04:02:38 | <copumpkin> | *completely |
| 04:03:07 | <roconnor> | eden: hmm. I'm not sure. I find MyCatVerbs's "Hot diggity!" comment more compelling. |
| 04:03:28 | <eden> | Hazing is a bit strong.. and I was in paicuar year of school where w decide to stoppeople at |
| 04:03:47 | <eden> | eden aaargh. |
| 04:03:58 | <copumpkin> | keyboard problems? :) |
| 04:04:01 | <MyCatVerbs> | roconnor: what? What? What am I being accused of saying now? WHAT DID I DO? AAAaaaaagh! *runs around* |
| 04:04:05 | <hatds> | using libraries is the hardest part of programming |
| 04:04:06 | <copumpkin> | but yeah, I didn't mean it with all the strong connotations |
| 04:04:29 | <roconnor> | [23:39] <MyCatVerbs> roconnor: "Hot diggity! The code I just wrote is awesome on toast. I must write about it! Otherwise nobody will realise how awesome my code is. Yesyesyesyesyes MANPAGES." |
| 04:04:31 | <hatds> | enough focus is given formally specifying languages, but there is very little formal specification of libraries |
| 04:04:43 | <hatds> | different problems though |
| 04:05:03 | <MyCatVerbs> | roconnor: oh right, yes. It was hypothetical, though. I can't remember ever having felt exactly like that while hacking. |
| 04:05:26 | <roconnor> | MyCatVerbs: It comes pretty close to the reason I documented my colour lib. |
| 04:05:30 | <MyCatVerbs> | roconnor: most of the code that I've really enjoyed writing actually made me cackle at the time instead, and caused deep shame upon later reflection. |
| 04:05:44 | <MyCatVerbs> | ;) |
| 04:06:07 | <Berengal> | MyCatVerbs: I've felt like that when hacking. Well, after I was mostly done |
| 04:06:19 | <hatds> | generally the more I enjoy a piece of code the quicker I end up hating it |
| 04:06:37 | <dmwit> | Berengal: No problem, my type variables are just as long as my normal variables... and they're all one letter long. |
| 04:06:41 | <dmwit> | Bwahahaha! |
| 04:06:47 | <hatds> | the best line of code I've ever written? That's gonna last till tomorrow, tops. |
| 04:07:17 | <dmwit> | Oh, yes, clever programmers are their own enemy. |
| 04:07:19 | <eden> | I keep hitting the return button by mistake.I do have some pride in being in the year at school to stop the institutional bullying.We simply decided that we hated it, and wouldn't do it, even tough we had suffered from it. It takes some stegnth, but it can be done... |
| 04:07:57 | <hatds> | yea hazing is for jerks |
| 04:08:06 | <hatds> | good for you guys |
| 04:08:18 | <copumpkin> | :) |
| 04:08:26 | <MyCatVerbs> | eden: I've no perspective on this, having never been through anything like it myself, but congratulations. |
| 04:12:31 | <eden> | MyCatVerbs: Cheers. It wasn't all clean tough, we git some of the upper yaers to give a hard time to te people who wanted to keep bullying the younger years, but on the whole it was a may improvement. It didn't start up again even after I'd left the place. |
| 04:13:00 | <MyCatVerbs> | eden: three cheers for lasting progress, huh. ^_^ |
| 04:15:15 | <ewwiz> | greetings fellow haskel'ers |
| 04:15:33 | <eden> | To be glib, It a bit like good documentation... doing the right thing for the right reasons. |
| 04:15:45 | <shapr> | hiya ewwiz |
| 04:15:55 | <copumpkin> | ewwiz ewwiz? |
| 04:15:59 | <shapr> | ewwiz: Have you written lots of Haskell? |
| 04:16:15 | <copumpkin> | (pronounced like who is ewwiz) |
| 04:16:19 | <ewwiz> | not that much. in the process of learning |
| 04:16:39 | <ewwiz> | i was thinking like oooh-iz |
| 04:16:45 | <ewwiz> | but it's up for interpretation |
| 04:16:51 | <copumpkin> | yeah :) that's how I saw it |
| 04:17:02 | <mhaggag> | Hello, another quick question. Is there a way, when installing a package from hackage, to get cabal to recursively download and install dependencies? |
| 04:17:24 | <mhaggag> | (I'm trying to run Yi, but there's a ton of dependencies missing..) |
| 04:17:28 | <eden> | eihter way, It's for in the morning and time to go to bed... |
| 04:18:18 | <MyCatVerbs> | mhaggag: cabal install does that. |
| 04:18:40 | <ewwiz> | i'm surprised how many participants are in this chat |
| 04:18:42 | <ewwiz> | over 500 |
| 04:18:44 | <MyCatVerbs> | mhaggag: but it can't do anything about missing non-Haskell libraries, unfortunately. |
| 04:19:06 | <mhaggag> | Hmm...can you elaborate a bit more? (Sorry, absolute noob here. I'm trying to follow the instructions on Yi/Hackage) |
| 04:19:09 | <roconnor> | @lusers |
| 04:19:09 | <lambdabot> | Maximum users seen in #haskell: 658, currently: 560 (85.1%), active: 16 (2.9%) |
| 04:19:14 | <MyCatVerbs> | ewwiz: we're aiming for nine tho-er, I mean, people have been doing their best to grow this little community. It seems to have been working. |
| 04:19:18 | <hatds> | hm, are there binaries available for Yi? |
| 04:19:19 | <mhaggag> | What's the difference between "cabal install" and the configure/build/install sequence? |
| 04:19:33 | <roconnor> | mhaggag: cabal install fetches dependencies |
| 04:21:05 | <mhaggag> | I see. So in theory, I should be able to install cabal-install and use it to fetch the dependencies? |
| 04:21:22 | <mhaggag> | (Do package manitainers have to do something special for this to work?) |
| 04:21:27 | <roconnor> | it only fetches dependencies available on hackage. |
| 04:21:38 | <shapr> | ewwiz: #haskell r0xx0rz! |
| 04:21:50 | <mhaggag> | roconnor: I see, thanks. |
| 04:22:19 | <jmcarthur> | mhaggag: maintainers must list the package's direct dependencies in the package's .cabal file |
| 04:22:28 | <jmcarthur> | mhaggag: which you are supposed to do anyway |
| 04:22:30 | <shapr> | ewwiz: Lots of people working hard to make this community. |
| 04:23:37 | <ewwiz> | that's awesome |
| 04:23:59 | <mhaggag> | jmcarthur: I see. So in theory I should be able to install yi that way, since it already lists its dependencies. |
| 04:24:14 | <jmcarthur> | yeah #haskell is by far the most helpful, friendly, entertaining, intelligent crowd on irc ;) |
| 04:24:23 | <roconnor> | ewwiz: shapr built the foundations of this community |
| 04:24:42 | <jmcarthur> | mhaggag: there is no guarantee that those dependencies are also on hackage, but usually they are |
| 04:24:51 | <shapr> | But nowadays, people like dons put in all the work! |
| 04:24:56 | <shapr> | I am now an irresponsible parasite! w00! |
| 04:25:00 | <SamB> | roconnor: or at least kept them from picking on the newbies ;-) |
| 04:25:15 | <roconnor> | SamB: it was (and is) an important job |
| 04:25:22 | <ewwiz> | are all of you guys professional programmers too or just doing haskell as a hobby? |
| 04:25:25 | <shapr> | g'day twb |
| 04:25:48 | <SamB> | well, I mean, he didn't actually design or build any of the people in this channel |
| 04:25:48 | <adu> | hi |
| 04:25:50 | <Berengal> | ewwiz: Can't we do both? :P |
| 04:25:54 | <shapr> | I'm a professional programmer for a lot of years, but I have had a Haskell job for a year. |
| 04:25:56 | <jmcarthur> | some of us use it professionally. i'm just a hobbyist right now, but there is always a chance i can sneak it in at work ;) |
| 04:25:57 | <SamB> | though he did used to be a lambdabot maintainer, I think |
| 04:26:31 | <shapr> | Yeah, I wrote the original plugin system for lambdabot, and hosted lambdabot for a few years. |
| 04:26:44 | <gwern> | nobody is a lambdabot maintainer; they just sort of fake knowing what's going on in the codebase |
| 04:26:45 | <Berengal> | It's possible to write haskell in any language. Painful in some, but possible... |
| 04:26:54 | <jmcarthur> | ACTION was designed and built by shapr |
| 04:26:58 | <shapr> | :-P |
| 04:27:06 | <shapr> | I haven't looked at the lambdabot sources much since I was maintainer. |
| 04:27:16 | <SamB> | gwern: well, you know, the person who lets people break lambdabot |
| 04:27:32 | <shapr> | Berengal: I've tried to write Haskell in C#, didn't turn out so well. |
| 04:27:39 | <twb> | Is there a better way to say "do f; return ()" ? |
| 04:27:39 | <roconnor> | Berengal: you can put a static type system into Python? |
| 04:27:51 | <SamB> | roconnor: I think you can |
| 04:27:52 | <dmwit> | twb: no |
| 04:27:55 | <shapr> | You can actually, there's some neat research about that. |
| 04:27:58 | <Berengal> | roconnor: You can pretend to... |
| 04:28:00 | <twb> | Bleh |
| 04:28:02 | <roconnor> | SamB: you mean by writing an external tool? |
| 04:28:05 | <dmwit> | twb: Unless you consider "f >> return ()" better. =) |
| 04:28:09 | <SamB> | those PyPy people, I think, did something of that nature ... |
| 04:28:13 | <roconnor> | ok |
| 04:28:13 | <SamB> | or are doing |
| 04:28:17 | <shapr> | ACTION hugs twb |
| 04:28:25 | <SamB> | dunno how it works |
| 04:28:33 | <twb> | shapr: easy there, big fella |
| 04:28:44 | <SamB> | but it makes sense if you're trying to write a Python implementation in "Python", doesn't it? |
| 04:28:59 | <shapr> | twb: I'm friendly, what can I say? :-) |
| 04:29:05 | <MyCatVerbs> | Berengal: not really. Most languages don't give you Turing-complete type systems. |
| 04:29:09 | <roconnor> | twb: do f; return () or f >> return () is not all that uncommon. |
| 04:29:24 | <jmcarthur> | :t (<$) |
| 04:29:25 | <lambdabot> | forall a (f :: * -> *) b. (Functor f) => a -> f b -> f a |
| 04:29:37 | <SamB> | MyCatVerbs: haskell doesn't either, without unsafePerformTypeclass... |
| 04:29:42 | <SamB> | er. well, something like that ;-P |
| 04:30:07 | <jmcarthur> | :t () <$ Just 5 |
| 04:30:07 | <lambdabot> | Maybe () |
| 04:30:08 | <adu__> | yes |
| 04:30:15 | <jmcarthur> | :t Just 5 >> return () |
| 04:30:16 | <lambdabot> | Maybe () |
| 04:30:19 | <MyCatVerbs> | SamB: overlapping and undecidable instances and MPTC, but I'd argue that they're as good as part of the language now. |
| 04:30:40 | <MyCatVerbs> | SamB: just, not actually switched on by default, since they're too powerful for everyday usage. |
| 04:30:41 | <SamB> | MyCatVerbs: not quite |
| 04:30:49 | <SamB> | I don't remember them being written up quite as well |
| 04:30:53 | <jmcarthur> | twb: ^^ |
| 04:31:09 | <jmcarthur> | () <$ f |
| 04:31:17 | <MyCatVerbs> | SamB: this is true. But that's not to say that they aren't used and supported well enough. |
| 04:31:42 | <dmwit> | jmcarthur is bringing Perl to Haskell, one miscalibrated modem at a time |
| 04:31:59 | <SamB> | lol |
| 04:32:07 | <Berengal> | Control.Applicative.Perl ? |
| 04:32:17 | <SamB> | dmwit: did you know that perl code is, in fact, NOT just line noise? |
| 04:32:25 | <SamB> | that's a common misconception |
| 04:32:35 | <dmwit> | Oh, is it line noise at a specific baud rate, then? |
| 04:32:41 | <jmcarthur> | SamB: you're full of crap |
| 04:32:55 | <SamB> | dmwit: no! it actually MEANS *something* |
| 04:32:57 | <SamB> | sometimes |
| 04:33:00 | <SamB> | in the right context |
| 04:33:06 | <Berengal> | Meh, Java has the worst signal/noise of the languages I've used... |
| 04:33:43 | <mauke> | Haskell code is harder to read than Perl code |
| 04:33:44 | <jmcarthur> | Berengal: c++ fares even worse for me |
| 04:34:13 | <Berengal> | jmcarthur: Haven't done C++ so I couldn't say |
| 04:34:18 | <mauke> | custom operators and sections give you all the line noise you need |
| 04:34:23 | <adu___> | > (+) 1 2 |
| 04:34:24 | <lambdabot> | 3 |
| 04:34:26 | <jmcarthur> | Berengal: lucky |
| 04:34:36 | <adu___> | > showIntAtBase 13 (" .begiklnortu"!!) 21086968406045718508607583582 "" |
| 04:34:38 | <lambdabot> | "but i like being broken..." |
| 04:34:39 | <Berengal> | jmcarthur: Yes, I consider myself that |
| 04:35:06 | <MyCatVerbs> | jmcarthur: Java isn't noisy, IMO. Rather, it has exceedingly low information content per byte. |
| 04:35:07 | <SamB> | jmcarthur: the problem I have with C++ is that the signal isn't even in the code you write, always ... |
| 04:35:24 | <SamB> | it's often in the code the compiler assumes you meant |
| 04:35:50 | <SamB> | )and all too often, that signal is SIGSEGV ;-( |
| 04:35:54 | <Berengal> | MyCatVerbs: That's what I mean by signal/noise |
| 04:36:13 | <MyCatVerbs> | Berengal: noise *is* information. Java code carries exceedingly little information per byte. :) |
| 04:36:25 | <jmcarthur> | MyCatVerbs: true. java is more like a very low volume signal than it is a signal drowned out by noise |
| 04:36:34 | <MyCatVerbs> | Berengal: regularly structured code isn't really noise, even if it does encode very little of use. |
| 04:37:32 | <Berengal> | MyCatVerbs: I don't know about you, but I consider the abhorringly long and repeated types to be noise |
| 04:37:41 | <jmcarthur> | one good thing about java is the source code compresses well ;) |
| 04:37:57 | <MyCatVerbs> | ACTION thwaps Berengal with Shannon. |
| 04:38:37 | <copumpkin> | someone should run lzma on the same algorithm implemented idiomatically in different languages |
| 04:38:50 | <monochrom> | hehehe |
| 04:39:16 | <MyCatVerbs> | Berengal: you might "consider..." but that's not what noise *is*. Java code *cannot* be noisy precisely because it has such atrociously low unpredictability because of all the repetition. :) |
| 04:39:26 | <jmcarthur> | doesn't the shootout compare gzipped source file sizes? |
| 04:39:34 | <MyCatVerbs> | Yep. |
| 04:39:41 | <jmcarthur> | of course, the shootout isn't _idiomatic_ code |
| 04:40:02 | <Berengal> | MyCatVerbs: Don't get technical with me now :P |
| 04:40:20 | <MyCatVerbs> | Berengal: ;-; |
| 04:40:20 | <jmcarthur> | i think it would be more interesting to compare compression ratios rather than final compressed size |
| 04:40:33 | <MyCatVerbs> | Technical is all I have to get, other than just plain stupid. |
| 04:40:48 | <Berengal> | What's noise when you're reading code is different from what's noise when interpreted as a signal |
| 04:41:22 | <twb> | @pl \ p q r s -> f p q r s >> f p q r s |
| 04:41:22 | <lambdabot> | ap (ap . (liftM2 (liftM2 (>>)) .) . f) f |
| 04:41:24 | <MyCatVerbs> | Berengal: I'm going to have to engrave "Claude Shannon" on the side of a foam baseball bat and start hitting people with it, aren't I? |
| 04:41:35 | <twb> | @pl \ p q r s -> f p q r s >> g p q r s |
| 04:41:36 | <lambdabot> | ap (ap . (liftM2 (liftM2 (>>)) .) . f) g |
| 04:41:52 | <mauke> | preflex: calc '36 2'100011000100100101101001101011101001 |
| 04:41:53 | <preflex> | haskell |
| 04:42:15 | <adu> | mauke: ooo |
| 04:43:02 | <copumpkin> | twb: that seems like it should be nicer than that |
| 04:43:07 | <Berengal> | MyCatVerbs: If you'd like, but why stop at foam? |
| 04:43:21 | <adu> | > showIntAtBase 15 (" :?adehikmotuwy"!!) 35057979013641215828658211984217 "" |
| 04:43:21 | <MyCatVerbs> | Pacifism, mixed with cowardice. |
| 04:43:23 | <lambdabot> | "mauke: how did you do that?" |
| 04:43:41 | <copumpkin> | :t \ p q r s -> f p q r s >> f p q r s |
| 04:43:42 | <lambdabot> | forall t t1 t2 t3 (m :: * -> *) a b. (SimpleReflect.FromExpr (t -> t1 -> t2 -> t3 -> m a), SimpleReflect.FromExpr (t -> t1 -> t2 -> t3 -> m b), Monad m) => t -> t1 -> t2 -> t3 -> m b |
| 04:43:53 | <mauke> | preflex: calc '36 37439508 |
| 04:43:53 | <preflex> | magic |
| 04:43:56 | <copumpkin> | :t \f p q r s -> f p q r s >> f p q r s |
| 04:43:57 | <lambdabot> | forall t t1 t2 t3 (m :: * -> *) a. (Monad m) => (t -> t1 -> t2 -> t3 -> m a) -> t -> t1 -> t2 -> t3 -> m a |
| 04:44:19 | <mmorrow> | @type join (>>) |
| 04:44:21 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => m a -> m a |
| 04:44:42 | <mmorrow> | @type join (>>) :: (Monad m) => (t -> t1 -> t2 -> t3 -> m a) -> t -> t1 -> t2 -> t3 -> m a |
| 04:44:44 | <lambdabot> | forall t t1 t2 t3 (m :: * -> *) a. (Monad m) => (t -> t1 -> t2 -> t3 -> m a) -> t -> t1 -> t2 -> t3 -> m a |
| 04:45:01 | <mmorrow> | (->) (>>=) ftw! |
| 04:45:10 | <adu> | preflex help |
| 04:45:11 | <preflex> | try 'help help' or see 'list' for available commands |
| 04:45:26 | <Berengal> | MyCatVerbs: I read that as "mixed with concrete" for a second :/ |
| 04:46:15 | <MyCatVerbs> | Berengal: now you are making me hungry. |
| 04:47:19 | <copumpkin> | :) |
| 04:50:26 | <dmwit> | (\c -> maybe (return []) c (peek priorityQueue)) $ do {- ... -} |
| 04:50:27 | <ewwiz> | ACTION tosses MyCatVerbs a reeses |
| 04:50:29 | <ewwiz> | jeje |
| 04:50:30 | <dmwit> | I feel vaguely dirty. |
| 04:51:12 | <MyCatVerbs> | Danke, ewwiz. |
| 04:51:18 | <dmwit> | Not least because I forgot the "\v ->" before that do. |
| 04:52:33 | <twb> | I really, really hate it the way that Cabal will go ahead and install a newer version of e.g. filepath, so that packages installed via cabal can't be used with packages installed via Debian |
| 04:53:32 | <SamB> | twb: so you want to be able to "pin" packages ? |
| 04:53:36 | <twb> | Hmm, bizarrely, I can just ghc-pkg unregister old-time and filepath... even though "cabal upgrade Cabal" forced me to install them, it apparently doesn't need them. |
| 04:53:40 | <twb> | SamB: basically, yeah |
| 04:54:22 | <twb> | SamB: actually the IDEAL solution would be for Debian to have working Haskell packages |
| 04:54:34 | <SamB> | twb: working how ? |
| 04:54:41 | <twb> | It seems that two weeks in every three, most packages are awaiting binNMU due to a GHC update |
| 04:55:04 | <twb> | So even of the subset of packages that are in apt, I can't install most of them. |
| 04:55:09 | <SamB> | oh |
| 04:55:17 | <SamB> | why can't they autobuild those ...? |
| 04:55:31 | <twb> | SamB: because then there wouldn't be adequate quality assurance. |
| 04:56:00 | <SamB> | ... test suites ? |
| 04:56:18 | <twb> | No, quality assurance of the packaging. |
| 04:56:53 | <SamB> | but there's no quality if there is no installable package ... |
| 05:03:32 | <dmwit> | What the deuce? |
| 05:04:19 | <SamB> | dmwit: what ? |
| 05:04:47 | <dmwit> | I have a piece of code like |
| 05:05:03 | <dmwit> | do { modify (\g -> blah blah blah); blah blah blah } |
| 05:05:26 | <dmwit> | If I factor out the (\g -> blah blah blah) and name it, I get an error. |
| 05:05:44 | <twb> | dmwit: blah blah blah is probably an infinite type |
| 05:05:55 | <dmwit> | Urk, nope, it was the MR. |
| 05:06:06 | <dmwit> | But the error message is incomprehensible. |
| 05:06:15 | <MyCatVerbs> | twb: in which case he should be getting the error anyay anyway with the lambda. >> |
| 05:06:16 | <dmwit> | "No instance for (MonadState (Grid i) m)" |
| 05:06:43 | <dmwit> | But the type of another (perfectly satisfactory) identifier is MonadState (Grid i) m => m [Time] |
| 05:06:50 | <dmwit> | So what is that supposed to mean? |
| 05:07:11 | <mauke> | it wants to monomorph m but doesn't know how |
| 05:07:40 | <dmwit> | How come it doesn't want to monomorph the other identifier? |
| 05:07:46 | <dmwit> | There's no type signature on it. |
| 05:08:00 | <Cale> | Is it a function binding? |
| 05:08:11 | <Cale> | Or a pattern binding? |
| 05:08:44 | <dmwit> | The acceptable one is a function binding; the unacceptable one is a (value) binding. |
| 05:08:58 | <Cale> | Right. The MR only applies to pattern bindings. |
| 05:09:05 | <dmwit> | oh |
| 05:09:10 | <Cale> | If it has parameters, then the MR doesn't apply. |
| 05:09:12 | <dmwit> | right |
| 05:09:23 | <dmwit> | ok, ok |
| 05:09:30 | <dmwit> | The MR is bewildering. =) |
| 05:09:53 | <MyCatVerbs> | Thank Simon it's getting thrown out soon. |
| 05:10:29 | <MyCatVerbs> | (If you ask me which Simon, the only response you will get is "yes". ;)) |
| 05:10:43 | <dolio> | Soon? |
| 05:10:45 | <mauke> | [Simon] |
| 05:10:58 | <Cale> | I wonder how many total hours people have wasted in confusion caused by the MR. |
| 05:11:26 | <twb> | @MR |
| 05:11:26 | <lambdabot> | Maybe you meant: . ? @ bf ft id pl rc v wn |
| 05:11:36 | <twb> | @wtf MR |
| 05:11:36 | <lambdabot> | Maybe you meant: bf ft wn |
| 05:11:39 | <twb> | Bah. |
| 05:11:49 | <Cale> | Monomorphism Restriction |
| 05:11:52 | <Cale> | @where mr |
| 05:11:53 | <lambdabot> | I know nothing about mr. |
| 05:11:54 | <Cale> | hmm |
| 05:12:07 | <dmwit> | ?wiki MonomorphismRestriction |
| 05:12:07 | <lambdabot> | http://www.haskell.org/haskellwiki/MonomorphismRestriction |
| 05:12:27 | <Cale> | http://haskell.org/onlinereport/decls.html#sect4.5.5 |
| 05:12:43 | <Cale> | @where+ mr http://haskell.org/onlinereport/decls.html#sect4.5.5 |
| 05:12:43 | <lambdabot> | Okay. |
| 05:13:58 | <Berengal> | Is there a proper 'solution' to polymorphic values? |
| 05:14:12 | <Cale> | Let them be polymorphic? |
| 05:14:26 | <dmwit> | Berengal: Add a type signature, or use the NoMonomorphismRestriction pragma. |
| 05:14:45 | <dolio> | Get rid of mutability. |
| 05:14:50 | <Cale> | {-# LANGUAGE NoMonomorphismRestriction #-} |
| 05:14:54 | <Cale> | mutability? |
| 05:14:57 | <Berengal> | Cale: I don't want the result of genericLength to be polymorphic |
| 05:15:05 | <Cale> | Berengal: huh? |
| 05:15:08 | <dolio> | (If you're ML.) |
| 05:15:09 | <Cale> | Berengal: Why not? |
| 05:15:29 | <Berengal> | Cale: let x = genericLength [1..10000] in (x `div` 2, x / 2) |
| 05:16:08 | <Cale> | Berengal: that works fine, what's wrong with it? |
| 05:16:09 | <Berengal> | Guess how many times the function will run |
| 05:16:19 | <Cale> | genericLength will be computed twice, of course |
| 05:16:47 | <Cale> | x will need to be evaluated once at every place where its type is specialised. |
| 05:16:56 | <dolio> | > genericLength [1..10000000] :: Int |
| 05:16:58 | <lambdabot> | * Exception: stack overflow |
| 05:16:59 | <Berengal> | Yes, I'd like for that not to happen |
| 05:17:02 | <Cale> | Huh? |
| 05:17:12 | <Cale> | It *has* to happen, or your program is meaningless. |
| 05:17:41 | <Berengal> | Then I'd prefer it to be meaningless |
| 05:17:46 | <Cale> | At least so long as there's no type on which / and `div` are defined |
| 05:18:02 | <Cale> | Why would you prefer that? |
| 05:18:13 | <Berengal> | Because I wouldn't want it to be computed twice |
| 05:18:17 | <Cale> | How is it any worse than the situation with: |
| 05:18:24 | <dmwit> | Berengal: An explicit type signature can specialize a polymorphic type. |
| 05:18:38 | <Cale> | let x n = genericLength [1..n] in (x 10000 `div` 2, x 10000 / 2) |
| 05:18:51 | <dmwit> | let x :: Integer; x = genericLength [1..10000] in (x `div` 2, x / 2) -- gives a type error |
| 05:19:06 | <Berengal> | dmwit: Yes, I know, but I'm not in the habbit of putting type signatures on every expression |
| 05:19:08 | <Cale> | Yes, and x will not be recomputed, because it's not polymorphic then. |
| 05:19:19 | <dmwit> | Berengal: Just put it on the ones you want to be careful about recomputing. |
| 05:19:25 | <dmwit> | Berengal: That is the solution. |
| 05:19:31 | <dmwit> | Dunno what else you want from us. |
| 05:20:09 | <Berengal> | dmwit: I'd rather the compiler told me about those than have to keep track of them myself. It's sort of the same reason we've got strong static typing, if you squint a bit |
| 05:20:41 | <Berengal> | I agree that most of the time the MR just gets in the way, and I usually turn it off. There are however cases where I'd like it turned on |
| 05:21:27 | <ski> | (`let x = ... in (x `div` 2, x / 2) :: (Integral i,Fractional q) => (i,q)' could be treated differently from `let x = ... in (x `div` 2, x / 2) :: (Integral a,Fractional a) => (a,a)' by the compiler ..) |
| 05:21:52 | <Cale> | :t let x = genericLength [1..10000] in (x `div` 2, x / 2) |
| 05:21:54 | <lambdabot> | forall i i1. (Integral i, Fractional i1) => (i, i1) |
| 05:22:12 | <Cale> | I think it's pretty obvious from the type that two separate values are being computed there. |
| 05:23:02 | <Cale> | We just need to get over the silly idea that just because something is a pattern binding that means it's a constant which can never be recomputed. |
| 05:23:15 | <Cale> | Nothing in the language spec even guarantees that anyway. |
| 05:23:16 | <copumpkin> | :t (\x -> (x `div` 2, x / 2)) $ genericLength [1..10000] |
| 05:23:34 | <copumpkin> | :( |
| 05:23:37 | <Cale> | :t (\x -> (x `div` 2, x / 2)) $ genericLength [1..10000] |
| 05:23:39 | <lambdabot> | forall a. (Fractional a, Integral a) => (a, a) |
| 05:23:45 | <copumpkin> | why doesn't it like me? |
| 05:23:50 | <Cale> | Because of the space |
| 05:23:51 | <ski> | copumpkin : spacing |
| 05:24:00 | <copumpkin> | oh my silly client doesn't even show that |
| 05:24:04 | <copumpkin> | ACTION slaps his client |
| 05:24:21 | <Berengal> | Cale: It's not always that obvious though. Say you needed the length for three different expressions, each which just so happened to be using a different numeric type from the two others, and all of these expressions were sub-expressions, and thus not given a type signature |
| 05:24:26 | <copumpkin> | (linkinus) |
| 05:24:29 | <ski> | @slap copumpkin's-client |
| 05:24:29 | <lambdabot> | ACTION pushes copumpkin's-client from his chair |
| 05:24:37 | <copumpkin> | :o |
| 05:24:41 | <Cale> | Berengal: huh? |
| 05:24:45 | <dmwit> | Yeah! Get out of lambdabot's chair! |
| 05:25:10 | <Cale> | Berengal: oh, well, then my program would at least work. |
| 05:25:25 | <ski> | (fsvo work :) |
| 05:25:41 | <Cale> | If it was a performance problem, I would look into it, and see that it was being re-evaluated and pick a monomorphic type. |
| 05:26:21 | <Cale> | But I think it's a somewhat unlikely scenario regardless. Usually you know what types you're applying something at. |
| 05:26:32 | <Berengal> | Cale: It'd also "work" if you removed the type system, or didn't bother to type-check |
| 05:26:33 | <ewwiz> | perms, they're making up functions |
| 05:26:45 | <Cale> | Berengal: Actually, it wouldn't. |
| 05:26:56 | <Berengal> | Cale: But yeah, the scenario is unlikely, but not impossible |
| 05:26:59 | <Cale> | Berengal: Because without a type system, typeclasses don't work. |
| 05:27:11 | <Cale> | and so you can't have polymorphic constants like that |
| 05:27:20 | <Berengal> | Cale: That's what weak typing is for |
| 05:27:25 | <Cale> | Huh? |
| 05:27:35 | <Cale> | No, it would just be entirely broken |
| 05:27:49 | <Berengal> | Tagged values and implicit conversion? |
| 05:27:58 | <Cale> | Because it would either be an integer or a floating point number, and the casting would result in a misinterpretation of the data. |
| 05:27:59 | <Berengal> | It'd work fine in python, is what I'm saying |
| 05:28:07 | <Cale> | Ah. |
| 05:28:07 | <dolio> | Without a type system you have to pass dictionaries manually. |
| 05:28:15 | <dmwit> | You're really espousing implicit conversion as a solution to the monomorphism restriction? |
| 05:28:24 | <twb> | "Weak" typing is where every value is a always string, and each function implicitly attempts to convert that string to the desired type internally. |
| 05:28:44 | <dmwit> | tcl! |
| 05:28:45 | <dmwit> | yeah! |
| 05:28:54 | <twb> | I was thinking sh, but whatever. |
| 05:29:01 | <MyCatVerbs> | IIRC there are at least three or four TCL interpreters in Haskell. |
| 05:29:05 | <MyCatVerbs> | Written in, I mean. |
| 05:29:22 | <twb> | MyCatVerbs: so TCL isn't even self-hosted? It must be shit, then :-) |
| 05:29:51 | <Cale> | Hey, that's not fair, there are lots of decent languages for which self-hosting is an impossibility :) |
| 05:29:55 | <Berengal> | dmwit: Nah, not really. I'm being somewhat more extreme than where my real opinions lie |
| 05:30:03 | <Cale> | Like every language which isn't Turing complete :) |
| 05:31:12 | <Cale> | Anyhow, I've turned the MR off in my .ghci and I always just turn it off at the module/package level if there's any trouble. |
| 05:31:14 | <hatds> | how do people feel over monomorphic pattern bindings? |
| 05:31:22 | <hatds> | http://haskell.org/ghc/docs/latest/html/users_guide/monomorphism.html |
| 05:31:56 | <dmwit> | Cale: Nonsense, HQ9x+S is self-hosting but not Turing-complete. |
| 05:32:28 | <dmwit> | Whoops, how did that 'x' get in there? |
| 05:32:49 | <MyCatVerbs> | dmwit: it's the x combinator? :D |
| 05:33:02 | <Cale> | hatds: Eh, maybe it's okay. I still think it's a bit unnatural. |
| 05:33:14 | <roconnor> | is ./foo | sort | uniq the typical way of using uniq? |
| 05:33:42 | <dmwit> | yes |
| 05:34:01 | <dmwit> | There is no nub-alike feature in uniq. |
| 05:34:26 | <dmwit> | However, ghc -e "interact (unlines . nub . lines)" gets you that. ;-) |
| 05:34:31 | <roconnor> | :( |
| 05:34:34 | <roconnor> | :) |
| 05:35:16 | <roconnor> | $ ghc |
| 05:35:16 | <MyCatVerbs> | roconnor: sort -u does uniq's job too. |
| 05:35:17 | <roconnor> | -bash: ghc: command not found |
| 05:35:19 | <roconnor> | aw crap |
| 05:35:32 | <roconnor> | so uniq should never be run |
| 05:35:34 | <roconnor> | well |
| 05:35:38 | <roconnor> | I guess if it is already sorted |
| 05:35:40 | <twb> | roconnor: uniq -c is useful |
| 05:35:47 | <roconnor> | what's that? |
| 05:35:52 | <twb> | RTFM? |
| 05:36:01 | <roconnor> | bah I'm to lazy |
| 05:36:09 | <roconnor> | I'll just take your word for it |
| 05:36:11 | <inimino> | uniq -u is also very useful |
| 05:36:17 | <dmwit> | I'll read it for you. |
| 05:36:23 | <dmwit> | uniq -c counts the number of duplicates. |
| 05:36:34 | <roconnor> | oh |
| 05:36:51 | <twb> | It's (length &&& head) . groupBy |
| 05:36:59 | <dmwit> | inimino: I don't understand; how is uniq different from uniq -u? |
| 05:37:00 | <roconnor> | right |
| 05:37:04 | <twb> | Sorry, s/By// |
| 05:37:08 | <inimino> | cat a b b | sort | uniq -u # set difference |
| 05:37:20 | <dmwit> | oooh |
| 05:37:58 | <dmwit> | cat a b | sort | uniq -u # symmetric difference? |
| 05:38:02 | <inimino> | it only prints lines which appear only once |
| 05:38:10 | <inimino> | dmwit: yep |
| 05:38:17 | <dmwit> | Assuming a and b really are sets, I guess. |
| 05:38:24 | <inimino> | right |
| 05:39:01 | <inimino> | assuming no duplicates, which you can always guarantee with ... well you know ;-) |
| 05:39:04 | <twb> | The sh program I never use enough is paste (and join). |
| 05:39:40 | <roconnor> | hmm |
| 05:39:51 | <roconnor> | apparently there is an icombinator.net |
| 05:39:58 | <inimino> | I don't think I've ever used paste |
| 05:47:13 | <roconnor> | I know this has probably been said before, but twitter is very weird. |
| 05:47:36 | <roconnor> | in particular trying to follow twitter conversations |
| 05:49:40 | <ski> | bad reimplementation of threads ? |
| 05:49:43 | <dmwit> | ?pl \g -> rnf (seqNo g) `seq` rnf (edges g) `seq` rnf (updates g) |
| 05:49:43 | <lambdabot> | ap (seq . ap (seq . rnf . seqNo) (rnf . edges)) (rnf . updates) |
| 05:49:51 | <dmwit> | yuck |
| 05:50:09 | <roconnor> | ski: the worst implementation of threads :) |
| 05:50:16 | <dmwit> | :t seq `on` rnf |
| 05:50:17 | <lambdabot> | forall a. (NFData a) => a -> a -> Done |
| 05:50:21 | <dmwit> | ooo |
| 05:50:31 | <dmwit> | close... |
| 05:50:33 | <roconnor> | ski: all comments are sorted by author. |
| 05:50:38 | <roconnor> | then by time |
| 05:50:50 | <roconnor> | not by topic :) |
| 05:50:50 | <dmwit> | Oh, no, not that close. |
| 05:51:24 | <ski> | ACTION recalls <http://www.rants.org/2008/03/06/thread_theory/> |
| 05:52:07 | <copumpkin> | :t seq `using` rnf |
| 05:52:08 | <lambdabot> | forall a t. (NFData (a -> t -> t)) => a -> t -> t |
| 05:52:13 | <copumpkin> | boo |
| 05:54:03 | <copumpkin> | :t (compare `on`) |
| 05:54:04 | <lambdabot> | forall b a. (Ord b) => (a -> b) -> a -> a -> Ordering |
| 05:54:05 | <copumpkin> | :t comparing |
| 05:54:06 | <lambdabot> | forall b a. (Ord a) => (b -> a) -> b -> b -> Ordering |
| 05:58:02 | <dmwit> | Aha! |
| 05:58:17 | <dmwit> | ?pl \g -> rnf (seqNo g, edges g, updates g) |
| 05:58:17 | <lambdabot> | rnf . ap (liftM2 (,,) seqNo edges) updates |
| 05:58:34 | <dmwit> | Still ugly, but the pointed version is much nicer. |
| 05:58:42 | <jmcarthur> | ACTION finally found an excuse to use (<=<) and suddenly realized that other cases for using it have been everywhere the whole time |
| 05:59:57 | <jmcarthur> | it was random. something i wanted didn't type check, so i threw a <=< in there where i thought it made sense and all was well with the world |
| 06:00:11 | <jmcarthur> | and now everything is a candidate for <=< |
| 06:01:48 | <copumpkin> | yeah I found the same thing |
| 06:01:59 | <copumpkin> | it looked silly until Cale explained it to me and now I want to use it everywhere |
| 06:02:21 | <copumpkin> | or was it Cale? someone, anyway :) |
| 06:02:34 | <jmcarthur> | i believe i recall the conversation |
| 06:03:17 | <jmcarthur> | i already knew about it at the time, and even knew where i might apply it, but i hadn't used it then and didn't all the way until now |
| 06:03:39 | <copumpkin> | I love it when things suddenly make sense :P |
| 06:03:52 | <copumpkin> | ACTION looks forward to more such feelings |
| 06:04:13 | <Peaker> | maybe <=< indicates you should be using an arrow or category? |
| 06:04:59 | <jmcarthur> | already looked into that, but i think that would be overkill for this particular scenario |
| 06:05:12 | <copumpkin> | it's prettier with <=< than Kleisli and <<< though |
| 06:05:17 | <jmcarthur> | this was just about making some code point free |
| 06:06:22 | <ewwiz> | i'm a programmer. going to make the big bucks! |
| 06:06:26 | <jmcarthur> | i like it when i can consider the operators invisible and just read the identifiers from right to left and get a story of how the function works |
| 06:06:46 | <copumpkin> | ewwiz: to make the big bucks, you must first understand kleisli composition! |
| 06:06:51 | <copumpkin> | or something like that |
| 06:07:19 | <copumpkin> | or to understand the fixpoint combinator, you must first understand the fixpoint combinator |
| 06:07:24 | <copumpkin> | ACTION shrugs |
| 06:07:38 | <jmcarthur> | i hate the flip function |
| 06:07:46 | <copumpkin> | how com? |
| 06:07:57 | <jmcarthur> | if i have to use flip to make something point free, i usually just don't make it point free |
| 06:08:01 | <Gracenotes> | hm. it does make for some unreadable code. |
| 06:08:07 | <jmcarthur> | it's intrusive, in the way i read code |
| 06:08:09 | <Zao> | I find it quite convenient for rearranging arguments. |
| 06:08:22 | <copumpkin> | I generally draw the line at two flips nearby |
| 06:08:24 | <jmcarthur> | it makes me have to stop reading so i can back up and try again |
| 06:08:26 | <Gracenotes> | imho it should only be used for functions with two 'arguments' (used informally) |
| 06:08:29 | <Zao> | f (\x -> nine thousand line function) foo |
| 06:08:30 | <ewwiz> | flip flops? |
| 06:08:46 | <Berengal> | A flip every now and then isn't too bad, but I try to keep them at a minimum |
| 06:08:48 | <ewwiz> | like a D flip flop? |
| 06:08:56 | <ski> | (`f` foo) $ \x -> nine thousand line function |
| 06:08:56 | <Gracenotes> | a function that returns a function that returns a function that does not return a function |
| 06:09:05 | <copumpkin> | how about functions called permute21, permute213, permute3142, and so on? |
| 06:09:07 | <copumpkin> | a bunch of them :P |
| 06:09:11 | <jmcarthur> | ewwiz: new to haskell? |
| 06:09:13 | <Zao> | ski: That made my head hurt a bit. |
| 06:09:15 | <jmcarthur> | :t flip |
| 06:09:16 | <lambdabot> | forall a b c. (a -> b -> c) -> b -> a -> c |
| 06:09:38 | <jmcarthur> | i find ski's notation _slightly_ easier to read, but i avoid it too |
| 06:09:41 | <ski> | Zao : i used that a bit before `forM' came into being |
| 06:09:44 | <ewwiz> | jmcarthur - just a little bit |
| 06:09:48 | <Gracenotes> | ACTION smites copumpkin with caddrarararrradr |
| 06:09:52 | <copumpkin> | lol |
| 06:09:53 | <ski> | (still use it for some cases) |
| 06:09:54 | <Zao> | copumpkin: Once upon a time I used pointlessness to move an argument from being last to being the first argument. |
| 06:10:02 | <copumpkin> | :) |
| 06:10:04 | <Gracenotes> | heck, I don't even know what the extra r's are for |
| 06:10:06 | <Zao> | copumpkin: If you squinted, my code was full of ascii boobs. |
| 06:10:09 | <copumpkin> | I think that naming scheme seems reasonable though |
| 06:10:14 | <Gracenotes> | cdadadaddddaaaaaaaaaddar |
| 06:10:26 | <Gracenotes> | for those intricate data structure |
| 06:10:35 | <Gracenotes> | s |
| 06:10:50 | <ski> | huffman-encoded field access ? |
| 06:11:12 | <Zao> | @pl \f a b c d e -> f e a b c d |
| 06:11:12 | <Gracenotes> | quite possibly |
| 06:11:13 | <lambdabot> | (((((flip .) . flip) .) . flip) .) . flip |
| 06:11:17 | <jmcarthur> | i think rot functions might be easier to follow than permute, and even then i would never use them |
| 06:11:32 | <Zao> | copumpkin: Would that break your flip comfort zone? |
| 06:11:34 | <copumpkin> | well, rot functions would be a special case of the permute functions :P |
| 06:11:39 | <copumpkin> | Zao: definitely |
| 06:11:48 | <Gracenotes> | in Factor, rot functions are actually considered a sort of code smell |
| 06:11:51 | <ewwiz> | has anyone ever used the book "Haskell, the craft of functional programming" by simon thompson? |
| 06:11:58 | <ski> | yes |
| 06:12:13 | <jmcarthur> | Gracenotes: i've never programmed in forth or factor, but i would think so as well! |
| 06:12:24 | <ewwiz> | ski - is that a good book or are there better ones to learn from? |
| 06:12:31 | <Gracenotes> | I always find similarities between pointless style in Haskell and stack-oriented style |
| 06:12:44 | <jmcarthur> | Gracenotes: me too! |
| 06:12:59 | <jmcarthur> | "do this, then do this to the result, then to this to that result, then ..." |
| 06:13:03 | <ski> | ewwiz : i found it useful .. never really compared with others |
| 06:13:14 | <Gracenotes> | jmcarthur: yep. It's generally called the 'applicative' style |
| 06:13:21 | <jmcarthur> | right |
| 06:13:27 | <ewwiz> | ski - k, thx for the info |
| 06:13:29 | <Gracenotes> | argument order can be a bitch, though |
| 06:13:51 | <jmcarthur> | :t flip flip flip flip flip flip |
| 06:13:52 | <lambdabot> | forall a b c a1 c1. (a1 -> ((a -> b -> c) -> b -> a -> c) -> c1) -> a1 -> c1 |
| 06:14:02 | <jmcarthur> | fix anything |
| 06:14:06 | <ski> | ewwiz : the "Haskell School of Expression" might be interesting if media examples strikes your fancy |
| 06:14:11 | <copumpkin> | :t flip |
| 06:14:12 | <lambdabot> | forall a b c. (a -> b -> c) -> b -> a -> c |
| 06:14:22 | <ski> | ewwiz : there's a recent "Real World Haskell", too |
| 06:14:32 | <Gracenotes> | :t flip . flip . flip . flip . flip . flip |
| 06:14:33 | <lambdabot> | forall a b c. (b -> a -> c) -> b -> a -> c |
| 06:14:34 | <Gracenotes> | noo |
| 06:14:40 | <Gracenotes> | ... hm |
| 06:14:48 | <Gracenotes> | an even number of flips :) |
| 06:14:49 | <jmcarthur> | :t flip . flip . flip . flip . flip . flip . flip |
| 06:14:50 | <lambdabot> | forall a b c. (b -> a -> c) -> a -> b -> c |
| 06:15:52 | <jmcarthur> | :t (.).(.) -- comes up a lot if you take point free to the extreme and looks like boobies |
| 06:15:53 | <hatds> | I remember seeing syntax like f _3 _1 _2 to rearrange arguments arbitrarily, as well as f _1 _1 _2 to duplicate inputs |
| 06:15:53 | <lambdabot> | forall a b c a1. (b -> c) -> (a -> a1 -> b) -> a -> a1 -> c |
| 06:16:01 | <copumpkin> | :t fix flip |
| 06:16:03 | <lambdabot> | forall b c. b -> b -> c |
| 06:16:04 | <hatds> | I think it was in the Boost C++ libs |
| 06:16:09 | <ski> | urgh |
| 06:16:12 | <copumpkin> | that's a really useful one |
| 06:16:19 | <jmcarthur> | that type signature looks familiar now... |
| 06:16:43 | <twb> | RWH is also available free of charge, which is apparently unusual for Haskell textbooks. |
| 06:16:52 | <ski> | > fix slip () () |
| 06:16:53 | <lambdabot> | Not in scope: `slip' |
| 06:16:55 | <ski> | > fix flip () () |
| 06:17:00 | <lambdabot> | mueval-core: Prelude.read: no parse |
| 06:17:01 | <lambdabot> | mueval: ExitFailure 1 |
| 06:17:09 | <stanv> | Hello! are there any RSS with about haskell ? |
| 06:17:22 | <Gracenotes> | jmcarthur: and, of course.. |
| 06:17:23 | <twb> | stanv: you mean blogs? |
| 06:17:29 | <Gracenotes> | :t fmap fmap fmap `asTypeOf` ( (.).(.) ) |
| 06:17:31 | <lambdabot> | forall a b c a1. (b -> c) -> (a -> a1 -> b) -> a -> a1 -> c |
| 06:17:33 | <copumpkin> | http://planet.haskell.org |
| 06:17:35 | <jmcarthur> | stanv: check out planet.haskell.org |
| 06:17:45 | <Gracenotes> | *fmap* *fmap* *fmap* |
| 06:17:50 | <ewwiz> | ski - cool. i'll tell my friend, he's the one that's trying to learn haskell. he asked me for some help but, i know nothing about it |
| 06:17:53 | <ray> | @fmap gracenotes |
| 06:17:53 | <lambdabot> | http://www.haskell.org/hawiki/HaskellUserLocations |
| 06:18:02 | <copumpkin> | Gracenotes: keep it for the hacathon |
| 06:18:08 | <ray> | @cobotsnack |
| 06:18:09 | <lambdabot> | :) |
| 06:18:12 | <copumpkin> | wow, that's a really old link |
| 06:18:14 | <jmcarthur> | oh! i saw it while playing with semantic combinators |
| 06:18:28 | <stanv> | twb: I want regulary updated and easy reading. Something interesting about haskell. |
| 06:18:32 | <ray> | hawiki's gone now |
| 06:18:35 | <copumpkin> | yup |
| 06:18:38 | <Gracenotes> | @botsnackco |
| 06:18:38 | <lambdabot> | :) |
| 06:18:38 | <lunabot> | :) |
| 06:18:45 | <copumpkin> | @cobotsnack |
| 06:18:45 | <lambdabot> | :) |
| 06:18:59 | <copumpkin> | only I can do it right |
| 06:19:03 | <ray> | ): |
| 06:19:15 | <ski> | @botsmack |
| 06:19:15 | <lambdabot> | :) |
| 06:19:16 | <lunabot> | :) |
| 06:19:16 | <Gracenotes> | something to do with Levenshtein distance, I think... |
| 06:19:24 | <jmcarthur> | :t fmap.fmap |
| 06:19:25 | <lambdabot> | forall (f :: * -> *) a b (f1 :: * -> *). (Functor f, Functor f1) => (a -> b) -> f (f1 a) -> f (f1 b) |
| 06:19:30 | <ray> | @botsack |
| 06:19:30 | <lambdabot> | :) |
| 06:19:30 | <lunabot> | :) |
| 06:19:32 | <twb> | Gracenotes: I don't think you write the `h' |
| 06:19:41 | <ray> | :t fmap `fmap` fmap |
| 06:19:42 | <lambdabot> | forall (f :: * -> *) a b (f1 :: * -> *). (Functor f, Functor f1) => (a -> b) -> f (f1 a) -> f (f1 b) |
| 06:19:58 | <Gracenotes> | twb: where? -.- |
| 06:20:05 | <copumpkin> | :t (. fmap .) |
| 06:20:07 | <lambdabot> | parse error on input `)' |
| 06:20:09 | <copumpkin> | :( |
| 06:20:18 | <twb> | Gracenotes: Levenstein |
| 06:20:34 | <jmcarthur> | :t \a b -> a . fmap . b |
| 06:20:35 | <lambdabot> | forall c a b (f :: * -> *) a1. (Functor f) => ((f a -> f b) -> c) -> (a1 -> a -> b) -> a1 -> c |
| 06:20:35 | <Gracenotes> | oh. I'm pretty sure there was an h. |
| 06:20:49 | <twb> | Hmm, apparently there is... |
| 06:21:00 | <jeffz`> | stanv: there's also the haskell reddit, linked in the topic |
| 06:21:15 | <twb> | I blame the transcriber (from cyrillic). |
| 06:21:33 | <ray> | :t liftA2 liftA2 liftA2 |
| 06:21:34 | <lambdabot> | forall (f :: * -> *) a b c (f1 :: * -> *). (Applicative f, Applicative f1) => ((a -> b -> c) -> f (f1 a)) -> (a -> b -> c) -> f (f1 b) -> f (f1 c) |
| 06:21:45 | <Gracenotes> | nod |
| 06:22:04 | <copumpkin> | :t liftA2 liftA2 liftA2 liftA2 |
| 06:22:06 | <lambdabot> | forall b c (f :: * -> *). (Applicative f) => (f c -> b -> c) -> (f (f c) -> f b -> b) -> f (f c) -> f b -> c |
| 06:22:09 | <copumpkin> | that's more like it |
| 06:22:10 | <Gracenotes> | you know, lots of interesting function types for the function instance of applicative |
| 06:22:18 | <Gracenotes> | @type liftA2.liftA2.liftA2 |
| 06:22:19 | <lambdabot> | forall (f :: * -> *) (f1 :: * -> *) a b c (f2 :: * -> *). (Applicative f, Applicative f1, Applicative f2) => (a -> b -> c) -> f (f1 (f2 a)) -> f (f1 (f2 b)) -> f (f1 (f2 c)) |
| 06:22:36 | <copumpkin> | :t liftA2 join |
| 06:22:37 | <stanv> | jeffz`: thanks :) |
| 06:22:38 | <lambdabot> | forall b c (f :: * -> *). (Applicative f) => f (b -> b -> c) -> f b -> f c |
| 06:22:46 | <Gracenotes> | can be useful in some cases, for combining the results of two three-argument functions |
| 06:22:51 | <Gracenotes> | my example |
| 06:23:30 | <Gracenotes> | or liftA3.liftA3, combing the results of three two-argument functions |
| 06:23:33 | <Berengal> | I think I've been overexposed to applicative function style... |
| 06:23:40 | <copumpkin> | no such thing |
| 06:23:51 | <ray> | :t fmap pure |
| 06:23:53 | <lambdabot> | forall a (f :: * -> *) (f1 :: * -> *). (Applicative f, Functor f1) => f1 a -> f1 (f a) |
| 06:23:56 | <Berengal> | I recently wrote 'isPrime = (==) <*> head . factorize' |
| 06:24:14 | <Gracenotes> | adorable! |
| 06:24:19 | <Berengal> | Without thinking about it. I was demoing haskell to a friend... |
| 06:24:29 | <Berengal> | He was confused :/ |
| 06:24:39 | <copumpkin> | :) |
| 06:24:44 | <Gracenotes> | except that it does rely on knowing about the exact ordering of factorize |
| 06:25:00 | <Berengal> | Gracenotes: factorize :: Integer -> [Integer] |
| 06:25:05 | <Gracenotes> | if it returns 1 or not |
| 06:25:06 | <Berengal> | As it should be |
| 06:25:46 | <Berengal> | Gracenotes: My version sepcial-cases out 0 and 1 |
| 06:25:51 | <Gracenotes> | if factorize 10 yields [10, 5, 2, 1], you're out of luck :) </unimportant> |
| 06:26:04 | <Berengal> | Gracenotes: That would be divisors, obviously |
| 06:26:15 | <Berengal> | factorize is prime factorization |
| 06:27:02 | <Gracenotes> | ah. that makes it clearer. |
| 06:27:27 | <Gracenotes> | I assumed factors <=> divisors here. |
| 06:27:30 | <Gracenotes> | :) |
| 06:27:38 | <twb> | Is HWN available by mailing list (or, say, in gmane)? |
| 06:28:01 | <Berengal> | divisors = map head . group . sort . map product . filterM (const [True, False]) . factorize |
| 06:28:10 | <Gracenotes> | <*> and =<< are useful, but not-so-clear, combinators |
| 06:29:10 | <twb> | Ah, "New editions are posted to the Haskell mailing list". Presumably that's a wider list, not just HWN. |
| 06:29:10 | <Berengal> | Funktions are always funky when treated as funktors++ |
| 06:29:29 | <copumpkin> | applikatives and monkads? |
| 06:29:31 | <ray> | even more useful and less clear than usual when you use the function functor |
| 06:29:36 | <jmcarthur> | i don't get confused by <*> and =<< very easily |
| 06:29:38 | <twb> | copumpkin: no, no, jive and soul |
| 06:29:45 | <ray> | :t jive |
| 06:29:46 | <lambdabot> | Not in scope: `jive' |
| 06:29:51 | <copumpkin> | :t soul |
| 06:29:53 | <lambdabot> | Not in scope: `soul' |
| 06:29:54 | <copumpkin> | lambdabot has no soul |
| 06:30:01 | <twb> | monkads are for jass. |
| 06:30:22 | <Gracenotes> | applikatives |
| 06:30:34 | <ray> | soul = pure; jive = (<*>) |
| 06:30:38 | <Berengal> | *snap snap snap* |
| 06:30:49 | <copumpkin> | @type loop (join *** id) |
| 06:30:51 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => m (m a) -> m a |
| 06:31:16 | <copumpkin> | how to make things more complicated than they need to be |
| 06:31:26 | <copumpkin> | loop (f *** id) === f ? |
| 06:31:32 | <jmcarthur> | @let soul = Control.Applicative.pure |
| 06:31:34 | <lambdabot> | Defined. |
| 06:31:40 | <ray> | :t id `id` id |
| 06:31:41 | <lambdabot> | forall a. a -> a |
| 06:31:42 | <jmcarthur> | @let jive = (<*>) |
| 06:31:43 | <lambdabot> | Defined. |
| 06:32:04 | <copumpkin> | @type loop (snd &&& fst) |
| 06:32:06 | <lambdabot> | forall b. b -> b |
| 06:32:11 | <copumpkin> | > loop (snd &&& fst) 5 |
| 06:32:13 | <lambdabot> | 5 |
| 06:32:21 | <copumpkin> | who needs id! |
| 06:32:34 | <copumpkin> | @type loop (join *** loop (snd &&& fst)) |
| 06:32:36 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => m (m a) -> m a |
| 06:32:43 | <Gracenotes> | > loop (loop (snd &&& fst)) 5 |
| 06:32:44 | <lambdabot> | 5 |
| 06:32:48 | <Gracenotes> | .. |
| 06:33:05 | <jmcarthur> | :t loop |
| 06:33:06 | <lambdabot> | forall (a :: * -> * -> *) b d c. (ArrowLoop a) => a (b, d) (c, d) -> a b c |
| 06:33:12 | <jmcarthur> | oh, that loop |
| 06:33:30 | <copumpkin> | @type loop (join *** loop (second id &&& first id)) |
| 06:33:31 | <lambdabot> | Occurs check: cannot construct the infinite type: d = (d, d1) |
| 06:33:31 | <lambdabot> | Expected type: d |
| 06:33:31 | <lambdabot> | Inferred type: (d, d1) |
| 06:33:42 | <copumpkin> | oh whoops :) |
| 06:33:43 | <Gracenotes> | loop f b = let (c,d) = f (b,d) in c |
| 06:34:19 | <ray> | arrows need ~> or something |
| 06:34:41 | <Gracenotes> | > loop (join (,) . snd) 10 |
| 06:34:46 | <lambdabot> | mueval-core: Prelude.read: no parse |
| 06:34:47 | <lambdabot> | mueval: ExitFailure 1 |
| 06:34:56 | <Berengal> | Someone needs to create a class Bow so we can program in Bow and Arrow style |
| 06:34:57 | <Gracenotes> | o-o |
| 06:35:06 | <Gracenotes> | > "poke" |
| 06:35:08 | <lambdabot> | "poke" |
| 06:35:55 | <jmcarthur> | > "o-o " <* "poke" |
| 06:35:56 | <lambdabot> | "oooo----oooo " |
| 06:36:08 | <jmcarthur> | woops |
| 06:36:10 | <jmcarthur> | > "o-o" <* "poke" |
| 06:36:11 | <lambdabot> | "oooo----oooo" |
| 06:36:55 | <copumpkin> | are people typically as ridiculous as they are in #hsakell at hackathons? |
| 06:36:56 | <Gracenotes> | @vixen How bored are people here? |
| 06:36:56 | <lambdabot> | what can i do to amuse you into a state of un-boredness? |
| 06:37:33 | <ray> | well, is there a lambdabot at hackathons to type random expressions? |
| 06:37:44 | <Gracenotes> | @vixen some efficient immutable data structures, perhaps |
| 06:37:44 | <lambdabot> | why, aren't you sure? |
| 06:37:48 | <Gracenotes> | uh |
| 06:38:07 | <jmcarthur> | > '?' <$ "I guess it is time for me to go to bed, but before I do, here's some random crap for lambdabot!" |
| 06:38:08 | <lambdabot> | "??????????????????????????????????????????????????????????????????????????... |
| 06:38:10 | <Berengal> | Gracenotes: How can you "do" a structure anyway? |
| 06:38:22 | <copumpkin> | don't ask |
| 06:38:47 | <ski> | ACTION . o O ( substitution/expression monad ) |
| 06:39:06 | <Gracenotes> | I was going to say "implement", but I don't want to ruin copumpkin's fantasy here |
| 06:39:34 | <copumpkin> | ACTION fantasizes some more |
| 06:39:52 | <ray> | you can "do" a structure by making it an instance of MonadZero |
| 06:39:53 | <outchanter> | clojure has array mapped hash tries ... I wonder if they're more efficient? |
| 06:39:54 | <Berengal> | ACTION just wondered if unicorns are Identity monads or Maybe monads... |
| 06:40:13 | <ray> | unicorns are ContT |
| 06:40:32 | <Gracenotes> | I'd say Identity |
| 06:42:35 | <Gracenotes> | outchanter: possibly... they are mutable, though, and more suited for Clojure, maybe. |
| 06:43:27 | <copumpkin> | outchanter: more efficient than what? |
| 06:43:50 | <copumpkin> | definitely more efficient than our hashtables :P |
| 06:44:50 | <outchanter> | I think they're used to implement immutable maps, actually. This seems to be a good explanation: http://arcanesentiment.blogspot.com/2008/08/array-mapped-hash-tries-and-nature-of.html |
| 06:46:00 | <copumpkin> | sounds interesting |
| 06:46:22 | <Gracenotes> | hm |
| 06:47:28 | <copumpkin> | we'd need some kind of Hashable typeclass though |
| 06:49:46 | <Peaker> | @unpl (==) <*> head . factorize |
| 06:49:46 | <lambdabot> | (\ c -> ((==) <*> head) (factorize c)) |
| 06:49:54 | <Peaker> | @unpl (==) `ap` head . factorize |
| 06:49:55 | <lambdabot> | (\ c -> ((==) >>= \ e -> head >>= \ d -> return (e d)) (factorize c)) |
| 06:50:01 | <Gracenotes> | eek |
| 06:50:10 | <Peaker> | @unpl really sucks |
| 06:50:11 | <lambdabot> | really sucks |
| 06:50:23 | <Gracenotes> | maybe if you had a "funcAp", which is the specific function instance for ap |
| 06:50:30 | <Peaker> | @unpl ((==) >>= \ e -> head >>= \ d -> return (e d)) (factorize c) |
| 06:50:30 | <lambdabot> | ((==) >>= \ e -> head >>= \ d -> return (e d)) (factorize c) |
| 06:50:44 | <Peaker> | well, it does know the type here |
| 06:50:58 | <copumpkin> | @redo ((==) >>= \ e -> head >>= \ d -> return (e d)) (factorize c) |
| 06:50:58 | <lambdabot> | (do { e <- (==); d <- head; return (e d)}) (factorize c) |
| 06:51:01 | <Gracenotes> | not sure pl does much type inference |
| 06:51:18 | <ski> | @pl \x -> x x |
| 06:51:18 | <lambdabot> | join id |
| 06:51:39 | <copumpkin> | @pl (\x -> x x) (\x -> x x) |
| 06:51:43 | <lambdabot> | ap id id (ap id id) |
| 06:51:43 | <lambdabot> | optimization suspended, use @pl-resume to continue. |
| 06:52:02 | <QtPlaty[HireMe]> | copumpkin: Evil. |
| 06:52:31 | <ski> | @pl \f -> (\t -> t t) (\g -> f (g g)) |
| 06:52:32 | <lambdabot> | join id . (. join id) |
| 06:53:02 | <copumpkin> | lambdabot definitely doesn't like that |
| 06:53:09 | <Gracenotes> | in demand: a funcAp |
| 06:53:25 | <Gracenotes> | >_> <_< |
| 06:53:52 | <ski> | @pl (\g -> g g) (\g f -> f (g g f)) |
| 06:54:01 | <lambdabot> | ap id id (ap id . ap id id) |
| 06:54:07 | <lambdabot> | optimization suspended, use @pl-resume to continue. |
| 06:54:42 | <jeffwheeler> | @uptime |
| 06:54:43 | <jeffwheeler> | :( |
| 06:54:43 | <Gracenotes> | goodnight, sweet lambdabot |
| 06:54:49 | <lambdabot> | uptime: 15s, longest uptime: 1m 10d 23h 44m 29s |
| 06:54:53 | <copumpkin> | seems like a bit of a DOS |
| 06:59:08 | <Peaker> | Hmm -- "cabal install" can find missing dependencies ("Blah is a member of hidden package ...") -- can a .cabal file construction be mostly automated? Perhaps cabal-install knows what different APIs are provided by different versions and can even automate creating the right version range? |
| 07:01:18 | <dmwit> | Yes, I think there's a command to construct a minimal .cabal file. |
| 07:01:20 | <ski> | @pl let i = id; k = return; s = ap in s (s (k s) (s (k k) (s (k s) (s (s (k s) (s (k k) i)) (k i))))) (k (s (s (k s) (s (k k) i)) (k i))) |
| 07:01:23 | <lambdabot> | liftM2 ap (return `fmap` (ap `fmap` liftM2 ap (return `fmap` id) (return id))) (return (liftM2 ap (return `fmap` id) (return id))) |
| 07:01:23 | <dmwit> | ...but I don't remember what it is. |
| 07:01:50 | <dmwit> | :t liftM2 ap (return `fmap` (ap `fmap` liftM2 ap (return `fmap` id) (return id))) (return (liftM2 ap (return `fmap` id) (return id))) |
| 07:01:51 | <lambdabot> | forall b a b1. (a -> b1 -> b) -> (a -> b1) -> a -> b |
| 07:01:54 | <mmorrow> | , randExp() |
| 07:01:56 | <lunabot> | luna: Not in scope: `randExp' |
| 07:01:59 | <mmorrow> | , randE() |
| 07:02:02 | <lunabot> | x3 ((\ x26 (x10) (x6) (- 13) (11 :: (->)) _ -> x12) ([] :: ())) |
| 07:02:05 | <mmorrow> | , randE() |
| 07:02:08 | <lunabot> | () |
| 07:02:09 | <mmorrow> | , randE() |
| 07:02:12 | <lunabot> | () |
| 07:02:13 | <mmorrow> | , randE() |
| 07:02:16 | <lunabot> | let { x0 (- 1) | "T" = x0} in x1 |
| 07:02:18 | <mmorrow> | wee |
| 07:02:31 | <ski> | hehee |
| 07:02:35 | <ziman> | haskell has deformed me; dividing a double by an int in Java feels weird now |
| 07:02:39 | <mmorrow> | quickcheck + TH |
| 07:02:52 | <dmwit> | ?pl \g f x -> g x (f x) -- ap? |
| 07:02:52 | <lambdabot> | ap |
| 07:03:06 | <mmorrow> | (stolen from andyjgill's hera pkg) |
| 07:03:13 | <dmwit> | ski: Is that whole think just s? |
| 07:03:20 | <ski> | dmwit : indeed :D |
| 07:03:30 | <dmwit> | Nasty. =) |
| 07:03:36 | <ski> | (it's the naive ski-conversion of `\f g x -> f x (g x)') |
| 07:03:40 | <mmorrow> | @pl |
| 07:03:41 | <lambdabot> | (line 1, column 1): |
| 07:03:41 | <lambdabot> | unexpected end of input |
| 07:03:41 | <lambdabot> | expecting white space, "()", natural, identifier, lambda abstraction or expression |
| 07:03:54 | <mmorrow> | @pl \f g x -> f (g x) x |
| 07:03:56 | <lambdabot> | flip flip id . liftM2 |
| 07:04:04 | <mmorrow> | S (?) |
| 07:04:10 | <mmorrow> | iirc |
| 07:04:22 | <Peaker> | @unpl flip flip id |
| 07:04:22 | <lambdabot> | (\ c f -> c f (\ g -> g)) |
| 07:04:24 | <ski> | s . flip |
| 07:04:27 | <mmorrow> | , [$ski|S[f][g][x]|] |
| 07:04:30 | <lunabot> | luna: Ambiguous type variable `a' in the constraints: |
| 07:04:36 | <mmorrow> | , [$ski|S[f][g][x]|] :: Expr |
| 07:04:39 | <lunabot> | luna: Ambiguous type variable `t' in the constraints: |
| 07:04:57 | <mmorrow> | , [$ski|S[f::Expr->Expr->Expr][g::Expr->Expr][x::Expr]|] |
| 07:05:00 | <lunabot> | f x (g x) |
| 07:05:02 | <Gracenotes> | eeks. |
| 07:05:09 | <mmorrow> | ah, ap is S |
| 07:05:27 | <ski> | @type [ap . flip,\f g x -> f (g x) x] |
| 07:05:29 | <lambdabot> | forall a b b1. [(a -> b1 -> b) -> (b1 -> a) -> b1 -> b] |
| 07:06:01 | <dmwit> | That doesn't mean they have the same type. |
| 07:06:05 | <dmwit> | :t [($), id] |
| 07:06:06 | <ski> | @type ap . flip |
| 07:06:06 | <lambdabot> | forall a b. [(a -> b) -> a -> b] |
| 07:06:07 | <lambdabot> | forall a b b1. (a -> b1 -> b) -> (b1 -> a) -> b1 -> b |
| 07:06:10 | <ski> | @type \f g x -> f (g x) x |
| 07:06:12 | <lambdabot> | forall t t1 t2. (t1 -> t -> t2) -> (t -> t1) -> t -> t2 |
| 07:06:14 | <Gracenotes> | @type (=<<) `asTypeOf` (\f g x -> f (g x) x) |
| 07:06:15 | <lambdabot> | forall a b t. (Monad ((->) t)) => (a -> t -> b) -> (t -> a) -> t -> b |
| 07:06:23 | <ski> | dmwit : satisfied ? |
| 07:06:24 | <mmorrow> | , [$ty| (\f g x -> [$ski|S[f][g][x]\|]) . flip |] |
| 07:06:24 | <Gracenotes> | (=<<) |
| 07:06:28 | <lunabot> | forall a b c . (c -> b -> a) -> (b -> c) -> b -> a |
| 07:06:34 | <dmwit> | ski: Oh, yeah. I was satisfied before, too. |
| 07:06:37 | <Gracenotes> | I consider =<< and ap opposites, in that sense |
| 07:06:40 | <dmwit> | I was just being annoying. =) |
| 07:07:27 | <ski> | (i figured since each type variable occured once covariantly, and once contravariantly (and there was no recursion involved), it'd be apparent that that was the most general type of both expressions) |
| 07:07:30 | <Gracenotes> | although ap is rather theoretical, S, and =<< is just, hm, I guess ($) generalized to monads |
| 07:07:55 | <dmwit> | ski: Ah, good point. Cool! |
| 07:08:50 | <dmwit> | Wait, no, that still doesn't mean anything, does it? |
| 07:09:07 | <dmwit> | :t [ap . flip, undefined] |
| 07:09:08 | <lambdabot> | forall a b b1. [(a -> b1 -> b) -> (b1 -> a) -> b1 -> b] |
| 07:09:18 | <ski> | granted |
| 07:09:36 | <Gracenotes> | >>=_>>= |
| 07:10:51 | <ski> | @seen TheHunter |
| 07:10:52 | <lambdabot> | I haven't seen TheHunter. |
| 07:15:48 | <dibblego> | is there a toEnum that will return Maybe instead of error? |
| 07:16:23 | <Peaker> | @type toEnum |
| 07:16:24 | <lambdabot> | forall a. (Enum a) => Int -> a |
| 07:16:28 | <copumpkin> | not that I know of |
| 07:16:58 | <copumpkin> | those seem like cases where it should be safe to have an unsafePerformIO with something to catch the error |
| 07:17:05 | <Peaker> | I wonder how Haskell would look if it actually had (/), head, and everything else that should be, inside a Maybe |
| 07:17:09 | <copumpkin> | but in a recent discussion people said they weren't |
| 07:17:24 | <copumpkin> | it seems odd to me |
| 07:17:57 | <Peaker> | @type maxBound |
| 07:17:58 | <lambdabot> | forall a. (Bounded a) => a |
| 07:18:11 | <Peaker> | If you have (Bounded a, Enum a) you can test against fromEnum maxBound |
| 07:18:12 | <Gracenotes> | at least the error-producing conditions for these functions are well known |
| 07:18:43 | <Gracenotes> | should be the case for any error-producing functions, in theory |
| 07:19:07 | <copumpkin> | someone could write their own Enum instance with invalid in-between cases :P |
| 07:19:49 | <Peaker> | yay total languages |
| 07:31:57 | <Peaker> | Is there a way to override: "Warning: The export item `module Text.Regex.DFA.String' exports nothing" in code (not compiler options)? Its used for instances only |
| 07:33:24 | <copumpkin> | you stick () on its export list don't you? |
| 07:33:28 | <copumpkin> | or is that only for imports |
| 07:39:56 | <Beelsebob1> | I'm trying to get ghc-api to compile a module to a .o/.hi file given the module contents as a string (rather than the name of the file), anyone have any idea where I need to look in the docs? |
| 07:41:06 | <dmwit> | Docs? For GHC API? |
| 07:41:27 | <mmorrow> | , flip (foldM (flip foldl)) [(*),(+)] 1 [1..4] |
| 07:41:29 | <lunabot> | 34 |
| 07:41:32 | <mmorrow> | , flip (foldM (flip foldl)) [(+),(*)] 1 [1..4] |
| 07:41:34 | <lunabot> | 264 |
| 07:42:11 | <copumpkin> | compileExpr :: GhcMonad m => String -> m HValue -- maybe? |
| 07:42:16 | <copumpkin> | I have no clue, really :) |
| 07:42:29 | <copumpkin> | that sounds kind of dynamic |
| 07:43:01 | <Beelsebob1> | copumpkin: yeh, not quite right |
| 07:43:06 | <Beelsebob1> | that compiles an expression |
| 07:43:10 | <copumpkin> | oh, I see |
| 07:43:16 | <Beelsebob1> | I need to compile a bunch of equations and some imports |
| 07:43:19 | <copumpkin> | compileToCoreModule :: GhcMonad m => FilePath -> m CoreModule -- is the one you're talking about, along with compilecoretoObj ? |
| 07:43:25 | <copumpkin> | that takes a filename |
| 07:43:29 | <mmorrow> | Beelsebob: hmm, it's definitely doable, although i'm not sure how to do it using the ghc-api proper |
| 07:43:42 | <Beelsebob1> | ohhhh... good call copumpkin – the one that goes with that is usable |
| 07:43:48 | <Beelsebob1> | I have an AST, not a string anyway |
| 07:43:52 | <Beelsebob1> | so I can rewrite it into core |
| 07:43:55 | <copumpkin> | that still takes a FilePath though |
| 07:44:03 | <Beelsebob1> | and push it through compileCoreToObj |
| 07:44:15 | <copumpkin> | ah, cool |
| 07:44:19 | <Beelsebob1> | cheers muchly :D |
| 07:44:42 | <copumpkin> | ACTION is glad his cluelessness was helpful |
| 07:45:45 | <dmwit> | Wow, the GHC API is big. |
| 07:46:36 | <cinimod> | I've just install cabal head |
| 07:46:48 | <cinimod> | dom@linux-6ofq:~/cabal_0> ghc-pkg list | grep abal |
| 07:46:48 | <cinimod> | Cabal-1.6.0.3, Cabal-1.7.0, HTTP-3001.1.5, HUnit-1.2.0.3, |
| 07:47:07 | <cinimod> | I thought later versions of packages hid earlier versions |
| 07:47:15 | <dibblego> | is Data.List.Split in the GHC stdlib? |
| 07:47:17 | <dmwit> | Nope! |
| 07:47:24 | <copumpkin> | dibblego: nope |
| 07:47:31 | <dibblego> | ok |
| 07:47:34 | <copumpkin> | I think it's byorgey's split package |
| 07:47:36 | <copumpkin> | @hackage split |
| 07:47:36 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/split |
| 07:47:41 | <dmwit> | cinimod: Also, you can just "ghc-pkg list Cabal" in the future. ;-) |
| 07:47:46 | <dibblego> | @hoogle [a] -> Int -> [[a]] |
| 07:47:47 | <lambdabot> | Control.Monad replicateM :: Monad m => Int -> m a -> m [a] |
| 07:47:47 | <lambdabot> | Prelude drop :: Int -> [a] -> [a] |
| 07:47:47 | <lambdabot> | Prelude take :: Int -> [a] -> [a] |
| 07:48:41 | <cinimod> | dom@linux-6ofq:~/cabal_0> ghc-pkg latest Cabal |
| 07:48:41 | <cinimod> | Cabal-1.7.0 |
| 07:49:03 | <cinimod> | dom@linux-6ofq:~/cabal_0> cabal --version |
| 07:49:03 | <cinimod> | cabal-install version 0.6.1 |
| 07:49:03 | <cinimod> | using version 1.6.0.3 of the Cabal library |
| 07:49:17 | <paper_cc> | cinimod: that's cabal-install, not Cabal |
| 07:49:41 | <paper_cc> | cinimod: you probably want to rebuild cabal-install to use Cabal-1.7 |
| 07:49:43 | <copumpkin> | the naming for that is really unfortunate |
| 07:49:46 | <cinimod> | I just realised that but it seems to use 1.6.0.3 |
| 07:49:53 | <Saizan> | cabal-install uses the stable version, i.e. 1.6.* |
| 07:50:30 | <copumpkin> | I wonder if we'll still get people trying the netflix challenge now that it's been won |
| 07:50:37 | <Saizan> | however in general you need to rebuild cabal-install if you want it to use a different Cabal version |
| 07:51:06 | <dmwit> | copumpkin: It's been won? |
| 07:51:17 | <copumpkin> | I thought it had |
| 07:51:28 | <dmwit> | The leaderboard shows 9.71 improvement as the number one leader. |
| 07:51:32 | <copumpkin> | oh I guess it hasn't |
| 07:51:33 | <dmwit> | 9.71%, that is |
| 07:51:39 | <copumpkin> | hmm, why did I think it had been won |
| 07:51:50 | <dmwit> | You read that article about the guys who won the progress prize this year. |
| 07:51:59 | <copumpkin> | probably :) |
| 07:52:22 | <copumpkin> | anyway, I still wonder if anyone will keep playing with it after it's been won |
| 07:52:51 | <copumpkin> | assuming it can be won |
| 07:52:53 | <copumpkin> | :P |
| 07:53:54 | <cinimod> | I did ghc-pkg hide Cabal-1.6.0.3 |
| 07:54:12 | <cinimod> | I'm sure Cabal used to hide old versions automatically |
| 07:54:27 | <Saizan> | no, they were never hidden |
| 07:54:51 | <Saizan> | but Cabal prefers the latest version of a package by default |
| 07:54:53 | <RayNbow> | ACTION wonders how hard it is to switch from community/xmonad to xmonad manually pulled from darcs... |
| 07:55:03 | <cinimod> | Did the latest get used by default then? |
| 07:55:18 | <Saizan> | it's still used by default. |
| 07:55:31 | <dmwit> | RayNbow: There's xmonad-darcs in AUR. |
| 07:55:33 | <Saizan> | unless there's a constraint saying otherwise |
| 07:55:46 | <Saizan> | like in cabal-install's build-depends |
| 07:56:34 | <RayNbow> | dmwit: I noticed... but I have no idea where yaourt would store the source files |
| 07:57:16 | <dmwit> | RayNbow: yaourt is not the only way to use AUR. ;-) |
| 07:57:48 | <dmwit> | RayNbow: (Anyway, yaourt stores them in /tmp/yaourt-RayNbow-somethingweirdhere/) |
| 07:58:20 | <dmwit> | sorry, /tmp/yaourt-tmp-RayNbow |
| 07:58:27 | <dmwit> | In any case, not somewhere permanent enough to be useful. |
| 07:58:43 | <RayNbow> | /tmp is the most dangerous place on a computer :p |
| 07:58:55 | <RayNbow> | I envy the courage of the bits that live there |
| 07:59:41 | <mmorrow> | /dev/fb is worse |
| 07:59:54 | <RayNbow> | :p |
| 08:00:05 | <dibblego> | > "abc" `intersperse ' '` "def" |
| 08:00:07 | <lambdabot> | <no location info>: parse error on input `'' |
| 08:00:11 | <dibblego> | > "abc" `intersperse " "` "def" |
| 08:00:13 | <lambdabot> | <no location info>: parse error on input `"' |
| 08:00:37 | <dibblego> | blah |
| 08:01:02 | <Neut> | Can someone help me debug this please, |
| 08:01:04 | <Neut> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2475#a2475 |
| 08:01:07 | <dmwit> | Only plain identifiers can go in backticks. |
| 08:01:44 | <Saizan> | Neut: what's the problem? |
| 08:01:47 | <RayNbow> | dmwit: but for development purposes, would you also recommend using AUR? |
| 08:01:48 | <dmwit> | Neut: Topping is a type, not a value. |
| 08:02:00 | <dmwit> | RayNbow: Sure, why not? |
| 08:02:21 | <Neut> | dmwit: How do I overcome this? |
| 08:02:57 | <dmwit> | Use an actual pattern instead of a type. ;-) |
| 08:03:29 | <Botje> | Neut: don't use [Topping] to match topping |
| 08:03:37 | <dmwit> | Also, your equations for "topping" have differing numbers of patterns, so I'm sure GHC is going to holler about that. |
| 08:03:47 | <Botje> | do something like topping (Pizza toppings price) = toppings |
| 08:04:05 | <Botje> | that way, the [Topping] part of Pizza is bound to toppings and the Price to price |
| 08:04:15 | <RayNbow> | dmwit: I have no idea how :p |
| 08:04:33 | <dmwit> | RayNbow: Ask in #archlinux, they'll tell you. |
| 08:04:41 | <dmwit> | RayNbow: In short, "man abs". =) |
| 08:04:52 | <Botje> | Neut: oh, and (== Pizza _ _) is wrong too |
| 08:05:15 | <Botje> | I think you need to re-read the chapter on pattern matching |
| 08:05:39 | <Botje> | and now i'm off to deliver some goodies! g'bye! |
| 08:05:44 | <Neut> | ACTION cries |
| 08:06:51 | <Neut> | dmwit: what do you mean by use an actual pattern instead of a type? |
| 08:07:02 | <Botje> | [Topping] is not a correct pattern |
| 08:07:22 | <Botje> | [topping] is, but that only matches lists of one element |
| 08:08:13 | <Neut> | oh kay |
| 08:08:23 | <Neut> | why is ghci complaining about the _'s? |
| 08:08:40 | <Botje> | the ones inside filter (== Pizza _ _) ? |
| 08:08:54 | <Botje> | or the the in toppings? |
| 08:09:00 | <Neut> | in the filter |
| 08:09:10 | <Botje> | you can't use pattern matching like that :) |
| 08:09:29 | <Botje> | write an isPizza function |
| 08:09:30 | <Peaker> | if "type" in a class defines a "type family", what does a "data" define in a class? |
| 08:09:42 | <Botje> | that uses pattern matching to check if something is a pizza |
| 08:09:45 | <dolio> | data family. |
| 08:09:55 | <Neut> | Botje: so this function would test if it was a pizza? |
| 08:09:58 | <Peaker> | copumpkin: about the instances importing, its only for imports :( |
| 08:10:26 | <copumpkin> | ah :/ |
| 08:10:49 | <Peaker> | copumpkin: hmm.. maybe the instances get re-exported anyway without having to explicitly export the modules |
| 08:12:05 | <Neut> | Botje: I have made the function, how would I apply it in the isVegetarian function? |
| 08:12:31 | <Neut> | fucntion is of type |
| 08:12:33 | <copumpkin> | I think you can't avoid having instances exported |
| 08:12:37 | <Neut> | isPizza :: Items -> Bool |
| 08:12:38 | <copumpkin> | for sanity reasons |
| 08:20:01 | <Peaker> | copumpkin: yeah, that's indeed the case, so its still a bug in the DFA regex package. I think I sent a patch long ago and it was ignored |
| 08:20:27 | <Peaker> | SPJ/oleg/et al suggest an Add class as an example of type families -- to coerce addition types |
| 08:21:19 | <Peaker> | but this seems like a bad idea O(N^2) instances? |
| 08:26:28 | <Peaker> | kudos to them for writing the paper with ASCII Haskell syntax and no fancy unicode |
| 08:26:42 | <dolio> | Heh. |
| 08:27:18 | <ivanm> | Peaker: awwwww |
| 08:27:21 | <copumpkin> | I like fancy symbols |
| 08:27:27 | <ivanm> | is TeX math symbols OK though? |
| 08:27:28 | <copumpkin> | they make me feel learnéd |
| 08:28:00 | <Neut> | If I had a data type of the form Int [Int] Int, how would I do a list comprehension to extract only the list of ints? |
| 08:28:18 | <copumpkin> | pattern match out the bit you want? |
| 08:28:21 | <Peaker> | Whenever I read a paper that uses fancy symbols instead of <*> and whatnot, I want to kick someone for putting an unnecessary barrier to reading their paper. |
| 08:28:54 | <Berengal> | Peaker: What about writing code with fancy symbols instead? |
| 08:28:59 | <ivanm> | copumpkin: so not just "learned" but "learn-ED"? ;-) |
| 08:29:00 | <Neut> | copumpkin> yes |
| 08:29:20 | <ivanm> | Peaker: tbh, I find reading code with <*> and whatnot an unnecessary barrier |
| 08:29:35 | <copumpkin> | ivanm: certainly! using words like learned makes me feel learned too |
| 08:29:36 | <Peaker> | Berengal: please no :( |
| 08:30:14 | <Peaker> | Berengal: that's going to put another huge barrier of entry on newbies (just configure one of the "approved editors" who can create fancy symbols) or duplicate many of the names for yet more confusion |
| 08:30:42 | <Neut> | copumkin: any advice? |
| 08:30:58 | <chromakode> | http://www.haskell.org/ghc/docs/6.10.1/html/libraries/ghc/StrictAnal.html |
| 08:31:00 | <chromakode> | I lolled. |
| 08:31:05 | <copumpkin> | Neut: oh, it was a questioning suggestion for your problem :) |
| 08:31:17 | <copumpkin> | chromakode: I even submitted a trac ticket about that :P they voted to keep it |
| 08:31:32 | <copumpkin> | in GHC, OccurAnal |
| 08:31:34 | <Neut> | copumkin: so no answers :( lol |
| 08:31:43 | <ivanm> | chromakode: so what you're saying is that you're immature? |
| 08:31:43 | <chromakode> | haha copumpkin, you're now famous on reddit: http://www.reddit.com/r/programming/comments/8mxum/someone_had_to_have_thought_maybe_asstuple_and/c09stpd |
| 08:31:46 | <copumpkin> | Neut: oh, I do have answers! |
| 08:31:51 | <Berengal> | double ∷ (Num a) ⇒ [a] → [a]; double = map (λn → n*2) |
| 08:31:52 | <Neut> | Can you please share? |
| 08:31:55 | <Neut> | Im stumped :/ |
| 08:32:00 | <copumpkin> | lol |
| 08:32:11 | <copumpkin> | Neut: what's the actual data declaration? |
| 08:32:17 | <ivanm> | Berengal: no, you have to use the actual \times symbol rather than * |
| 08:32:48 | <Berengal> | ivanm: I knew there was something I forgot |
| 08:33:24 | <Neut> | (Int, [Int], Int) -> [Int] |
| 08:34:04 | <Peaker> | Berengal: yuck .. |
| 08:34:45 | <Peaker> | we should learn from the Chinese that having more symbols than you have keyboard keys is a bad idea... :P |
| 08:34:55 | <copumpkin> | Neut: so you can do \(_, x, _) -> x |
| 08:34:59 | <Peaker> | s/more/significantly more |
| 08:35:24 | <Neut> | copumkin: No love for a list comprehension though? |
| 08:35:33 | <Peaker> | @djinn-add data List a = Nil | Cons a (List a) |
| 08:35:34 | <lambdabot> | Error: Recursive types are not allowed: List |
| 08:35:36 | <copumpkin> | Neut: it wouldn't help you there |
| 08:35:39 | <outchanter> | list comprehensions don't work on tuples |
| 08:35:49 | <copumpkin> | Neut: you could make a really contrived one if you wanted |
| 08:35:58 | <Berengal> | double ∷ (Num a) ⇒ [a] → [a]; double = map (λn → n⋅2)∘join (⊕) |
| 08:36:06 | <Berengal> | ivanm: Happy? |
| 08:36:20 | <ivanm> | ACTION prefers \times to \cdot |
| 08:36:35 | <copumpkin> | starting to look like agda :) |
| 08:36:41 | <copumpkin> | (a good thing in my book) |
| 08:36:50 | <ivanm> | copumpkin: s/agda/line noise/ ;-) |
| 08:36:57 | <Neut> | hmm ok thanks |
| 08:36:59 | <copumpkin> | but agda's so purty! |
| 08:37:03 | <Berengal> | ivanm: Me too, but for some reason this is what my third level numpad got me. It doesn't even have proper division... |
| 08:37:10 | <ivanm> | :( |
| 08:37:14 | <ivanm> | @wn purty |
| 08:37:17 | <lambdabot> | No match for "purty". |
| 08:37:31 | <copumpkin> | I bet lambdabot would understand @purty if it had the correct word |
| 08:37:48 | <outchanter> | Neut: there's a much bigger difference between Haskell's lists and tuples than there is between Python's |
| 08:37:51 | <ivanm> | copumpkin: yes, but lambdabot is used to making sense of idiots :p |
| 08:37:53 | <ivanm> | @botsnack |
| 08:37:54 | <lambdabot> | :) |
| 08:37:54 | <lunabot> | :) |
| 08:38:01 | <copumpkin> | @ivanmsmack |
| 08:38:02 | <lambdabot> | Unknown command, try @list |
| 08:38:04 | <copumpkin> | :( |
| 08:38:19 | <Neut> | copumkin: so im learning |
| 08:38:20 | <copumpkin> | @smack ivanm |
| 08:38:20 | <lambdabot> | ACTION moulds ivanm into a delicous cookie, and places it in her oven |
| 08:38:25 | <copumpkin> | o.O |
| 08:38:33 | <copumpkin> | that sounds rude somehow |
| 08:38:35 | <ivanm> | mmmmm..... bikkies.... |
| 08:38:40 | <copumpkin> | Neut: great :) |
| 08:38:59 | <copumpkin> | ACTION gave up learning, it rots the mind |
| 08:39:00 | <Berengal> | Sometimes... sometimes lambdabot freaks me out a little... |
| 08:39:09 | <copumpkin> | you just gotta be opinionated about stuff on the internet |
| 08:39:28 | <Berengal> | copumpkin: I see you've understood what it's all about |
| 08:39:29 | <copumpkin> | the less you have to back up your opinions, and the stronger your language, the better |
| 08:39:37 | <mjrosenb> | lambdabot's @smack is how i learned abouot the evil mangler |
| 08:40:25 | <fasta> | Is CReal on Hackage? Or is there just the darcs repository? |
| 08:40:29 | <copumpkin> | @hackage numbers |
| 08:40:30 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numbers |
| 08:41:15 | <fasta> | Thanks |
| 08:41:36 | <copumpkin> | :) |
| 08:42:08 | <Botje> | ACTION returns |
| 08:42:28 | <Peaker> | looking at conal's old memoization blog post (similar example used in the paper about type families) -- and the comments about undefined-ness.. I think unamb between the memo lookup and the original function could resolve the problem -- anyone knows that post? |
| 08:42:52 | <Heffalump> | the memoization done via type families? |
| 08:48:36 | <Pellwurst> | how can i escape a $-char? i am working on a RegExp with a $ in it, but it doesn't like that char :/ |
| 08:49:17 | <EvilTerran> | Pellwurst, is this regexps expressed as Strings? |
| 08:49:32 | <EvilTerran> | if so, i think that'll be \\$ |
| 08:49:46 | <EvilTerran> | or [$] |
| 08:50:12 | <EvilTerran> | (either should work, \\$ is more conventional, but [$] is clearer, imo) |
| 08:51:10 | <Peaker> | DAMN, the session type example in the type fun paper is cool! Sounds like a practical approach for actual protocols! |
| 08:51:13 | <Pellwurst> | EvilTerran: that works fine...thx. i just tried \$ |
| 08:51:46 | <EvilTerran> | Pellwurst, the trouble with that is that the \ would get interpreted as a string escape character, so wouldn't get as far as the regex engine |
| 08:51:58 | <EvilTerran> | > "\$" |
| 08:51:59 | <lambdabot> | <no location info>: |
| 08:51:59 | <lambdabot> | lexical error in string/character literal at end o... |
| 08:52:02 | <Pellwurst> | ahh ok |
| 08:52:17 | <EvilTerran> | > text "\\$" |
| 08:52:18 | <lambdabot> | \$ |
| 08:52:37 | <EvilTerran> | so you have to escape the escape character, thus getting dangerously close to Leaning Toothpick Syndrome |
| 08:53:53 | <Pellwurst> | :P |
| 08:54:05 | <Zao> | EvilTerran: I managed to end up in a situation a few weeks ago where I needed eight \ to get a literal \. |
| 08:55:57 | <WorkyBob> | with Ghc Core is the only way to simulate let (x,y) = f z essentially let x = case r of (a,b) -> a; y = case r of (a,b) -> b; r = f z? |
| 08:56:43 | <lvh> | hello :-) |
| 08:57:17 | <yakov> | hello |
| 08:57:42 | <yakov> | could you help me with GADTs+IORefs here http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5207#a5207 |
| 08:58:08 | <yakov> | it seems to me like a rigidity problem :-/ but I can't figure out how to help GHCi type check it |
| 08:58:29 | <Peaker> | WorkyBob: how are irrefutable patterns implemented in general? |
| 08:59:09 | <copumpkin> | I thought it was just case f z of (x, y) -> (rest of code) |
| 08:59:19 | <WorkyBob> | Peaker: I don't know – but the only place I seem to get to specify a constructor is in a case expression |
| 08:59:29 | <Berengal> | yakov: I'm guessing it's because you commented out 'deriving Show' |
| 08:59:40 | <WorkyBob> | copumpkin: oh, sorry, I'm talking about a top level binding here |
| 08:59:45 | <WorkyBob> | so it's one of many recursive bindings |
| 09:00:01 | <copumpkin> | oh |
| 09:00:04 | <EvilTerran> | Zao, ouch |
| 09:00:16 | <yakov> | Berengal, it can't autoderive Show |
| 09:00:32 | <yakov> | 'cause GADTs+records is not haskell'98 |
| 09:00:48 | <Zao> | EvilTerran: Let's just say that PHP regexen aren't exactly easy to use :) |
| 09:00:59 | <Berengal> | yakov: Then you'll have to make it an instance yourself. It's the lacking instance it's complaining about |
| 09:01:36 | <Peaker> | WorkyBob: do you not get to use fst/snd in Ghc Core? |
| 09:01:41 | <yakov> | well, Show constraint is on `p' not on all ProgramState2! |
| 09:01:57 | <copumpkin> | WorkyBob: how does GHC translate it? |
| 09:01:59 | <yakov> | Show is example class, I have my own class in real code |
| 09:02:21 | <WorkyBob> | Peaker: well you do - the question was really around do I have to create individual bindings for each variable in the irrifutable pattern, or is there a neater way? |
| 09:02:30 | <EvilTerran> | Zao, s/regexen aren't/isn't/ :P |
| 09:02:32 | <WorkyBob> | copumpkin: good question *checks* |
| 09:02:43 | <yakov> | Berengal, anyway thx! i'll move my question to h-i-d |
| 09:03:14 | <Peaker> | WorkyBob: intuition tells me that individual bindings are the only way to implement irrefutable patterns, and I think let pattern matches are all irrefutable |
| 09:04:05 | <fasta> | I get No instance for (NearZero CReal), but there is a default implementation for NearZero (a type class in the Vec package) when "a" is in the Num class. CReal is in the Num class. Why doesn't it pick up the instance? |
| 09:04:17 | <WorkyBob> | Peaker: cool, just as long as I'm not missing a trick :) |
| 09:04:26 | <Zao> | EvilTerran: -en as in plural form, as there's half a dozen of them. |
| 09:04:42 | <Peaker> | WorkyBob: I am just speculating here, though, I might be missing something too |
| 09:04:47 | <Peaker> | yakov: why is ProgramState2 a GADT? just one constructor? |
| 09:05:02 | <yakov> | Peaker, because of foo function |
| 09:05:09 | <yakov> | it must have constraint on `p' |
| 09:05:14 | <yakov> | particular class |
| 09:06:33 | <yakov> | i.e. foo accepted `p' direcly in the past |
| 09:06:38 | <yakov> | then i moved to record syntax |
| 09:06:50 | <yakov> | and so i figured that i need GADT to constraint foo |
| 09:07:50 | <yakov> | (when foo accepted `p' it has *this* constraint explicitly - foo::Show p => p -> ..)( |
| 09:09:57 | <Peaker> | yakov: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5207#a5208 |
| 09:10:26 | <Peaker> | yakov: the forall has to be outside the PS2 constructor if you want it to be existential inside the constructor field |
| 09:11:04 | <blueonyx> | hi, how to make functions of a class visible in 'instance'? http://www.moonpatio.com/fastcgi/hpaste.fcgi/view?id=2476#a2476 |
| 09:12:20 | <ski> | blueonyx : tried s/data/newtype/ plus `newtype'-deriving ? |
| 09:12:57 | <ski> | (or export `empty',`isEmpty' together with `DynGraph' .. but presumably you don't have control over that (?)) |
| 09:13:23 | <blueonyx> | thought about that, but later i want to add other properties to Species :/ |
| 09:13:39 | <Saizan> | blueonyx: if you're using fgl, empty and isEmpty are methods of the class Graph, not DynGraph |
| 09:13:46 | <blueonyx> | oh |
| 09:14:23 | <ski> | empty = S empty |
| 09:14:24 | <ski> | isEmpty = isEmpty . graph |
| 09:14:36 | <ski> | presumably |
| 09:15:50 | <blueonyx> | when i use Graph instead of DynGraph i get "Expected kind `* -> * -> *', but `Species' has kind `*'" |
| 09:16:51 | <yakov> | Peaker, thx a lot! |
| 09:16:58 | <Saizan> | yeah, the Graph class requires you to be polymorphic over the type of the labels |
| 09:17:02 | <ski> | .. so `Graph' wants to provide its own arguments to the instancee |
| 09:17:19 | <ski> | (Saizan : s/polymorphic/parametric/) |
| 09:17:27 | <blueonyx> | mh |
| 09:20:22 | <yakov> | Peaker, is it possible to do same quantification with GADTs? |
| 09:20:39 | <blueonyx> | so then i make it instance Graph Spec and use type Species = Spec SNLabel SELabel, thanks you two! |
| 09:20:49 | <Peaker> | yakov: sure |
| 09:24:20 | <dibblego> | is data Digit = Zero | One | ... | Nine in the stdlib? |
| 09:25:01 | <ivanm> | @hoogle Digit |
| 09:25:01 | <lambdabot> | Text.Parsec.Char digit :: Stream s m Char => ParsecT s u m Char |
| 09:25:01 | <lambdabot> | Text.ParserCombinators.Parsec.Char digit :: Stream s m Char => ParsecT s u m Char |
| 09:25:01 | <lambdabot> | Data.Char digitToInt :: Char -> Int |
| 09:25:17 | <ivanm> | dibblego: in what context? |
| 09:25:25 | <dibblego> | just a type-safe digit |
| 09:25:37 | <dibblego> | a data type with nullary constructors |
| 09:25:42 | <dibblego> | *ten nullary constructor |
| 09:28:26 | <ivanm> | never even heard of it |
| 09:29:02 | <copumpkin> | there's D0-D9 in one of the type-level numbers packages |
| 09:29:08 | <Axman6> | @hoogle showHex |
| 09:29:08 | <lambdabot> | Numeric showHex :: Integral a => a -> ShowS |
| 09:29:15 | <copumpkin> | but I haven't seen them written out as words before |
| 09:30:00 | <dibblego> | that'll do cheers |
| 09:30:27 | <copumpkin> | http://hackage.haskell.org/packages/archive/type-level/0.2.2/doc/html/Data-TypeLevel-Num-Reps.html |
| 09:31:19 | <doserj> | those are ten types, though, not a type with ten data constructors |
| 09:31:26 | <dibblego> | oh |
| 09:31:40 | <copumpkin> | oh true |
| 09:32:24 | <copumpkin> | hmm, guess not then :) |
| 09:38:35 | <hackagebot> | mohws 0.2.0.1 |
| 09:44:00 | <ivanm> | hackagebot is back! \o/ |
| 09:46:35 | <willard> | Greetings folks. I just started teaching a course on Haskell to first and second year undergraduates, and am currently looking around for IDEs for writing Haskell programs to recommend to my students. Besides Emacs (which I use) and VIm, which IDE would you recommend? I plan on having my students write many small programs, and one bigger program near the end of the course. |
| 09:46:51 | <mreh> | yi |
| 09:46:54 | <dibblego> | nice, which uni? |
| 09:47:04 | <Baughn> | willard: It's May. Can I assume you won't really get started until fall? |
| 09:47:08 | <willard> | Reykjavík University, Iceland |
| 09:47:08 | <mreh> | I wish I had gone to that university |
| 09:47:14 | <dibblego> | I'm giving a talk on Haskell tomorrow night (QuickCheck specifically) http://www.meetup.com/Brisbane-Functional-Programming-Group-BFG/calendar/10469028/ |
| 09:47:23 | <ivanm> | dibblego: oh? |
| 09:47:25 | <ivanm> | where is it? |
| 09:47:31 | <dibblego> | at QUT (Queensland University of Technology) |
| 09:47:38 | <Baughn> | willard: EclipseFP exists, but is not quite done. It's still worth investigating, and there's currently a SoC project working to improve it. |
| 09:47:39 | <ivanm> | gah |
| 09:47:39 | <willard> | Baughn: This is a summer course, so no ;-) |
| 09:47:43 | <ivanm> | the evil uni! |
| 09:47:44 | <ivanm> | ;-) |
| 09:47:55 | <ivanm> | dibblego: I saw the "Brisbane" in the URL, hence the query :p |
| 09:47:57 | <dibblego> | why is it evil over others? |
| 09:48:00 | <Baughn> | willard: Oh well. EclipseFP, anyway. |
| 09:48:04 | <ivanm> | because I go to UQ? :p |
| 09:48:10 | <Baughn> | (Personally I just use Emacs) |
| 09:48:13 | <dibblego> | oh I applied for a job there the other day :) |
| 09:48:38 | <dibblego> | ivanm, you should join the Brisbane Functional Programming Group |
| 09:48:58 | <ivanm> | didn't know there was one |
| 09:49:07 | <mreh> | has anyone else worked out how to make Graphics.SOE.Event work with Graphics.SOE.Key? |
| 09:49:11 | <ivanm> | dibblego: don't you work at Danger Mouse/Working Mouse/whatever it's called? |
| 09:49:11 | <dibblego> | there was, since a couple of weeks ago |
| 09:49:18 | <dibblego> | Workingmouse, not any more |
| 09:49:28 | <ivanm> | any particular reason for quitting? |
| 09:49:36 | <dibblego> | the company closed |
| 09:49:49 | <ivanm> | oh? |
| 09:50:00 | <mreh> | bummer |
| 09:50:20 | <Peaker> | re-exporting a module re-exports all of its namespace? |
| 09:50:34 | <dibblego> | http://projects.tmorris.net/public/haskell-intro/artifacts/latest/chunk-html/index.html here are the slides for tomorrow night (don't everyone hit it at once please!) |
| 09:51:09 | <willard> | Baughn: @ EclipseFP : Very nice. I'll point this out to my students. |
| 09:51:23 | <dibblego> | willard, fwiw, I use kate, but it's just a text editor |
| 09:51:43 | <willard> | Baughn: Have you by any chance tried out Leksah? |
| 09:51:48 | <Baughn> | willard: Keep in mind that it's /not done/. There are bound to be holes and bugs. |
| 09:51:59 | <ivanm> | dibblego: well, I'd come except that page says there's no spots left :s |
| 09:52:19 | <mreh> | SOE seems to have been bundled with HGL, but I dont think they are even compatible |
| 09:52:21 | <Baughn> | willard: Ah.. yeah. My first thought as a response was "Avoid", but that /was/ admittedly half a year ago. Still, it is if possible even less complete. |
| 09:52:23 | <dibblego> | ivanm, yeah tis a bummer -- maybe someone will pull out |
| 09:52:37 | <dibblego> | ivanm, sorry, should have told you earlier (only reached 20 this afternoon) |
| 09:52:46 | <Baughn> | willard: Interesting place to visit, but I wouldn't want to live there. |
| 09:52:53 | <dibblego> | ivanm, it will be very basic -- I don't expect the users to have used Haskell before |
| 09:53:08 | <ivanm> | dibblego: if I pm you my mobile, could you give me a msg or ring before say 4:30 (because that's normally when I head off home) if a spot turns up? |
| 09:53:13 | <dibblego> | sure |
| 09:54:12 | <ivanm> | ta |
| 09:54:19 | <Baughn> | willard: Really, the main issue I have with EclipseFP is that it's not emacs. No automatic column alignment, no keyboard macros, etc. |
| 09:55:15 | <ivanm> | Baughn: \foo -> Really, the main issue I have with foo is that it's not emacs. No automatic column alignment, no keyboard macros, etc. |
| 09:55:16 | <ivanm> | ;-) |
| 09:55:41 | <dibblego> | ivanm, I just msged the organiser and he says "he should fit -- does he have a camera?" (since there are a *huge* number of requests to video it) |
| 09:55:59 | <ivanm> | ummmm.... I have a camera... |
| 09:56:04 | <ivanm> | but it's not "mine" (it's my dad's) |
| 09:56:11 | <ivanm> | and I don't think I'll be able to bring it :( |
| 09:56:21 | <dibblego> | ok |
| 09:56:23 | <Baughn> | ivanm: Right. It seems to me that it'd be less work to complete Emacs' haskell support than it'd be to improve Eclipse's editing support. |
| 09:56:23 | <willard> | dibblego: I haven't had any need for anything more than a text editor when writing Haskell code either. Sadly, there are computation science students which think that "programming occurs in a bloated IDE". I wish to make sure that if they insist on using one, they can ;-) |
| 09:56:24 | <dibblego> | you're in anyway |
| 09:56:35 | <ivanm> | thanks |
| 09:56:55 | <ivanm> | willard: isn't *nix an IDE? :p |
| 09:57:07 | <dibblego> | you'll want a copy of the slides -- since we're not sure we have a projector :) |
| 09:57:30 | <ivanm> | lol |
| 09:57:49 | <ivanm> | is this in a lecture theatre? or an office? |
| 09:58:03 | <dibblego> | no idea -- a small room afaik |
| 09:58:11 | <willard> | Baughn: @ Interesting place to live: I don't want to live here either given our current situation; that's why I'm moving to Gothemburg to work on my PhD this autumn :-P |
| 09:58:17 | <ivanm> | I would have thought QUT would have projectors in most meeting rooms, etc. |
| 09:58:18 | <dibblego> | Z413 at QUT Gardens Point |
| 09:58:30 | <ivanm> | *nod* |
| 09:58:40 | <Baughn> | willard: Oh yeah, Iceland. Hm, you wouldn't want to come here to Norway instead? |
| 09:58:42 | <ivanm> | dibblego: maybe you should but the BFG onto haskell.org somewhere? |
| 09:58:56 | <willard> | Baughn: I'm planning on showing my students what working with Emacs + a ghci buffer is like. Perhaps they will be inspired. |
| 09:58:59 | <Baughn> | willard: ..we were actually considering annexation at one point. >_> |
| 09:59:00 | <dibblego> | ivanm, good idea |
| 09:59:23 | <ivanm> | willard: + hlint integration! ;-) |
| 09:59:53 | <ivanm> | dibblego: right-o, this gives me a couple of hours after I officially stop getting paid to start hacking on something :p |
| 09:59:53 | <dibblego> | ivanm, it will be very basic -- I hope you don't get bored -- maybe you can help others out since they will have their laptops and we will be writing QuickCheck tests |
| 10:00:01 | <ivanm> | I've never used QC ;-) |
| 10:00:22 | <dibblego> | ok, others will be held back by syntax though, but you can help out :) |
| 10:00:36 | <ivanm> | so should I bring my laptop along? and RWH for the QC bit? |
| 10:00:37 | <willard> | ivanm: *nix IDE: True; but the clutter is conveniently hidden away until you ask for it ;-) |
| 10:00:42 | <ivanm> | heh |
| 10:00:57 | <dibblego> | yes, bring laptop and RWH if you like -- the laptop is why we have limited places (hopefully we will all fit) |
| 10:01:32 | <ivanm> | heh |
| 10:02:49 | <ivanm> | dibblego: so how much room is there still? there might be some other people interested in coming if there's still room... |
| 10:03:03 | <willard> | Baughn: @ Annexation: Haha :-) If offered at the right moment, Iceland just might have accepted. Iceland was even statistically ready to enter EU in October last year (but we all know how reliable those polls are...). In most cases, however, the offer would hurt Iceland's pride :-P |
| 10:03:09 | <dibblego> | I have no idea to be honest -- but we better not get too many people |
| 10:03:22 | <ivanm> | *nod* |
| 10:03:26 | <ivanm> | OK, I'll leave it for now |
| 10:03:30 | <ivanm> | maybe future meetings |
| 10:03:49 | <dibblego> | yep -- we've only just started and depending on how tomorrow goes and how many people we get, we might need to organise better rooms |
| 10:03:55 | <willard> | Baughn: You could let Iceland take on the Norwegian currency. I am sure there is plenty of mutual benefit... :-P |
| 10:03:59 | <ivanm> | Baughn: since when was #haskell interested in annexing a country? |
| 10:04:06 | <ivanm> | willard: lol |
| 10:04:10 | <Baughn> | ivanm: Not #haskell, Norway. |
| 10:04:18 | <ivanm> | I did realise that... |
| 10:04:27 | <ivanm> | but the way you used "we"... :p |
| 10:04:45 | <p_l> | ACTION looks at torrent described as "want to invade a small country?" |
| 10:05:35 | <Baughn> | Aand.. Pantheocide has started. |
| 10:05:41 | <Baughn> | Book 2, that is. :D |
| 10:05:55 | <Baughn> | ACTION blinks |
| 10:05:58 | <ivanm> | is that when you kill off a whole bunch of gods? |
| 10:05:59 | <Heffalump> | we could annex Iceland and turn it into the Haskell country |
| 10:06:02 | <Baughn> | p_l: Hey, no fair making me think I'm in #nanoha! |
| 10:06:18 | <fasta> | Heffalump: Haskell has not got _that_ many users. |
| 10:06:28 | <ivanm> | fasta: so let's get some more! |
| 10:06:41 | <p_l> | Baughn: LOL |
| 10:06:50 | <Baughn> | ivanm: It's when armageddon shows up, and realizes humanity is much more advanced than the gods. |
| 10:07:09 | <ivanm> | Heffalump: then again, isn't Haskell stateless? isn't thus annexation an imperative thing? :p |
| 10:07:15 | <ivanm> | Baughn: ahhh |
| 10:07:28 | <Baughn> | annex :: Country -> IO Warzone |
| 10:07:48 | <ivanm> | Baughn: not necessarily... |
| 10:07:59 | <ivanm> | there are occasionally voluntary annexations IIRC |
| 10:08:17 | <Baughn> | It's been known to happen, yes. That was the kind we were considering re: iceland. |
| 10:08:43 | <Baughn> | But let's be honest, Iceland is basically a wholly-owned subsidiary of scandinavia already. :P |
| 10:09:05 | <ivanm> | heh |
| 10:09:08 | <willard> | Bah :-P |
| 10:09:15 | <ivanm> | Baughn: except with its own dodgy currency? |
| 10:09:53 | <Peaker> | heh, SPJ uses "design pattern" in the Haskell context in his paper |
| 10:10:06 | <ivanm> | :o |
| 10:10:26 | <ivanm> | I thought "Design patterns" was the OOP world's excuse for verboseness... |
| 10:10:31 | <ivanm> | FactoryFactorFactory, etc. |
| 10:10:49 | <dibblego> | ivanm, join the meetup list so you can get emails and so on and RSVP formally -- we are going to set the limit to 25 in a moment |
| 10:11:03 | <willard> | Haskell programmers: Come to Iceland. We have cookies. |
| 10:11:05 | <ivanm> | dibblego: I'm just waiting for the confirmation email to come through ;-) |
| 10:11:11 | <ivanm> | willard: I prefer biscuits |
| 10:11:19 | <ivanm> | seeing as how I'm not a yank and all... |
| 10:11:20 | <ivanm> | ;-) |
| 10:12:46 | <ivanm> | besides, isn't the traditional online bribe meant to be "caek"? |
| 10:12:47 | <dibblego> | ivanm, let me know when it is in, since there are others waiting to take up those 5 spot |
| 10:12:54 | <ivanm> | *nod* |
| 10:13:50 | <monadic_kid> | he uses the word "design pattern" in context of monads |
| 10:13:50 | <ivanm> | dibblego: done |
| 10:13:59 | <dibblego> | ivanm, so you've joined BFG? |
| 10:14:07 | <ivanm> | yup |
| 10:14:16 | <ivanm> | ACTION gave up on waiting for offlineimap to sync and just signed in to gmail |
| 10:14:18 | <dibblego> | ok, we're working on it now |
| 10:14:50 | <dibblego> | ivanm, go, it's set to 30 |
| 10:14:59 | <ivanm> | done! \o/ |
| 10:15:05 | <dibblego> | see you tomorrow :) |
| 10:15:06 | <dibblego> | see you tomorrow :) |
| 10:15:09 | <dibblego> | oop |
| 10:15:14 | <ivanm> | heh |
| 10:15:34 | <monadic_kid> | oop and OOP |
| 10:15:50 | <monadic_kid> | they are fundamentally the same lol |
| 10:16:54 | <monadic_kid> | didn't get the joke... |
| 10:18:01 | <ivanm> | oh, wait, that was a _joke_? :o |
| 10:18:03 | <ski> | (willard : what cookies ?) |
| 10:18:50 | <monadic_kid> | ivanm: my rubbish joke |
| 10:19:37 | <willard> | (ski: lambda-chip cookies :-P ) |
| 10:19:51 | <ivanm> | dibblego: "z413" means building z, room 413? |
| 10:20:05 | <dibblego> | your guess is as good as mine, which is what my guess is also :) |
| 10:20:22 | <ivanm> | heh |
| 10:20:56 | <Baughn> | @seen conal |
| 10:20:57 | <lambdabot> | I saw conal leaving #haskell and #ghc 4m 6d 5h 6m 46s ago, and . |
| 10:21:02 | <Peaker> | ivanm: design patterns are just "documented solutions to common problems".. In Haskell there are plenty of them as well.. |
| 10:21:14 | <Baughn> | ACTION threatens lambdabot with bodily harm |
| 10:21:17 | <ivanm> | gah, translink doesn't want to tell me citycat times :@ |
| 10:21:44 | <ivanm> | Peaker: well, IIRC I failed the exam I had on design patterns... |
| 10:21:49 | <ivanm> | didn't get them :s |
| 10:22:35 | <monadic_kid> | Peaker: you left out *recurring* problems/solution. |
| 10:22:49 | <Peaker> | monadic_kid: common kinda implies recurring |
| 10:22:50 | <monadic_kid> | *re-ocurring |
| 10:23:19 | <monadic_kid> | meh |
| 10:23:22 | <Peaker> | the "strategy" pattern, for example, solves a common problem of how to control aspects of a behavior of a called function -- in both OOP and Haskell -- pass a function |
| 10:23:55 | <Baughn> | So, "strategy" = "function"? |
| 10:23:57 | <Peaker> | pass a function (or a func ptr, or delegate, or higher order function) or a function table (record of functions, type-class instance, etc) |
| 10:24:04 | <Baughn> | ..right. |
| 10:24:05 | <ski> | newtype Strategy a b = S (a -> b) -- ? |
| 10:24:19 | <Peaker> | Baughn: "strategy" = "passing a function[s] as an argument in order to control aspects of its execution" |
| 10:24:29 | <Baughn> | Peaker: Well, why /else/ would you pass a function? |
| 10:24:40 | <Peaker> | Baughn: you might want to store the function inside the data structure |
| 10:24:44 | <ski> | > const not False |
| 10:24:45 | <lambdabot> | Overlapping instances for GHC.Show.Show |
| 10:24:45 | <lambdabot> | (GHC.B... |
| 10:24:57 | <ski> | > const False not |
| 10:24:58 | <lambdabot> | False |
| 10:25:00 | <Baughn> | Peaker: I suppose, but at some point it will be controlling aspects of some execution somewhere. |
| 10:25:15 | <Baughn> | > const not False True |
| 10:25:17 | <lambdabot> | False |
| 10:25:21 | <Peaker> | Baughn: if its directly called by the function stack you gave it to, then its a strategy |
| 10:25:49 | <Baughn> | Peaker: I see. I suppose that's a useful definition, then. |
| 10:25:59 | <Peaker> | I think people like to attack patterns because some were indeed language-specific and many were really workarounds for bad language features. But some patterns are just "good ways to utilize the language" |
| 10:28:05 | <ivanm> | Peaker: aren't even most of the original GoF patterns hacks around C++/Java? |
| 10:28:43 | <chrisdone> | so awesome! http://yaxu.org/haskell-hack/ |
| 10:28:45 | <Peaker> | ivanm: I don't have the statistics :) But it does have the "Visitor pattern" which is really an ugly workaround for lack of multi-dispatch (which also does inversion of control at the same time!) |
| 10:29:08 | <ivanm> | chrisdone: so slow! |
| 10:29:17 | <Baughn> | chrisdone: So Slashdotted! |
| 10:29:22 | <Baughn> | Is that #haskelldotted? |
| 10:29:44 | <ivanm> | Baughn: I don't think we're _that_ fast! |
| 10:29:45 | <Peaker> | ivanm: It has various factory patterns -- which are basically using higher-order functions to generate polymorphic results whose type you don't care about (including indeed language-specific implementation details of how to do this) |
| 10:29:51 | <ivanm> | we're lazy, after all! :p |
| 10:29:51 | <chrisdone> | you're welcome |
| 10:29:56 | <Peaker> | ivanm: I don't remember all of the patterns it had |
| 10:30:01 | <ivanm> | *nod* |
| 10:30:23 | <Peaker> | my Flash is broken. Gnash only shows YouTube and non-free Flash works poorly on 64-bit, need to "set it up", yikes |
| 10:30:36 | <chrisdone> | I usually keep links to myself in case people have already seen it, that way the most people get to see cool new projects |
| 10:31:42 | <Peaker> | it downloads at ~15K/sec |
| 10:39:14 | <ivanm> | dibblego: hmmm.... BFG doesn't seem to be listed here: http://www.meetup.com/cities/au/brisbane/groups/technology/?radius=25.0 |
| 10:43:49 | <Neut> | Can someone help me debug this |
| 10:43:51 | <Neut> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2477#a2477 |
| 10:45:03 | <ivanm> | Neut: what's the error? |
| 10:45:11 | <ivanm> | also, why are you using Float rather than Double? |
| 10:45:25 | <Neut> | Type error, |
| 10:45:42 | <ivanm> | where? |
| 10:45:55 | <Neut> | couldnt match expected type Point against infered [Point] |
| 10:45:56 | <doserj> | closed is the wrong way round. pathLength (x:y:xs) = distance x y + pathlength (y:xs) |
| 10:46:38 | <Neut> | Oh derr! |
| 10:46:41 | <Neut> | thanks doserj |
| 10:46:46 | <Neut> | ACTION goes to the corner |
| 10:49:22 | <ski> | ACTION hands Neut the "Ego Asinus Sum" cornet hat |
| 10:51:02 | <ivanm> | ski: you mean a cornette? http://en.wikipedia.org/wiki/Cornette |
| 10:51:12 | <Neut> | i think its German what he siad? |
| 10:51:19 | <Neut> | or professor google told a fibsie |
| 10:51:32 | <Botje> | latin, more like |
| 10:51:48 | <ivanm> | Ego Asinus Sum: I think, therefore I'm an idiot? |
| 10:52:06 | <ivanm> | but wikipedia doesn't seem to know anything about a cornet hat |
| 10:52:19 | <ivanm> | unless he meant corner? |
| 10:52:25 | <outchanter> | I like to think it's a hat with these sticking out? http://en.wikipedia.org/wiki/Cornett |
| 10:52:30 | <Botje> | try "dunce cap" instead :P |
| 10:52:39 | <Botje> | or dunce hat |
| 10:52:48 | <ski> | ivanm : actually, it appears the correct english term is "dunce cap/hat" .. ty |
| 10:53:09 | <ivanm> | ahhh |
| 10:53:10 | <ski> | ACTION was tranlating from non-english into "cornet hat" |
| 10:53:41 | <malcolmw> | think ice-cream cornet |
| 10:54:07 | <ivanm> | yeah, I get what he means now |
| 10:54:19 | <ivanm> | it's not a very Australian thing, which is why I didn't think of it at first |
| 10:54:52 | <ski> | (ivanm : "Ego Asinus Sum" would be more like "I'm an ass/idiot") |
| 10:55:19 | <ivanm> | oh, I thought the English "Ego" came from Latin |
| 10:55:21 | <Saizan> | Asinus = donkey |
| 10:55:29 | <Saizan> | Ego = I |
| 10:55:31 | <ivanm> | duh, Ego refers to self, not to thought processes |
| 10:55:41 | <ivanm> | Saizan: I got the Asinus bit ;-) |
| 10:56:00 | <outchanter> | doesn't εγο come from Greek? |
| 10:56:12 | <Gracenotes> | it does now. |
| 10:56:13 | <wli> | encoding... |
| 10:56:26 | <ivanm> | heh |
| 10:56:29 | <wli> | iago? |
| 10:57:00 | <Saizan> | still ego |
| 10:57:03 | <ivanm> | as in the aladdin parrot? :p |
| 10:57:16 | <outchanter> | who was named after the villain in Othello |
| 10:57:44 | <wli> | I thought that was how the Greek pronoun transliterated. |
| 10:57:46 | <dibblego> | is there a function to split every n starting from the right? |
| 10:57:54 | <Neut> | and to bring this conversation full circle, othello was the theme of my last assignment |
| 10:58:31 | <ivanm> | dibblego: you mean foo :: Int -> [a] -> [[a]] |
| 10:58:31 | <ivanm> | ? |
| 10:58:41 | <ivanm> | not sure about "from the right" though... infinite lists! |
| 10:58:41 | <dibblego> | ivanm, correct |
| 10:58:51 | <dibblego> | yes, this will not be infinite |
| 10:59:19 | <ivanm> | reverse, do recursive splitting, then map reverse? |
| 10:59:31 | <dibblego> | I've thought of that |
| 10:59:33 | <ski> | @type \n -> unfoldr (\as -> if null xs then Nothing else Just (splitAt n as)) |
| 10:59:34 | <lambdabot> | Not in scope: `xs' |
| 10:59:37 | <ivanm> | I'm not sure you can do the splitting from the end, that's all |
| 10:59:39 | <ski> | @type \n -> unfoldr (\as -> if null as then Nothing else Just (splitAt n as)) |
| 10:59:41 | <lambdabot> | forall a. Int -> [a] -> [[a]] |
| 10:59:53 | <ivanm> | ski: he wants to do it from the _end_ |
| 10:59:54 | <ski> | > unfoldr (\as -> if null as then Nothing else Just (splitAt 4 as)) [0..] |
| 10:59:55 | <lambdabot> | [[0,1,2,3],[4,5,6,7],[8,9,10,11],[12,13,14,15],[16,17,18,19],[20,21,22,23],... |
| 11:00:06 | <dibblego> | > unfoldr (\as -> if null as then Nothing else Just (splitAt 4 as)) [0..5] |
| 11:00:08 | <lambdabot> | [[0,1,2,3],[4,5]] |
| 11:00:15 | <ski> | ivanm,dibblego : sorry, missed that part |
| 11:00:20 | <dibblego> | I want [[0, 1], [2, 3, 4, 5]] |
| 11:00:27 | <ski> | i see |
| 11:00:39 | <ivanm> | that bit I'm not sure if you can do |
| 11:00:48 | <ivanm> | since you don't know how long the list is |
| 11:01:01 | <dibblego> | I'm sure I can if I assume the list is finite |
| 11:01:02 | <ivanm> | whereas splitting from the front, you can start counting straight away |
| 11:01:15 | <dibblego> | i.e. reverse will terminate |
| 11:10:15 | <Neut> | with this function |
| 11:10:17 | <Neut> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2478#a2478 |
| 11:10:25 | <Neut> | why doesn't it like the yy |
| 11:10:28 | <Neut> | or y:Y |
| 11:10:29 | <Neut> | y:y |
| 11:10:35 | <Neut> | by it, I mean ghci |
| 11:10:46 | <wjt> | yy isn't defined |
| 11:10:47 | <outchanter> | > let (f, l, n, rem) = (unfoldr (\as -> if null as then Nothing else Just (splitAt n as)), [0..10], 4, length l `mod` n) in (take rem l):(f (drop rem l)) |
| 11:10:49 | <lambdabot> | [[0,1,2],[3,4,5,6],[7,8,9,10]] |
| 11:11:15 | <wjt> | Neut: i think you mean y:y:stutter y xs |
| 11:11:55 | <Neut> | thanks wjt |
| 11:12:14 | <wjt> | Neut: where would "yy" come from? |
| 11:12:23 | <ivanm> | wjt: thin ari |
| 11:12:24 | <ivanm> | *air |
| 11:12:26 | <ivanm> | duh :p |
| 11:12:31 | <Neut> | Gah Im finding Haskell recursion difficult |
| 11:13:00 | <Neut> | ivanm, fair go - this is a channel to learn haskell I believe |
| 11:13:20 | <ivanm> | well, it's a channel to discuss haskell, which includes haskell help |
| 11:13:24 | <ski> | dibblego : what do you want for `foo 4 [0..7]' ? |
| 11:13:44 | <ivanm> | and I'm not making fun of you (I was making fun of wjt actually), just attempting (and obviously failing miserably) to be funny |
| 11:14:00 | <ski> | [[0,1,2,3],[4,5,6,7]] -- yes ? |
| 11:14:15 | <dibblego> | [[0, 1, 2, 3], [4, 5, 6, 7]] |
| 11:14:19 | <Neut> | It's fine. I'm sure I would find my style of questions testing if I knew alot about Haskell as well.. |
| 11:22:45 | <ski> | @let foo n xs0 = ys0:yss0 where (_,ys0,yss0) = loop xs0; loop [] = (n,[],[]); loop (x:xs) = (pred j,x:zs,zss) where (i,ys,yss) = loop xs; (j,zs,zss) | i > 0 = (i,ys,yss) | otherwise = (n,[],ys:yss) |
| 11:22:47 | <lambdabot> | Defined. |
| 11:22:49 | <ski> | > foo 4 [0..9] |
| 11:22:52 | <lambdabot> | [[0,1],[2,3,4,5],[6,7,8,9]] |
| 11:22:53 | <ski> | > foo 4 [0..7] |
| 11:22:55 | <lambdabot> | [[0,1,2,3],[4,5,6,7]] |
| 11:23:10 | <ski> | > foo 4 [] |
| 11:23:11 | <lambdabot> | [[]] |
| 11:23:17 | <ski> | hm |
| 11:23:28 | <ski> | > foo 0 [0..7] |
| 11:23:30 | <lambdabot> | [[0],[1],[2],[3],[4],[5],[6],[7],[]] |
| 11:23:55 | <ski> | i suppose positiveness of the size is a precondition |
| 11:25:09 | <Deewiant> | > foo (-1) [1..10] |
| 11:25:11 | <lambdabot> | [[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[]] |
| 11:26:24 | <ski> | @let outchanter size list = take rem l:f (drop rem l) where (f, l, n, rem) = (unfoldr (\as -> if null as then Nothing else Just (splitAt n as)), list, size, length l `mod` n) |
| 11:26:26 | <lambdabot> | Defined. |
| 11:26:42 | <ski> | > outchanter 4 [0..7] |
| 11:26:43 | <lambdabot> | [[],[0,1,2,3],[4,5,6,7]] |
| 11:27:04 | <dibblego> | I've already cheated using reverse |
| 11:27:05 | <ski> | > outchanter 4 [] |
| 11:27:07 | <lambdabot> | [[]] |
| 11:29:38 | <ski> | > outchanter 0 [0..7] |
| 11:29:39 | <lambdabot> | [* Exception: divide by zero |
| 11:39:30 | <Neut> | http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2479#a2479 |
| 11:39:39 | <Neut> | Can someone help me with the recursion in allColinear? |
| 11:40:21 | <Botje> | how many arguments does allColinear take? |
| 11:40:33 | <Neut> | allColinear :: [Point] -> Bool |
| 11:40:38 | <Neut> | type Point = (Float, Float) |
| 11:40:45 | <Botje> | allColinear x (y:xs) |
| 11:40:54 | <Botje> | how many arguments are you calling it with? :) |
| 11:41:49 | <Neut> | Botje: not really following you here, |
| 11:42:43 | <Deewiant> | allColinear x (y:xs) calls the function allColinear, passing it the two arguments x and (y:xs) |
| 11:42:49 | <Philonous> | allColinear (x:y) = False That matches all lists with at least one element |
| 11:43:13 | <Philonous> | Maybe you meant [x,y] instead of (x:y) ? |
| 11:43:41 | <Neut> | oh yeah good catchm |
| 11:43:44 | <Axman6> | Neut: g'day |
| 11:43:46 | <Philonous> | ( [x,y] matches lists with exactly two elements) |
| 11:43:49 | <Neut> | so what would the last line need to be? |
| 11:43:51 | <Axman6> | you're at ANU apparently |
| 11:43:57 | <Neut> | its true |
| 11:44:01 | <Neut> | you too? |
| 11:44:05 | <Axman6> | yep :) |
| 11:44:12 | <Neut> | can you help me :D |
| 11:44:26 | <Axman6> | heh, maybe. |
| 11:44:32 | <byorgey> | Neut: allColinear takes only one argument, a list of Points, right? |
| 11:44:41 | <Neut> | yeah thats right |
| 11:44:49 | <byorgey> | Neut: so which list do you want to pass it in the recursive call? |
| 11:44:56 | <Deewiant> | As pointed out above, you're passing it two arguments currently |
| 11:45:10 | <Neut> | the first 3 |
| 11:45:13 | <Neut> | then the next 3 |
| 11:45:15 | <Neut> | and so on |
| 11:46:05 | <Neut> | Deewiant: how can I pass it 3? |
| 11:46:08 | <Philonous> | Neut: do you mean [1,2,3,4,5,6] -> [1,2,3], [2,3,4] or rather [1,2,3] and [5,6,7] |
| 11:46:12 | <byorgey> | right, so if you got (x:y:z:xs), that is, a list starting with x, y, z, and then a whole bunch of other stuff xs, what list do you want to pass to the recursive call? |
| 11:46:26 | <Philonous> | [4,5,6] |
| 11:46:27 | <Neut> | Philonous: the 2nd |
| 11:46:35 | <Deewiant> | Neut: Since it only takes one argument, you should only passing it one, not more than that :-) |
| 11:46:37 | <Neut> | [4,5,6] |
| 11:46:39 | <Philonous> | then pass it only the tail of the list, i.e. xs |
| 11:46:40 | <Deewiant> | +be |
| 11:46:45 | <dibblego> | is fmap . fmap somewhere in the libraries? |
| 11:46:56 | <Deewiant> | So "allColinear xs" instead of "allColinear x (y:xs)" |
| 11:47:06 | <Deewiant> | dibblego: Not to my knowledge |
| 11:47:33 | <byorgey> | Neut: also, + is only for numbers, so you'll need to replace that with some sort of Boolean operator |
| 11:48:38 | <Axman6> | > let allColinear [] = True; allColinear ((x1,y1):xss@((x2,y2):(X3,y3):xs)) = (y2-y1)/(x2-x1) == (y3-y2)/(x3-x2) && allColinear xss in allColinear [(1,1),(2,2),(3,3)] |
| 11:48:39 | <lambdabot> | Not in scope: data constructor `X3'Not in scope: `x3' |
| 11:48:51 | <Philonous> | Neut: btw. you can save yourself some lines if you match the case with at least 3 elements first and then all the other ones |
| 11:48:53 | <Axman6> | > let allColinear [] = True; allColinear ((x1,y1):xss@((x2,y2):(x3,y3):xs)) = (y2-y1)/(x2-x1) == (y3-y2)/(x3-x2) && allColinear xss in allColinear [(1,1),(2,2),(3,3)] |
| 11:48:54 | <lambdabot> | * Exception: <interactive>:1:217-341: Non-exhaustive patterns in function a... |
| 11:49:28 | <Axman6> | > let allColinear ((x1,y1):xss@((x2,y2):(x3,y3):xs)) = (y2-y1)/(x2-x1) == (y3-y2)/(x3-x2) && allColinear xss; allColinear _ = True in allColinear [(1,1),(2,2),(3,3)] |
| 11:49:29 | <lambdabot> | True |
| 11:49:34 | <Axman6> | > let allColinear ((x1,y1):xss@((x2,y2):(x3,y3):xs)) = (y2-y1)/(x2-x1) == (y3-y2)/(x3-x2) && allColinear xss; allColinear _ = True in allColinear [(1,1),(2,2),(3,4)] |
| 11:49:35 | <lambdabot> | False |
| 11:49:39 | <Axman6> | whoot |
| 11:49:48 | <Neut> | allColinear x (y:xs) = colinear x y z + allColinear x (y:xs) |
| 11:50:06 | <Axman6> | where's the z come from? |
| 11:50:22 | <Botje> | fairies! |
| 11:50:24 | <LeCamarade> | Who can tell me how to hunt down a case where my GHC-compiled app quits with "thread blocked indefinitely". |
| 11:50:27 | <Axman6> | and isn't the type of allColinear :: [Point] -> Bool? |
| 11:50:32 | <LeCamarade> | I used no explicit locks, so ... |
| 11:50:34 | <LeCamarade> | ? |
| 11:50:47 | <Neut> | well I need to pass it three arguments.. but at the same time Id ont know |
| 11:51:15 | <Axman6> | i think what you need is... |
| 11:51:32 | <Botje> | Neut: no, your type says it only has one argument. |
| 11:51:47 | <Botje> | you want it to pass a *list* of size at least three |
| 11:51:49 | <Neut> | colinear :: Point -> Point -> Point -> Bool |
| 11:51:58 | <Axman6> | allColinear (x:(xss@(y:z:xs)) = colinear x y z && allColinear xss; allColinear _ = True |
| 11:52:22 | <Axman6> | Neut: which course are you doing btw? |
| 11:52:30 | <Neut> | Fail 1100 |
| 11:52:39 | <Axman6> | heh, i loved 1100 |
| 11:52:44 | <Axman6> | i have a few friends doing it too |
| 11:52:51 | <Axman6> | Clem's such a maddog |
| 11:52:57 | <Neut> | do you do haskell in later courses? |
| 11:53:05 | <Axman6> | yeah, a few |
| 11:53:12 | <Axman6> | 2310 is one i think |
| 11:53:12 | <Neut> | ~great~ |
| 11:53:21 | <Axman6> | no, that's the concurrent systems one |
| 11:53:31 | <Axman6> | anyway, one of them i'm doing next semester uses it |
| 11:53:48 | <Axman6> | Neut: if you need haskell help, i'd be happy to meet up with you in the labs and give you a hand :) |
| 11:53:58 | <Neut> | are you a tutor? |
| 11:54:19 | <Axman6> | nah, though i've been told i should be one by one of the other tutors for 1100 |
| 11:54:21 | <Botje> | worse, he'se an axeman ;) |
| 11:54:38 | <Axman6> | :o |
| 11:54:51 | <Neut> | Can Axman6: is it ok if I pm you for one moment? |
| 11:54:57 | <Axman6> | sure |
| 11:55:02 | <Neut> | also xD @ Botje |
| 11:55:42 | <Axman6> | have you pm'd me yet? if you have, you're probably not registered, so i'm not getting it |
| 11:55:48 | <Axman6> | or not, heh |
| 12:00:35 | <mgee> | hey, how do I create a list with ascending numbers? like [0,1,2,3,4,5,6,7,8,...] |
| 12:00:46 | <mgee> | ah iterate |
| 12:00:46 | <mgee> | :D |
| 12:00:47 | <Botje> | [0..] |
| 12:00:59 | <mgee> | Botje: even nicer! :) |
| 12:02:14 | <Axman6> | > [0..] |
| 12:02:15 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,... |
| 12:03:53 | <Botje> | > let i = 0 : map succ i in i |
| 12:03:54 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,... |
| 12:04:14 | <Botje> | > let i = fix ((0:) . map succ) in i |
| 12:04:15 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,... |
| 12:04:19 | <Botje> | whee! |
| 12:04:22 | <mgee> | :D |
| 12:04:37 | <Botje> | right |
| 12:04:39 | <Botje> | TO BUSINESS |
| 12:04:41 | <Botje> | << |
| 12:07:08 | <WorkyBob> | when I run this, ghc complains that the module Jam is not found, am I missing something about how to get it to realise that it's right there in the string buffer I hand it? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5212#a5212 |
| 12:11:26 | <WorkyBob> | ah, I see |
| 12:11:28 | <WorkyBob> | the file has to exist |
| 12:11:33 | <WorkyBob> | and be older than the time specified there |
| 12:21:43 | <endojelly> | sometimes ghc, cabal and haskell-platform are rather bitchy during installation |
| 12:23:51 | <inbuninbu> | maybe there's something i'm not getting (ok, obviously there is), hopefully somebody can help |
| 12:24:25 | <inbuninbu> | so i have an IO action i want to write |
| 12:24:32 | <inbuninbu> | that uses a file handle |
| 12:24:56 | <inbuninbu> | so the type signature might be something like :: Handle -> IO () |
| 12:25:21 | <inbuninbu> | and i want to use functions like hPutStrLn |
| 12:26:07 | <inbuninbu> | but I don't want to have to put the same handle each time i want to write IO to it, i want to make it implicit |
| 12:26:32 | <Botje> | let write = hPutStrLn handle |
| 12:26:41 | <Botje> | then just call write instead of hPutStrLn |
| 12:26:42 | <inbuninbu> | ah! |
| 12:26:45 | <ski> | in case of a lexical scope |
| 12:27:26 | <inbuninbu> | however, i want to be able to handle it transparently in subfunctions |
| 12:27:47 | <Botje> | ah. you're screwed then :] |
| 12:27:53 | <inbuninbu> | monads? |
| 12:28:10 | <inbuninbu> | i noticed in Data.Binary, you can run |
| 12:28:40 | <endojelly> | Could not find module `System.IO.UTF8': |
| 12:28:40 | <endojelly> | There are files missing in the `utf8-string-0.3.4' package, |
| 12:28:40 | <endojelly> | try running 'ghc-pkg check'. |
| 12:28:40 | <endojelly> | Use -v to see a list of the files searched for. |
| 12:28:40 | <endojelly> | cabal: Error: some packages failed to install: |
| 12:28:42 | <endojelly> | WHY |
| 12:28:58 | <dcoutts> | endojelly: "There are files missing in the `utf8-string-0.3.4' package" |
| 12:29:13 | <inbuninbu> | runPut PutMethod ouput |
| 12:29:16 | <inbuninbu> | for example |
| 12:29:35 | <endojelly> | dcoutts, yes but why. I did what I always do. installed latest stable ghc from a binary tar.bz2, installed haskell-plattform, cabal update. all in ~/local |
| 12:29:35 | <dcoutts> | endojelly: because you probably deleted the files belonging to the package, but did not unregister the package |
| 12:29:45 | <inbuninbu> | and in PutMethod you can just chain PutWord8, etc together to make a new functions |
| 12:29:49 | <endojelly> | dcoutts, no I didn't, I did nothing, I just freshly installed ghc and haskell-platform |
| 12:29:57 | <inbuninbu> | all combinator-like |
| 12:30:01 | <Botje> | inbuninbu: you could use a readerT Handle IO |
| 12:30:14 | <endojelly> | when I do "ghc-pkg check" there's tons of missing files |
| 12:30:19 | <endojelly> | how could that happen! |
| 12:30:22 | <dcoutts> | endojelly: then run ghc-pkg check utf8-string as it suggests, see what it finds to be missing |
| 12:30:40 | <dcoutts> | endojelly: did you ever rm -rf ~/.cabal ? |
| 12:31:19 | <endojelly> | dcoutts, no, it doesn't work like that. you don't get to specify a package name with ghc-pkg check. you just issue ghc-pkg check and then it tells you about tons of missing files and you're still wondering WHY it suddenly won't install correctly even though it said it did |
| 12:31:33 | <endojelly> | dcoutts, yes, of course, right before trying to reinstall everything *again*. |
| 12:31:44 | <dcoutts> | endojelly: ok, so that's why the files are all missing |
| 12:31:58 | <inbuninbu> | Botje: thanks, i'll check that monad out |
| 12:32:14 | <endojelly> | dcoutts, no. I did it before I reinstalled cabal. and ghc. and whole haskell-platform, which cabal is part of |
| 12:32:15 | <dcoutts> | endojelly: the per-user ghc package database is in ~/.ghc/$version/ |
| 12:32:38 | <endojelly> | dcoutts, oooh. finally. that's helpful! I forgot to delete that one. thanks, it seems to work now |
| 12:32:51 | <endojelly> | very good |
| 12:33:11 | <dcoutts> | endojelly: so assuming you removed that file then you've got no per-user packages registered any more |
| 12:33:15 | <endojelly> | happy now, will keep that in mind next time. thanks again dcoutts |
| 12:33:42 | <endojelly> | dcoutts, yup I just removed ~/.ghc and now it's re-building everything that's missing, that's what I wanted |
| 12:33:55 | <endojelly> | cabal install agda works now |
| 12:34:04 | <dcoutts> | good good |
| 12:46:18 | <ski> | (inbuninbu : "subfunctions" ?) |
| 12:47:10 | <inbuninbu> | ski: think combinators, like in parsec, where you can write custom Parser actions |
| 12:47:28 | <inbuninbu> | you can write a Parser that doesn't explicitly take it's input |
| 12:47:30 | <Absolute0> | What's the difference between (*5) and (5*)? |
| 12:47:41 | <inbuninbu> | i'm looking at how some other libraries do it now |
| 12:48:06 | <ski> | (* 5) x = x * 5 |
| 12:48:11 | <ski> | (5 *) x = 5 * x |
| 12:48:18 | <Absolute0> | ah |
| 12:48:24 | <Absolute0> | thanks :) |
| 12:48:35 | <Absolute0> | no wonder i was getting the same result |
| 12:48:42 | <ski> | inbuninbu : ok .. probably monad or applicative, then |
| 12:49:05 | <ski> | > (/ 5) 2 |
| 12:49:07 | <lambdabot> | 0.4 |
| 12:49:09 | <ski> | > (5 /) 2 |
| 12:49:10 | <lambdabot> | 2.5 |
| 12:49:14 | <inbuninbu> | ski: thanks, that's what i guess i'm having trouble figuring out, but looking at some other code is helping |
| 12:49:19 | <Absolute0> | yeah |
| 12:49:25 | <ivanm> | yay for fromIntegral! |
| 12:49:37 | <ski> | fromIntegral++ |
| 12:49:49 | <Axman6> | @karma fromIntegral |
| 12:49:49 | <lambdabot> | fromIntegral has a karma of 1 |
| 12:50:24 | <ivanm> | it's really annoying in languages like Python that don't do that |
| 12:51:55 | <ski> | it might be nice if `IO' allowed change of `stdin',`stout',`stderr' environment in a local extent |
| 12:52:23 | <ski> | (redirections from/to strings/et.c. could also be nice) |
| 12:53:01 | <fasta> | ski: like the I/O system of C++? |
| 12:53:12 | <ski> | maybe, i don't really know C++ |
| 12:53:22 | <ivanm> | ski: redirection in Haskell rather than in the shell? |
| 12:56:08 | <ski> | i was thinking of `with-input-from-file',`with-output-to-file' of R5RS |
| 12:56:26 | <ski> | (also often `with-input-from-string',`with-output-to-string') |
| 12:57:24 | <ski> | withInputFromFile,withOutputToFile :: FilePath -> IO a -> IO a |
| 12:58:01 | <ski> | withInputFromString :: String -> IO a -> IO a |
| 12:58:18 | <ski> | withOutputToString :: IO a -> IO (String,a) |
| 12:59:23 | <ski> | (i suppose one might generalize on redirecting arbitrary handles .. hmm) |
| 13:00:15 | <ski> | (.. or maybe it's better not to mutate the handles themselves, but just pointers to `stdin',`stdout',`stderr' handles) |
| 13:00:30 | <ivanm> | dibblego: you still around? |
| 13:00:54 | <ski> | ACTION has a few times wanted |
| 13:01:07 | <monadic_kid> | in common lisp you use dynamic scoping to "redirect" stdn/out/err |
| 13:01:09 | <ski> | cointeract :: IO a -> String -> IO (String,a) |
| 13:01:27 | <ski> | (or something like that) |
| 13:01:49 | <Absolute0> | how does forever (from Control.Monad) know when to stop? |
| 13:01:56 | <ski> | yes, this would be dynamic scoping/environment/reader monad/implicit arguments, too |
| 13:02:03 | <ski> | Absolute0 : no |
| 13:02:09 | <Absolute0> | ? |
| 13:02:16 | <ski> | it doesn't stop (by itself) |
| 13:02:36 | <monadic_kid> | @src forever |
| 13:02:36 | <lambdabot> | Source not found. Where did you learn to type? |
| 13:02:42 | <fasta> | I get No instance for (NearZero CReal), but there is a default implementation for NearZero (a type class in the Vec package) when "a" is in the Num class. CReal is in the Num class. Why doesn't it pick up the instance? |
| 13:02:42 | <Absolute0> | I am reading: http://learnyouahaskell.com/input-and-output#hello-world and the forever doesn't seem to stop in the code but it stops somehow.. |
| 13:02:45 | <monadic_kid> | @src Control.Monad.forever |
| 13:02:45 | <lambdabot> | Source not found. Just what do you think you're doing Dave? |
| 13:03:14 | <Botje> | Absolute0: it only stops when you kill the program |
| 13:03:19 | <Absolute0> | oh |
| 13:03:27 | <Absolute0> | well thats useless. |
| 13:03:43 | <Absolute0> | recursive main has more control.. |
| 13:03:45 | <ski> | forever ma = mb |
| 13:03:47 | <Botje> | you can also exit it by raising an exception and catching it |
| 13:03:48 | <ski> | where |
| 13:03:51 | <ski> | mb = do ma |
| 13:03:51 | <ski> | mb |
| 13:03:58 | <fasta> | Absolute0: it has uses |
| 13:04:13 | <monadic_kid> | ACTION renames lambdabot to HAL 9000 |
| 13:04:15 | <ski> | Absolute0 : in monads with a notion a failure, it can terminate |
| 13:05:20 | <ski> | (e.g. expression monads, `ListT m',`MaybeT m',`Either e',`ErrorT e m') |
| 13:05:31 | <Botje> | don't forget ContT |
| 13:05:54 | <ski> | i wouldn't exactly say that `ContT' has a notion of failure |
| 13:06:02 | <ski> | (though it can be simulated, sure) |
| 13:08:49 | <PeakerWork> | how can it be simulated? |
| 13:09:03 | <ski> | discarding the current continuation |
| 13:09:35 | <ski> | or, more generally, transfer control outside the `forever' loop (to maybe later resume inside the loop .. or maybe not) |
| 13:10:42 | <ski> | every (computable) monad can be simulated in terms of composable continuations |
| 13:11:09 | <ski> | (and composable continuations is implementable in terms of ordinary non-composable ones, plus a piece of state) |
| 13:11:54 | <Coko|Raptor> | hey, can someone tell me what !! means. |
| 13:12:01 | <ski> | look up Representing Monads, and Representing Layered Monads, by Andrzej Filinski |
| 13:12:03 | <Botje> | :t (!!) |
| 13:12:04 | <lambdabot> | forall a. [a] -> Int -> a |
| 13:12:19 | <Botje> | Coko|Raptor: it takes the n-1'th element of a list. |
| 13:12:23 | <ski> | (Andrzej Filinski's publications <http://www.diku.dk/hjemmesider/ansatte/andrzej/papers/>) |
| 13:12:28 | <Coko|Raptor> | thanks |
| 13:12:29 | <fasta> | Anyone who speaks Perl? What is a BOF? |
| 13:12:35 | <ski> | > [0,1,2,3,4,5] !! 3 |
| 13:12:36 | <lambdabot> | 3 |
| 13:12:40 | <ski> | > "hello" !! 3 |
| 13:12:41 | <lambdabot> | 'l' |
| 13:12:45 | <Coko|Raptor> | great cheers! |
| 13:12:47 | <ski> | > "hello" !! 1 |
| 13:12:49 | <lambdabot> | 'e' |
| 13:13:02 | <Botje> | fasta: "birds of a feather" it's a format where everyone brings along a tiny presentation (15mins max) |
| 13:13:15 | <michael__> | I have a program: > data Seq a = Emp | Cons a (Seq a) > sum1 Emp = 0 > sum1 (Cons x s) = x + sum1 s. Why does it give me a type error with this: sum1 Cons 5 (Cons 5 Emp) |
| 13:13:32 | <Heffalump> | you're missing parens |
| 13:13:39 | <Heffalump> | sum1 (Cons 5 (Cons 5 Emp)) |
| 13:14:00 | <fasta> | Botje: isn't that a horrible experience for both the presenter as the audience? |
| 13:14:03 | <michael__> | OK cool. Thanks Heffalump |
| 13:15:30 | <PeakerWork> | @type sum1 |
| 13:15:31 | <lambdabot> | Not in scope: `sum1' |
| 13:15:50 | <Axman6> | michael__: in what you had, you were passing three arguments to sum1: Cons, x and s |
| 13:16:19 | <Axman6> | uh, x = 5, s = (Cons 5 Emp) |
| 13:17:27 | <fasta> | Botje: what kinds of things can you possibly say in 15 minutes? You could introduce some library or other "practical" stuff, but that's it, no? |
| 13:23:53 | <marcusb> | hi, after I made a per-user installation of a cabal package into $HOME, do I have to run ghci with special flags to make it find the installed modules? |
| 13:24:08 | <Axman6> | nope |
| 13:24:45 | <marcusb> | mpfh, but I get a Could not find module `Language.ASN1.BER' |
| 13:25:47 | <dcoutts> | marcusb: check with ghc-pkg that the package is registered and what the module it exports is really called, ghc-pkg describe $name |
| 13:26:15 | <Botje> | fasta: I only get 20 minutes to present my thesis |
| 13:26:36 | <marcusb> | exposed-modules: Language.ASN1 Language.ASN1.BER (etc...) |
| 13:26:37 | <Botje> | and 15 minutes is enough to explain the gist of it |
| 13:27:04 | <marcusb> | (thanks for ghc-pkg, by the way, didn't know about it, "list" shows the package) |
| 13:27:06 | <Botje> | BOFs aren't meant to teach something, only to show off something cool you wrote or teach people how to use the Writer monad, for example. |
| 13:27:18 | <Botje> | s/something/& extensively/ |
| 13:27:24 | <fasta> | Botje: at which university is that? |
| 13:27:31 | <marcusb> | ah |
| 13:27:33 | <Botje> | vub.ac.be |
| 13:27:37 | <marcusb> | sorry, I should restart ghci in the emacs |
| 13:28:07 | <marcusb> | import works now! (:m + at the command line is still fishy, I think) |
| 13:28:18 | <marcusb> | ah no |
| 13:28:20 | <marcusb> | everything good |
| 13:28:22 | <marcusb> | strange |
| 13:28:22 | <Botje> | fasta: if you search around for "bird feather presentation" i'm sure you'll find some stuff |
| 13:28:32 | <Botje> | (or just bof presentation) |
| 13:28:43 | <Botje> | fasta: did you ever go to FOSDEM? |
| 13:28:52 | <Botje> | they have lightning talks which are also 15 mins each |
| 13:29:22 | <fasta> | Botje: no, I am not really much of a conference visitor, but I might go when they would be really close. |
| 13:29:25 | <Botje> | and 15 minutes is plenty of time for showing off what your project is, what's cool about it and even how it works |
| 13:31:08 | <fasta> | Botje: yes, that's what I figured. Shiny pictures and people saying "oooh" ;) |
| 13:31:57 | <Botje> | that's what it's all about |
| 13:32:13 | <Botje> | and if you find it interesting enough you strike up a conversation with the presenter later on |
| 13:32:25 | <Botje> | or just ask a few questions at the end |
| 13:32:32 | <Botje> | fun stuff, lightning talks :) |
| 13:33:20 | <fasta> | I think I would enjoy one of Zed Shaw's (?) talk for the entertainment value ;) |
| 13:38:13 | <Botje> | there's a lot of interesting talks on google video, if you want |
| 13:38:34 | <Botje> | most of them are ~1hr though, so don't click open too much :P |
| 13:39:17 | <fasta> | Botje: I watched a video about Qi yesterday, which was sort of interesting. Qi is interesting, because it already has or will have a formal semantics. |
| 13:40:23 | <Botje> | ACTION notes |
| 13:40:33 | <Botje> | i'll take a look when i don't have a thesis due in less than a week ;) |
| 13:41:28 | <fasta> | Botje: fun times ;) |
| 13:52:19 | <michael__> | What is the difference between => and -> when writing function types? |
| 13:53:43 | <doserj> | => has nothing to do with functions. it is just for type-class constraints |
| 13:53:54 | <michael__> | ok thanks |
| 13:54:16 | <doserj> | @type 0 |
| 13:54:18 | <lambdabot> | forall t. (Num t) => t |
| 13:55:14 | <michael__> | just defines a constraint on that particular type then. Can you do (Num t) => (Num c) => t -> c? |
| 13:55:39 | <doserj> | that would be written (Num t, Num c) => t -> c |
| 13:55:39 | <dev31212> | Nah |
| 13:55:52 | <dev31212> | (Num c, Num t )=> |
| 13:55:56 | <michael__> | ok. thanks u guys |
| 13:56:03 | <michael__> | and girls... |
| 13:56:31 | <dev31212> | Sometimes it gets confusing what is a class, and what is an instance of a class |
| 13:56:45 | <dev31212> | I wish that was a bit more straightforward |
| 13:56:51 | <dev31212> | I guess you just have to memorize them all? |
| 13:57:11 | <michael__> | Example? |
| 13:57:24 | <dev31212> | Like remembering Fractional, Int, Num, etc |
| 13:57:27 | <dev31212> | all the various classes |
| 13:57:30 | <dev31212> | Its not a huge deal |
| 13:57:33 | <dev31212> | I was thinking out loud :)) |
| 13:58:00 | <dev31212> | Like if classes all were prefixed with a _ or something |
| 13:58:13 | <dev31212> | that would simplify it...but thats not going to happen..so not point in my talking about it |
| 13:58:15 | <doserj> | dev31212: there is no syntactic distinction between type names and class names, yes, that's sometimes unfortunate |
| 13:58:18 | <walter_> | how can I write something like this ? filter ((<3)||(>5)) [1..10] I dont know how to use || in filter, thanks |
| 13:58:28 | <michael__> | does anyone know M.Mataric? |
| 13:58:46 | <zachk> | walter_: do you know about lambdas? |
| 13:58:51 | <dev31212> | yeah doser. |
| 13:59:04 | <walter_> | zachk, yeah |
| 13:59:25 | <zachk> | walter_: use a lambda or go pointfree but that is beyond me |
| 13:59:47 | <doserj> | > filter (liftM2 (||) (<3) (>5)) [1..10] -- pointfree |
| 13:59:49 | <lambdabot> | [1,2,6,7,8,9,10] |
| 14:00:13 | <walter_> | doserj, great! |
| 14:00:48 | <doserj> | walter_: that needs the (->) r Monad instance, though, which is not quite standard |
| 14:01:11 | <dev31212> | So anyone working on any cool projects? |
| 14:01:15 | <walter_> | dosery, I see. |
| 14:01:21 | <dev31212> | That they would like to talk about? brag about? |
| 14:01:21 | <dev31212> | etc |
| 14:05:12 | <doserj> | > filter (uncurry (||) . ((<3) &&& (>5))) [1..10] -- pointfree, using the -> arrow instead of the (->) r monad |
| 14:05:14 | <lambdabot> | [1,2,6,7,8,9,10] |
| 14:10:38 | <LeCamarade> | I wonder how to deal with deadlocks that I see, yet I'm not taking any explicit locks. |
| 14:10:50 | <LeCamarade> | I use only MVars and Chans and I get deadlocks. |
| 14:15:15 | <Saizan> | a MVar is not that far from a lock |
| 14:15:32 | <Twey> | And a Chan is a bunch of MVars |
| 14:37:56 | <LeCamarade> | I think I have many MVars. I wonder how to chase up the cause of the deadlock exception. |
| 14:38:25 | <LeCamarade> | I'll end up being mad: doing the same thing over and over, expecting different results. Heh. Threads. |
| 14:41:17 | <mmorrow> | , ppDoc <$> (let a |>>=| (p,b) = [|$(return a) >>= $(LamE [p] <$> b)|]; undo (DoE ss) = go ss; go [] = [|return|]; go [NoBindS e] = return e; go (NoBindS e:ss) = e |>>=| (WildP, go ss); go (BindS p e:ss) = e |>>=| (p, go ss); go (LetS decs:ss) = LetE decs <$> go ss in undo =<< [|do (f,m) <- ask; a <- m; set (f a); join m|]) |
| 14:41:19 | <lunabot> | ask >>= (\(f_0, |
| 14:41:19 | <lunabot> | m_1) -> m_1 >>= (\a_2 -> set (f_0 a_2) >>= (\_ -> join m_1))) |
| 14:42:10 | <mmorrow> | ACTION just had to write that and was surprised how (relatively) straightforward it was |
| 14:43:23 | <byorgey> | mmorrow: nice =) |
| 14:43:30 | <mmorrow> | and it's cool how you mirror the quoted syntax with the non-quoted (or whatever) syntax |
| 14:44:24 | <mmorrow> | , src 'DoE |
| 14:44:28 | <lunabot> | data Exp = ... | DoE ([Stmt]) | ... |
| 14:44:28 | <lunabot> | infixl 9 |
| 14:44:29 | <mmorrow> | , src ''Stmt |
| 14:44:32 | <lunabot> | data Stmt = BindS Pat Exp |
| 14:44:32 | <lunabot> | | LetS ([Dec]) |
| 14:44:32 | <lunabot> | | NoBindS Exp |
| 14:46:18 | <mmorrow> | i've also broken down and started using <$>, and i like it :) |
| 14:49:02 | <mxc> | mmorrow - i had the same experience.. wouldn't call it 'broken down' as mcuh as 'learned about applicative functors and monads and realized how dumb it was of me to not be using it |
| 14:50:04 | <mmorrow> | mxc: i was mostly refusing because i didn't want to have to write the import in all my modules, and because the class name is long which annoys me :-) |
| 14:50:09 | <mmorrow> | "call me crazy" |
| 14:50:12 | <mmorrow> | ;) |
| 14:50:32 | <mmorrow> | mxc: but really though, yeah they're nice |
| 14:51:18 | <mmorrow> | i like the |
| 14:51:40 | <mmorrow> | foo <$> a <*> b <*> .... <*> c |
| 14:51:42 | <mmorrow> | pattern a lot |
| 14:52:17 | <mxc> | it would be nice if you could sort of add a global import via ghc option |
| 14:52:50 | <mxc> | so you could just set in your .cabal file a ghc option to implicitly import something to every file |
| 14:53:43 | <mmorrow> | yeah that would be nice |
| 14:53:50 | <mmorrow> | in ghci you can use your .ghci |
| 14:53:59 | <mmorrow> | but not for loaded mods.. |
| 14:54:55 | <mmorrow> | typing "import Data.Map(Map)\nimport qualified Data.Map as M\nimport Data.IntMap(IntMap)\nimport qualified Data.IntMap as IM\nimport Data.Monoid(Monoid(..))" |
| 14:54:59 | <mmorrow> | starts to get old quick |
| 14:55:21 | <mmorrow> | even though you start to be able to type it /really/ fast |
| 14:56:00 | <mxc> | i just add vim mappings |
| 14:56:21 | <mmorrow> | good point |
| 14:57:51 | <gwern> | @quote slow.*as |
| 14:57:51 | <lambdabot> | shapr says: < shapr> the snow falls slowly / the lambdas are lifting - / weak head normal form. |
| 14:57:57 | <gwern> | @quote slow.*as |
| 14:57:57 | <lambdabot> | roconnor says: Damn it, I don't know how to make this as slow as python. |
| 14:58:07 | <gwern> | @quote register.*it |
| 14:58:07 | <lambdabot> | No quotes match. stty: unknown mode: doofus |
| 14:58:10 | <mxc> | to automatically put in the module declaration, common imports etc |
| 14:58:22 | <gwern> | @remember koeien Let's register it [monomorphismrestriction.com] to prevent it from being used ;) |
| 14:58:22 | <lambdabot> | Nice! |
| 14:58:31 | <gwern> | @quote air.*travel |
| 14:58:31 | <lambdabot> | No quotes match. You type like i drive. |
| 14:58:36 | <mxc> | also, haskell mode for vim has a shortcut to add the import statement for whatever is under the cursor - huge timesaver |
| 14:58:41 | <gwern> | @remember Elly Rule 1 of malloc is the same as rule 1 of air travel: "Attempt at all costs to keep your number of landings equal to your number of takeoffs." |
| 14:58:41 | <lambdabot> | It is forever etched in my memory. |
| 14:58:47 | <gwern> | @quote sensible |
| 14:58:47 | <lambdabot> | augustss says: ghc had a bug once where it deleted the source file if it had a type error. Quite sensible, I think. |
| 14:58:50 | <FunctorSalad> | isn't "import qualified Data.Map" a good case for abusing typeclasses for overloading? |
| 14:58:51 | <gwern> | @quote sensible |
| 14:58:51 | <lambdabot> | monochrom says: I was trying to design a sensible language... then I downloaded ghc. |
| 14:59:02 | <gwern> | @quote Kleene |
| 14:59:02 | <lambdabot> | conal says: The C ADT is implemented simply as String (or char *, for you type theorists, using a notation from Kleene) |
| 14:59:12 | <gwern> | @quote suspicious |
| 14:59:12 | <lambdabot> | No quotes match. Maybe if you used more than just two fingers... |
| 14:59:27 | <gwern> | @remember WillDonnelly monads are okay after a bit (though I'm still a little suspicious of them) |
| 14:59:27 | <lambdabot> | I will remember. |
| 14:59:30 | <gwern> | @flush |
| 15:01:43 | <mmorrow> | mxc: i need to spend the time to get a bunch of common bits mapped to various various keys seqs in some organized manner |
| 15:03:38 | <FunctorSalad> | mmorrow, do you use emacs? I found yasnippets nice |
| 15:03:48 | <mmorrow> | vim |
| 15:04:24 | <mxc> | mmorrow do you use haskellmode.vim? |
| 15:04:27 | <mxc> | very very helpful |
| 15:04:51 | <mmorrow> | mxc: i've played with it briefly for the first time the other week |
| 15:05:26 | <mmorrow> | i should pick it up again |
| 15:06:24 | <mxc> | you hsould |
| 15:06:26 | <mxc> | its worth it |
| 15:07:07 | <mxc> | here are some of my additiosn to .vimrc with htat though: |
| 15:07:10 | <mxc> | map _m :wa\|:make!<CR> |
| 15:07:19 | <mxc> | au Bufenter *.hs map _w :call setline(1,'module '.bufname("%").' where')\|1,1s/.hs//g\|1,1s#/#.#g<CR> |
| 15:07:40 | <mmorrow> | cool |
| 15:07:57 | <mxc> | in ghc.vim: |
| 15:07:58 | <mxc> | au Bufenter *.hs map _w :call setline(1,'module '.bufname("%").' where')\|1,1s/.hs//g\|1,1s#/#.#g<CR> |
| 15:08:00 | <mxc> | oops |
| 15:08:07 | <mxc> | execute 'setlocal makeprg=' . g:runghc .'\ Setup.hs\ build' |
| 15:08:15 | <mxc> | execute 'map _c :!' . g:runghc . ' Setup.hs configure --user;<CR>' |
| 15:08:38 | <mxc> | so its all cabalized, and _c is a shortcut to run the configure phase |
| 15:09:01 | <mxc> | just keep my working directory at the top level of the code |
| 15:09:16 | <shapr> | @quote g.*h |
| 15:09:16 | <lambdabot> | <luqui> says: sigh: mathematicians. can't live with 'em, can't prove 'em wrong. |
| 15:10:36 | <mxc> | hm |
| 15:10:41 | <mxc> | is drift dead |
| 15:11:16 | <mxc> | drift and derive, both dead... one is slick with TH, the other is slick with having XmlContent built in.. |
| 15:11:40 | <mxc> | anyone have any best practices for semi-human-readable [de]serialization |
| 15:11:41 | <mxc> | ? |
| 15:11:49 | <mxc> | or just do it all by hand :( |
| 15:12:06 | <Absolute0> | A b c d preferred over A {b = b', c = c', d = d'}? |
| 15:12:10 | <Twey> | deriving (Show, Read)? |
| 15:12:27 | <Twey> | Absolute0: Not really |
| 15:12:28 | <FunctorSalad> | impossible for non-h98 :-( |
| 15:13:00 | <Absolute0> | Twey the latter is better? |
| 15:13:05 | <Twey> | Absolute0: If you mix and match the two styles, you're depending on the order of the record not changing |
| 15:13:05 | <FunctorSalad> | Absolute0: -XNamedFieldPuns, A{b,c,d} |
| 15:13:21 | <FunctorSalad> | (will use local variables called b,c,d) |
| 15:13:26 | <Twey> | Oh, that's nice |
| 15:13:29 | <mxc> | twey - IIRC thats not really robust though, not really guaranteed that show . read = id |
| 15:13:46 | <Twey> | mxc: It is with the derived instances |
| 15:13:51 | <Twey> | (AFAIK) |
| 15:13:57 | <Absolute0> | FunctorSalad: huh? |
| 15:13:59 | <FunctorSalad> | do you really need show . read = id? read . show = id, yes |
| 15:14:12 | <Twey> | ACTION nods. |
| 15:14:15 | <FunctorSalad> | show . read should just be idempotent |
| 15:14:42 | <FunctorSalad> | (which follows from read . show = id) |
| 15:14:56 | <Absolute0> | is a list with key value records an effecient way of implementing hashmaps in haskell? |
| 15:15:13 | <Twey> | No |
| 15:15:19 | <Absolute0> | I retrieve values by iterating over the whole list until a key is matched. |
| 15:15:22 | <mxc> | functorsalad - should, but i thought that using it for [de]serialization was explicitly discouraged |
| 15:15:22 | <Botje> | Absolute0: that would be Data.Map :) |
| 15:15:28 | <Twey> | It makes lookup O(n) worst-case |
| 15:15:41 | <Twey> | Yeah, Data.Map is O(log n) |
| 15:15:55 | <Absolute0> | Twey: lookup _is_ O(n) in my case |
| 15:16:02 | <Absolute0> | oh nice |
| 15:16:07 | <FunctorSalad> | mxc: I read that too, but I'm not sure why (except that it relies on the libraries you use having (read . show = id)) |
| 15:16:23 | <Twey> | Absolute0: Only if the item you want to look up is at the end of the list |
| 15:17:12 | <FunctorSalad> | (maybe there should be one class for text [de]serialization, and one for nice debug output) |
| 15:17:14 | <mxc> | the HXT library seems to have a very, very safe way of serializing to XML |
| 15:17:38 | <mxc> | but, no derive/DriFT support |
| 15:19:06 | <mxc> | started to look at adding a derive XmlPickler (from HXT) to Data.Derive, but gave up... |
| 15:19:10 | <FunctorSalad> | mxc: you could consider using syb, but I don't know how viable this is |
| 15:19:37 | <mxc> | Data.Derive is not the easiest thing to understand from the code.. ndm is kind of too clever, can be difficult to follow... |
| 15:19:42 | <FunctorSalad> | (probably start with the code of the "gshow" function) |
| 15:21:19 | <Absolute0> | Twey: is it worthwhile to use Data.Map when my map is at most of size 32? |
| 15:21:42 | <Twey> | Absolute0: Probably not |
| 15:21:47 | <Absolute0> | Twey: but I may have many of those maps of size 32 being compared in parallel :) |
| 15:22:25 | <Twey> | But it might be if it's going to be used in a computationally-expensive environment. |
| 15:22:37 | <Absolute0> | ^^ |
| 15:24:46 | <Twey> | It's not hard to switch later if you decide you need more performance. |
| 15:25:26 | <Absolute0> | Instead of having a tuple of an id followed by values i now need a tupe of an id and a tuple of the rest |
| 15:27:18 | <Twey> | What else would you have? |
| 15:27:24 | <Twey> | :t lookup |
| 15:27:25 | <lambdabot> | forall a b. (Eq a) => a -> [(a, b)] -> Maybe b |
| 15:27:57 | <Absolute0> | thanks anyways |
| 15:28:06 | <cogno> | :t lookup1 |
| 15:28:07 | <lambdabot> | Not in scope: `lookup1' |
| 15:28:26 | <Absolute0> | The way i was doing it is by comparing a value withing a tuple |
| 15:28:40 | <Absolute0> | which is part of the tuple data structure |
| 15:28:50 | <Absolute0> | repeating that in key does seem so nice |
| 15:28:52 | <saml> | hey Absolute0 |
| 15:28:57 | <Absolute0> | hey |
| 15:29:24 | <saml> | bloomberg doesn't care for haskell. |
| 15:29:32 | <Absolute0> | ? |
| 15:29:52 | <Absolute0> | bloomberg? |
| 15:30:08 | <ski> | @google bloomberg doesn't care for haskell |
| 15:30:09 | <lambdabot> | http://dyn.politico.com/blogs/dinnerdish/index.cfm/category/Thursday |
| 15:30:09 | <lambdabot> | Title: Dinner Dish: Thursday - POLITICO.com |
| 15:30:27 | <ski> | .. maybe not |
| 15:39:03 | <saml> | > 00087 |
| 15:39:05 | <lambdabot> | 87 |
| 15:44:55 | <walter_> | I import Text.HTML.TagSoup but I find Text.HTML.TagSoup.Match wasn't imported, do I have to import Text.HTML.TagSoup.Match seperately? |
| 15:48:21 | <Saizan> | walter_: there's no direct relation between the two |
| 15:48:21 | <MyCatVerbs> | walter_: that should do it. |
| 15:48:27 | <Saizan> | so yes |
| 15:49:17 | <walter_> | but from hoogle, I find that Text.HTML.TagSoup.Match just indent under the Text.HTML.TagSoup |
| 15:50:01 | <walter_> | Saizan, so I have to. Thanks. |
| 15:57:22 | <Eelis> | do i understand correctly that the cabal-install command-line interface for Cabal isn't actually shipped with Cabal itself? |
| 15:57:56 | <Eelis> | and in particular, that while Cabal itself is shipped with ghc, cabal-install isn't? |
| 15:58:00 | <dcoutts> | Eelis: The package "Cabal" and the package "cabal-install" are separate. |
| 15:58:06 | <hackagebot> | multirec-binary 0.0.1 |
| 15:58:12 | <Eelis> | dcoutts: ok, is there a specific reason for this? |
| 15:58:31 | <FunctorSalad> | hello hackagebot |
| 15:58:39 | <dcoutts> | Eelis: yes, they were developed at different times, have different levels of maturity and have different dependencies. |
| 15:58:57 | <hatds> | @pl \x -> (x,x) |
| 15:58:58 | <lambdabot> | join (,) |
| 15:59:00 | <Eelis> | dcoutts: i see. has there been any work toward getting cabal-install shipped with ghc? |
| 15:59:21 | <dcoutts> | Eelis: we call it the Haskell Platform, which includes ghc, cabal-install and various libs. |
| 15:59:49 | <Eelis> | dcoutts: ah, ok. great, then i look forward to seeing that deployed widely :) thanks |
| 16:00:11 | <dcoutts> | Eelis: the first version has been released, you can ask your distro to get on with it! :-) |
| 16:00:45 | <Eelis> | dcoutts: i just might :) |
| 16:03:50 | <matrix> | i have a mobile phone software box ,using that i cant install os to mobile phones |
| 16:03:53 | <mreh> | can you take inverses of haskell functions? |
| 16:03:58 | <matrix> | plz help me with this |
| 16:04:07 | <mreh> | not unless their bijective i suppose |
| 16:04:14 | <mreh> | they're |
| 16:04:19 | <Heffalump> | matrix: running Haskell? |
| 16:04:20 | <bavardage> | mreh: what, take inverses automatically? |
| 16:04:37 | <Heffalump> | there's some work on automatically construction functions together with their inverses, IIRC |
| 16:04:49 | <DrSyzygy> | mreh: What would you expect the inverse of head to be? The inverse of fst? The inverse of (^2) ? |
| 16:04:56 | <DrSyzygy> | Heffalump: Sounds cool. |
| 16:05:03 | <bavardage> | (^2) is easy :D |
| 16:05:07 | <mreh> | DrSyzygy: well yes indeed |
| 16:05:09 | <DrSyzygy> | bavardage: Is it? |
| 16:05:10 | <bavardage> | the others, non |
| 16:05:16 | <mreh> | inverse of ^2, lol |
| 16:05:17 | <bavardage> | DrSyzygy: the standard sqrt? |
| 16:05:23 | <mreh> | um... sqrt |
| 16:05:26 | <bavardage> | yes I know the issues about +- |
| 16:05:30 | <DrSyzygy> | bavardage: Why is that better than negative sqrt? |
| 16:05:31 | <FunctorSalad> | ACTION once coded a Data.Map that keeps track of preimages |
| 16:05:32 | <bavardage> | but just constrain to + |
| 16:05:35 | <bavardage> | as is the convention |
| 16:05:50 | <Gilly> | So, I'd like to produce a lazy list of repeated IO Action. Any ideas how to accomplish this? (I'd need to be able to do something like res <- repeat (readLn :: Int) ; print $ take 5 res) |
| 16:05:50 | <bavardage> | well, with the sqrt on my calculator, it doesn't ask me every time if positive or negative |
| 16:05:53 | <bavardage> | same with sin^-1 |
| 16:06:04 | <bavardage> | it doesn't ask me which result I want |
| 16:06:06 | <Heffalump> | http://www.st.cs.ru.nl/papers/2005/alia2005-biarrowsHaskellWorkshop.pdf |
| 16:06:07 | <bavardage> | it gives me the principal |
| 16:06:12 | <mreh> | inverse of sin, yeah, they aren't bijective functions |
| 16:06:18 | <DrSyzygy> | The point here is that (^2) gives a double cover, and hence you cannot possibly get a sensible derivative without some arbitrary choice, and my question is for all of these why we expect Haskell to be able to do that. |
| 16:06:37 | <FunctorSalad> | preimage maps are nice if you have labeled disjoint sets of stuff, and want to look up the set for a label quickly, and the label for an element :) |
| 16:06:42 | <DrSyzygy> | We could make inverses for head and fst the same way - by picking, say, (:undefined) and (,undefined) |
| 16:07:49 | <DrSyzygy> | But these are all not quite inverses, only almost. - one way around they do invert; for a restricted domain - but |
| 16:08:04 | <FunctorSalad> | even if the function is bijective, inversion can be uncomputable... |
| 16:08:12 | <FunctorSalad> | hmm or wait |
| 16:08:16 | <shapr> | hej michi! |
| 16:08:21 | <DrSyzygy> | yo shapr |
| 16:08:21 | <FunctorSalad> | not if the function itself is computable |
| 16:08:40 | <FunctorSalad> | but it can be arbitrarily complex, I guess |
| 16:09:18 | <NEEDMOAR> | FunctorSalad: uhm. How do you see that? |
| 16:09:38 | <Gilly> | hum, do i, perhaps, need unsafeInterleaveIO for this? |
| 16:09:42 | <NEEDMOAR> | Uhm. |
| 16:09:46 | <NEEDMOAR> | Yeah, nevermind. |
| 16:09:56 | <Philippa> | Everybody: I just posted to haskell-cafe about getting an Anglohaskell run this year, can anyone interested take a look and respond please? |
| 16:09:59 | <DrSyzygy> | bavardage: For arcsin the issue is even hairier. For sqrt, we can at least agree that we like for the principal answer to be within (0,inf). But which domain do you pick for the principal arcsin, and why? Is (0,2pi) better or worse than (-pi,pi) and why? |
| 16:10:01 | <FunctorSalad> | NEEDMOAR: the first part? if it's bijective and computable (with r.e. domain), given an element of the codomain, just search through all elements of the domain |
| 16:10:08 | <NEEDMOAR> | Yep. |
| 16:10:14 | <mreh> | Cale: was it you who suggested to me a better GUI library? |
| 16:10:18 | <bavardage> | DrSyzygy: I agree there are difficulties |
| 16:10:20 | <mreh> | I think I want to change |
| 16:10:30 | <bavardage> | DrSyzygy: but I'm saying in many cases one can just go with convention |
| 16:10:33 | <DrSyzygy> | FunctorSalad: Doesn't that mean you need finite domains? |
| 16:10:42 | <mreh> | @seen Cale |
| 16:10:43 | <lambdabot> | Cale is in #haskell-in-depth, #ghc, #haskell-overflow and #haskell. I last heard Cale speak 7h 50m 9s ago. |
| 16:10:51 | <DrSyzygy> | bavardage: And I'm saying that "Go with convention" is an ill-defined concept, and therefore not something that one can easy build automation on. |
| 16:10:58 | <bavardage> | yeah |
| 16:11:00 | <NEEDMOAR> | FunctorSalad: do you have idea if primitive recursive functions (with no minimizer) have this property as well? |
| 16:11:20 | <roconnor> | Is Alan Kay's "Worlds: Controlling the scope of side effects" paper worth reading? |
| 16:11:25 | <bavardage> | I'd imagine automating the inverses of functions is pretty difficult anyway |
| 16:11:40 | <bavardage> | I guess just restricting it to bijective functions would be easiest |
| 16:11:45 | <mwc> | Anybody written a firefox bookmarklet to reference haddock documentation of all locally installed packages? ie, docs in /usr/share/doc, ~/.cabal/share/doc, etc |
| 16:11:56 | <bavardage> | and so for things like sin, you'd create a bijective sin first and pass that |
| 16:12:31 | <DrSyzygy> | bavardage: And then FunctorSalad's points of arbitrary complexity start becoming relevant... |
| 16:12:39 | <bavardage> | yop |
| 16:12:43 | <duaneb> | man |
| 16:12:44 | <NEEDMOAR> | bavardage: if you construct the bijective functions by using composition of bijective functions, it would be easy. |
| 16:12:48 | <duaneb> | optimizing haskell is hard :( |
| 16:12:59 | <bavardage> | but then you have issues with infinite domains, surely? |
| 16:13:12 | <bavardage> | which would be icky |
| 16:13:35 | <FunctorSalad_> | <DrSyzygy> FunctorSalad: Doesn't that mean you need finite domains?<FunctorSalad> DrSyzygy: why? assuming the func. is bijective, you will eventually find the preimage |
| 16:13:56 | <DrSyzygy> | FunctorSalad: What does _eventually_ even mean for infinite domains then? |
| 16:14:19 | <duaneb> | can anyone help me optimize this function here? |
| 16:14:19 | <duaneb> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5215#a5215 |
| 16:14:23 | <NEEDMOAR> | FunctorSalad_: do you have idea if primitive recursive functions (with no minimizer) have this property as well? |
| 16:14:31 | <duaneb> | it's eating up ~2/3rds of my entire program :| |
| 16:15:48 | <isaacd> | duaneb: 1. call it less often? 2. what if Color has {-#UNPACK#-} before each of the !Doubles ? |
| 16:16:33 | <FunctorSalad_> | DrSyzygy: I just mean that this algorithm for computing the inverse of f will be total, if f is total and bijective (surjective being enough, actually) |
| 16:16:41 | <FunctorSalad_> | maybe my statement is too trivial :) |
| 16:16:44 | <DrSyzygy> | Oh, okay... |
| 16:16:51 | <FunctorSalad_> | it's just true by def of surjectivity |
| 16:17:10 | <duaneb> | isaacd: doesn't make a difference |
| 16:17:15 | <mwc> | duaneb: are you calling this function for every single pixel in a presumably large raster? |
| 16:17:22 | <duaneb> | I use -funbox-strict-fields |
| 16:17:26 | <duaneb> | mwc: yes |
| 16:17:34 | <mwc> | what is the raster being stored as? |
| 16:17:35 | <duaneb> | a few million times, actually |
| 16:17:38 | <mwc> | figured |
| 16:17:49 | <duaneb> | mwc: what do you mean? |
| 16:17:55 | <isaacd> | how do you use the result tuple? |
| 16:17:57 | <mwc> | [Pixel], Array, UArray? |
| 16:18:00 | <FunctorSalad_> | NEEDMOAR: hmm, not sure I understand... which property? the searching algorithm clearly won't work unless the function is surjective |
| 16:18:08 | <duaneb> | I store it into a file |
| 16:18:09 | <duaneb> | hold on |
| 16:18:23 | <duaneb> | this is the bad line: writeTarga (Targa width height $ map pixel $ map (\r -> raytrace r objects 1) (rays width height)) "foo.tga" |
| 16:18:45 | <mwc> | Yeah, but what type is the image? |
| 16:18:51 | <duaneb> | a Targa |
| 16:18:53 | <duaneb> | I write it myself |
| 16:18:56 | <mwc> | no, in haskell |
| 16:19:05 | <mwc> | what do you have as your datatype for the image |
| 16:19:12 | <mwc> | as in, what are you representing the raster with? |
| 16:19:31 | <thoughtpolice> | copumpkin: ping |
| 16:19:32 | <duaneb> | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5217#a5217 |
| 16:19:47 | <mwc> | I think your problem might be high overhead in that map |
| 16:19:51 | <duaneb> | ahh |
| 16:19:57 | <roconnor> | hmm |
| 16:20:08 | <roconnor> | shouldn't duaneb's list be deforested? |
| 16:20:20 | <mwc> | it doesn't look to me like you could squeeze much more out of your pixel routine |
| 16:20:21 | <isaacd> | not if it's in a 'data' ? |
| 16:20:23 | <mux> | dcoutts: ping |
| 16:20:30 | <roconnor> | maybe writeTarga needs to be inlined? |
| 16:20:34 | <dcoutts> | mux: pong |
| 16:21:02 | <mux> | dcoutts: the "workaround" I described at great length on haskell-cafe@ for building the docs like I wanted didn't work on hackage :-( |
| 16:21:21 | <dcoutts> | mux: any clues from the build log? |
| 16:21:42 | <mux> | dcoutts: nope, but it *seems* the sources aren't getting re-processed |
| 16:21:48 | <duaneb> | I guess |
| 16:22:00 | <mux> | dcoutts: I was considering adding debug output and upload a new version just to see what happened but I'd hate that... |
| 16:22:05 | <duaneb> | the profile says that most of the program is spent IN pixel |
| 16:22:16 | <roconnor> | duaneb: your use of min instead of max is bizarre |
| 16:22:17 | <duaneb> | is this because it can't be inlined in map? |
| 16:22:21 | <dcoutts> | mux: you could take this opportunity to ask Ross to post the code |
| 16:22:28 | <mux> | dcoutts: right, good idea |
| 16:22:29 | <duaneb> | roconnor: well, I want the min.... |
| 16:22:39 | <thoughtpolice> | dcoutts: maybe i should ask in #ghc but, can we expect full shared lib support in 6.12? i'm wondering because it's been a long time coming... |
| 16:22:46 | <FunctorSal> | sorry guys, my connection is foiling this discussion again |
| 16:22:56 | <dcoutts> | thoughtpolice: depends on what you mean by "full" :-) |
| 16:22:58 | <thoughtpolice> | (full as in works on OS X, linux, windows etc.) |
| 16:23:05 | <dcoutts> | thoughtpolice: oh, in that case no. |
| 16:23:43 | <thoughtpolice> | dcoutts: ah, so linux only atm? |
| 16:23:51 | <duaneb> | roconnor: if I don't use min, then the color will overflow and wrap around |
| 16:24:04 | <duaneb> | i.e. a color that was 1.2 will become 0.2 |
| 16:24:06 | <roconnor> | duaneb: ah right. Sorry. I'm dumb |
| 16:24:13 | <roconnor> | ACTION goes to eat |
| 16:24:18 | <isaacd> | duaneb: the profiling might be "wrong" and include the ray computations (because pixel is strict?) |
| 16:24:39 | <isaacd> | not sure |
| 16:24:56 | <isaacd> | I've heard that profiling Haskell can be misleading |
| 16:25:23 | <duaneb> | uhoh |
| 16:25:30 | <duaneb> | that's NOT good :P |
| 16:26:09 | <mwc> | Hmm, that's a good point. Could you manually add a cost center for pixel? would that help? |
| 16:26:22 | <jeffwheeler> | Is it possible/acceptable to run a lambdabot off of c.h.o? |
| 16:26:40 | <thoughtpolice> | dcoutts: if so, I think any good support (i.e. passes validate etc.) even if it's for only one platform is better than none |
| 16:27:03 | <dcoutts> | thoughtpolice: yes, OSX is doable but someone has to do the remaining work. |
| 16:27:04 | <duaneb> | mwc: that's what I'm doing right now |
| 16:27:26 | <dcoutts> | thoughtpolice: and I expect you're also assuming some level of support from Cabal etc |
| 16:27:30 | <jeffwheeler> | that is, community.haskell.org |
| 16:27:46 | <duaneb> | wait, this is calculated lazily, right? |
| 16:27:59 | <dcoutts> | thoughtpolice: current status is here: http://blog.well-typed.com/2009/05/buildings-plugins-as-haskell-shared-libs/ |
| 16:28:06 | <duaneb> | it computes the ray -> color -> pixel -> into the targa, and then goes onto the next ray |
| 16:29:27 | <duaneb> | strange |
| 16:29:33 | <duaneb> | mwc: with this paste http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5215#a5218 |
| 16:29:42 | <duaneb> | it's now 70% !r |
| 16:30:17 | <Stephan202> | @pt every f xs = liftM (all id) $ sequence $ map f xs |
| 16:30:17 | <lambdabot> | Maybe you meant: ft pl |
| 16:30:21 | <Stephan202> | @pl every f xs = liftM (all id) $ sequence $ map f xs |
| 16:30:22 | <lambdabot> | every = ((fmap and . sequence) .) . map |
| 16:30:41 | <mux> | sometimes I feel I'm the only developer on earth to have never ever coded a raytracer |
| 16:31:27 | <duaneb> | heh |
| 16:32:41 | <isaacd> | duaneb: you could also have 'data ColorWord8' or such, instead of your tuple, so that the values wouldn't need to be re-boxed before being output |
| 16:32:48 | <mmorrow> | what's the/an algo for all closed paths in a graph given a vertex? |
| 16:32:57 | <duaneb> | isaacd: yea, that's what I suspect the problem is, actually |
| 16:33:04 | <mmorrow> | so i guess "circuits" or i'm not sure the lingo |
| 16:33:08 | <duaneb> | because pixel also has a large portion of the allocations |
| 16:33:12 | <SamB> | mmorrow: those are countable ? |
| 16:33:21 | <mmorrow> | SamB: they are in my graphs |
| 16:33:45 | <SamB> | what about loops ??? |
| 16:33:50 | <mmorrow> | SamB: (dependency graphs of datatypes) |
| 16:34:04 | <PeakerWork> | mux: I think you're right :) |
| 16:34:16 | <PeakerWork> | mux: we were the last 2 but I wrote one about 8 months ago :) |
| 16:34:17 | <mmorrow> | SamB: i've already got those, i need to know all possible (non-trivial) paths back to a vertex |
| 16:34:30 | <mux> | PeakerWork: hehehe |
| 16:35:07 | <mmorrow> | SamB: err, so i want to find all ways back to a *single* vertex starting from it |
| 16:35:24 | <mmorrow> | (not all possible closed paths from every vertex back to itself) |
| 16:36:21 | <mmorrow> | i guess it's just running a reachable and keeping track of the paths when you see the origin again.. |
| 16:36:21 | <mmorrow> | i feel like this one has a name though.. |
| 16:36:56 | <duaneb> | ACTION notes that he actually is a graphics person |
| 16:37:05 | <DrSyzygy> | mmorrow: Based loops? |
| 16:37:30 | <duaneb> | I've written more reyes renderers |
| 16:39:57 | <mmorrow> | DrSyzygy: hmm, i think so |
| 16:40:24 | <DrSyzygy> | mmorrow: You're looking for cycles that are forced to contain one single vertex? |
| 16:40:35 | <DrSyzygy> | one specific vertex |
| 16:40:42 | <mmorrow> | this looks like it's a way NP complete problem in the general case from google, but my graphs are small and far from complete graphs on n-verts |
| 16:41:25 | <DrSyzygy> | mmorrow: I would probably floodfill the graph from that vertex and keep track of paths and look for reoccurrences of the base vertex. |
| 16:41:29 | <mmorrow> | DrSyzygy: ohhh, i see. so given a vertex, i want to find all paths back to that vertex |
| 16:41:36 | <DrSyzygy> | But then I know almost nothign of algorithmics... |
| 16:42:16 | <mmorrow> | DrSyzygy: that sounds reasonable to me, just find all reachable nodes, and during the process keep track of the paths so you can record them whenever you hit the origin |
| 16:42:23 | <mmorrow> | ACTION tries that |
| 16:42:56 | <byorgey> | that sounds like it might miss some possible paths. |
| 16:43:01 | <byorgey> | if you wanted to generate all of them. |
| 16:43:32 | <mmorrow> | i want to /find/ all of them (is this different than generate?) |
| 16:43:48 | <mmorrow> | hmm, how could it miss some? (i'm not sure) |
| 16:44:07 | <mmorrow> | ooh, i think i see |
| 16:44:43 | <duaneb> | you know what's really hard? |
| 16:44:44 | <duaneb> | graphs |
| 16:44:45 | <mmorrow> | (a --> b), (b --> c), (b --> d), (d --> a), (a --> d) |
| 16:44:45 | <duaneb> | and haskell |
| 16:44:47 | <duaneb> | together |
| 16:44:58 | <mmorrow> | duaneb: no way, graphs are easy in haskell :) |
| 16:45:06 | <duaneb> | nah |
| 16:45:14 | <duaneb> | no way to do them efficiently without state |
| 16:45:18 | <duaneb> | and state is not fun in haskell :P |
| 16:45:25 | <mmorrow> | IntMap IntSet |
| 16:46:13 | <lament> | The State Of Haskell |
| 16:46:24 | <lament> | is eternal and immutable!! All hail the Monad! |
| 16:46:41 | <Beelsebob> | mmorrow: how do you do union on that and retain the identifiers of the nodes? |
| 16:46:49 | <lament> | We were always at war with the Land of Lisp! |
| 16:47:19 | <mmorrow> | Beelsebob: it depends what you want to happen when you "union" |
| 16:47:27 | <DrSyzygy> | mmorrow: Loops based in a? From a go to b and d, register [b],[d] respectively. Recurse. From b go to c, with [b,c], and to d with [b,d]. From d go to a with [d,a] and add this to your master list of loops. From c, return nothing. From d, go to a with [b,d,a] and return this. |
| 16:47:51 | <DrSyzygy> | Now you've exhausted all recursions, and you're done with the complete list being [[d,a],[b,d,a]] |
| 16:47:55 | <Beelsebob> | mmorrow: I want to retain all the important data and all the edges between them – I'm assuming that the Int id is purely internal |
| 16:48:05 | <mmorrow> | DrSyzygy: hmm, interesting |
| 16:48:27 | <dcoutts> | @seen blackh |
| 16:48:27 | <lambdabot> | blackh is in #haskell. I don't know when blackh last spoke. |
| 16:48:37 | <dcoutts> | @localtime blackh |
| 16:48:48 | <mmorrow> | Beelsebob: what is your desired result of (a --> {b,c}) `union` (a --> {c,d}) ? |
| 16:48:57 | <ski> | lament :D |
| 16:49:02 | <DrSyzygy> | mmorrow: The idea is to recurse down every arrow you can reach, logging as you go, and stopping your recursion when either outdegree=0 or the newly reached node is equal to the basepoint. |
| 16:49:12 | <Beelsebob> | mmorrow: a --> {b,c,d} |
| 16:49:15 | <mmorrow> | (mine is (a --> {b,c,d}) |
| 16:49:25 | <mmorrow> | Beelsebob: ok, then what's the problem? :) |
| 16:49:45 | <Beelsebob> | mmorrow: the fact that you have to go comparing all the values in the IntMap to find the nodes that need to be merged |
| 16:49:58 | <Beelsebob> | because after all, the Int ID is only an internal construct |
| 16:50:06 | <mmorrow> | DrSyzygy: ooh, that sounds like it could work |
| 16:50:13 | <Beelsebob> | bbiab... dinner's done |
| 16:50:31 | <DrSyzygy> | mmorrow: What ELSE would anyone ever want to do to solve that problem? *mystified* |
| 16:50:41 | <ski> | (DrSyzygy : that's loop-avoiding traversal, yes ?) |
| 16:50:45 | <mmorrow> | Beelsebob: the Ints are uniquely associated with whatever you have at the nodes |
| 16:50:51 | <DrSyzygy> | ski: Loop-avoiding?? |
| 16:51:05 | <DrSyzygy> | ski: This is an attempt to FIND loops... |
| 16:51:07 | <mmorrow> | Beelsebob: if two nodes are equivalent, they have the same Int (and are the same node) |
| 16:51:08 | <DrSyzygy> | Though ... wait .... |
| 16:51:21 | <Beelsebob> | mmorrow: how do you maintain that across *all* graphs you create? |
| 16:51:24 | <DrSyzygy> | ski has a point. This method needs some extra stuff to avoid running around OTHER loops eternally. |
| 16:51:24 | <ski> | ACTION hasn't followed the discussion from the beginning |
| 16:51:48 | <mmorrow> | Beelsebob: i map the nodes to Ints :) |
| 16:52:03 | <mmorrow> | Beelsebob: (i'm clearly not seeing the context you have in mind here..) |
| 16:52:08 | <ski> | DrSyzygy : yeah, but you'd just check the incremental part of each path you've created, to see that the next node isn't already visited, no ? |
| 16:52:15 | <DrSyzygy> | ski: Exactly. |
| 16:52:22 | <DrSyzygy> | Unless you WANT those. |
| 16:52:35 | <Beelsebob> | mmorrow: suppose I create one graph a --> {b,c} and you assign an 1 to a, 2 to b and 3 to c |
| 16:52:43 | <mmorrow> | i think this calls for graphviz cgi ;) |
| 16:52:49 | <Beelsebob> | now I create a second graph a --> {c, d}, how do you know you must use 1 for a? |
| 16:52:49 | <ski> | (i suppose one could either build up the paths in an accumulator, or "top-down") |
| 16:52:55 | <DrSyzygy> | So, based loops from b wiht the graph above would go to c and then terminate, and would go to d, and then start returning loops [d,a,b],[d,a,d,a,b],[d,a,d,a,d,a,b],.... |
| 16:52:56 | <Beelsebob> | 3 for c and something new for d? |
| 16:53:00 | <mmorrow> | http://moonpatio.com/cgi-bin/graphedit.cgi |
| 16:53:19 | <mmorrow> | ACTION braces for teh server to be crushed :) |
| 16:53:32 | <duaneb> | how can I combine typeclasses and datatypes? |
| 16:53:40 | <lament> | into a what? |
| 16:53:43 | <DrSyzygy> | duaneb: Bravely! |
| 16:53:52 | <duaneb> | like, data NumTree = NumTree !(Num a => a) |
| 16:53:53 | <duaneb> | or something |
| 16:53:54 | <ski> | duaneb : data families ? |
| 16:53:57 | <mmorrow> | Beelsebob: oh, well you don't create two graphs without knowledge of how you should assign Ints to "equivalent" nodes |
| 16:54:06 | <duaneb> | ski: that sounds complicated |
| 16:54:18 | <Beelsebob> | mmorrow: sounds a lot like state to me |
| 16:54:20 | <mmorrow> | Beelsebob: if that ever is the case, then you need to use something else |
| 16:54:23 | <thoughtpolice> | duaneb: data Numtree = Num a => Numtree |
| 16:54:26 | <thoughtpolice> | duaneb: i think |
| 16:54:29 | <jmcarthur> | duaneb: something like data NumTree = forall a . Num a => NumTree !a |
| 16:54:34 | <ski> | duaneb : maybe you want an "existential datatype", i.e. `data NumTree = forall a. Num a => NumTree !a' ? |
| 16:54:43 | <mmorrow> | Beelsebob: usually it's somthing like this (rather than IntSet): |
| 16:54:48 | <jmcarthur> | -XExistentialQuantification |
| 16:54:52 | <mmorrow> | IntMap (Foo a) |
| 16:54:55 | <mmorrow> | where you have a |
| 16:54:56 | <thoughtpolice> | yeah, you need the quantifier for existential quantification |
| 16:54:59 | <mmorrow> | (a -> IntSet) |
| 16:55:04 | <duaneb> | heh |
| 16:55:12 | <mmorrow> | and possibly a root Int |
| 16:55:15 | <thoughtpolice> | of course, the fact that Numtree has a num isn't indicated by its type, but you know so anyway |
| 16:55:17 | <ski> | duaneb : that way each value of type `NumTree' contains a value of type `a', with `a' in `Num', for *some* type `a', possibly different for different values of `NumTree' |
| 16:55:23 | <jmcarthur> | duaneb: using the EQ extension is like trying to put OO into your Haskell sometimes, but sometimes is exactly what the doctor ordered |
| 16:55:23 | <viraptor> | > pl \f a b c -> c a b |
| 16:55:24 | <lambdabot> | <no location info>: parse error on input `\' |
| 16:55:36 | <ski> | duaneb : and the only thing you can do with such a value is call `Num' methods on it |
| 16:55:44 | <viraptor> | > pl f a b c -> c a b |
| 16:55:46 | <lambdabot> | <no location info>: parse error on input `->' |
| 16:55:55 | <duaneb> | jmcarthur: I thought that was a joke |
| 16:55:58 | <duaneb> | heh |
| 16:55:59 | <ski> | @pl \f a b c -> c a b |
| 16:55:59 | <mmorrow> | you can always map Map a (Set a) <==> IntMap (Node a), where data Node a = Node a IntSet |
| 16:56:00 | <lambdabot> | const (flip . flip id) |
| 16:56:17 | <mmorrow> | (and IntMap is way faster structure than Map) |
| 16:56:17 | <viraptor> | ski: thanks :) |
| 16:56:21 | <ski> | @pl f a b c = c a b |
| 16:56:22 | <lambdabot> | f = flip . flip id |
| 16:56:33 | <ski> | viraptor : not sure which of those two you were after |
| 16:56:49 | <jmcarthur> | duaneb: heh |
| 16:57:00 | <Beelsebob> | mmorrow: sure, there are alternatives, but I was mostly pointing out that it's not as simple as IntMap IntSet for all cases of graphs |
| 16:57:13 | <ski> | jmcarthur : `EQ' being ? |
| 16:57:22 | <mmorrow> | Beelsebob: oh sure, that was a simplification |
| 16:57:45 | <mmorrow> | (==> the case where you have no extra data at nodes) |
| 16:57:55 | <mmorrow> | and only have the graph structure |
| 16:58:05 | <Beelsebob> | yep, that makes sense then |
| 16:58:30 | <jmcarthur> | ExistentialQuantification |
| 16:58:35 | <ski> | oh |
| 16:59:07 | <ski> | ACTION was thinking about the `a0 ~ a1' equality constraint (or however it was written) |
| 16:59:50 | <skorpan> | ℵ |
| 17:02:00 | <flux> | OR |
| 17:02:09 | <jmcarthur> | AND |
| 17:02:10 | <flux> | whops |
| 17:02:17 | <ski> | NOT |
| 17:02:37 | <skorpan> | <<< |
| 17:05:20 | <FunctorSalad_> | NIMPLIEDBY |
| 17:07:29 | <riddochc> | Having problems wrapping my brain around functors. I've been reading RWH chapter 10, and it's just not helping. Anyone have recommendations on other reading material that would clarify things? |
| 17:08:07 | <jmcarthur> | riddochc: the basic idea is that fmap transforms a function of type (a -> b) to a function of type (f a -> f b), for some Functor f |
| 17:08:27 | <jmcarthur> | riddochc: it's an abstract enough concept that examples are the only way to really go into more detail |
| 17:08:29 | <hatds> | the most common instances of functors are data structures |
| 17:08:44 | <mmorrow> | DrSyzygy, ski: here's (3 versions of) one representative graph that this'll be run on: ==> (every edge present/nothing removed for the sake of viewability) http://moonpatio.com/graphs/Exp_full.png |
| 17:08:52 | <hatds> | fmap f datastruct is the analogue of map f xs for lists xs |
| 17:08:59 | <mmorrow> | the same, but the transitive reduction: http://moonpatio.com/graphs/Exp.png |
| 17:09:20 | <yakov_> | Peaker, FYI wrt GADTs+record syntax http://www.haskell.org/pipermail/cvs-ghc/2008-May/042421.html |
| 17:09:26 | <mmorrow> | the transitive reduction of the SCC (+ directly reachable neighbors) http://moonpatio.com/graphs/Exp_SCC.png |
| 17:09:48 | <riddochc> | So, any suggestions for good examples? |
| 17:10:13 | <DrSyzygy> | mmorrow: So, what's the kind of questions you'd be asking of this graph? |
| 17:10:51 | <DrSyzygy> | Also, when you say transitive reduction, what exactly do you mean? |
| 17:11:12 | <DrSyzygy> | Wait ... nm the last question. |
| 17:11:58 | <riddochc> | Is wikipedia's "Function object" page talking about the same concept? |
| 17:12:09 | <mmorrow> | DrSyzygy: i'm trying to autogenerate a clump of mutually recursive class instances (or it's looking like i might not be able to use classes, but one way or another) so that you can, say for some Type T, get a function which'll give you *all* contained T's at any level of depth |
| 17:12:47 | <mmorrow> | and then there's a datatype that lets you walk over each of these contexts, update them, then it re-assemble the T |
| 17:13:25 | <ski> | riddochc : probably not |
| 17:13:27 | <mmorrow> | so then you can do really fast manipulations of ASTs (and have the grunt work code autogen) |
| 17:14:03 | <bavardage> | what is the limit on the size of haskell's integers? |
| 17:14:06 | <bavardage> | is it memory-bound? |
| 17:14:12 | <bavardage> | or implementation-bound |
| 17:14:18 | <ski> | (riddochc : the name "functor" here comes from a part of math called Category Theory, but knowledge of it isn't required to understand what `fmap' and `Functor' in haskell is good for) |
| 17:14:20 | <bavardage> | or compilation-parameters bound |
| 17:14:29 | <mmorrow> | the relevant type is: |
| 17:14:33 | <mmorrow> | data View a b |
| 17:14:33 | <mmorrow> | = Done a |
| 17:14:33 | <mmorrow> | | View b (Maybe b -> View a b) |
| 17:14:50 | <mmorrow> | class Look a b where look :: a -> View a b |
| 17:15:17 | <jmcarthur> | bavardage: i think it is _semantically_ unbounded |
| 17:15:20 | <jmcarthur> | Integer, that is |
| 17:15:28 | <bavardage> | kk |
| 17:15:28 | <DrSyzygy> | mmorrow: Sorry, but I don't get it. What if you step back a step or two - higher abstraction? |
| 17:15:29 | <jmcarthur> | Int is only required to be at least 30 bits |
| 17:15:33 | <mauke> | bavardage: there is no explicit limit, which means it's probably your memory |
| 17:15:39 | <DrSyzygy> | You want to find cycles in the Exp_SCC-graph? |
| 17:15:40 | <bavardage> | right |
| 17:15:54 | <DrSyzygy> | And you want to pick out all cycles that contain one single node? |
| 17:15:58 | <DrSyzygy> | one specific node |
| 17:16:13 | <riddochc> | ski: I thought not - I've run into functions as objects in a variety of other languages, and this just seemed different. |
| 17:16:41 | <mmorrow> | DrSyzygy: (oh, i thought you meant what am i trying to do in particular) |
| 17:16:53 | <mauke> | fmap is simply 'do this to each element of some container' |
| 17:16:57 | <Badger> | Twey: ping |
| 17:17:00 | <DrSyzygy> | mmorrow: Nah, I'm just interested in the graphtheory of it. |
| 17:17:17 | <DrSyzygy> | mauke: Or for that matter "Translate this to whatever it should mean for the new context" |
| 17:17:36 | <DrSyzygy> | There are non-container functors possible... |
| 17:17:45 | <mauke> | bah, details |
| 17:17:50 | <jmcarthur> | mauke: assuming containers |
| 17:17:56 | <mmorrow> | DrSyzygy: ok, so given a type's Name, you have (Name -> [Type]), and you can get all enclosed types w/in a type (e.g. ["Maybe [Int]","[Int]","Int"]) |
| 17:18:22 | <jmcarthur> | (->) r is not a container (although i guess you could warp your thinking into viewing it as one) |
| 17:18:26 | <LeCamarade> | How do I begin to track down a deadlock exception case? |
| 17:18:33 | <mauke> | jmcarthur: it's a Map |
| 17:18:56 | <mmorrow> | DrSyzygy: so the starting node is identified by a Name, which maps to [Type], which in turn maps to [([Type],Name)] (the last type in the list ("Int") is just a name) |
| 17:19:03 | <jmcarthur> | mauke: -ish |
| 17:20:09 | <jmcarthur> | a Map is a partial function, sure, but i wouldn't say that means all functions are containers |
| 17:20:50 | <jmcarthur> | with a Map (Data.Map, at least), you can have a toList function. not really so with just any function |
| 17:20:58 | <mauke> | bah, details |
| 17:21:09 | <jmcarthur> | although i guess lack of Foldable also doesn't necessarily imply that it's not a function |
| 17:21:16 | <jmcarthur> | err, container |
| 17:21:50 | <Twey> | Badger: Pong |
| 17:22:06 | <mmorrow> | DrSyzygy: (beyond that, i'm not sure what there is to say about the graph) |
| 17:22:13 | <Badger> | Twey: d'you ever continue those SDL tutorials? |
| 17:22:46 | <DrSyzygy> | mmorrow: Oh well... It's getting late and my brain is turning into mush.... |
| 17:22:47 | <Twey> | Nope |
| 17:23:01 | <Twey> | Got carried away with other stuff, as usual |
| 17:23:05 | <mmorrow> | ACTION tries to implem the all-loops algo now |
| 17:23:21 | <Badger> | A few more languages here and there? :P |
| 17:23:31 | <ski> | mmorrow : istr you showing something like that `View' before |
| 17:23:49 | <Twey> | Yeah, actually |
| 17:23:55 | <ski> | probably when we were discussing lenses/functional references and/or zippers |
| 17:24:10 | <Badger> | :o |
| 17:24:33 | <Badger> | Fluent Finnish now then? |
| 17:24:50 | <Twey> | Nay... couldn't find any more materials for it :( |
| 17:25:11 | <Badger> | :/ |
| 17:25:44 | <ski> | mmorrow : care to compare with `data Lens a b = L (a -> (b,b -> a))' again ? |
| 17:26:35 | <mmorrow> | DrSyzygy: i just realized that if you begin by following all *incoming* edges into the origin vertex, then walk the graph in reverse, you're guaranteed not to miss any nodes (i think) |
| 17:26:53 | <mmorrow> | ski: ah yeah, i remember |
| 17:26:57 | <ski> | mmorrow : btw, itym s/all-loops/all non-looping loops/ ? |
| 17:27:16 | <ski> | ACTION doesn't recall how mmorrow's "lens" variant worked |
| 17:27:53 | <mmorrow> | oh, i see what you mean. i just need one cycle around every loop to get what i'm after |
| 17:28:02 | <ski> | right |
| 17:28:26 | <ski> | maybe one could call it "irreducible loops" |
| 17:29:48 | <ski> | modify :: (b -> b) -> (View a b -> View a b) -- ? |
| 17:29:59 | <ski> | get :: View a b -> (a -> b) -- ? |
| 17:30:16 | <ski> | hm .. maybe not |
| 17:31:11 | <ski> | mmorrow : i guess i'm not seeing why `Done :: a -> View a b' doesn't use `b' |
| 17:36:27 | <mmorrow> | ski: ok, so here's what i have currently in the first paste http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2486 |
| 17:36:59 | <mmorrow> | ski: and the second paste has derived instance of Look for every type in Exp's and Type's SCC |
| 17:37:10 | <mmorrow> | (where Exp,Type are the TH ones) |
| 17:37:44 | <raimo_> | how do you organize quickcheck specifications so that you can easily run them all and inspect results? |
| 17:37:46 | <mmorrow> | so i just need to figure out how to get *every* reachable expression from a given Exp, not just the one-level deep ones |
| 17:38:04 | <ski> | mmorrow : was this `View' the one you had mentioned a while earlier .. or is this a fancier variant for this application ? |
| 17:38:16 | <mmorrow> | ski: this is that same View |
| 17:38:35 | <mmorrow> | (do you mean a while earlier as in 10 minutes, or as in a month or two?) |
| 17:38:44 | <ski> | the latter :) |
| 17:38:54 | <mmorrow> | oh, i think that was something like: |
| 17:39:14 | <mmorrow> | data Cxt a b = Top a | Loc b (b -> Cxt a) |
| 17:39:17 | <mmorrow> | iirc |
| 17:39:25 | <ski> | yes, that seems to ring a bell |
| 17:39:32 | <mmorrow> | hmm, so i guess it is pretty much the same |
| 17:39:38 | <ski> | so `View' is same, except for the `Maybe' thrown in |
| 17:39:41 | <mmorrow> | heh |
| 17:39:52 | <ski> | i suppose that is for saying "nothing's changed" ? |
| 17:40:50 | <mmorrow> | yes, and also (i can't recall the exact situation that made me add it initially, but there was a case where i didn't have anything to give the function in View (it was originally (b -> View a b)) |
| 17:41:00 | <ski> | in any case, this isn't an abstract point, like `head', but specific to a given piece of data |
| 17:41:06 | <ski> | s/point/pointer/ |
| 17:42:00 | <mmorrow> | yes, what i'm currently doing is just having it provide you a way to map over all the 'b's in an 'a' in some (unspecified) order, so you can e.g. thread a state monad though it |
| 17:43:08 | <ski> | so, if the `Cxt a b'/`View a b' is of `Top a'/`Done a' form, then there's no sub-structure marked |
| 17:43:46 | <mmorrow> | yeah, that's actually one thing that's annoying that i want to fix |
| 17:43:59 | <mmorrow> | (you can never change the top-level of the 'a') |
| 17:44:08 | <ski> | but in the `Loc b (b -> Cxt a b)'/`View b (Maybe b -> View a b)', there is one sub-structure marked, and possibly more, (inside that ?) |
| 17:45:41 | <ski> | ACTION tries to remember the basic construction wholly |
| 17:45:53 | <mmorrow> | exactly, you can recurse and keep on viewing. currently i'm having to do it manually, but i feel like the knot could be tied somehow... but it's looking more and more like typeclasses won't help here and you just have to compute all possible paths back to the 'a', and then generate code that reaches down them and pulls out all the 'b's |
| 17:46:04 | <ski> | so why `b -> Cxt a b'/`Maybe b -> View a b' instead of just one marked sub-structure ? |
| 17:46:32 | <ski> | is this to support "up" operations in more efficient (or even implementable) fashion ? |
| 17:46:37 | <mmorrow> | oh, so say i'm writing an (Exp -> Exp) |
| 17:47:00 | <mmorrow> | i usually want to do the action to all Exp's recursively, and also have a state monad or something |
| 17:47:15 | <ski> | (also, is the "context levels" represented in "direct" or "reversed" order .. i can possibly figure that out by thinking about it) |
| 17:47:38 | <mmorrow> | what do you mean "context levels"? |
| 17:48:13 | <mmorrow> | err, what do ... by "direct" or "reversed"? |
| 17:48:44 | <ski> | well, say `Node 1 (Node 2 Nil Nil) (Node 3 (Node 6 Nil (Node 13 Nil Nil)) Nil)' |
| 17:49:02 | <walter_> | Is tagsoup outdated for web scraping on haskell ? |
| 17:49:03 | <ski> | say i want to mark the `Node 13 Nil Nil' substructure |
| 17:49:21 | <mmorrow> | ski: oh, i gotcha. so top-down vs. bottom up? |
| 17:49:37 | <mmorrow> | i want to be able to do either |
| 17:49:43 | <ski> | that means i have a sequence of "levels", `Node 1 (Node 2 Nil Nil) <>',`Node 3 <> Nil',`Node 6 Nil <>' |
| 17:49:47 | <mmorrow> | viewTopDown, viewBottomUp |
| 17:50:31 | <ski> | afaic, representing these levels from "inside-out" with the `Node 6 Nil <>' "directly" accessible, gives you O(1) local traversals |
| 17:50:43 | <ski> | (s/afaic/afaicr/) |
| 17:51:04 | <mmorrow> | hmm |
| 17:51:11 | <mmorrow> | interesting |
| 17:51:42 | <ski> | (it's basically the difference of either just removing a sub-structure .. or removing the sub-structure, then do pointer-reversal on all nodes from the hole up the path to the root) |
| 17:52:01 | <ski> | (you could imagine keeping the levels as separate entities in a list too, i suppose) |
| 17:52:27 | <walter_> | any advice on web scraping? |
| 17:52:54 | <ik> | walter_: don't do it while hanging from your toenails above the grand canyon |
| 17:53:01 | <ik> | that's generally considered unsafe |
| 17:54:11 | <walter_> | ik, did you mean haskell is not good at web scraping ? |
| 17:54:22 | <mmorrow> | ski: i think there's something to that. i'm gonna think about it. |
| 17:54:43 | <ski> | (mmorrow : i can give concrete examples of direct vs. reversed contexts if you want) |
| 17:54:45 | <jaredj> | unsafeWebScrapeHangingFromToenails |
| 17:54:56 | <mmorrow> | ski: ooh, yes :) |
| 17:55:03 | <ski> | ok, so we had |
| 17:55:20 | <ski> | data Tree a = Nil | Node a (Tree a) (Tree a) |
| 17:55:21 | <ik> | walter_: no, I mean your question was very vague |
| 17:55:34 | <ski> | well, we can say |
| 17:55:54 | <ski> | data Tree a = Nil | Node {element :: a , left :: Tree a , right :: Tree a} |
| 17:56:02 | <ski> | for verbosity's sake |
| 17:56:13 | <sclv> | walter_: tagsoup is great. dunno why you wouldn't want to use it. |
| 17:56:29 | <mmorrow> | ski: you mean the diff between [Int], and Zip a (Seq (Cxt a)), Cxt a = L (Tree a) | R (Tree a) (or something) ? |
| 17:57:02 | <mmorrow> | like (where [Int] represents a path) |
| 17:57:05 | <mmorrow> | s/like// |
| 17:57:22 | <walter_> | sclv, just because in #gentoo-haskell, someone said it is outdated, problably I misunderstood. |
| 17:57:29 | <ski> | no, my "context level" is the `Cxt a', there |
| 17:57:44 | <sclv> | in gentoo they probably just meant the package for gentoo needed to be upgraded. |
| 17:57:50 | <mmorrow> | walter_: there's a ByteString version on hackage, and also one with an updated parser (maybe these are the same thing) |
| 17:58:08 | <copumpkin> | has anyone seen the latest pidigits submission? |
| 17:58:11 | <ski> | there's several variant ways to think about this, and i can't say i'm fully clear on it myself, yet |
| 17:58:23 | <copumpkin> | it's tiny, clean, and is the fastest 32-bit entry on the shootout |
| 17:58:26 | <walter_> | mmorrow, thanks , will look |
| 17:58:34 | <ski> | maybe it's best if i explain what i meant, then you can compare |
| 17:58:41 | <mmorrow> | ACTION listens |
| 17:58:46 | <copumpkin> | (http://shootout.alioth.debian.org/u32q/benchmark.php?test=pidigits&lang=all) |
| 17:58:46 | <ski> | so |
| 17:58:49 | <ski> | data Tree a = Nil | Node {element :: a , left :: Tree a , right :: Tree a} |
| 17:59:12 | <ski> | then, given values of type `Tree a' we can look at substructures of differing types |
| 17:59:31 | <ski> | we might look at marking / removing an element `a' |
| 17:59:42 | <ski> | or marking / removing a whole sub-tree `Tree a' |
| 18:00:24 | <ski> | (that `Tree a' has `a' as parameter is irrelevant here .. we could just as well have `IntTree' with `Int' elements, or `Command' tree with `Expression' sub-structures) |
| 18:00:26 | <jmcarthur> | copumpkin: wow that is impressive |
| 18:00:35 | <jmcarthur> | and they say haskell is slow at arithmetic |
| 18:00:55 | <ski> | anyway, either we may just *mark* an element/sub-structure (but keep it in-place) |
| 18:01:14 | <ski> | or we may *remove* an element/sub-structure, so we get a hole in its place |
| 18:01:19 | <copumpkin> | jmcarthur: yeah, I was surprised... it was a name I hadn't seen much on -cafe before, and he just randomly said "yo, I have a faster pidigits" and it's not just faster, it's the fastest! zomg |
| 18:01:20 | <copumpkin> | :P |
| 18:01:31 | <jmcarthur> | huh, it does much worse on 64 bit though |
| 18:01:31 | <copumpkin> | it runs into the 6.10 inefficiency bug on 64-bit though |
| 18:01:31 | <ski> | these are mostly similar, to i'll just talk about removing |
| 18:01:35 | <jmcarthur> | oh |
| 18:01:36 | <ski> | s/to/so/ |
| 18:01:43 | <jmcarthur> | i don't know about this bug |
| 18:01:44 | <mmorrow> | ok |
| 18:01:57 | <copumpkin> | jmcarthur: something about integers not getting freed correctly |
| 18:02:03 | <copumpkin> | it's fixed in 6.10.2 I think |
| 18:02:06 | <ski> | so, i've been calling what you get when you remove a part, a "context" |
| 18:02:28 |