00:04:52 -!- copumpkin has quit (Quit: Computer has gone to sleep.). 00:10:31 Grrrr wget 00:10:38 * Sgeo wants wget to ignore robots.txt >.> 00:11:20 you wicked spammer 00:11:46 wget has a lot of options look to see if it has the one you want 00:12:12 * Sgeo found something online about it 00:12:21 I don't see this version of wget's --wait thingy 00:19:25 patch wget problem solved 00:19:54 There is no problem 00:20:04 I think --wait just wasn't listed in --help, or I didn't see it 00:20:31 And there is an option to disable checking robots.txt 00:21:54 -e robots=off 00:23:40 Yes 00:23:54 * Sgeo is using it to great effect >.> 00:26:29 Is there an option to change the name of the file to check (other than robots.txt), or to change which entry it searches for in robots.txt? 00:26:59 -!- copumpkin has joined. 00:29:22 I'm not sure what the use of that would be 00:29:39 Or, um, the first option anyway 00:30:19 It's pretty much a standard, if not an official one. About as useless to make an option to change as making a browser that sends RETRIEVE/SEND instead of GET/POST 00:31:16 more of that mustafar/dwarf fortress discussion http://www.irregularwebcomic.net/draakslair/viewtopic.php?t=6110 00:33:29 -!- Patashu has joined. 02:39:10 -!- myndzi\ has quit (Ping timeout: 240 seconds). 03:05:02 -!- nys has quit (Quit: f00f). 03:10:58 hello friends. 03:11:37 I looked in the haskell-src-exts files. The ParseSyntax.hs file (as well as many of the other files) do something, stuff added needs to be added in multiple places manually. For example, PExp needs to also define ann, amap, fmap, etc. But most of that is just the same way. It might seem (to me, at least) a better way using TH-splices generating more-declarations. 03:13:17 I don't know what it seems to you. 03:34:50 The code accumulation in Strathclyde Haskell Enhancement is a very crude idea with code accumulation feature, but it seems insufficient tome (it is also designed for layout mode). That one does not do ordering, removal of duplicates, cooperating with Template Haskell, and a bunch of other stuff. 03:35:40 anyone familiar with xpath? 03:35:53 I'm wondering if the | can be used to search for elements by multiple criteria 03:36:29 -!- CakeProphet has quit (Quit: Reconnecting). 03:36:46 -!- CakeProphet has joined. 03:36:47 -!- CakeProphet has quit (Changing host). 03:36:47 -!- CakeProphet has joined. 03:38:00 //a[@class=...|@href=...|@name=...|@id=...] 03:39:46 Why doesn't "hint" have a function for loading a module from a string instead of from a file? 03:41:06 -!- MDude has changed nick to MSleep. 03:41:25 zzo38: because it is really crappy. 03:41:48 for my IRC bot I worked around this by just writing the string to file and adding the module bits. 03:41:48 Then how to do it better? 03:41:55 mueval has that capability but mueval is also bad. 03:42:42 And you must also send expressions to be evaluated as strings, there is no command to interpret a Q Exp instead? 03:43:01 What program has that one? 03:43:37 Which are better programs? 03:47:45 I have no idea. 03:47:52 lambdabots code is not bad. 03:47:53 -!- augur has quit (Remote host closed the connection). 04:18:06 What kind of data can be compressed well with run length encoding multiple times? What kind of data should you run length encode and then use Huffman coding on the result? 04:19:11 -!- Patashu has quit (Ping timeout: 258 seconds). 04:31:50 multiple time run length encoding sounds unlikely to improve things 04:32:43 that's essentially look-and-say transformation, which quickly starts growing exponentially 04:33:35 Yes I know that is what it is. Doing it a lot will likely grow large. 04:34:20 But maybe some data works better doing RLE twice instead of once, or something like that. Maybe you want to combine multiple units into one unit or split units in some cases. 04:37:20 well in order for the second step to give any further compression, you'd want to collect character c in blocks of length c 04:38:42 or for the first block in a series, perhaps of length equal to the previous character 04:38:42 Yes, it is true; but, what if it is variant RLE where the character is implied? For example, you always alternate black and white so you do not need to indicate that 04:39:14 ah yes. but then the second step would be of a different kind. 04:39:29 Yes it would be different kind 04:39:53 since the RLE coding itself does not preserve that property 04:40:43 but yes, if you had frequently blocks of black and white that had the same length, then that would work 04:42:16 Maybe you have "001001001001001001001001" and you should do the encoding to (2,1) and 8(2,1) if such patterns are common in whatever data you are dealing with. 04:42:40 * CakeProphet is the best programmer in the world. 04:42:42 I know all of the codes. 04:42:58 hm 04:43:09 CakeProphet: Are you sure? I think nobody knows *all* of the codes 04:43:28 oh he does. he just cannot remember which is which. 04:43:29 And even if you did I am unsure if that would make you the best programmer in the world 04:43:35 famous babel library problem. 04:44:17 oerjan: yes I often get minute details of different languages confused. 04:44:37 for example: I have accidentaly wrote "using Control.Monad" in Haskell. 04:44:45 after some C# programming. 04:46:33 and after some intense Perl scripting, I find myself wanting to type $ in front of everything. 04:47:07 for example: in Python I will accidentally type $ instead of % in a string when sprintf'ing it. (sprintf'ing something sounds pretty dirty) 04:47:41 > sin $2 04:47:42 0.9092974268256817 04:47:50 heh. 04:47:53 I have Sokoban encoding, that is first RLE of wall/nonwall alternating, next RLE of target/nontarget skipping all walls, next is a more complicated encoding for the crates. (Characters are implied) Some numbers occur much more often than others, usually low numbers occur more than high numbers. 04:48:14 oerjan: I will now code Haskell in that style from now on. 04:48:23 CakeProphet: O KAY 04:48:41 I composed a Huffman tree by hand but I made a mistake. 04:48:44 > let x = 2 in sin $x 04:48:45 0.9092974268256817 04:48:57 bashkell 04:49:13 CakeProphet: Template Haskell it would do different $ immediately followed by words 04:49:28 Can you make polyglot program now? 04:49:39 not with that "feature" no 04:49:52 polyglots are essentially done by taking advantage of strings and comments. 04:49:58 Perl is particularly well-suited for this. 04:50:12 you can include Perl in almost any polyglot with ease. 04:50:18 it's a little awkward since you cannot do $x = 2 in haskell 04:50:19 Or, make a Haskell program that does different things, all valid, but still somewhat useful, depending on which language extensions are enabled. 04:50:56 oerjan: right and you can't do let or in in Perl unless you define subroutines with some kind of hacked meaning. 04:51:39 zzo38: most common extensions wouldn't do that since they usually inroduce some kind of construct or syntax that didn't exist before. overloaded strings could be used for that purpose though. 04:52:03 zzo38: heh the extensions which add keywords or syntax, perhaps 04:52:39 rec and ? perhaps 04:53:14 > let f ?x = 2 in f ?3 04:53:16 : Parse error in pattern 04:53:17 the easiest way to polyglot Haskell is to use literate Haskell. 04:53:18 > let f ?x = 2 in f ? 3 04:53:19 : Parse error in pattern 04:53:40 zzo38: also I am slightly drunk so, no, probably can't write a polyglot right now. 04:53:42 -!- Patashu has joined. 04:53:43 CakeProphet: i meant for zzo38's distinguishing by haskell extension idea 04:53:56 oerjan: right 04:54:07 You can define # as an operator and then do stuff with the magic hash mode and CPP stuff, and it does differently when these are enabled or disabled. 04:54:13 not sure how ? could be used though 04:54:21 zzo38: ah right 04:54:23 doesn't it require an explicit type signature or...? 04:54:35 no 04:54:40 > let ?x = 2 in ?x 04:54:41 2 04:54:42 ah okay 04:55:13 what DOES require an explicit type signature other than record fields? 04:55:26 but it's not quite clear how to get something which parses both with ? as operator and as implicit parameter prefix 04:55:29 type defintions, and the like 04:55:45 Do classes require an explicit type signature? 04:55:47 CakeProphet: polymorphic recursion 04:55:59 higher rank types 04:56:09 * CakeProphet has really figured out higher rank types yet. 04:56:14 zzo38: not to _use_ them in functions, no 04:56:22 basically it means there is a forall in the type, right? 04:56:31 very basically... 04:56:34 in the type, and not at the front 04:56:35 What I meant is, in definition of classes 04:56:39 oerjan: right 04:56:55 zzo38: for the methods, yes 04:56:59 oerjan: so for example, a type with an embedded existential is a rank-2 type, yes? 04:57:31 but class A a is legal by itself i think, a class with no methods 04:57:50 ah, that's interesting. Basically a set of types. 04:58:22 CakeProphet: i think they are different extensions but you can sometimes convert between using existentials and using higher rank 04:58:54 yes they're different extensions but they both permit the forall syntax. 04:59:10 in different places yes 04:59:56 basically the syntax for existential types are based on the fact that its _constructors_ has a higher rank type 05:00:11 er, or at least polymorphic 05:00:29 I actually understand how the Perl community has taken influence from Haskell. I believe I've heard people (not on this channel) that it's strange. 05:00:38 data SomeShow = forall a. Show a => SomeShow a 05:00:42 +mention 05:01:01 then SomeShow :: forall a. Show a => SomeShow 05:01:04 oerjan: ah, okay. 05:01:32 so does RankNTypes permit existentials? 05:01:33 er 05:01:40 *then SomeShow :: forall a. Show a => a -> SomeShow 05:02:10 i don't _think_ there's any automatic implication anyway, look it up in the user guide :P 05:02:16 *any way 05:02:32 *either way 05:02:45 also how do language extensions work with importing? 05:03:04 modules can ignore the language extensions that other modules use. They do not need to explicitly support them, right? 05:03:38 i don't think they need to. it might depend on what is imported. 05:03:53 right if the API requires a syntax extension to be used properl 05:04:01 y. like fclabels uses TH. 05:05:05 of course, if a dependency uses a language extension then the compiler must support that language extension as well. 05:12:39 -!- zzo38 has quit (Remote host closed the connection). 05:14:14 01:14 < bob2> oh wait, takewhile 05:14:14 01:14 < bob2> I finally understand what it is for 05:14:17 #python 05:15:14 apropos taking influence from haskell :P 05:16:51 itertools, functools, and a very limited list comprehension syntax is probably the only influence Python has from Haskell. 05:19:28 -!- augur has joined. 05:19:50 -!- augur has quit (Read error: Connection reset by peer). 05:20:23 -!- augur has joined. 05:21:45 Not sure if what I did was a good idea or just really really stupid 05:24:09 well there's only one way to find out. make that into a fry meme picture and post to reddit. 05:25:43 < jtannenbaum> and put a dang comment at the end so people know what you're doing, it's tough to read either way 05:26:03 in regards to: list(itertools.product(*[range(x) for x in (2,3,4)])) 05:26:08 -- #python 05:26:50 what's the * for 05:27:04 "flattens" a list into function arguments 05:27:21 f(*[a,b,c]) = f(a,b,c) 05:27:35 also works with tuples and other iterators. 05:27:51 mhm 05:28:00 ** is used to translate dictionaries to named arguments. 05:28:07 It's not possible to go to an eye doctor to preemptively ask if you just infected your eye, is it? 05:28:25 it is possible to do that, yes. 05:28:29 not sure if it'll help though. 05:29:04 ask a doctor. :P 05:54:27 -!- oerjan has quit (Quit: Good night). 06:10:25 Sgeo: what did you do? (the thing that was either good or really really stupid?) 06:11:00 Poking around my eye to try to deal with an eyelash 06:11:04 After my dad told me not to 06:11:18 I did wash my hands and air-dried them, but not entirely sure if I was vigilant enough about that 06:11:27 I may have done a bit of poking around before washing 06:11:36 I did successfully deal with the eyelash 06:11:54 oh, that should be fine, just blink furiously for a while so you re-lubricate your eye 06:12:57 My finger, while I don't think it touched eyeball, did touch skin that probably did touch eyeball 06:14:25 oh no, you touched skin that touches your eyeball? it'd be fine if it was the eyeball directly, but now you're definitely going to die 06:14:45 what's so bad about touching eyeballs? 06:14:56 it scares Sgeo? :) 06:15:26 My dad thought that my eye could get infected like that 06:15:50 (By touching the eyeball if my hands weren't really really really clean) 06:16:07 oh, then my eyes must be really sick by now 06:20:48 -!- augur has quit (Remote host closed the connection). 07:10:01 -!- azaq23 has joined. 07:25:32 > (`replicateM` "abc") =<< [0..] 07:25:33 ["","a","b","c","aa","ab","ac","ba","bb","bc","ca","cb","cc","aaa","aab","a... 07:33:58 so if I wrote a language that compiles to Core 07:34:09 would that give me access to Haskell bindings? 07:34:13 Core? 07:35:12 one of GHC's intermediate languages. 07:38:25 -!- nooga has joined. 08:15:28 -!- copumpkin has quit (Ping timeout: 240 seconds). 08:15:52 -!- copumpkin has joined. 08:16:03 -!- myndzi has joined. 08:43:49 -!- FireFly has joined. 08:43:57 -!- FireFly has quit (Changing host). 08:43:57 -!- FireFly has joined. 08:46:12 -!- Tritonio has joined. 09:09:28 Sgeo: i recommend you stir your emotions with a moving song or video causing you to cry 09:09:41 haha. 09:14:24 (to greensleeves) There once was a cat who had come to my home, and it's life had only just begun. 09:14:49 It played on the carpet with balls of string, while a small family watched it do it's thing. 09:16:20 It jumped on the fridge and slept there all day, or climbed along fences all carefree and gay. 09:22:49 im moved 09:27:17 I moved. 09:39:19 the point was to move sgeo :P 09:39:25 heheh 09:48:18 > nub . permutations $ "sgeo" 09:48:20 ["sgeo","gseo","egso","geso","esgo","sego","oegs","eogs","egos","oges","goe... 09:48:37 nub? why would there be any duplicates? 09:48:53 I'm a cautious guy. 09:49:46 > let permuts = permutations "sgeo" in length $ nub $ permuts == length permuts 09:49:47 Couldn't match expected type `[[GHC.Types.Char]]' 09:49:47 against inferred ... 09:49:51 you would want nub there if it were any string with duplicate characters... so I kind of just use it out of habit. 09:49:57 yes I understand it's the same in this case. 09:50:11 > let permuts = permutations "sgeo" in length . nub $ permuts == length permuts 09:50:12 Couldn't match expected type `[[GHC.Types.Char]]' 09:50:12 against inferred ... 09:50:22 Grah 09:50:23 Sgeo: what are you trying to do? 09:50:38 oh, I see 09:50:42 Sgeo: problem is most likely related to precedence of $ and == 09:50:42 Have lambdabot tell me if length with and without nub is the same 09:50:50 right 09:51:03 > let permuts = permutations "sgeo" in (length $ nub $ permuts) == (length permuts) 09:51:04 True 09:51:23 > let permuts = permutations "sgeo" in (length . nub $ permuts) == (length permuts) 09:51:25 True 09:51:37 Hmm, makes sense 09:52:02 > let permuts = permutations "lambdabot" in (length . nub $ permuts) == (length permuts) 09:52:06 mueval-core: Time limit exceeded 09:52:12 > let permuts = permutations "aa" in (length . nub $ permuts) == (length permuts) 09:52:41 > let permuts = permutations "baby" in (length . nub $ permuts) == (length permuts) 09:52:42 False 09:52:57 #esoteric: conducting groundbreaking research in combinatorics. 09:55:18 > permutations "zzz" 09:55:19 ["zzz","zzz","zzz","zzz","zzz","zzz"] 09:55:34 * Sgeo goes to publish a paper 09:55:43 > join . permutations . "zzz" 09:55:44 Couldn't match expected type `[a]' 09:55:44 against inferred type `GHC.Types... 09:55:46 > join . permutations $ "zzz" 09:55:48 "zzzzzzzzzzzzzzzzzz" 09:55:49 > ((==) <*> nub) (permutations "sgeo") 09:55:50 True 09:55:53 > ((==) <*> nub) (permutations "baby") 09:55:54 False 09:56:01 What's <*> 09:56:07 :t (<*>) 09:56:07 S 09:56:08 forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b 09:56:11 Oh it's that thing isn't it? 09:56:26 I have no idea what it''s doing there 09:56:28 and yeah for the ((->) a) instance it's S 09:56:29 for functions <*> is ap is the S combinator. 09:56:32 * Sgeo needs sleep 09:57:04 And knowledge of what the S combinator does 09:57:14 \fgx.fx(gx) 09:57:18 f <*> g x = f x (g x) 09:57:19 yes 09:57:20 that 09:58:20 oh right I forgot to do length on them 09:58:21 oops 09:58:39 probably more efficient to do it this way though. 09:58:39 anyway I checked if they were identical rather than merely of the same length 09:58:50 CakeProphet: nope 09:59:11 more efficient to do the lengths, I'd imagine, since you don't have to do comparisons on all the elements 09:59:42 are comparisons more expensive that accumulated addition? also, the false case would be short-circuiting on the shorter list. 09:59:52 whereas with length you traverse the entire list. 10:00:15 er, not on the shorter list 10:00:19 just short circuiting on the false case. 10:00:57 so that gives better average time. :P 10:01:04 I guess if the'd be different really early on and the lists are really long it'd be best to do straight comparison yeah 10:01:19 the thing about comparisons is it depends on the Eq instance 10:01:26 right 10:01:29 could be a 2-d list for example 10:01:32 but not in this case. 10:01:36 er... wait 10:01:37 lol 10:01:41 yes in this case 10:01:42 yep 10:02:13 so yeah length is faster on the true case. 10:02:43 just comparison is maybe faster on the false case. 10:02:45 >_> 10:03:34 > [1..] == [] 10:03:36 False 10:03:38 > [1..] == [1..] 10:03:42 mueval-core: Time limit exceeded 10:03:52 > (((==) `on` length) <*> nub) (permutations "sgeo") 10:03:53 True 10:03:55 > (((==) `on` length) <*> nub) (permutations "baby") 10:03:56 False 10:03:58 oh wait no 10:04:01 mesed that one up 10:04:03 confused myself 10:04:12 wait no 10:04:16 did not mess 10:04:21 double confused ;_; 10:04:25 you want the ap to be on length I would think. 10:04:36 ?? 10:04:37 :t on 10:04:38 forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c 10:04:54 oh nevermind 10:05:03 no that's correct. 10:05:51 I want a whole suite of preposition functions. 10:06:14 like what 10:06:15 on, in, around, about, for, with, without 10:06:33 but what would they do 10:06:43 what they say duh. 10:07:00 ok 10:07:25 -!- azaq23 has quit (Ping timeout: 260 seconds). 10:07:27 obviously [] `around` [1,2,3] is [[1,2,3]] 10:07:31 >_> 10:10:54 -!- Wamanuz has quit (Remote host closed the connection). 10:11:23 -!- Wamanuz has joined. 10:11:24 typeclass Match a b where { (===) :: a -> b -> Bool } 10:11:27 *class 10:11:47 now you can have the clusterfuck that is Perl's ~~ (aka "smart match") operator 10:11:57 in the form of like 10 instance declarations. 10:12:44 also can you do things like this in an instance declaration 10:13:03 instance (Eq a) => Match a a where (===) = (==) 10:13:30 with one of those typeclass extensions? 10:14:54 I'd find it more elegant to have an isomorphism (or something more general in a good way not a stupid way) typeclass and define (===) in terms of its operations and (==) 10:14:59 elegant and useful 10:15:26 that is not how Perl's smart matching works. :P 10:15:38 it's DWIS equality. :P 10:15:47 er DWIM 10:16:08 perl the most elegant language 10:16:09 so there's not really a generalization. 10:16:30 nor a haskell implementation 10:16:41 CakeProphet: MultiParamTypeClasses for Match, FlexibleInstances for that instance (because it uses 'a' twice) 10:16:44 I just showed you how it could be done. 10:18:01 I guess yours accounts for cases wherein an isomorphism doesn't exist but you still want thinks to be considered equal, but this is operation is dumb and nobody should want it ever 10:18:24 I mostly use it because it provides a quick way to test list membership in Perl 10:18:34 (1,2,3,4) ~~ 2 is true 10:18:54 ew 10:18:55 so 10:19:05 instance Match [a] a where ... 10:19:12 instance Match a [a] where ... 10:19:35 `elem` sure is a lot of typing 10:19:39 ​/home/hackbot/hackbot.hg/multibot_cmds/lib/limits: line 5: exec: elem`: not found 10:19:47 also you'd need an Eq a => in there 10:19:51 monqy: yeah because I totally think this is a viable thing in Haskell 10:19:58 or equivalent 10:20:00 and not just a thought experiment on how I would implement such a thing. 10:20:32 if I were you I'd probably go about implementing it in something along the lines of syb, such as not to have to define instances for every pair of types 10:21:16 also regexes do regex matching stuff 10:21:53 I think list ~~ list is intersection for some reason 10:23:58 so that means it couldn't return Bool 10:24:20 it would need to return some kind of special data type or Either if there's only two kinds of result 10:24:36 or Dynamic. :P 10:25:10 intersection? not set equality? sure isnt doing what id mean...... 10:25:30 -!- Phantom_Hoover has joined. 10:25:49 or you could include the result type as a third typeclass param. 10:25:55 for great fun. 10:26:11 should just name it TripleArgumentFunction instead of Match 10:26:23 where by set equality I mean something like ((==) `on` Data.Set.fromList) or ((==) `on` Data.List.Ordered.nub . sort) or something like that 10:26:23 er TwoArgumentFunction rather 10:26:47 at least I think there's a package that provides Data.List.Ordered 10:27:28 Data.List.Ordered.nub = map head . group 10:28:11 her is the Grand Smart Matching table: http://perldoc.perl.org/perlsyn.html#Smart-matching-in-detail 10:29:49 so list ~~ list is true if all elements ~~ to true with the element of the same index in the other list. 10:30:13 that works too I guess 10:31:05 obviously it's a very straightforward operator. 10:32:25 array ~~ function is like all in Haskell 10:34:41 CakeProphet, ~~ is the terrifying, ill-defined operator in Perl, right? 10:36:20 well, it has a definition, but yes it's somewhat terrifying. 10:36:35 it is defined by a huge table of which pairs of types results in what. 10:36:46 most of it makes some kind of intuitive sense. 10:38:09 it has a definition, but it's not a good one 10:38:11 hence ill-defined 10:38:58 where by good I mean "not just a bunch of stupid special cases" 10:41:44 also none of them are technically special 10:41:46 just... cases. :P 10:42:16 they are all special like snowflakes they are special snowflakes 10:42:44 Ruby's === isn't particularly like ~~, is it? 10:43:11 === is the switch-case operator 10:43:19 similar but I don't think it's identical 10:43:42 well, ~~ is also the switch-case operator in Perl so... 10:43:48 yeah it's derived from that. 10:44:12 but I do not know how it works exactly. 10:45:14 most of what ~~ does is already pretty short code so it's kind of pointless other than it provides a somewhat nice switch-case mechanism. 10:47:37 hash ~~ array intersects the hash keys with the array elements 10:47:51 I guess that's kind of useful. 11:13:18 http://www.garshol.priv.no/download/text/perl.html 11:13:36 a very lengthy article about why Perl is bad, written by someone who obviously has very little experience with Perl. 11:14:41 and then starts talking about why Python is awesome 11:16:12 i like how he uses a paul graham quote in introducing python 11:16:56 I don't think you get to complain about manipulating complex data structures in Perl if you can't even do it properly. 11:17:11 though perhaps that's part of his argument. that stupid people can't figure it out. 11:20:07 -!- monqy has quit (Quit: hello). 11:41:49 -!- azaq23 has joined. 11:46:04 -!- Lymee has quit (Read error: Operation timed out). 11:57:55 Anyone know what the contact legs on chips are made from? 12:05:38 -!- Tritonio has quit (Read error: Connection reset by peer). 12:09:53 all i can find is that the contacts on RAM are gold-plated. possibly aluminum or tin. 12:10:38 something that either doesnt corrode or coated with same 12:12:58 Argh, I went for steel. 12:56:14 -!- Necrosporus has joined. 12:58:26 -!- Necrosporus has quit (Quit: Leaving). 13:02:16 -!- Necrosporus has joined. 13:03:43 http://paste.org.ru/?lu3vtb 13:03:57 Do you like it? What' sthat at your opinion? 13:04:33 -!- loje has joined. 13:10:09 -!- loje has quit (Ping timeout: 240 seconds). 14:20:16 -!- Patashu has quit (Ping timeout: 240 seconds). 14:20:22 :t (.)(.) 14:20:22 forall a b (f :: * -> *) (f1 :: * -> *). (Functor f, Functor f1) => f1 (a -> b) -> f1 (f a -> f b) 14:20:40 :t (.) 14:20:41 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 14:20:51 That... what. 14:20:57 @type (.) 14:20:58 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 14:21:13 That's fmap... 14:21:31 -!- copumpkin has quit (Quit: Computer has gone to sleep.). 14:23:11 fmap is a generalization of (Prelude..) and Cale decided that lambdabot should have (.) be generalized as well 14:23:35 For this, and other reasons, lambdabot's Haskell dialect is generally known as Caleskell. 14:23:44 ?ty (++) -- Another example 14:23:45 forall m. (Monoid m) => m -> m -> m 14:24:49 fmap is a generalisation of .? 14:25:37 (Prelude..) is fmap but limited to the (a->) functor 14:25:47 Yeah, I was coming to that conclusion. 14:25:54 > fmap (+1) (*2) 3 14:25:55 7 14:26:08 > (Prelude..) (+1) (*2) 3 14:26:09 Not in scope: `Prelude..' 14:26:15 Bah. 14:26:18 ?ty (Prelude..) 14:26:20 forall b c a. (b -> c) -> (a -> b) -> a -> c 14:26:26 > (Prelude.(.)) (+1) (*2) 3 14:26:33 > (Prelude.(.)) (+1) (*2) 3 14:26:33 Not in scope: data constructor `Prelude' 14:26:34 The syntax is (Prelude..) 14:26:58 I guess it's just missing a qualified import of Prelude 14:27:05 Or then it's using a modified Prelude. 14:46:30 -!- copumpkin has joined. 14:58:39 -!- MSleep has changed nick to MDude. 15:33:26 -!- Phantom_Hoover has quit (Ping timeout: 245 seconds). 15:54:23 -!- nooga has quit (Ping timeout: 264 seconds). 16:14:06 -!- pumpkin has joined. 16:14:33 -!- copumpkin has quit (Ping timeout: 240 seconds). 16:22:59 -!- Phantom_Hoover has joined. 16:30:31 -!- pumpkin has changed nick to copumpkin. 17:34:52 -!- Wamanuz has quit (Read error: Operation timed out). 17:35:26 -!- Wamanuz has joined. 17:47:05 -!- elliott has joined. 17:49:29 hi 17:49:29 elliott: You have 11 new messages. '/msg lambdabot @messages' to read them. 17:49:35 help 17:51:11 thank you...everyone... i think ... 17:55:02 elliott, says the one who has, on multiple occasions, left 20+ messages in my lambdabot inbox. 17:55:22 @tell Phantom_Hoover spamo 17:55:23 Consider it noted. 17:55:24 @tell Phantom_Hoover spamo 17:55:24 Consider it noted. 17:55:27 >_> 17:56:33 -!- augur has joined. 17:58:55 -!- pumpkin has joined. 17:58:56 So, who wants to continue my dramatic effort at a tweetable interpreter for a TC language in C? 17:59:01 -!- pumpkin has quit (Changing host). 17:59:01 -!- pumpkin has joined. 17:59:11 I have a tweetable interpreter for a TC-flavored language with restricted addressing >_> 17:59:19 -!- pumpkin has changed nick to copumpkin_. 17:59:20 Nice FSM 17:59:36 Yeah, exactly :P 17:59:44 Here's my FSM in a tweet 17:59:48 main(){return 0;} 18:00:05 char*a,b[9999];main(){gets(a=b);while(*a)a+=(a[*a]-=a[a[1]])?3:a[2];puts(b);} 18:00:06 Gregor: You have 7 new messages. '/msg lambdabot @messages' to read them. 18:00:07 OK, OK, you say, but how do I get it to loop?? 18:00:16 main(){if(getchar())for(;;);return 0;} 18:00:27 Gregor: What 18:00:34 Who spammed Gregor X-D 18:00:43 -!- copumpkin has quit (Disconnected by services). 18:00:46 -!- copumpkin_ has changed nick to copumpkin. 18:00:52 elliott: Phantom_Hoover sez "By the way, two messages does not a spam make." 18:01:01 Of course, replace those " "s with \n/msg lambdabot @tell Gregor 18:02:51 But anyway, my subtract-and-branch-if-zero is pretty sweet, and plenty tweetable at 77 characters, but can only address 256 bytes :P 18:02:58 00:10:38: * Sgeo wants wget to ignore robots.txt >.> 18:03:04 Obviously it is impossible to make wget do this. 18:03:23 Gregor: I would be OK with it if it could address, like, at LEAST a gigabyte :P 18:03:31 And if there was a way to do so, it would be far too secret to include in the man page. 18:03:32 Phantom_Hoover: You have 2 new messages. '/msg lambdabot @messages' to read them. 18:03:33 elliott: Pffffffffffffff 18:04:02 void main(int c,char **v){((void(*)(void))v[1])();} 18:04:16 kmc: UB 18:04:21 i know 18:04:22 kmc: omg u so klevr 18:04:32 kmc: Come back when you have a C program :P 18:05:06 elliott, I figured out how to do it 18:05:19 void main(){system("gcc /dev/stdin&&./a.out");} 18:05:32 kmc: omg u so klevr 18:06:24 kmc: Implementation-defined behaviour :P 18:07:38 Incidentally, mine has /relative/ addressing of 256 bytes, so it can, in fact, access more, but only a 256 byte area around the pc. 18:08:02 Gregor: Hmm, I wonder if that's TC (modulo C's limited addressing)? 18:08:08 You just have to move around a lot. 18:08:31 elliott: I'm fairly certain it's not, since the area you're moving around in is also where the program is, so you'll very quickly run out of space for both your program logic and your actual data. 18:08:49 (Maybe, that's not a real argument of course) 18:09:15 Gregor: I kind of feel like you could implement a simple TC language by having a really small program that can self-modify quinelike and move around the actual data... 18:09:28 That's the fancy-L problem, though 18:09:34 elliott: But the program and data aren't separate. 18:09:41 (http://esolangs.org/wiki/%E2%84%92) 18:09:44 Gregor: Indeed 18:11:45 * Gregor starts vaguely wondering if a subleqalike can make any sense at all if the program and data are separate. Conclusion: lolno. 18:19:15 I also made input and output a requirement in my original design of this :P 18:20:09 Do you even have a twatter. 18:21:59 Probably? :P 18:28:18 Is EOF equal to a value other than -1 on any system anywhere? >_> 18:28:27 (It's totally lame to assume it's -1, but it would help me SO MUCH) 18:29:07 Is EOF equal to a value other than -1 on any system anywhere? >_> 18:29:12 Yes, C-compliant DS9ks 18:29:15 It's <0, though 18:29:26 Friggin' DS9k! :P 18:29:42 Phantom_Hoover: oh my god DS9's computers run DS9k 18:29:42 That still leaves me with (...)>=0 :( 18:29:49 Which is a lot more characters than +1 18:29:54 Gregor: try using a bit-and? 18:29:59 somehow??? 18:30:00 Has anybody written a C DS9K yet? 18:30:09 Deewiant: They're too busy being real systems 18:30:28 elliott: In less characters than ()>=0? :P 18:30:29 I'll take that as a no 18:30:52 Gregor: Why do you need the () there but not in the +1 18:31:16 Deewiant: I have some plans for such a system but it's too large an undertaking for me to bother 18:31:17 Deewiant: The bit here is while (*++a=getchar()+1) if EOF == -1 18:31:26 Deewiant: a is an int * here 18:31:28 Deewiant: You basically need to keep all the types and the like around to be fully pedantic about it 18:31:31 (I'm trying to give it a bigger range) 18:31:40 And you want pointers' representations as integers to be completely fucked up so that nothing works on them 18:31:55 (Perhaps have a pointer-integer type so you can yell whenever the program tries to arithmetic on them then cast it back) 18:32:01 elliott: Doesn't matter, everything is int *, nothing is ever accessed char-wise. 18:32:05 elliott: Absolutely 18:32:09 Gregor: ? 18:32:12 I'm talking about ds9ks 18:32:15 Oh, sorry, I thought you --- yeah :P 18:32:22 Deewiant: The great thing is, it would actually make a useful debugging system :P 18:32:26 elliott: I figure it'd be... yeah 18:32:29 Because you could provide _really_ helpful error messages at runtime. 18:32:44 Downside: Really slow, but probably not slower than, like, Ruby, so whatever. 18:32:53 elliott: So it can just say things like "Undefined behaviour #1234: casting a function pointer to a pointer" or whatever 18:32:57 Also you couldn't provide any libraries that make incorrect assumptions i.e. most of them. 18:33:00 Preferably it would still work 18:33:11 int*a,b[9<<20];main(){a=b;while(scanf("%d",++a)>0);while(*a)a+=(a[*a]-=a[a[1]])?3:a[2];while(a>b)putchar(*--a);} <-- sexy :P 18:33:12 So that it could just keep going and outputting more errors 18:33:23 Deewiant: If it still works, then it has to use a less rich internal representation, which leads to fewer errors being caught 18:33:28 But it might be that you have to break everything to.. yeah 18:33:40 It could work for some things but probably not for function pointers → pointers 18:33:44 It feels like there should be... yeah 18:33:46 Because function pointers should contain arity and type information 18:33:48 Deewiant: ...yeah 18:33:54 Dammit, stop preëmpting what I say 18:33:58 Deewiant: Although you could have a function-pointer-pointer type that acts like a pointer but still carries that information :-) 18:34:03 Then you need a function-pointer-pointer-integer 18:34:25 Deewiant: What about that project that's doing an abstract interpreter of C 18:34:28 K90 or something? 18:34:31 Klee? 18:34:37 It was something involving K 18:34:53 IIRC they don't have several important valid things 18:34:55 Klee is the symbolic VM for LLVM 18:35:06 http://klee.llvm.org/Tutorial-1.html ;; This is cool, but no. 18:35:32 Deewiant: It was literally translating the abstract semantics of C to something machine-readable, IIRC 18:35:34 Well, for C, but I suppose you can theoretically use it with anything LLVM 18:35:42 Deewiant: And had this massive test suite or something 18:36:20 I can't seem to find it :/ 18:37:23 Deewiant: I have a feeling it's impossible to detect all such bugs, though 18:37:39 -!- Lymee has joined. 18:37:52 elliott: http://www.softlab.ntua.gr/~nickie/Thesis/ related? 18:37:56 Like, either you reject valid programs (does complicated sizeof-related tricks but it turns out that it's provably OK for every valid sizeof) or they slip through the cracks 18:38:12 Deewiant: I don't think so, it was much more recent than that, but maybe I'm wrong 18:38:15 It was something you could actually run 18:39:05 Oh wellz, can't find it either 18:39:23 And yeah, you can't detect all bugs 18:39:30 Halting problem should be enough to prove it :-P 18:39:57 But you can probably reject just about every nontrivial C program and that's enough for me 18:40:54 Deewiant: Hey, I try very hard to stay within semantic limits 18:41:37 Deewiant: When I was working on mcmap's Guile branch I left a long comment when I assumed a SCM could be casted to a (void *), despite the fact that any non-pointer representation would be insane, and that (void *) was incredibly tied into the current Guile implementation 18:41:44 Because, hey, it COULD be an integer index into a heap :-P 18:41:51 That's... bigger than a pointer? 18:42:02 Hell, could be a function pointer 18:42:41 Do you typically take into account that INT_MAX might be 32767 and that increasing an int past that is UB? 18:43:13 Deewiant: BTW, how does mushspace do the caching of the "currently relevant" array? Just stores a global masked x/y and checks the masked x/y of the "lookup cell" function is the same before hashtable lookups? 18:43:26 There's a separate cursor structure 18:43:33 Deewiant: And I'd consider making an increment past 32767 a user error 18:43:34 Which you use if you want to cache where you are 18:43:38 -!- ralc has joined. 18:43:43 (That's one thing you can't catch generically, incidentally) 18:44:06 Deewiant: So much for your minimal API :P 18:44:16 It's a separate thing 18:44:46 It's more like iterating over the structure than doing individual accesses 18:44:49 That is not implementable ideally without using the internal structure details 18:44:58 Unless you expose a way to get an array out? 18:45:06 No, cursor is complicated 18:45:24 Eh? 18:45:46 I'm saying that I couldn't implement my own cursor with the same efficiency using your public API sans cursor, so it is part of the core :P 18:46:03 Yes, agreed 18:46:27 But my point was that it's a (fairly) minimal API for what it does 18:46:33 Deewiant: But that would be resolved if you provided a way to go from (x,y) -> array, I think? 18:46:44 Unless I totally misunderstand how your fungespace works 18:46:56 I don't think that'd suffice 18:47:02 -!- fizzie has joined. 18:47:12 You also need at least the bounds in that array that you're allowed to access 18:47:32 Both (x,y) and (start_idx,end_idx) 18:48:01 And then for multidimensional cases you need the full AABB data, i.e. width/area so you can stride properly between start_idx/end_idx 18:48:21 And then you might run into the hash table 18:48:28 No, it's too complicated :-) 18:48:46 It's the next thing I need to C-ify 18:49:04 Back 18:49:18 -!- boily has quit (Quit: WeeChat 0.3.5). 18:49:28 lololol @ "BUGS" section in malloc(3). 18:49:31 Deewiant: Maybe you should expose an internal AABB API that the public API is based on :P 18:49:35 Somebody doesn't like Linux's overcommit behavior :P 18:49:46 Gregor: Overcommit is utterly stupid 18:49:57 "In case Linux is employed under circumstances where it would be less desirable to suddenly lose some randomly picked processes, ..." 18:50:05 Unfortunately it's the easiest way to achieve a heap with nice properties 18:50:10 So I can't really turn it off 18:50:17 (SBCL uses it f.e.) 18:51:29 elliott: I'd rather make the whole thing as opaque as possible 18:51:31 Isn't there a a /proc/ thing that can turn it off? 18:51:53 Yes, /proc/sys/vm/overcommit_* 18:52:28 Anyway, int*a,b[9<<20];main(){a=b;while(scanf("%d",++a)>0);while(*a)a+=(a[*a]-=a[a[1]])?3:a[2];while(a>b)putchar(*--a);} 18:52:56 Do you think sysadmins remember to do that? 18:53:33 Deewiant: That's why it'd be an internal thing :P 18:53:47 Deewiant: i.e. subject to change whenever the internal representation does 18:53:56 (But more stable than poking members directly) 18:54:15 elliott: I'll add it when somebody needs it :-P 18:54:21 Deewiant: You do, see cursor.c :P 18:54:40 I can poke members directly? 18:55:34 Deewiant: Well, I don't know how cursor.c works, but we've established it isn't implemented with the API 18:55:38 So there is surely some . or -> in it 18:55:49 -!- zzo38 has joined. 18:55:52 Yes, exactly 18:55:54 And I can do that 18:55:59 So I don't need an "AABB API" 18:56:04 Because I can just do aabb->foo 18:56:13 And not worry about breakage 18:56:26 Deewiant: Yes, but you need the AABB API, you're just working around it by doing fragile things 18:56:37 And taking advantage of your enviable maintainer position to ensure it doesn't break 18:56:38 This is the kind of thing that is supposed to be fragile 18:56:45 My character set has a left-facing swatstika but not a right-facing one. 18:56:47 -!- azaq23 has quit (Quit: Leaving.). 18:56:51 *sigh* 18:56:54 If I mess with the internal representation of mush_aabb I really do need to rethink everything :-P 18:57:23 Phantom_Hoover: Heh. 18:57:29 Which one is the one the Nazis used? 18:57:41 The Nazis used the 45-degrees rotated one 18:57:54 thanks 18:58:13 Right-facing. 18:59:48 http://en.wikipedia.org/wiki/Strafgesetzbuch_%C2%A7_86a 18:59:53 Way to free speech, Germany. 18:59:59 Phantom_Hoover: BTW, s/character set/font/ 19:00:06 elliott, erm, yes. 19:00:09 Also, you don't know about that? 19:00:19 I did. 19:00:30 Although I didn't know the precise nature of the law. 19:00:51 "In late 2005 police raided the offices of the punk rock label and mail order store "Nix Gut Records" and confiscated merchandise depicting crossed-out swastikas and fists smashing swastikas." 19:00:52 Pro. 19:01:35 http://en.wikipedia.org/wiki/File:98-animate.gif Surely there are easier ways to accomplish this. 19:02:02 I really want to punch these people, which distresses me because I don't really like people who want to punch people. 19:03:08 I don't think you can blame them for wanting to de-nazificate in the forties, but it's long-obsolete by now of course. 19:03:18 And obviously hasn't stopped neo-Nazis. 19:04:00 Hmm, I don't know if I like zenburn. 19:05:14 Has anyone here used Scion with Emacs? I suppose that's vanishingly unlikely. 19:14:08 Neo-Nazis should use symbolism common German alphabetic in order to show problems with these laws 19:15:14 And the Swastika does not even necessarily have to do with Nazi, even though the Wikipedia article says the law applies to all forms. 19:22:31 I have read that Supero makes a Haskell code as fast as C, but it is still experimental 19:23:37 Some stuff from Supero is now in GHC IIRC 19:23:47 I may be wrong 19:23:48 But similar things 19:24:13 The swastika has been stigmatized by the nazis. But the history of it is probably complicated full of many twists and turns through various cultures. 19:24:45 i was in a discount shop here in germany today 19:24:57 and they had those clothes racks in shape of a swastika 19:25:08 Then again I guess it's not a debate of historical accuracy. 19:26:35 i should just stay out of this one 19:27:00 Maybe there should be a compiler option to tell it to also make small system small executable file omitting a lot of things not required for operation of the program. 19:27:39 I don't know how Supero compares in memory and file size; they only show that the speed is as fast as C. 19:32:26 -!- oerjan has joined. 19:34:50 Deewiant: Re: my circular dependencies, I asked Haskell and apparently the only decent solution is to put everything in Types/Internal.hs; for each type, have Types/Internal/T.hs that imports Types.Internal and just re-exports T(..) with all constructors, and ensure these are the only modules that import Types.Internal; have Types that imports Types.Internal and just re-exports the external API; and have each individual T module import Types.Inte 19:34:50 rnal.T. 19:35:09 A solution almost as elegant as the reciprocal of how many files it produces. 19:35:47 :-D 19:36:22 Having said that, I'd only have two Types.Internal.Foo modules to start with... but it's a slippery slope. 19:37:00 Deewiant: The other solution was to not use a global Types thing, but just turn anything circular into a type parameter, meaning I need newtype wrappers for the actual usage. :-| 19:38:32 Hmm, how does that work? 19:39:05 Deewiant: module A where {import B; data A = A B;}; module B where {import A; data B = B A;} 19:39:07 --> 19:39:37 module A where {data A b = A b;}; module B where {import A; data B = B (A B);} 19:39:56 It's not quite a newtype-wrapper, but eurgh, that's even worse than exposing constructors I shouldn't; it's exposing the structure itself. 19:40:15 But doesn't A need to use the API of B 19:40:43 Put that in the structure? :-) 19:41:16 22:33:09 My dad thought that my eye could get infected like that 19:41:16 22:33:32 (By touching the eyeball if my hands weren't really really really clean) 19:41:17 Deewiant: You could still split them up into Types modules but just have one Types.Internal.X for each type, and then you don't need a Types.Internal, just a Types that re-exports the public interface and I guess defines the instantiations of the type variables 19:41:18 But ugh 19:41:30 oerjan: thank you, I was going to logread but now I won't 19:41:34 I mean, you have something like module A where f :: A -> Int; f (A b) = g b 19:41:53 And now you have f :: A b -> Int; f (A _) = error "derp" 19:41:54 _could_ may be the operative word here. i've done that thousands of times. 19:41:57 Deewiant: I meant put "g" in the structure but that was facetious. 19:42:01 Like I said, 19:42:02 Deewiant: You could still split them up into Types modules but just have one Types.Internal.X for each type, and then you don't need a Types.Internal, just a Types that re-exports the public interface and I guess defines the instantiations of the type variables 19:42:43 Right, but if you do that you might as well go with the earlier solution 19:42:52 although come to think of it, my eye _does_ tend to get irritated if i don't wash my hands first. 19:42:53 Yeah (this one's less files though) 19:43:49 (also if the speck or eyelash is damn hard to get hold of) 19:44:32 also i sometimes pluck nosehairs, which i hear risks me getting an infection in my nose spreading to my brain or something. 19:46:03 Only if you pluck them all or something, I think 19:46:30 Point being that they're there for a purpose but ±1 hair obviously shouldn't make a difference 19:46:41 * elliott systematically starts plucking all his nose hairs. 19:46:46 Pretty much the best way to commit suicide I can think of. 19:48:07 Wikipedia says there's no evidence for it being dangerous, d'oh 19:48:13 elliott: i minimize it somewhat by using my electric razor instead. 19:48:38 also you are far too young to have significant nose hair. 19:49:08 Sorry but your lawn is comfortable. 19:49:18 wat 19:49:23 I am not getting off it, 19:49:39 ok, but then you better start mowing. 19:50:17 I'll use an electric razor 19:51:46 reminds me of my "russ" year, where we had silly assigned tasks, one of which was to cleanse the town square pavillion with a toothbrush. 19:52:44 Deewiant: FWIW, the main interdependency is due to fingerprints 19:53:18 elliott: also why are you not taking my `addquote bait. 19:53:20 Deewiant: IPs have to hold loaded FP instructions (which obviously include Shiro monadic actions), and Shiro is StateT FungeState IO, and FungeState has to contain IPs 19:53:29 oerjan: Which line 19:53:53 at least a couple of them, i think 19:54:16 oerjan: sorry im, not smart 19:54:35 `addquote ALL THE LINES 19:54:38 637) ALL THE LINES 19:54:46 * oerjan whistles innocently 19:54:51 `delquote 637 19:54:52 * elliott cries 19:54:53 ​*poof* 19:54:55 :( 19:55:05 what do you want me to addquote :( 19:55:28 ...if you cannot see it yourself then it probably isn't good enough anyhow. 19:57:00 you think too highly of my opinions, 19:57:10 is it the mowing one... 19:57:15 is it the far too young one...help 19:57:35 neither of those, but if you think they fit... 19:58:03 is it toothbrush anecdote, 19:58:10 the "also i sometimes pluck nosehairs" is the one where i started wondering if someone would addquote it 19:58:12 is it although come to think of it, my eye _does_ tend to get irritated if i don't wash my hands first. 19:58:12 help 19:58:21 oerjan: o 19:58:25 i thought about, that one, 19:58:26 and the toothbrush one too 19:58:31 but i thought it was too much like usual you... 19:58:35 heh :P 19:58:51 -!- Slereah has joined. 19:59:49 -!- GuestIceKovu has quit (Ping timeout: 276 seconds). 20:04:10 is CakeProphet still idle 20:04:28 > let permuts = permutations "baby" in (length . nub $ permuts) == (length permuts) 20:04:55 because i could tell him that is True for a finite list iff it has no duplicate elements 20:05:55 and also that compiling to ghc core may be awkward because there is no easy way to compile _from_ it 20:06:01 that is probably his intention, no? 20:06:12 what is 20:06:15 because i could tell him that is True for a finite list iff it has no duplicate elements 20:06:32 and whatever he's doing, if he's planning on compiling to ghc core: ha ha ha ha ha ha ha 20:06:52 03:41:25: zzo38: because it is really crappy. 20:06:54 hint is not really crappy. 20:07:13 elliott: i have for a few months now since i discovered the reflection package thought that it _really_ needs to be written in core. 20:07:33 with the new ghc plugins, maybe it would even be plausible to achieve 20:07:59 oerjan: hmm, what would it do as core? 20:08:59 ...create a typeclass dictionary _directly_ rather than via ridiculously convoluted whatchamacallit in the type system 20:09:16 CakeProphet: I am 99 percent sure the limiation of hint there is a limitation in _GHC_, not in hint. 20:09:30 (whatchamacallit represents a simple word which my brain refuses to remember) 20:09:33 You could make a symlink to an FD and try and load that. 20:09:48 oerjan: coercion? casting? 20:10:00 no, much worse 20:10:05 oerjan: unsafeness? 20:10:22 oerjan: but I didn't know Core could create typeclass dictionaries. Hey, I wonder if reflection's implementation solves the problem I had with my hack? 20:10:36 those are not _inefficient_ per se. what it does is ridiculously roundabout. 20:10:54 oerjan: (did you see that hack?) 20:11:01 (I'm convinced I could make it work reliably somehow...) 20:11:05 elliott: well i'm _assuming_ core must be able to, since haskell sometimes requires generating them on the fly 20:11:20 e.g. with polymorphic recursion 20:11:23 um it does? surely not report Haskell, iirc with report Haskell typeclasses can be eliminated at runtime entirely 20:11:38 I know they can't with GHC, but I'd be surprised if they needed to be _created_ at runtime 20:11:40 no they cannot, not when there is polymorphic recursion 20:11:41 rather than just passed around 20:11:48 oerjan: can you do polymorphic recursion in report haskell? 20:12:03 yes. you just need an explicit type declaration 20:12:09 ok then 20:12:14 oerjan: (http://hpaste.org/50760 is the hack I am referring to) 20:12:17 the main function works if you do 20:12:20 main = a >> b 20:12:23 where a and b are the two statements there 20:12:49 the idea, if that worked, was to define some TH stuff to define the GADT for an arbitrary specified class, and the functions 20:13:15 oerjan: I think it could also let you create dictionaries at runtime, actually 20:13:26 if a class contains (a :: T) and (b :: S), then you need 20:13:33 erm, and has type parameter t 20:13:35 then you need 20:13:45 newtype Runtime = Runtime { value :: t, _a :: T, _b :: S } 20:14:00 instance Runtime where a = _a; b = _b 20:14:03 hmm with some things to unwrap the value 20:14:13 I guess it might not be doable exactly like that but I think you can achieve it in general 20:14:19 anyway, it's a cool hack :P 20:14:39 elliott: well reflection is stronger since it generates a dictionary containing an actual _value_ in it 20:14:58 stronger than unsafeCoerce? :P 20:15:09 yes. 20:15:17 well, possibly. 20:15:30 oerjan: I think I could achieve the same thing, really, with a combination of that runtime method plus unsafeCastD, but maybe I'm wrong 20:15:38 ShowD a is basically a reification of the show dictionary there, after all 20:16:00 and I believe you can define 20:16:08 ExplicitShow -> ShowD, ShowD -> ExplicitShow 20:16:11 where ExplicitShow is 20:16:22 erm, add type parameters there 20:16:26 data ExplicitShow a = ExplicitShow { explicit_show :: a -> String } 20:16:39 which is all you need to do generate an instance at runtime. 20:16:50 so the only problem is that mine breaks if you don't separate out each relevant statement :D 20:16:53 I think I need to twiddle with the inliner 20:17:04 I wish core wasn't so damn hard to read 20:17:16 huh, it is actually doing some inlining here 20:17:33 litD :: ShowD String 20:17:33 litD = unsafeCastD (ShowD :: ShowD Lit) 20:17:39 does that actually _work_? 20:17:53 oerjan: yes. read the comment: it works in GHCi 20:17:55 and if you change main to 20:17:58 main :: IO () 20:17:59 main = a >> b 20:17:59 a = print "Hello, world!" 20:17:59 b = withInstance litD $ print "Hello, world!" 20:18:00 that works too 20:18:11 (it isn't really a GHCi problem, more a global-vs-subexpression problem, I think) 20:18:22 because the do statement that is main has the incorrect behaviour in ghci too. 20:18:37 oerjan: but yes, it works, proving that ShowD is a bona-fide dictionary at runtime 20:18:54 and ofc newtypes have identical representation, so the Lit instance is "another" Show instance for String 20:20:22 elliott: i vaguely recall implicit parameters supposedly have similar problems in some uses 20:20:30 -!- ralc has quit (Ping timeout: 260 seconds). 20:21:23 oerjan: you mean implementation difficulties or actual runtime bugs? 20:21:26 and they are of course the closest thing ghc has to a _supported_ runtime value-wrapping dictionary 20:21:59 elliott: i think i mean unintuitive differences between expressions that _should_ behave the same 20:22:37 right 20:22:45 I read in the manual about how adding a type signature can change the result 20:22:48 which is gross 20:23:39 elliott: anyway your ShowD still doesn't allow you to wrap a runtime-constructed value into a dictionary, i think. you can replace a dictionary with a different one, but it still must be compile-time defined. 20:24:04 reflection gets around that by essentially defining _all_ necessary dictionaries at compile-time 20:24:32 and using type system calculations to choose the right one 20:24:43 Reflection? 20:24:47 As in Data.Reflection? 20:24:49 oerjan: um no, I _told_ you you can explicitly do it at runtime 20:24:55 Sgeo: a hackage package 20:24:56 and I believe you can define 20:24:56 ExplicitShow -> ShowD, ShowD -> ExplicitShow 20:24:56 where ExplicitShow is 20:24:56 erm, add type parameters there 20:24:56 data ExplicitShow a = ExplicitShow { explicit_show :: a -> String } 20:26:09 oerjan: it probably requires lots of unsafeCoerce to do, but I believe it's perfectly possible 20:26:25 elliott: you figure that out then >:) 20:26:52 maybe one could do a more efficient implementation of reflection that way, then 20:27:20 hmm, it's certainly rather tricky :) but I _think_ it's possible 20:27:28 it might have to be 20:27:34 ExplicitShow a -> ShowD (Wrapper a) 20:27:41 oerjan: would that still lead to an efficient reflection? 20:27:49 -!- sllide has joined. 20:28:15 hm I suppose not, that's a rather obvious instance after all 20:28:16 but maybe 20:28:29 I suppose I should ask what the runtime representation of dictionaries is like? 20:31:03 i suppose it would be obvious from the core, i haven't tried testing it 20:31:29 nothing is obvious from Core :) 20:32:03 also a polymorphic recursion case to show how values or at least subdictionaries are put into them 20:32:11 oerjan see he core. he has the power. 20:32:44 data Tree a = Leaf a | Tree (a,a) deriving Show would be a good example, i think 20:32:51 I found in some foot-shooting list they added how to shoot your foot with Haskell: Make a copy of the entire universe except your foot has a hole. 20:33:34 zzo38: heh 20:34:16 that might be FullBinaryTree, technically 20:35:15 elliott: ^ that should be an example of a Show instance that requires generating new Show instances internally 20:35:28 oerjan: I believe you typo'd 20:35:32 what you have there is not a tree. 20:35:48 elliott: that might be FullBinaryTree, technically 20:36:00 um no, I believe you've made a _big_ mistake. 20:36:04 what you have is Either a (a,a). 20:36:12 ...ah. 20:36:31 *data Tree a = Leaf a | Tree (Tree (a,a)) 20:36:35 that makes more sense :) 20:36:46 I might look at the show instance for that, but anything with constructors is really hideous in core 20:38:06 elliott: maybe the function showLeaf (Leaf a) = show a; showLeaf (Tree t) = showLeaf t might be cleaner? 20:38:21 oerjan: hmm, yes, probably 20:38:29 I'll try that 20:39:42 oerjan: heh, either the dictionary gets inlined somehow, or ghc-core is hiding it from me >_< 20:39:52 ouch 20:40:29 maybe i'm wrong about the construction-on-the-fly then, although how could that be... 20:40:34 oerjan: http://hpaste.org/50901 20:40:51 it's obviously taking in a show instance 20:40:52 ($dShow_aiO) 20:40:58 but it just passes it onto show 20:41:01 it doesn't need to construct anything 20:41:13 it does a worker/wrapper transform by the looks of it so that $dShow_aiO is only passed in once rather than on recursion 20:41:18 lvl_sjs being the worker 20:41:19 -!- monqy has joined. 20:42:56 elliott: no, a_sjx is a constructed Show instance 20:43:16 oh 20:43:24 $fShow(,) is ShowD a -> ShowD b -> ShowD (a,b)? 20:43:27 approximately 20:43:40 probably 20:43:43 oerjan: sounds like I need to define my own tuple type to see what $fShow(,) looks like 20:44:01 hm, right 20:44:41 oerjan: aha 20:45:20 hm? 20:45:45 oerjan: http://hpaste.org/50902 20:45:54 oerjan: I suspect this more be readable without the -O2 I gave it 20:47:06 yeah I have no idea what that is saying. 20:47:19 oerjan: oh hm 20:47:25 oerjan: I should define my own that uses show rather than showsPrec 20:48:07 are these instances of show? 20:48:07 that might be easier to read yeah 20:48:13 CakeProphet: yes 20:48:32 M.$fShowTuple [InlPrag=[ALWAYS] CONLIKE] 20:48:32 :: forall a_abQ b_abR. 20:48:32 (Show a_abQ, Show b_abR) => 20:48:32 Show (M.Tuple a_abQ b_abR) 20:48:32 [GblId[DFunId], 20:48:34 Arity=2, 20:48:35 M. = method? 20:48:36 Unf=DFun(arity=4) D:Show [{M.$fShowTuple_$cshowsPrec}, 20:48:38 {M.$fShowTuple_$cshow}, {M.$fShowTuple_$cshowList}]] 20:48:40 M.$fShowTuple = 20:48:42 \ (@ a_abQ) 20:48:44 CakeProphet: btw this is somewhat vaguely descended from your question about compiling to core 20:48:44 (@ b_abR) 20:48:45 $ = perl? :P 20:48:46 ($dShow_afR :: Show a_abQ) 20:48:48 ($dShow1_afS :: Show b_abR) -> 20:48:50 D:Show 20:48:51 oerjan: ah I see. 20:48:52 @ (M.Tuple a_abQ b_abR) 20:48:54 (M.$fShowTuple_$cshowsPrec @ a_abQ @ b_abR $dShow_afR $dShow1_afS) 20:48:56 -!- elliott has left ("Leaving"). 20:49:00 -!- elliott has joined. 20:49:03 yes I was wondering if I could utilize Haskell bindings if I had a language that compiled to Core. 20:49:04 (M.$fShowTuple_$cshowList @ a_abQ @ b_abR $dShow_afR $dShow1_afS) 20:49:06 flood but w/e 20:49:08 CakeProphet: M is my module obviously 20:49:09 CakeProphet: my comment to which is that ghc makes it very awkward if at all possible to compile _from_ core 20:49:10 oerjan: there you go, that's what they look like in Core 20:49:12 ok let's try that again 20:49:14 CakeProphet: core cannot be compiled 20:49:20 it's not possible 20:49:22 there is no parser 20:49:45 oerjan: http://hpaste.org/raw/50903 20:49:45 none of the other ILs too I imagine? 20:49:54 oerjan: that's what the instance constructor looks like 20:50:04 CakeProphet: Cmm has a parser; in fact part of the RTS is written in Cmm 20:50:22 CakeProphet: Agda compiles to Haskell with a lot of unsafeCoerces 20:50:29 (for "performance") 20:50:32 (it's still slow) 20:50:57 so then I would use Cmm as my target and hope that at that level there's still interfacable bindings. 20:51:17 oerjan: anyway, I suppose this just begs the question of what D:Show looks like 20:51:41 CakeProphet: it won't work well. 20:51:59 Haskell.NET 20:52:46 it would be nice if they redesigned the ILs to support other languages using Haskells awesome libraries for awesome things. 20:52:46 CakeProphet: there is however last (well, the only time) i checked in the ghc API a _very_ rudimentary function for compiling a single module from the _internal_ core representation 20:53:10 but it has a comment to the effect it has only been tested for that case 20:53:20 oh good. 20:53:33 (well had, there's a new ghc version out so things might have improved for all i know) 20:53:39 *may 20:53:39 sounds like a good basis to build a compiler on. 20:56:44 elliott: i suppose D:Show is the constructor for a Show dictionary, which is just passed the methods? also i assume you have the code for M.$fShowTuple_$cshowsPrec etc. in your full output. 20:57:06 essentially any kind of language I build on top of Haskell's environment would be more or less a set of extensions. 20:57:17 but enough to warrant a new language/dialect 20:57:26 oh hey, I could always compile to Haskell. 20:57:45 oerjan: I do have the code but it's boring. Yes, D:Show is the dictionary constructor, which I bet isn't given any real "definition" in Core, but I can define my own class to check. 20:58:38 elliott: why wouldn't it have a definition, i assume Show is a completely ordinary class if you ignore derivations... 20:59:01 it probably is in whatever module defines Show 20:59:27 oerjan: yes, but D: _is_ the class 20:59:39 but OK, I'll define my own class to see 21:00:08 oerjan: yep, at least with ghc-core, D:Aah isn't created 21:00:09 just 21:00:13 M.ooh [InlPrag=[NEVER]] :: forall a_abI. M.Ooh a_abI => a_abI 21:00:13 [GblId[ClassOp], 21:00:13 Arity=1, 21:00:13 Unf=Unf{Src=, TopLvl=True, Arity=1, Value=True, 21:00:13 ConLike=True, Cheap=True, Expandable=True, 21:00:13 Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=True)}, 21:00:15 RULES: Built in rule for M.ooh: "Class op ooh"] 21:00:17 M.ooh = 21:00:19 \ (@ a_abI) (tpl_B1 [Occ=Once!] :: M.Ooh a_abI) -> 21:00:21 case tpl_B1 of _ { M.D:Ooh tpl_B2 [Occ=Once] _ -> tpl_B2 } 21:00:23 and the same for my other method aah 21:00:28 I suspect D:Ooh is "defined" at some other level 21:01:15 a magical land deep below Core 21:01:20 CakeProphet: there is also the new ghc plugin system in the latest version, which i assume does core to core transformations 21:01:30 oerjan: just checked with -ddump-simpl 21:01:36 if D:Ooh is defined in core, it's sure not printed by GHC 21:01:46 oerjan: I suspect, instead, the typeclass info goes into the .hi 21:01:56 ah 21:02:01 and then the actual Cmm or whatever for the class constructor is constructed on the fly 21:02:21 oerjan: otoh, from the way pattern-matching and the like is used in it, I have this _wonderful_ feeling that it might look like a regular data type 21:02:21 i.e. 21:02:28 class Ooh a where { ooh :: a; aah :: a -> () } 21:02:30 might look like 21:02:36 data Ooh a = Ooh { ooh :: a, aah :: a -> () } 21:02:37 at runtime 21:02:54 ...otherwise "case" has special behaviour when you use something prefixed with D: 21:02:55 which is gross 21:03:06 elliott: well afaiu core's System F has no concept of classes and instances, so it should be that way 21:03:10 elliott: ewwwww 21:03:24 CakeProphet: What? 21:03:27 oerjan: indeed 21:03:29 gross. 21:03:31 oerjan: but I mean, it could be unboxed ors omething 21:03:39 CakeProphet: what is? 21:03:52 special cases of case. 21:04:01 elliott: the one thing istr reading is that dictionaries are always unboxed as a whole 21:04:06 CakeProphet: it was just a hypothesis 21:04:31 oerjan: hm well I wish I knew how Core parameter lists worked, because normal parameters seem to be prefixed with @ like (@ a) but the typeclasses aren't 21:04:45 I guess it might mean unboxed 21:05:02 elliott: um @ signifies a _type_ parameter, not a value, iiuc 21:05:06 oh 21:05:11 that makes more sense :) 21:05:16 oerjan: but modulo unboxing, I suspect you can simply define the equivalent (existential) data type for a class and have it be coercable directly to the dictionary type 21:05:27 system F works that way with explicit type arguments 21:05:37 oerjan: ooh, if ShowD looks like (ShowD UnboxedDictionary), then it's boxed 21:05:51 oerjan: and so an explicitly-defined record should have the same runtime representation as ShowD 21:05:53 and be coercable directly 21:06:23 elliott: maybe. but that still leaves the question of getting any runtime value _into_ a dictionary 21:06:24 it is defined by a huge table of which pairs of types results in what. 21:06:29 er what 21:06:36 wrong paste :P 21:06:43 http://hackage.haskell.org/trac/ghc/browser/compiler/supercompile/Supercompile/Core/Syntax.hs?rev=5a142af2955f7cda76c2e63104e7672044cffaa2 21:06:54 is this helpful? I'm guessing it's Core syntax stuff 21:07:02 (which in my understanding is the sticking point which makes all of reflection's hoops necessary) 21:07:05 CakeProphet: not... really 21:07:20 oerjan: I'm still not sure what you _mean_ by that 21:07:21 if you have 21:07:39 data ExplicitShow a = ExplicitShow { show :: a -> String, shows :: blah blah, showsPrec :: blah blah, showList :: blah blah } 21:07:51 and ExplicitShow a -> ShowD a (and assuming ShowD and withInstance work properly) 21:08:05 then how does that not let you put any runtime value in you want? 21:08:07 http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/fc-tldi.pdf 21:09:14 doesn't seem to mention the @ so I guess it's not an exact replica of what GHC uses. 21:11:05 elliott: oh you are assuming dictionaries have the exact same representation as an ordinary record. yeah i guess if you could do that... 21:11:24 (you probably want to at least use seq on that record first) 21:11:26 oerjan: well they are eliminated with "case" in core in the _exact same way_ data-types are. 21:12:11 oerjan: so either case changes behaviour based on something totally gross like whether the name is a class dictionary, or it's equivalent to a data-type, modulo strictness and unboxing 21:12:26 elliott: the CONLIKE pragma, does it mean that the function result is always a strict constructor? 21:12:35 strictness can be controlled, and since my ShowD introduces an additional layer, if dictionaries are unboxed than ExplicitShow should have the exact same representation as ShowD 21:12:43 oerjan: no, that's an inlining thing 21:12:50 CONLIKE means it's safe to duplicate a call at very low cost 21:12:53 istr seeing it before but have forgotten 21:12:55 (this is in the manual) 21:12:57 ok 21:12:59 it's useful for rules 21:13:14 @a is apparently a "type argument" 21:13:15 Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v 21:13:37 CakeProphet: yes, that's what oerjan told me right after I asked :P 21:14:41 >_> 21:14:53 elliott: well since core is supposed to be extremely simple they probably haven't made a distinction unless it's absolutely necessary 21:15:08 oerjan: indeed. so they should, in fact, have the exact same representation 21:15:10 (between data and dictionary) 21:15:14 ?src Show 21:15:15 class Show a where 21:15:15 showsPrec :: Int -> a -> ShowS 21:15:15 show :: a -> String 21:15:15 showList :: [a] -> ShowS 21:15:24 hmm, I hope that ordering is authoritative 21:15:35 seems to be the same in ghci so that's good 21:15:54 why would ordering matter are you doing something icky :( 21:16:08 monqy: yes 21:16:13 :( 21:16:25 elliott: it's the same as in the core you pasted 21:16:30 oerjan: heh, thanks :P 21:16:43 -!- augur has quit (Remote host closed the connection). 21:17:31 monqy: he is going to use unsafeCoerce to convert a record into a class instance :P 21:17:55 oerjan: hm I suspect the fields are _not_ strict 21:17:57 oerjan: you can do 21:18:02 instance Show Blah where show = error "x" 21:18:07 and it works fine until you call show 21:18:11 elliott: indeed 21:18:18 so it's just the record itself that's strict 21:18:48 and the report afair says that undefined methods are treated as, well, undefined 21:19:15 (i think i recently saw that ghc has a specific exception for those though) 21:19:18 oerjan: it works 21:19:21 dear god, it works 21:19:45 *Main> b 21:19:45 *** Exception: help 21:19:49 explicit_lit :: ExplicitShow String 21:19:49 explicit_lit = ExplicitShow 21:19:50 { explicit_showsPrec = error "help" 21:19:50 , explicit_show = \s -> s 21:19:50 , explicit_showList = error "helpList" } 21:19:51 > "*MW" ++ cycle "AH" 21:19:53 "*MWAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA... 21:20:07 er, hm. 21:20:11 but why is it using the showList case? 21:20:26 I guess I should try something that isn't a list type first 21:20:32 you mean showsPrec? 21:20:46 oh 21:20:47 duh :) 21:20:57 ?src show 21:20:57 show x = shows x "" 21:20:58 ?src showList 21:20:59 Source not found. It can only be attributed to human error. 21:21:02 >:| 21:21:36 *Main> b 21:21:36 : internal error: PAP object entered! 21:21:36 (GHC version 7.0.4 for x86_64_unknown_linux) 21:21:36 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug 21:21:36 Process haskell aborted 21:21:38 oerjan: it could be worse 21:21:42 ok, so function members don't work. 21:21:47 "enter" is unsafeCoerce jargon I know. 21:21:48 ::::D 21:21:55 oerjan: maybe function fields do have to be strict, or something... 21:22:14 indeed, error "x" works but \_ -> error "x" doesn't 21:22:23 clearly this is a question for #haskell-in-depth 21:22:37 elliott: insane idea: you might want to convert a Show dictionary _to_ your type so you can use the usual showsPrec and showList from it 21:23:00 that is indeed insane. 21:23:18 CakeProphet: I'm asking #ghc 21:23:31 see elliott get banned from #ghc for life 21:23:31 probably a better place to ask. 21:23:35 oerjan: that would be useful, yes 21:23:43 and might help me find out what the difference in representation is 21:23:49 * CakeProphet is currently waiting for the banhammer 21:24:01 is the excitement in #ghc now 21:24:06 no 21:24:14 *Main> explicit_show (implicit (ShowD :: ShowD String)) "abc" 21:24:14 " 21:24:14 Process haskell segmentation fault 21:24:15 ah. 21:24:19 #esoteric is always the root of the party. 21:24:30 oerjan: ok I should probably try a class that contains some innocuous value rather than a function. 21:24:31 elliott, idea for elliottcraft: http://www.youtube.com/watch?v=ZXxDnx_UE6I (yogscast) 21:25:39 elliott, watch it! 21:25:41 looks nice 21:25:49 yep 21:25:55 not sure it fits in stylistically 21:26:31 elliott, no, but you could do a game like it that was high def in other places too. I think it could work fairly well, and would also avoid "yet another minecraft clone" feel 21:26:44 I don't want it to look like the real world, at least 21:26:49 that boat sure is hd 21:27:25 go underwater dammit 21:27:46 elliott, he doesn't in the video sadly 21:28:06 elliott, I will probably try out that mod tomorrow 21:28:23 should run fine on my high end gpu 21:28:30 indeed, error "x" works but \_ -> error "x" doesn't <-- so this is the same as that difference between data and function for unsafeCoerce, right? 21:28:35 do the squisd like it 21:28:45 no idea 21:28:53 oerjan: I suspect so; I wonder if unsafeCoerce (error "x" :: Int) :: function type works the same way? 21:28:54 I suspect it might 21:28:57 except the ohter way around 21:29:02 elliott, also I think that mod needs a HD texture pack to not be too jarring 21:29:10 * elliott tries strictifying for the hell of it 21:29:45 elliott, I'd also like to see waterfalls 21:29:47 oerjan: wat, now it uses show instead of showsPrec 21:29:54 oh, I think that's correct 21:29:56 print should invoke show, after all 21:30:02 *Main> explicit_show (implicit (ShowD :: ShowD String)) "abc" 21:30:02 " 21:30:02 Process haskell segmentation fault 21:30:06 haksel :( 21:30:18 oerjan: what, then changing show to 21:30:20 \_ -> error "help show" 21:30:22 causes showList to be called 21:30:26 Process haskell segmentation fault <-- how? 21:30:26 oh duh 21:30:27 elliott: um shouldn't you have an argument for the actual value _printed_? 21:30:29 because 21:30:33 strict fields 21:30:34 duh 21:30:38 Vorpal: it's not hard 21:30:43 *Main> b 21:30:43 : internal error: PAP object entered! 21:30:43 (GHC version 7.0.4 for x86_64_unknown_linux) 21:30:43 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug 21:30:43 Process haskell aborted 21:30:46 ok that is definitely not better. 21:30:49 elliott, using some language extension? 21:30:55 Vorpal: unsafecoerce 21:30:57 ah 21:31:06 well okay, no wonder it crashes 21:31:06 elliott: it looks to me like your explicit_show has one argument missing 21:31:14 Warning: Ignoring unusable UNPACK pragma on the 21:31:14 third argument of `ExplicitShow' 21:31:21 guess you can't unpack functions 21:31:25 , explicit_show :: {-# UNPACK #-} !(a -> String) 21:31:25 oerjan: no? 21:31:29 the implementation did 21:31:31 but that's before i strictified 21:31:37 oerjan: if you mean i missed out the argument, duh 21:31:38 you can say 21:31:40 show = error "foo" 21:31:41 too 21:31:51 well yes 21:31:52 but hmm 21:32:09 oerjan: ok i suspect the function representation is different, then. 21:32:10 but if it doesn't error, it needs to be a function? 21:32:14 i am not sure _how_. 21:32:47 elliott: what does that M.$fShowTuple_$cshow you didn't paste before look like? 21:33:14 oerjan: um, like you'd expect it to? do you want me to run it again 21:33:46 it's just that it's what's put in the dictionary 21:33:48 M.$w$cshow 21:33:48 :: forall a_abJ b_abK. 21:33:48 (Show a_abJ, Show b_abK) => 21:33:48 a_abJ -> b_abK -> [Char] 21:33:48 [GblId, 21:33:48 Arity=4, 21:33:50 Unf=Unf{Src=, TopLvl=True, Arity=4, Value=True, 21:33:52 ConLike=True, Cheap=True, Expandable=True, 21:33:54 Guidance=IF_ARGS [3 3 0 0] 14 3}] 21:33:56 M.$w$cshow = 21:33:58 \ (@ a_abJ) 21:34:00 (@ b_abK) 21:34:04 (w_sio :: Show a_abJ) 21:34:06 (w1_sip :: Show b_abK) 21:34:08 (ww_sis :: a_abJ) 21:34:10 (ww1_sit :: b_abK) -> 21:34:12 : 21:34:13 how long is this? 21:34:14 @ Char 21:34:16 M.$fShowTuple4 21:34:18 (++ 21:34:20 @ Char 21:34:22 [boring stuff] 21:34:24 that's for 21:34:26 instance (Show a, Show b) => Show (Tuple a b) where 21:34:27 pastebin might have taken less time to paste 21:34:28 show (Tuple a b) = "X" ++ show a ++ "Y" ++ show b ++ "Z" 21:34:30 oh hm 21:34:34 that's not M.$fShowTuple_$cshow 21:34:36 oerjan: http://sprunge.us/fLTc 21:37:13 oerjan: found the discrepancy yet? :-P 21:37:30 erm no 21:37:37 * CakeProphet got into a debate on the difference between setting attributes to None vs. using getattr and setattr to check for undefined attributes in objects that may or may not have a large number of attributes defined. 21:37:42 in #python 21:38:02 my stance was that it made no difference. and there's what that checking for attribute existence is /bad style. 21:38:07 the former is obviously the correct solution. 21:38:11 the other one is horrible. 21:38:13 ... 21:38:22 if you disagree, you are wrong. (this is true independent of language.) 21:38:44 I say it makes no difference and amounts to almost the same code. 21:39:19 yes, you have repeatedly shown a lack of understanding of possible vs. a good idea 21:39:52 no difference. same amount of code. 21:40:17 actually more in the case of None because you have to set all of the attributes to None. 21:40:36 lines of code is not the only way to measure code. 21:40:41 correct you are. 21:40:49 but it _is_ revealing that you are using it that way. 21:41:24 is hasattr(self, "attr") or getattr(self, "attr", default) objectively worse than self.attr is None and self.attr if self.attr is None else default? 21:41:40 or is it just a stylistic preference? 21:41:41 yep 21:41:44 objectively worse 21:41:54 -!- Nisstyre has quit (Quit: Leaving). 21:42:27 elliott: my hunch is that if that error happens when functions and data types are confused, then something _must_ be applied to the wrong number of arguments somewhere 21:42:51 oerjan: I have a feeling that classes contain multiple argument functions 21:42:53 im agre with elliott 21:42:54 same code. in the same place. to the same effect. I don't see the difference other "oh no this one uses strings literals". 21:42:58 oerjan: or something 21:43:01 hmm ,ayme bt not 21:43:03 *other than 21:43:18 CakeProphet: sorry, I doubt I could explain it to you because of your incorrect perspective. 21:43:27 elliott: but a method can be any haskell value can it not 21:43:46 oerjan: doesn't stop ghc treating them specially 21:43:50 ok did you actually look at that core? i fnot i will 21:44:01 say if you put trace on one like trace "mumble" $ \x -> ... wouldn't that trace have to be applied only once 21:44:21 and even if you just seq the method 21:44:24 i don't think there's any guarantees about thta 21:44:29 trace is unsafe 21:44:37 ok not guarantee but most likely 21:44:47 ok did you actually look at that core? i fnot i will 21:44:54 i guess my seq comment is what i really mean 21:45:13 elliott: i don't know what i'm comparing _to_ :P 21:45:21 oerjan: um what i pasted above 21:45:27 is the actual M.$w$cshow implementation 21:45:53 which is put in a record? 21:46:06 um, no, this is the old testcase you asked about. 21:46:17 do you want me to define an equivalent function at top level and show that? 21:46:23 elliott: I agree it makes sense when there's only a small number of attributes to set to None. but the context was for a game in which the object could easily have large numbers of attributes undefined. 21:46:30 yes. but now i don't know what the things in the records look like :P 21:46:33 CakeProphet: sorry, uninterested. 21:46:41 oerjan: gimme a minute 21:47:49 http://sprunge.us/cDPR 21:47:59 ah. 21:50:19 elliott: btw are you making sure to evaluate your record before unsafeCoerce'ing it? 21:50:27 oerjan: with seq, yes. 21:50:48 Is this program the Obfuscated Haskell Contest program? Not quite. 21:50:56 hm might strictness analysis mess that up somehow? 21:51:19 turning off -O removes strictness analysis right? 21:51:42 some tasks require more performance than others. if the data set is large such as hex editing a 1gb file or doing batch processing then performance will matter more and more. or some programs such as "some" video games or emulators will seek to maximize performance. 21:51:48 i mean, if ghc doesn't think that unsafeCoerce can change whether something is strict, that might mess things up 21:52:16 And with multitasking apps will want each other to be polite guests 21:52:41 oerjan: hm 21:52:45 oerjan: what do you mean? 21:52:52 oerjan: oh i think i might need pseq instead of seq to be sure 21:53:03 elliott: ah right that might work 21:54:12 elliott: i mean, it might detect that the seq is redundant in something like x `seq` unsafeCoerce x, but be wrong because x is put into a dictionary on the converted side 21:54:18 er 21:54:48 oerjan: well pseq did not help. 21:54:49 * x `seq` unsafeCoerce (YourStrictRecord x) 21:55:03 explicit :: ExplicitShow a -> ShowD a 21:55:03 explicit a = a `pseq` unsafeCoerce a 21:55:13 no seqing of the fields is done; that's surely incorrect to do 21:55:38 elliott: seq one of the fields you don't use, for good measure :P 21:55:39 Does the program I posted work? 21:55:49 Improve it if you like to do so 21:55:53 in fact if possible _print_ it IO 21:56:06 then ghc cannot possibly get around evaluating it first 21:56:12 *in IO 21:56:15 oerjan: um I have no idea what you are talking about, do you mean for the conversion the other way around? 21:56:31 explicit_lit :: ExplicitShow String 21:56:31 explicit_lit = ExplicitShow 21:56:31 { explicit_showsPrec = \_ -> error "help" -- \_ s t -> s ++ t 21:56:31 , explicit_show = \_ -> error "help show" 21:56:31 , explicit_showList = \_ -> error "help showList" } 21:56:34 how will printing any of these help at all? 21:57:09 elliott: er they are _all_ error? i guess that's not useful to print. you might apply and catch. 21:57:54 elliott: i'm just suggesting making as absolutely sure as you can that ghc doesn't convince itself that it can avoid evaluating the record before converting it 21:58:06 oerjan: I could just look at the core rather than relying on voodoo. 21:58:11 or that :P 21:58:43 elliott: it's just that the one thing i _do_ recall about ghc's class dictionaries is that ghc assumes they are strict 21:59:04 so a value containing them will not have them evaluated before use 21:59:19 oerjan: the fact that I get the errors properly if I do (error "foo") rather than (\_ -> error "foo") seems to prove I'm doing it right. 21:59:22 or it'd just segfault or whatever. 21:59:25 if it was lazy 21:59:28 elliott: ok 21:59:34 main3 = 21:59:34 lazy 21:59:34 @ (ShowD String) 21:59:34 (main4 21:59:34 `cast` (CoUnsafe 21:59:34 (ExplicitShow String) (ShowD String) 21:59:36 :: ExplicitShow String ~ ShowD String)) 21:59:38 i have no idea what's going on :D 21:59:54 WHAT 22:00:10 main3 lazy ShowD is my rapper name. 22:00:11 elliott: hm maybe a class method really _must_ not be a function in that unsafeCoerce sense, then. 22:00:20 CoUnsafe sounds good 22:00:39 oerjan: just a second, something's insane 22:00:53 we all are 22:01:05 _wtf._ 22:01:20 oerjan: it briefly worked (producing "help show") 22:01:23 but on GHCi restart, it doesn't. 22:01:55 oerjan: unfortunately nobody is replying in the ghc chanenl :( 22:02:08 hmm 22:02:34 oerjan: ok i'm going to try the thing i was going to try 22:03:26 -!- Necrosporus has quit (Ping timeout: 245 seconds). 22:03:30 elliott: they've gone into hiding. btw what happens if you have a method whose type is _not_ a function? 22:03:42 i.e. an actual data type 22:03:54 oerjan: I was going to try that next, but I'm going to figure this out first 22:04:03 food -> 22:04:12 M.ooh' = plusInt 22:04:12 M.$fOohInt = 22:04:12 plusInt 22:04:12 `cast` (sym (M.NTCo:T:Ooh Int) 22:04:12 :: (Int -> Int -> Int) 22:04:13 ~ 22:04:15 M.T:Ooh Int) 22:04:24 oerjan: ok so the core definition is identical apart from a cast 22:04:42 and I think casts are just unsafeCoerce casts plus a proof 22:08:37 this looks pretty helpful: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Coercions 22:09:52 "The nd binding extracts the Num superclass dictionary from the C dictionary; the case expression is called a superclass selector." 22:10:01 hmm 22:10:10 oerjan: Show has no superclasses but maybe it has a free field for them? 22:10:20 huh 22:10:35 hmm 22:11:01 elliott: btw when you had just error ..., the correct error was raised according to which method you were trying to call? 22:11:18 oerjan: yes, except when i wanted to unbox 22:11:26 which just failed horribly 22:12:28 05:28:07: It's not possible to go to an eye doctor to preemptively ask if you just infected your eye, is it? 22:12:32 oerjan: i'm blaming you for my suffering 22:12:44 O KAY 22:12:48 tempted to touch my eye to feel smug but i'd have a hard time making myself do that 22:12:49 :t Some 22:12:49 Not in scope: data constructor `Some' 22:12:53 :t \x -> Some x 22:12:54 Not in scope: data constructor `Some' 22:12:56 * Lymee ? 22:13:00 Lymee: ? 22:13:10 it helps to ask a question in english rather than just babbling invalid haskell 22:13:20 what do you think Some is? 22:13:24 Experiments. >:c 22:13:28 what do you think Some is? 22:13:38 a -> Maybe a? 22:13:39 Isn't Some the ML equiv of Just? 22:13:42 Lymee: Just 22:13:46 Uh opps 22:13:48 Wrong language 22:14:41 I am the right language. 22:14:49 I will guide your communication. 22:15:00 ok 22:15:22 10:16:41: CakeProphet: MultiParamTypeClasses for Match, FlexibleInstances for that instance (because it uses 'a' twice) 22:15:26 Deewiant: Undecidable 22:15:28 instances, that is 22:15:33 Not needed for that alone 22:15:43 um are you sure? maybe Overlapping then? 22:15:44 I know that 22:15:47 instance (C a) => D a 22:15:48 is not ok 22:15:54 i would be surprised if the additional thing made it work 22:15:56 I am sure, I checked it 22:15:58 overlapping sounds like the right qualifier. 22:16:01 MPTCs + Flexible 22:16:01 ok 22:16:27 maybe flexible in overlapping in the case that the instances... overlap 22:16:31 s/in/and/ 22:16:43 overlappinginstances implies flexibleinstances 22:16:52 ah okay 22:17:14 * CakeProphet has never need the .*?instances extensions 22:17:59 I've needed flexible once but other than that I've just read the manual pages 22:18:05 13:02:16: -!- Necrosporus has joined #esoteric. 22:18:05 13:03:43: http://paste.org.ru/?lu3vtb 22:18:06 13:03:57: Do you like it? What' sthat at your opinion? 22:18:06 hi 22:18:19 monqy: I need flexible constantly 22:18:23 but obviously if you want to overlap you probably want to be flexible. 22:18:29 14:21:13: That's fmap... 22:18:36 Phantom_Hoover: it's the _wrong_ generalisation. 22:18:39 (.) should be (Control.Category..) 22:18:45 map should be fmap though. 22:18:52 Control.Category didn't exist at the time IIRC 22:18:56 and (++) being Monoid is right 22:19:05 > (P..) 22:19:06 Overlapping instances for GHC.Show.Show 22:19:07 ((b ->... 22:19:10 Phantom_Hoover: 22:19:12 Prelude is P 22:19:23 Darn 22:19:24 Why 22:19:47 Concision? It's IRC 22:19:48 BRB 22:19:56 Why not both 22:20:39 is there anything ($) could be generalized to? 22:20:59 yes 22:21:06 id 22:21:30 ($) :: (a -> b) -> a -> b; ($) = id 22:21:31 tempted to touch my eye to feel smug but i'd have a hard time making myself do that <-- NORTHUMBRIAN TOUCHES EYE TO FEEL SMUG, EYE FALLS OUT 22:22:43 @hoogle m a b -> a -> b 22:22:44 Control.Monad.Reader runReader :: Reader r a -> r -> a 22:22:44 Control.Monad.State.Lazy evalState :: State s a -> s -> a 22:22:44 Control.Monad.State.Strict evalState :: State s a -> s -> a 22:23:05 what 22:23:20 that is a generalization of )$_ 22:23:21 ($) 22:25:02 -!- Patashu has joined. 22:26:23 class Whatever (~>) where ($) :: (a ~> b) -> a -> b ? 22:26:57 yes. 22:27:19 yes that's the gnera;lization of which iw as thinking too 22:27:31 I would say Applicative but that is already taken. 22:27:48 ?ty app 22:27:49 forall (a :: * -> * -> *) b c. (ArrowApply a) => a (a b c, b) c 22:27:54 I think that's what you guys want 22:28:16 but what if I dislike arrows? 22:28:27 ?src ArrowApply 22:28:27 Source not found. :( 22:28:29 :( 22:28:41 that doesn't look like the correct type. 22:28:42 class Arrow a => ArrowApply a where that function 22:28:43 too many tuples. :P 22:29:05 specifically one too many. 22:29:43 !haskell take 20 $ Unsafe.Coerce.unsafeCoerce [1..] :: [()] 22:29:49 ​[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()] 22:29:52 that looks a little bit different than ours, anyway 22:30:14 also filter could be generalized. 22:30:14 !haskell take 20 $ Unsafe.Coerce.unsafeCoerce [Left 1, Right 2] :: [()] 22:30:16 :t filter 22:30:17 ​[(),()] 22:30:17 forall a. (a -> Bool) -> [a] -> [a] 22:30:31 (a -> Bool) -> t a -> t a 22:30:42 ?ty app .: (,) 22:30:43 forall b b1. (b -> b1) -> b -> b1 22:31:22 @hoogle filter 22:31:23 Prelude filter :: (a -> Bool) -> [a] -> [a] 22:31:23 Data.ByteString filter :: (Word8 -> Bool) -> ByteString -> ByteString 22:31:23 Data.IntMap filter :: (a -> Bool) -> IntMap a -> IntMap a 22:31:39 :t (.:) 22:31:40 forall a b (f :: * -> *) (g :: * -> *). (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) 22:31:42 :t Data.Traversable.filter 22:31:43 Not in scope: `Data.Traversable.filter' 22:31:55 hm i guess it cannot remove elements 22:32:10 oerjan: is ByteString a synonym for Something Word8? 22:32:44 it's an unpacked array of Word8, yes 22:32:58 well more or less 22:33:26 *unboxed 22:33:57 @hoogle fromList 22:33:57 Data.HashTable fromList :: Eq key => (key -> Int32) -> [(key, val)] -> IO (HashTable key val) 22:33:58 Data.IntMap fromList :: [(Key, a)] -> IntMap a 22:33:58 Data.IntSet fromList :: [Int] -> IntSet 22:34:20 @hoogle Foldable f => [a] -> f a 22:34:21 Test.QuickCheck elements :: [a] -> Gen a 22:34:21 Data.Maybe listToMaybe :: [a] -> Maybe a 22:34:21 Data.Sequence fromList :: [a] -> Seq a 22:34:28 bah 22:35:20 class FromListable a r where fromList :: [a] -> r 22:35:32 maybe with a fundep 22:35:52 CakeProphet: that's just Monoid really 22:36:02 well, nearly 22:36:41 @hoogle (a -> Bool) -> f a -> f a 22:36:41 Data.IntMap filter :: (a -> Bool) -> IntMap a -> IntMap a 22:36:42 Prelude dropWhile :: (a -> Bool) -> [a] -> [a] 22:36:42 Prelude filter :: (a -> Bool) -> [a] -> [a] 22:37:04 @hoogle NotABloodyList f => (a -> Bool) -> f a -> f a 22:37:05 Warning: Unknown class NotABloodyList 22:37:05 Data.IntMap filter :: (a -> Bool) -> IntMap a -> IntMap a 22:37:05 Prelude dropWhile :: (a -> Bool) -> [a] -> [a] 22:37:51 they could extend the query syntax that way 22:37:57 having constrains placed before a => 22:38:14 i thought they did 22:38:45 it's just always fuzzy when there's no perfect match 22:39:22 @hoogle Monad m => [m a] -> m [a] 22:39:22 Prelude sequence :: Monad m => [m a] -> m [a] 22:39:23 Control.Monad sequence :: Monad m => [m a] -> m [a] 22:39:23 Data.Traversable sequence :: (Traversable t, Monad m) => t (m a) -> m (t a) 22:39:35 @hoogle Applicative m => [m a] -> m [a] 22:39:35 Data.Traversable sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a) 22:39:36 Prelude sequence :: Monad m => [m a] -> m [a] 22:39:36 Control.Monad sequence :: Monad m => [m a] -> m [a] 22:39:44 yeah it does 22:40:18 no I mean constrains like "t is not a list" 22:40:28 not class constraints. 22:40:44 back 22:41:05 monqy: ive seen 22:41:16 hi>? 22:41:20 class (Arrow (~>)) =. ArrowApply (~>) where (($) :: (a ~> b) -> a -> b 22:41:23 as opposed to the existing arrowapply 22:41:59 since arrows are lame and nobody likes to use them. 22:42:15 what's the need for the Arrow (~>) context there.... 22:42:31 monqy: because it was in terms of arrow? 22:42:45 why must it?? 22:42:45 anything that can be applied should be an arrow anyhow, whether you like arrows or not 22:42:54 mmh 22:43:01 you should be able to write the arrow functions 22:43:04 whether you like the Arrow class or not 22:43:14 otherwise your application has no laws and is hence useless 22:43:31 >_> 22:43:45 :t \p m = m >>= \x -> if p x then return x else mzero 22:43:46 parse error on input `=' 22:43:48 thankfully I will never use CakeProphet's code. 22:43:48 laws -> practical use. The elliott law. 22:43:52 :t \p m -> m >>= \x -> if p x then return x else mzero 22:43:53 forall (m :: * -> *) a. (MonadPlus m) => (a -> Bool) -> m a -> m a 22:43:58 What does "Irrefutable pattern failed" mean in Haskell? 22:44:00 CakeProphet: sorry, you do not undrestand programming. 22:44:02 understand 22:44:03 is there any good alternative to arows is Category&Applicative useful for that I've also heard of a Generalized Arrows thing but maybe that is not a real thing maybe I should make my own alteratnive to do the things I want to do 22:44:14 zzo38: depends what your code is 22:44:27 > let Left x = Right "like this" in x 22:44:28 *Exception: :3:4-29: Irrefutable pattern failed for pattern Da... 22:44:29 monqy: you cannot use applicative in the arrowapply head because it must be universally quantified. 22:44:30 elliott: if you want me to see it they way you do then you'll have to use words for that. 22:45:02 CakeProphet: i'm not interested in doing so, because I've tried before and it was fruitless; I suspect either time and experience will make you clear up your confusion, or nothing will 22:45:24 oerjan: How does that do? 22:45:24 zzo38: it's for when a failing match is lazy so it is not checked until another expression is evaluated 22:45:52 matches are by default lazy in let and where, but strict in case and function arguments 22:46:21 but you can turn strict matches into lazy with ~ or lazy into strict with ! (the latter is an extension) 22:46:21 But what does let Left x = Right "like this" in x even supposed to do? 22:46:31 zzo38: fail, badly 22:46:39 hth 22:46:47 elliott: though I do find it a bit insulting that I apparently don't _understand_ programming because I do not see it in this way. 22:47:06 as if the way I have been viewing it is totally invalid and does not correspond to actual programming. 22:47:14 What is that syntax supposed to mean? 22:47:26 > let (x, y) = (5, 3) in (y, x) 22:47:26 zzo38: it defines Left x lazily to be the result of the expression Right "like this". if it was Left x = Left "like this", then it would simply make x = "like this" 22:47:26 (3,5) 22:47:27 CakeProphet: I predict that any further responses I make will only offend you more, so I'm not going to 22:47:50 oerjan: ok i'm going to adjust my code for the exciting class: class Ooh a where ooh :: a 22:48:06 ooh 22:48:07 (06:48:02 PM) CDGregorR: int*a,b[9<<20];main(){a=b;while(scanf("%d",++a)>0);while(*a)a+=(a[*a]-=a[a[1]])?3:a[2];while(a>b)putchar(*--a);} 22:48:08 (06:48:30 PM) -: I see a :( in there 22:48:08 (06:48:35 PM) -: That's how I'd feel about it, too 22:48:14 zzo38: it makes more sense if Right "like this" is replaced by an expression which is not known whether it is Left or Right, though 22:48:40 oerjan: or rather one you know to be Left or Right. 22:48:42 elliott: then nothing has been learned by either of us from this conversation. congratulations. 22:48:45 (it is not good practice to assume :P) 22:48:53 * CakeProphet moves on to other things. 22:48:58 CakeProphet: you are the one who was sarcastic and pinged me after I made a statement. 22:49:03 did you _expect_ to get anything from it? 22:49:08 zzo38: and supposedly you should only _use_ such an expression Left x = y if you are sure that y evaluates to a Left value, but if you do a mistake you get that "irrefutable pattern" error 22:49:22 *such a definition 22:49:28 elliott: I would like to. 22:49:37 CakeProphet: then maybe start it in a better way next time 22:49:43 Now it says "No instance for (Show GHC.Prim.Any)" if I type x or Left x or Right x 22:49:44 oerjan: I suspect the source of my unreliability is withInstance, btw 22:50:11 oerjan: it should really be some core that takes the dictionary out of the ShowD and applies k to it 22:50:25 I might be able to coerce that into working if I can figure out how to unbox it properly 22:50:27 zzo38: that's a different error because x defaults to type Any 22:50:43 (when there are no other restrictions on it) 22:51:18 zzo38: however that's a bit weird that there is no Show instance 22:51:20 > [] 22:51:21 [] 22:51:57 oerjan: um of course there is no Show Any instance. 22:52:01 [] only works because of defaulting. 22:52:04 oh wait ghc defaults it to () 22:52:14 elliott: I was basically saying I don't understand how a set of laws corresponds directly to usefulness. 22:52:25 not that I don't understand the importance of laws. 22:52:28 elliott: oh hm. the default to Any is only if there are _no_ type classes involved. 22:52:44 oerjan: incidentally Any won't show up like that in error messages soon 22:52:47 instance Eq (->) where 22:52:48 it was fixed recently iirc 22:52:53 elliott: as I could make something completely useless that also has laws. 22:52:54 @let x = [] 22:52:55 Defined. 22:52:58 > x 22:52:59 Ambiguous occurrence `x' 22:52:59 It could refer to either `L.x', defined at oops 22:53:03 @undefine 22:53:11 now what 22:53:19 > "hm" 22:53:20 "hm" 22:53:32 @list let 22:53:32 eval provides: run let undefine 22:53:35 @undefine 22:53:40 > x 22:53:42 x 22:53:51 huh it gives no message 22:53:57 @let x' = [] 22:53:58 Defined. 22:54:00 > x' 22:54:02 [] 22:54:07 :t x' 22:54:08 forall a. [a] 22:54:11 bah 22:54:17 CakeProphet: (~a -> ~b) =/= (a -> b) 22:54:23 no monomorphism restriction for @let 22:54:33 or wait 22:54:49 > (x' :: String, x' :: [Bool]) 22:54:51 ("",[]) 22:54:55 indeed not 22:54:58 elliott: is ~ laziness in this case? I've never seen ~ used like that. 22:55:04 or is it not? 22:55:22 aka complement. 22:55:42 How is a definition such as Left x = Right "like this" can be used afterward? 22:56:06 CakeProphet: what I said was not code. 22:56:17 *Main> withInstance explicitTestD (ooh :: Int) 22:56:17 99 22:56:20 oerjan: ok so data values work. 22:56:30 elliott: ah, well then it is not very enlightening to me. 22:56:34 *Main> ooh :: Int 22:56:34 9 22:56:37 CakeProphet: maybe so. 22:56:48 oerjan: so there _is_ something different about functions in dictionaries 22:57:17 has #ghc answered yet 22:57:29 monqy: no 22:57:34 :( 22:57:52 elliott: it is not very difficult nor time consuming to explain what you mean. 22:58:10 CakeProphet: that is where you are wrong 22:58:28 elliott: oh wait I understand. :P 22:58:41 logic, not types. 22:59:12 oerjan: I've asked #ghc about how functions are represented in typeclass dictionaries, anyway 22:59:13 oerjan: I suspect the source of my unreliability is withInstance, btw <-- would the higher rank method used in reflection be good enough for you? 22:59:24 oerjan: what type signature? 22:59:29 reify :: a -> (forall s. Reifies s a => Proxy s -> w) -> w 22:59:38 oerjan: that's... close to what i have 22:59:39 withInstance :: OohD a -> ((Ooh a) => r) -> r 22:59:41 I suppose I could do 22:59:44 withInstance :: OohD a -> (forall b. (Ooh b) => r) -> r 22:59:49 but that would rather reduce usefulness, I think 22:59:53 although, hmm 22:59:56 withInstance print "foo" would work 23:00:19 elliott: okay so then practical use -> laws would be the logical equivalent of your statement. 23:00:24 which I still do not see as being true. 23:00:49 CakeProphet: I was replying to your statement with a demonstration of its fallacy. 23:01:07 right, and I just revised it. 23:01:18 meta-conversation is cool though. 23:01:49 I'm afraid you have no idea what I'm talking about. 23:01:51 anyway 23:02:03 oerjan: I guess quantification might fix it by forcing explicit dictionary passing but I'm mostly sceptical of the implementation 23:02:10 zzo38: it cannot, that's an error which i just made to demonstrate how the Irrefutable pattern error message happens. Left x = Left "like this" would be useable, though. 23:03:19 zzo38: if you get an Irrefutable pattern error in your own code, though, it might because you are making something similar to Left x = y where you _think_ y is a Left value but it actually sometimes is a Right value. 23:03:28 *might be because 23:03:48 but it could be with other data type constructors, of course. 23:04:09 elliott: you said, in effect, no laws -> useless. I made the wrong implication from that, you showed that it was incorrect. So I revised to use -> laws, which I still do not agree with. Is that not what we just talked about? 23:05:00 zzo38: because of laziness, it is allowed to define Left x = y even if y is a Right value, as long you don't actually _use_ y in that case. but it may be easy to do a mistake then. 23:05:54 Argh, my TinyTC was wrong :( 23:06:29 -!- copumpkin has quit (Quit: Computer has gone to sleep.). 23:06:52 Gregor: I thought I had just realized that your name is Roger G. but whois says otherwise. :( 23:07:09 for some reason I like reverse names. 23:07:16 Ohhhhhhhhhhhhhhhhhhhhhhhhhkidoke. 23:07:23 >_> 23:07:33 CakeProphet, take a guess what Gregor's name is 23:07:40 Gregor. 23:07:46 *clap clap clap* 23:07:50 that's what whois says. 23:08:01 BUT IT COULD EASILY BE ROGER G. 23:08:04 I'm not much of a mystery :P 23:08:08 I exist ... ON THE INTERNET! 23:08:43 assholes. 23:08:51 :'( 23:09:00 I think most people have only one... 23:09:02 All of this is distracting from the tragedy of my TinyTC being wrong. 23:09:12 int*a,b[9<<20];main(){a=b;while(scanf("%d",a++)>0);a=b;while(*a)a+=(a[*a]-=a[a[1]])?3:a[2];while(a>b)putchar(*--a);} // this is corrected, but 117 characters :( 23:09:15 Gregor: perhaps this is not a bad thing perhaps. 23:09:45 Gregor, clearly, you have to change your other name to conform to CakeProphet's specs... in ... weirdly 23:10:41 not at all. 23:10:56 elliott: well you need _some_ way to prevent ghc from lifting print "hello world" entirely out of your carefully constructed context :P 23:11:29 I was merely sharing an amusing and false connection I made. 23:11:39 because Roger G. is a funny name. 23:12:11 that Tehpor Pekac guy has some wild ideas 23:12:12 oerjan: doing it at the top-level seems to make it work for some reason 23:12:19 Gregor: how was it wrong? 23:12:47 elliott: I ++a'd even when it didn't read in an int, so *a was always 0 by the time the loop started. 23:12:54 So, it never went into the loop at all >_> 23:13:04 heh 23:13:08 elliott: yeah but obviously it will be brittle since ghc is by haskell semantics _allowed_ to do that lifting. 23:13:43 oerjan: yeah. I think the quantified type might avoid that? 23:13:56 hmm maybe: 23:13:58 withInstance :: OohD a -> (forall b. (Ooh b, a ~ b) => r) -> r 23:14:01 to get the full power 23:14:04 maybe 23:14:20 Gregor: is it okay if I call you Roger from now on? 23:14:24 (it'd be nice to call random monomorphic methods but fuck up the instances they use, but GHC _definitely_ erases too much for that) 23:14:28 Nope ;P 23:14:38 (and I guess I should avoid allowing you to see that by sticking to the plain universal rank-two type) 23:15:00 * Sgeo decides to ignore Roger's wishes wrt whether Roger wants to be called Roger 23:15:24 I think this is an excelelnt idea Oeg S. 23:15:38 hey no oegs 23:15:47 yeah Sgeo is the reversed name 23:15:56 so he's actually S. Geo 23:16:05 that's intruding on my alphabet territory 23:16:17 my real name is yqno m. 23:16:27 -!- Sgeo has changed nick to Sgelo. 23:16:39 shut up, Monq Y. 23:17:04 and someone is trying _very_ hard to hide that his real name is L. Toilet 23:17:39 * oerjan go too far 23:17:41 * Sgelo fails to get people to infer that he's pretending to be Oleg :( 23:17:51 I caught it.. 23:17:56 me too.......... 23:17:58 substitute oleg 23:18:03 I AM A MASTER OF MYSTERIES 23:18:05 but which oleg are you 23:18:05 I REVERSE ALL NAMES. 23:18:06 which 23:18:07 oleg 23:18:27 I SEE ALL OF THE SECRET CODES. 23:18:43 oerjan: ellio turd, toilet l., i am poop in every way :( 23:18:51 * elliott cries 23:19:04 I keep my window covered by a bedsheet so that the government cannot spy on me with their spy crafts. 23:19:08 your life is so shitty 23:19:31 :'( 23:19:54 -_;; my soul is black like the night. 23:20:08 me too 23:20:39 I do not know how to make a crying emo face. ;_;;? 23:21:18 I also do not know what contractions are help. 23:21:23 Sometimes I like to touch sharp things and feel their sharpness. 23:21:44 * Sgelo #s Phantom_Hoover 23:21:51 I made a Haskell program to know the extensions: http://sprunge.us/CBKY 23:21:54 yesterday i cut myself 23:21:54 Sgelo: gros 23:21:55 s 23:22:00 trying to open a bottle of cranbery juice 23:22:12 * Sgelo belatedly recognized the gross interpretation of that 23:22:12 monqy, ah, you're getting into the spirit. 23:22:25 Sgelo: there's a gross interpretation? 23:22:27 Do you work at Starbucks? 23:23:18 Sgelo: he is too young do not explain it it is too gross. 23:23:51 "I think if we are going to allow ourselves the luxury of semantic breakage, it should at least be worth the cost" --Malcom Wallace on seq 23:24:08 it's not worth the cost? 23:24:41 not as the report specifies it IHO 23:26:08 seq is both luxurious and not worth the cost? Sounds expensive. 23:26:30 I have discussed making a Haskell program that is programmed to tell what extensions it uses, now I have done so. Other ideas are, extend it with the capability to tell if it is Literate Haskell or not, as well as be valid programs in other programming languages such as C, C++, INTERCAL, TeX, Brainfuck, Malbolge, AWK, ... 23:26:30 it's a quibble about the Report, nothing much to do with usage. 23:27:07 zzo38: isBrainfuck = True 23:27:16 zzo38: :D 23:28:11 CakeProphet: I mean that it will do something proper, too. Of course any file with balanced [] is a valid Brainfuck program 23:28:32 "After all the Report doesn't actually say 23:28:32 that monomorphic pattern-bound variables are shared, either." huh 23:28:49 proper? like sipping tea and maintaining upright posture? 23:29:17 I don't know how a computer program can do that, but if you can figure it out then do so 23:29:29 It can also make output. 23:29:34 Attention spammers: Asthma is not a vaginal infection 23:29:47 I have seen a polyglot program that makes output to tell you what programming language it is. 23:30:06 -!- copumpkin has joined. 23:30:13 print "Just another", ((0 and " Ruby ") or ("Pyt" + "hon" or " Perl ")), "hacker.\n", 23:30:15 Sgelo: that would be hysterical 23:30:30 oerjan: annoyingly I can't cast (forall b. (C b) => r) to (CD b -> r), because that's an additional layer of boxing 23:30:49 How does the ("Pyt" + "hon" or " Perl ") part work in Perl? 23:30:54 Deewiant: Yes, something like that 23:31:10 Sgelo: . is concat in perl 23:31:12 + is numeric 23:31:13 Sgelo: Both get coerced to integers 23:31:20 Ah, ok 23:31:23 so it becomes 0 which is false 23:32:44 but 0 is apparently not false in Ruby? 23:33:24 Right, only false and nil are 23:33:24 IIRC 23:33:27 yeah 23:33:34 which is far more correct than the hideous Python/Perl behaviour. 23:33:36 :t (print "Just another", ((0 and " Ruby ") or ("Pyt" + "hon" or " Perl ")), "hacker.\n") 23:33:37 Couldn't match expected type `t -> t1 -> [Char]' 23:33:37 against inferred type `[Char]' 23:33:37 In the second argument of `(+)', namely `"hon" or " Perl "' 23:33:41 -!- itidus20 has quit (Ping timeout: 257 seconds). 23:33:59 SHOCKING 23:35:12 elliott, well, objects in Python can define what happens when they're tested by if 23:35:35 Sgelo: so? 0 is not false 23:35:38 neither is [] 23:36:03 C begs to differ 23:36:22 Deewiant: char a[] = {}; // a isn't false after this, is it? 23:36:27 it's convenient that they are false though. 23:36:27 But anyway, C is wrong about most things. 23:36:33 No, but int a = 0 is 23:36:39 Although the one I have seen, if I remember correctly, includes Plain TeX, C, C++, LaTeX, Perl, and a few more, but not Haskell. 23:36:42 CakeProphet: when have you ever exploited the "==0 being false" behaviour in Python? 23:36:55 I can see the argument for [], but unless your language has no boolean type, 0 being false is pure insanity. 23:37:03 elliott: I have used if list: to test if it is empty 23:37:07 or None 23:37:30 I used LSL's similar behavior.... but I really shouldn't have 23:37:32 that's not an answer to the question I asked you 23:37:33 But there are other TeX formats as well, such as AMS-TeX, and there is primitive TeX which I sometimes find a use for. 23:37:36 None is ~ nil, so Ruby has that too 23:37:57 elliott: I don't really understand the question ==0 is not valid Python. :P 23:38:14 oh nevermind. 23:38:20 Some function returns -1 if it can't find the item in the list.... I did if(llWhatever(...)+1) 23:38:28 CakeProphet: x == 0 is perfectly valid Python. 23:38:34 well, I've used it in a while loop I believe. I'm sure it would be useful as an if. 23:38:58 ok, so "I believe" with no example and "I'm sure". 23:39:01 Note: I recognize now how "clever" (bad) that sort of thing is 23:39:29 uh, I think it's perfectly valid but I'm not going to get involved in yet another one of these debates. 23:39:57 because it is preference and not objective. 23:40:14 that is how you resolve all debates about languages 23:40:16 10:20:18 00:10:38: * Sgeo wants wget to ignore robots.txt >.> 23:40:16 10:20:24 Obviously it is impossible to make wget do this. 23:40:29 well _i_ thought so, but Sgeo managed to. 23:40:38 elliott: over tiny trivial things, yes. 23:40:43 oerjan: whoosh. 23:40:48 CakeProphet: haha 23:40:54 elliott: not really 23:41:16 elliott: i'm pointing out that if you are insulting sgeo for believing that, you are really insulting me :P 23:41:32 I'm sure I could go through VB and find things that are objectively bad. 23:41:37 oerjan: I insult for more than pure factual content 23:42:16 elliott: i _do_ recall i could not manage to find it in the manpage, so they are not exactly advertising how to do it. 23:42:29 (which is somewhat reasonable i guess) 23:42:36 It's a config file option 23:42:41 -e is documented 23:42:50 and the man page points you to GNU info for documentation on .wgetrc/-e 23:42:50 And -e lets you set config file options on the command-line 23:43:03 And googling pretty much gives you the answer 23:44:46 well it's not in the _obvious_ place 23:44:52 * oerjan sulks in the corner 23:45:05 oerjan: /pats 23:49:16 I am a spider. 23:52:14 -!- FireFly has quit (Quit: FireFly). 23:53:41 -!- kmc_ has joined. 23:54:52 elliott: that's where i keep my Porn And Trailers 23:55:42 pugs and togs 23:56:22 -!- kmc has quit (Ping timeout: 245 seconds).