00:11:36 -!- Sgeo_ has joined. 00:11:43 -!- Sgeo_ has quit (Client Quit). 00:12:03 @hoogle [a] -> [a] 00:12:04 Prelude cycle :: [a] -> [a] 00:12:04 Prelude init :: [a] -> [a] 00:12:04 Prelude reverse :: [a] -> [a] 00:12:34 -!- hagb4rd has joined. 00:13:16 If there are no Oracle machines capable of dealing with itself as part of the system it ... oracles, how can an omniscient entity exist? 00:14:19 by not knowing about itself 00:14:21 it cannot. 00:14:27 one that keeps separate from the system 00:14:28 darn :P 00:14:48 :P 00:14:53 Hmm. So, would Christians be ok with that sort of response? 00:15:04 let me ask the consortium of defining what a christian can be 00:15:09 they say it's half past you're a moron 00:15:09 hmm. do an of us care? 00:15:28 elliott: dammit you almost owed me a keyboard there :P 00:16:08 oerjan: :D 00:16:43 Sgeo: God can make a rock so big he can't lift it, and still lift it! Moreover, God can know everything about everything and completely ignore any logical contradictions that happen as a result of this. God is beyond logic! 00:17:15 god is beyond logic, and if you say anything else he'll smack you 00:17:47 with lightning 00:17:48 sgeo: incompleteness is about logic systems 00:17:50 christianity is not 00:17:59 (if you didn't notice any smacking that's because god is beyond logic) 00:18:16 can god make yo mama so fat that even he cant lift her? 00:18:21 The Torah actually says somewhere that God'll kill you if you work on Yom Kippur 00:18:23 he can not smack you, and still have fulfilled the prophecy that he would smack you 00:18:37 sgeo: ... eventually. 00:18:40 newsham: smbc ripoff much? 00:18:42 Sgeo: presumably it doesn't say ho... right 00:18:55 quintopia: quite. 00:19:16 god kills everyone eventually 00:19:27 except me 00:19:28 bwahahaha 00:19:45 i shall kill myself at a ripe old age of 2099 00:19:49 i've sometimes been wondering, since one of the essential pieces of diagonalization is the negation, whether you could have a self-consistent self-referential system if you threw out negation. 00:20:25 possibly. you can have consistent self-referential systems by throwing out any number of things. 00:20:27 newsham, except Enoch! 00:20:32 (i.e. lambda calculus has fixpoints, but (thus) no negation that can work on all functions) 00:20:36 And Mary, if you believe anything the Pope says. 00:21:02 quintopia: well hopefully it would still be an interesting one somehow :P 00:21:25 The Gospels do say Jesus had brothers... 00:21:26 -!- TeruFSX has joined. 00:21:32 so umm.. whats the big deal w/ mary? jesus had brothers, i'm pretty sure she's not a virgin anymore. 00:22:08 newsham: she was so awesome she stayed a virgin anyway? 00:22:23 i've never been on ianbells hp till now.. it's so,..oldskool :) lotta things to get there for grownup spacerowdies 00:22:36 she didn't have to be a virgin to be what's the word... 00:22:43 hagb4rd: wat? 00:22:52 http://www.iancgbell.clara.net/ 00:22:54 well the pope is always going on about her being a virgin.. is all... 00:23:12 theres also a little bit of sourcecode 00:23:25 hagb4rd: wow, did someone build a time machine? 00:23:30 http://www.catholic.com/library/Mary_Ever_Virgin.asp oh here's the answer 00:23:43 that web page is one tag away from 1992 00:23:45 "you can believe whatever you like. she's still a virgin dammit" 00:24:01 Why are we talking about Ian Bell all of a sudden? 00:24:14 (It makes my eyes bleed.) 00:24:17 somebody has to kick off a sequel newsham 00:24:30 newsham: wait you mean blink tags are time machines? maybe they shouldn't have been stamped out... 00:24:55 newsham, TbH, Ian Bell gets off with it by virtue of being Ian Bell. 00:24:58 what of james the brother of jesus? 00:25:43 http://bible.cc/galatians/1-19.htm 00:26:30 -!- Lymee has quit (Ping timeout: 258 seconds). 00:26:49 newsham: that page says that he could be at most a stepbrother 00:26:49 *shrug* mary mary, quite contrary... 00:27:04 quintopia: because God wasn't his dad? 00:27:24 newsham: if mary had been his mother, he'd be a half-brother 00:27:29 oh, this is the guy who wrote Elite.. neat. 00:27:54 instead, he was just the son of Joseph 00:27:57 hm did jews practice polygamy at that time? 00:28:14 who was a widower when mary was entrusted to him 00:28:21 anyway 00:28:25 that's what that page says 00:28:32 supper time... 00:28:58 super soup supper 00:29:22 this page is not readable without highlighting text 00:29:23 http://www.iancgbell.clara.net/elite/nes/index.htm 00:29:26 very retro 1992 00:30:01 82Kbytes.. huge game 00:30:27 I approve of this Elite talk. 00:32:20 i wonder how many 8-bit game devs worked in crossdev environments vs. native environments 00:36:38 and if you haven't seen it yet, ..no even you hate ..be sure to watch southpark episode 13.3 .. it's analogies to good ol joshuas story are just delicious --> http://de.southparkstudios.com/alleEpisoden/1303/?lang=en 00:37:27 if you're not in a hurry ;) 00:37:51 newsham, I'm amazed they ported it that much, TbH. 00:38:33 It was written in straight assembly; porting was just writing it again with an entirely new set of optimisations. 00:39:12 -!- Lymee has joined. 00:40:32 -!- Sgeo has quit (Ping timeout: 255 seconds). 00:45:31 got Elite in NES emulator. 00:46:00 phantom: they did have many ports for same cpu, too, ie. all the 6502 ports, two 68k ports 00:46:16 newsham, FWIW, there's a modern remake at http://oolite.org 00:46:22 also game design done once, programming done several times, profit. 00:46:29 who wants a modern remake? :) 00:46:45 thats like installing SCUMMVM and then running some new community-made game 00:46:50 Well, you can turn on the wireframe and put it into strict mode and it's basically the same. 00:47:16 they have the BBC elite code online.. thats kinda neat 00:47:24 wish they had some 6502 code.. i'd rather look at that 00:47:56 newsham: Elite is boring though, Oolite is less boring :P 00:48:03 also wish this site had more story to it 00:48:15 elliott: honeslty i dont plan to really play either 00:48:41 but thakns for pointing it out.. looks neat 00:55:32 -!- Sgeo has joined. 00:56:44 i would love to resign on the story gaining its sandbox abilities.. a real world made up by its citizens 00:57:08 the star-dreamer problem is problem in mp 00:57:32 i cant tell if you're talking or just generating random trigrams 00:58:30 i guess it's more random and definitly not worth your time 00:59:23 we were youg, and we had the time and the money *g 00:59:31 newsham: latter 00:59:43 * hagb4rd .Dispose() 01:00:23 "We had access to too much money, too much equipment, and little by little we went insane" 01:00:27 -!- Sgeo has quit (Ping timeout: 260 seconds). 01:01:01 oolite is in objc. heh 01:01:17 portable objc! 01:09:20 -!- Lymee has quit (Ping timeout: 276 seconds). 01:11:59 agum library and program: Unification and Matching in an Abelian Group 01:11:59 cmu library and program: Unification in a Commutative Monoid 01:12:03 oerjan: IS THERE ANYWHERE SAFE FROM UNIFICATION 01:12:29 elliott: koreas? taiwan? 01:12:41 (I guess we can rule out germany) 01:12:51 hyuk 01:13:59 cyprus? 01:14:16 gondwana? 01:14:44 -!- cheater_ has quit (Ping timeout: 255 seconds). 01:17:21 it's still expanding as far as i know.. my discordian friends ..the unification will implode if we don't find a new name for the princess ;) 01:20:06 plagiata 01:20:39 -!- Sgeo has joined. 01:21:32 hey it's not taken, it just grows and breeds tiny new creatures 01:22:20 What? 01:22:32 Sorry, looking at logs right now will put me in a world of pain 01:24:15 !bf . 01:24:21 ... 01:26:20 Ok, can afford to look at logs now 01:27:29 WOAH 01:28:06 http://calormen.com/l33t/jselite.htm 01:28:08 -!- cheater_ has joined. 01:30:55 -!- Vorpal has quit (Ping timeout: 258 seconds). 01:32:21 -!- Lymee has joined. 01:32:28 i'm a tard, the bbc was 6502? 01:38:51 i need to write some 6502 code 01:44:54 <3 Text Elite. 01:48:48 Phantom_Hoover, I assume these are not in any particular order? 01:49:11 http://calormen.com/l33t/jselite.htm 01:49:55 OK I think it's starting to get light outside argh. 01:49:55 -!- Phantom_Hoover has left ("Leaving"). 01:49:57 -!- Phantom_Hoover has quit (Quit: Leaving). 01:50:12 no it isnt 01:50:40 it takes another hour for that] 01:50:53 hehe 01:50:54 I think NES/Famicom is like 6502 except that the decimal mode has no function 01:51:52 the bcd instructions were useless anyway :) 01:52:39 "The Ricoh 2A03 was a 6502 variant lacking the BCD Mode, used in the Nintendo Entertainment System." 02:02:53 "We also experiment with photograpy of nudes painted with flourescent cosmetics under "black" (UV) light. " -Ian Bell, as we love him 02:04:17 a 02:17:06 I think the decimal mode flag still exists except that it doesn't do anything except storing one flag bit (now you can use it for your own purpose, I think). 02:27:38 -!- TeruFSX has quit (Ping timeout: 255 seconds). 02:40:39 :t interleave 02:40:40 forall (m :: * -> *) a. (MonadLogic m) => m a -> m a -> m a 02:41:53 CALESKELL 02:41:59 CakeProphet: s/m/[]/ 02:44:45 wtf O_O 02:44:52 what about Logic, LogicT, all of the other bizarre MonadLogic instances 02:44:57 like isn't there a ST instance 02:45:00 :t intersperse 'o' (repeat 'l') 02:45:01 [Char] 02:45:05 > intersperse 'o' (repeat 'l') 02:45:05 "lololololololololololololololololololololololololololololololololololololo... 02:45:24 > fix ("no" ++) 02:45:26 "nonononononononononononononononononononononononononononononononononononono... 02:45:26 oops 02:45:28 yes 02:46:14 > interleave "what" "now?" 02:46:15 "wnhoawt?" 02:46:47 what about Logic, LogicT, all of the other bizarre MonadLogic instances 02:46:48 those aren't standard 02:46:52 intersperse is caleskell 02:47:04 as in 02:47:05 oh 02:47:08 real intersperse is lists only 02:47:20 :t intercalate 02:47:21 forall a. [a] -> [[a]] -> [a] 02:47:27 elliott: um that's interleave, not intersperse 02:47:31 -!- Behold has quit (Remote host closed the connection). 02:47:34 :t intersperse 02:47:35 forall a. a -> [a] -> [a] 02:47:38 yeah yeah 02:47:39 same thing 02:47:45 ?src Int (/) 02:47:45 Source not found. Do you think like you type? 02:47:46 ?src div 02:47:46 Source not found. Your mind just hasn't been the same since the electro-shock, has it? 02:47:53 ?hoogle div 02:47:53 Prelude div :: Integral a => a -> a -> a 02:47:53 Data.Fixed div' :: (Real a, Integral b) => a -> a -> b 02:47:53 Control.Exception DivideByZero :: ArithException 02:47:57 um no caleskell in intersperse 02:48:04 :t interleave 02:48:05 forall (m :: * -> *) a. (MonadLogic m) => m a -> m a -> m a 02:48:10 you know what i mean 02:48:17 :t intercalate 02:48:17 forall a. [a] -> [[a]] -> [a] 02:48:24 surely that could be generalised :) 02:48:36 elliott: um afaik interleave does not exist in Data.List at all 02:48:41 ?hoogle interleave 02:48:42 System.IO.Unsafe unsafeInterleaveIO :: IO a -> IO a 02:48:42 Control.Monad.ST unsafeInterleaveST :: ST s a -> ST s a 02:48:42 Control.Monad.ST.Lazy unsafeInterleaveST :: ST s a -> ST s a 02:48:43 oh 02:48:47 fair enough then 02:48:55 it's entirely caleskell, then 02:49:02 although it might have been useful 02:49:38 quotRemInt :: Int -> Int -> (Int, Int) 02:49:38 quotRemInt a@(I# _) b@(I# _) = (a `quotInt` b, a `remInt` b) 02:49:38 -- OK, so I made it a little stricter. Shoot me. (WDP 94/10) 02:49:38 divModInt :: Int -> Int -> (Int, Int) 02:49:38 divModInt x@(I# _) y@(I# _) = (x `divInt` y, x `modInt` y) 02:49:45 it's ok WDP, we forgive you 02:49:48 > interleave "abc" (repeat ' ') 02:49:49 "a b c ... 02:50:01 > "hello" >>- return 02:50:02 div x@(I8# x#) y@(I8# y#) 02:50:02 | y == 0 = divZeroError 02:50:02 | x == minBound && y == (-1) = overflowError 02:50:02 | otherwise = I8# (narrow8Int# (x# `divInt#` y#)) 02:50:02 "hello" 02:50:03 boring 02:50:14 wait shouldn't that have a hash after the 0 in the y comparison 02:50:16 elliott: not quite the same as intersperse even that way 02:50:23 :t (>>-) 02:50:24 forall (m :: * -> *) a b. (MonadLogic m) => m a -> (a -> m b) -> m b 02:51:06 you know what i wish? 02:51:20 i wish the fail method wasn't in the Monad class. 02:51:29 i wish that too 02:51:33 (and replaced with class MonadFail e m where fail :: e -> m a) 02:51:39 (instance MonadFail e (Either e) where fail = Left) 02:51:46 (instance MonadFail e Maybe where fail = const Nothing) 02:51:58 instance (Show e, Typeable e) => MonadFail e IO where fail = throw . SomeWrapper) 02:52:03 i also wish there weren't so many ridiculous equivalent typeclasses 02:52:07 that would be Nice. 02:52:28 myFailingThing :: (MonadFail String m) => Int -> m BlahBlah 02:52:34 monqy: like what? 02:52:50 elliott: off the top of my head, monadplus, alternative, and friends 02:52:58 ah, right 02:53:00 ?src MonadPlus 02:53:00 Source not found. Are you on drugs? 02:53:03 isn't MonadPlus just Monoid 02:53:09 that too 02:53:12 monqy: i also wish applicative was a superclass of monad. 02:53:18 mmmm 02:53:24 monqy: and also, that subclasses could define default methods for _superclasses_ 02:53:29 that use the methods in itself 02:53:31 yes yes 02:53:32 so that you would have 02:53:34 class Monad m where 02:53:35 ... 02:53:37 fmap = liftM 02:53:43 pure = return 02:53:43 etc. 02:53:50 then you could just define one Monad instance, and get Functor and Applicative for free. 02:53:54 why doesn't this already work. 02:53:59 > "hello" >>- repeat 02:53:59 "hehlhehlhehlhehohehlhehlhehlhehohehlhehlhehlhehohehlhehlhehlhehohehlhehlhe... 02:54:02 it would retain total backwards compatibility 02:54:03 woohoo 02:54:07 monqy: lol 02:54:33 who do you think I need to pay to get those subclass defaults in GHC 02:54:40 oh, it would also let you clean up the numeric prelude 02:54:41 by, like 02:54:44 just defining a Field instance 02:54:52 and getting all the weird algebraic superclasses filled in for you 02:55:12 > once "hello" 02:55:13 "h" 02:55:16 :t (>>-) 02:55:17 forall (m :: * -> *) a b. (MonadLogic m) => m a -> (a -> m b) -> m b 02:55:41 i would make haskell just that little bit nicer than it is if i was dictator :( 02:55:43 oh just the >>= for MonadLogic? 02:55:48 or something else 02:55:48 yeah 02:55:50 fair >>= 02:55:58 oh 02:56:03 monqy knows too much about MonadLogic 02:56:08 i am staring suspiciously at him 02:56:18 i have the docs open _right now_ 02:56:52 > runLogic "fucks" (flip const) 0 02:56:52 Couldn't match expected type `Control.Monad.Logic.Logic a' 02:56:53 against ... 02:57:08 ur a fagot 02:57:09 :( 02:57:11 hmm 02:57:20 :t runLogic 02:57:21 forall a r. Logic a -> (a -> r -> r) -> r -> r 02:57:21 *ovations* 02:57:21 logict is cool 02:57:25 its oleg 02:57:29 olegs cool 02:57:36 deep thoughts w/ ehird 02:57:50 i have the paper but its in my reading pile 02:57:53 not my brain 02:58:07 monqy: the entirety of okmij.org should be in your reading pile and/or brain 02:58:09 even the C++ bits 02:58:12 even the Perl bits 02:58:20 @src MonadLogic 02:58:20 Source not found. Are you on drugs? 02:58:21 putting in reading pile 02:58:40 monqy: you do know of oleg though right 02:58:40 rofl 02:58:46 nice updates 02:58:47 like in the "minor deity" sense of knowing 02:58:48 i've heard the name 02:58:59 > "ab" >>- repeat 02:58:59 the name;s everywhere 02:58:59 "ababababababababababababababababababababababababababababababababababababab... 02:59:04 > "abc" >>- repeat 02:59:05 "abacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacab... 02:59:29 that doesn't look very fair, every second is an a :P 02:59:32 monqy: he's basically a genius. he has done practically everything that is possible to do in the lambda calculus, in haskell, in scheme, in haskell's type system, in scheme hygienic macros. 02:59:37 and he even does practical stuff, too :D 02:59:39 e.g. iteratees are his fault. 02:59:55 hmm, did Oleg popularise the zipper? 02:59:59 I think he might have 03:00:04 oerjan: hard to be fair when you have an odd number :P 03:00:24 > ifte "hello" fail "nope" 03:00:24 Couldn't match expected type `GHC.Types.Char' 03:00:24 against inferred type... 03:00:31 uhh 03:00:33 elliott: um why can't it be the same as cycle "abc"? 03:00:34 oh right 03:00:35 you need Logic a 03:00:40 oerjan: presumably that's not how it works 03:00:42 > ifte "hello" (const fail) "nope" 03:00:42 Couldn't match expected type `[b]' 03:00:43 against inferred type `GHC.Base.... 03:00:46 oh wait 03:00:49 as in 03:00:51 not the same operation 03:00:54 > ifte "hello" (fail . return) "nope" 03:00:55 "" 03:00:59 > "abcd" >>- repeat 03:01:00 "abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadab... 03:01:06 not knowing how to use ifte is the worst 03:01:12 elliott: that's even ;P 03:01:14 monqy: btw i was not serious about reading all of okmij.org. that would take a _long_ time 03:01:22 too late 03:01:26 i will only read part of it 03:02:06 > ifte "hello" repeat "nope" 03:02:07 "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh... 03:02:21 just read the haskell, scheme, prolog, ML, typed DSL, other, continuations, OS, computation, essays, probabilistic programming, numerical math, and meta-theory sections. plus everything linked from the algorithms and data structures, computing and computation, operating systems and networking pages. 03:02:32 that skips out the C/C++, Perl and XML sections 03:02:48 i dislike xml xml is boring and ugly 03:02:55 is there anything interesting at all in xml 03:02:57 oleg makes it cool 03:03:03 now im curious 03:03:14 he invented SXML, which embeds the entirety of XML into nice clean s-expressions 03:03:23 thus making it not horrid to process and generate from Scheme code 03:03:40 then went and built an entire practical library on top of it as he is infuriatingly wont to do. 03:03:44 you can only be good at one thing, oleg :( 03:03:56 also sxpath, which is basically s-expression xpath for sxmls. 03:04:01 and then 03:04:02 HSXML: Typed SXML 03:04:02 This message reports on several experiments in Haskell to ascertain plausibility, benefits and drawbacks of typed SXML in a mainstream functional language. It turns out that Haskell as it is can represent semi-structured data in SXML-conforming syntax, with the extensible set of `tags' and statically enforced content model restrictions. Querying, transforming and advanced rendering into HTML and XML are possible. The experience of writing (modera 03:04:02 tely complex, so far) web pages in HSXML shows that the typed SXML can be used in practice. 03:04:28 what, he wrote an sxml->latex translator 03:04:35 Joint processing of two immutable SXML documents with update cursors 03:04:35 We give an example of traversing two SXML documents ``side-by-side'' and making pure functional updates to arbitrary encountered nodes. The example illustrates the benefits of zipper -- an update cursor into an immutable data structure. 03:04:45 SXML as a normalized database 03:04:45 S-expression-based files are handy not only for authoring Web pages. They can be used to build XML documents. The following article shows a real-life and less-trivial example of that. It is straightforward to convert data into (tag "data") and vice versa. The SSAX parser and the SXML manipulation tools can do that easily. However, exporting relational sources into XML often runs into an impedance mismatch: XML by its nature is a hierar 03:04:45 chical database. We will show an example of generating XML from s-expressions that involves denormalizations, "table joins" and third-order tags. The s-expression format turns out not only more understandable and insightful, but more concise as well, by a factor of four. 03:04:51 dammit oleg 03:04:56 you're making me interested in xml :( 03:06:50 > cycle "01" >>- repeat 03:06:51 "01000101010001000100010101000101010001010100010001000101010001000100010101... 03:08:38 ?type (>>-) 03:08:39 forall (m :: * -> *) a b. (MonadLogic m) => m a -> (a -> m b) -> m b 03:09:13 ?src (>>-) 03:09:13 Source not found. 03:09:18 what is that? 03:09:26 fair >>= for monadlogic 03:09:45 i dont know monadlogic.. i need to look it up 03:09:52 m >>- f = do { Just (a, m') <- msplit m; interleave (f a) (m' >>- f) } 03:09:57 thats the default definition 03:10:38 aha 03:11:12 > msplit "abcd" 03:11:13 [Just ('a',"bcd")] 03:11:32 so i thought people used maybe/[] for backtracking.. whats this got over them? 03:11:50 cool backtracking for cool people 03:12:23 oh man is this actually a monad 03:12:28 newsham: oleg 03:12:41 newsham: tl;dr its about five hundred times more efficient. 03:12:46 and has a cleaner model IIRC 03:13:20 newsham: it looks like >>- unlike >>= backtracks on the first argument even if the second one returns an infinite list 03:14:11 instance Monad ((:>:) a) where 03:14:11 return a = Tele (\f x -> (a,x)) 03:14:11 t >>= f = Tele (\ff x -> unTele (f (get t x)) ff x) 03:14:12 maybe it is 03:14:43 what are the monad laws again 03:15:11 with that >>- i'm particularly worried about the third one 03:16:14 return x >>= f = f x, x >>= return = x, (x >>= f) >>= g = x >>= \t -> f t >>= g 03:16:14 -!- Sgeo has quit (Ping timeout: 255 seconds). 03:16:48 thou shalt not take the name of wadler in vain, thou shalt not covet your neighbors impure scripting language, bind unto others as you would have them bind unto you 03:16:51 or something like that 03:16:58 whats (:>:) 03:17:19 -!- Sgeo has joined. 03:17:37 monqy: newtype a :>: b = Tele { unTele :: (b -> b) -> a -> (b, a) } 03:17:37 How likely is it that Symantec is the reason my computer runs like crap? 03:17:42 my reinvention of lenses and fclabels 03:17:45 except this has efficient update 03:17:49 Sgeo: haahahahaha why do you use symtantec 03:17:55 is it because your father demands it 03:17:56 is it a good reinvention 03:18:01 elliott, even my dad hates it. 03:18:03 monqy: it has efficient update, so maybe? 03:18:06 The school requires it. 03:18:06 Sgeo: then why the fuck do you use it 03:18:09 hahahaha 03:18:10 who gives a shit 03:18:12 do they check 03:18:13 what sort of school 03:18:14 would do that 03:18:19 To use wifi 03:18:21 monqy: my baby's first college 03:18:22 Sgeo: do they check 03:18:23 At school, I mean 03:18:25 Sgeo: do they check 03:18:29 > ("ab" >>- \x -> [[x,'c'],[x,'d']]) >>= \y -> ['e':y,'f':y] 03:18:30 ["eac","fac","ebc","fbc","ead","fad","ebd","fbd"] 03:18:41 elliott, yes. Not sure how, probably can be worked around 03:18:48 Sgeo: uninstall it immediately and figure out how to work around it 03:18:58 er wait 03:19:04 > "ab" >>- \x -> [[x,'c'],[x,'d']] >>- \y -> ['e':y,'f':y] 03:19:04 sgeo: turn it off and find out. 03:19:05 ["eac","ebc","ead","ebd","fac","fbc","fad","fbd"] 03:19:16 sgeo: do you really want a useless piece of software slwoing down every single file access? 03:19:25 > ("ab" >>- \x -> [[x,'c'],[x,'d']]) >>- \y -> ['e':y,'f':y] 03:19:25 ["eac","ebc","fac","ead","fbc","ebd","fad","fbd"] 03:19:46 elliott: ok >>- is not a monad >>= 03:19:53 oerjan: no shit 03:19:56 its not meant to be 03:20:01 maybe you should read the docs :P 03:20:05 um 03:20:11 > (0$0 >>-) 03:20:12 The operator `Control.Monad.Logic.Class.>>-' [infixl 9] of a section 03:20:12 m... 03:20:29 elliott: that's a criminal lack of fixity consideration 03:20:36 also, what do you mean _read_? 03:20:45 study 03:20:57 as the brits say, revise 03:21:04 worship??? 03:21:30 (b :>: c) -> (a :>: b) -> (a :>: c) 03:21:31 ugh how 03:22:37 :t ?x 03:22:38 forall t. (?x::t) => t 03:22:45 why does nobody use implicit parameters 03:23:26 implicit parameters are scary 03:24:04 i wish i had a big project like ghc to hug 03:24:12 elliott: first oleg needs to show how they can be used to make lightweight delimited continuations that also make coffee 03:24:16 like i feel like i'm getting really good at modelling large programs with haskell 03:24:19 but to test that 03:24:23 i need to write a large program 03:24:27 and i have no large programs to _write_ 03:24:30 oerjan: :D 03:24:38 "lightweight delimited continuations" is _so_ oleg 03:27:57 http://www.symantec.com/business/support/index?page=content&id=TECH102286&locale=en_US oh what the fuck why do they make it annoying? 03:28:06 They don't just provide an uninstaller, afaict 03:28:13 ok, so fair disjunction is mplus that lets some answers from both sides in 03:28:17 ? 03:28:26 n/m they do 03:28:27 and thats "interleave"? 03:29:01 > interleave "hello" "world" 03:29:01 "hweolrllod" 03:29:25 >interleave [1..] [-1,-2..] 03:29:29 >interleave [1..] [-1,-2..] 03:29:32 > interleave [1..] [-1,-2..] 03:29:33 [1,-1,2,-2,3,-3,4,-4,5,-5,6,-6,7,-7,8,-8,9,-9,10,-10,11,-11,12,-12,13,-13,1... 03:29:41 > sum $ interleave [1..] [-1,-2..] 03:29:45 mueval-core: Time limit exceeded 03:29:51 Blasphemy. 03:30:18 so you basically use "interleave" and ">>-" where you would have used "mplus" and ">>=" in the past? 03:30:23 carpen dioxide 03:31:38 once for pruning, ifte for soft-cut 03:31:42 msplit for msplit 03:31:52 > fix ((0:).(interleave<=<(1-))) 03:31:53 Couldn't match expected type `[t]' 03:31:53 against inferred type `m a -> m a' 03:31:55 bah 03:32:13 Deewiant: Did you ever benchmark list-tries against Data.Map? 03:32:36 monqy: side-msplitting 03:33:44 it's like you have one element of a side and then the rest of the side except when there is no side in which case you have nothing???? 03:34:20 well a wrapped just elementofside,restofside or a wrapped nothing 03:34:43 i am bad at wording things what will i do in life 03:34:59 :t (<**>) 03:35:00 forall (f :: * -> *) a b. (Applicative f) => f a -> f (a -> b) -> f b 03:35:30 I still don't quite understand why (<**>) exists 03:36:13 ?hoogle address 03:36:13 Text.Html address :: Html -> Html 03:36:13 Text.XHtml.Frameset address :: Html -> Html 03:36:13 Text.XHtml.Strict address :: Html -> Html 03:36:16 ?hoogle address with some hashes after it 03:36:17 No results found 03:36:17 monqy: to get the actions done in the reverse order of the application 03:36:20 ?hoogle so unsafe baby 03:36:20 No results found 03:36:24 ?hoogle be unsafe w/ me 03:36:24 Parse error: 03:36:24 --count=20 "be unsafe w/ me" 03:36:25 ^ 03:36:29 ?hoogle ass 03:36:29 Control.Exception assert :: Bool -> a -> a 03:36:29 Control.OldException assert :: Bool -> a -> a 03:36:29 Control.Exception.Base assert :: Bool -> a -> a 03:36:30 oerjan: but is it ever stylish to do that 03:37:01 monqy: istr we found a perfect use for it in one of elliott's programs 03:37:11 :D 03:37:14 my best programs 03:38:08 monqy: it was in Parsec, for a language syntax where the "minus sign" comes after the number 03:38:49 so it was essentially parseNumber <**> (parseSign *> negate <|> id) 03:39:03 -!- TeruFSX has joined. 03:39:05 well at one point any way 03:39:17 very stylish 03:39:39 that is actually stylish, dunno if you're being sarcastic 03:39:50 sometimes im not sarcastic 03:40:03 what's the definition of (<**>) btw? 03:40:06 monqy: sometimes 03:40:13 @src (<**>) 03:40:13 monqy: like whenever you're not talking to me ;D 03:40:14 (<**>) = liftA2 (flip ($)) 03:40:15 sometimes im both sarcastic and not sarcastic in the same sentence i am a bad person 03:40:36 i can never tell whether monqy is mocking me or agreeing with me, maybe he is always mocking me, maybe he is always both 03:41:14 > fix ((0:).(interleave<*>map(1-))) 03:41:15 [0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,... 03:41:25 -!- azaq23 has joined. 03:41:28 hm that's not quite it 03:42:16 -!- Sgeo has quit (Read error: Connection reset by peer). 03:42:38 wtf not 03:43:00 > interleave "0110" "1001" 03:43:01 "01101001" 03:43:34 oh wait 03:44:21 > interleave "abcd" "ABCD" 03:44:21 "aAbBcCdD" 03:44:49 oh hm 03:45:13 > fix ((0:).(interleave=< [0,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,... 03:45:21 still not 03:45:27 What are you trying to get it to do? 03:46:12 > interleave "1001" "0110" 03:46:17 > interleave "1001" "0110" 03:46:18 "10010110" 03:46:22 > fix (((0:).tail).(interleave<*>map(1-))) 03:46:24 Terminated 03:46:31 wat 03:46:40 is there any other pair of four digit binary strings that has that property oerjan? 03:46:52 certainly :P 03:47:12 > interleave "1010" "0101" 03:47:13 "10011001" 03:47:50 hm i guess only trivial ones 03:47:58 > interleave "0000" "0000" 03:47:59 "00000000" 03:48:24 > fix (((0:).tail).(interleave<*>map(1-))) 03:48:26 [0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,... 03:48:26 hmm 03:48:41 that works, but i'd hoped for something prettier :( 03:48:42 -!- Lymia has joined. 03:48:57 hm... 03:49:04 why is reallyUnsafePtrEquality# not reliable :( 03:49:21 I think it is the Thue-Morse sequence, isn't it? 03:49:23 reallyUnsafe good prefix 03:49:31 monqy: it is 03:49:40 zzo38: yep 03:49:43 it's not nearly as unsafe as unsafeCoerce so i dunno why it's called that :) 03:49:56 reallyReallyUnsafeCoerce 03:51:12 justFuckingDon'tDoItNotEvenOnceCoerce :: a -> no bad why no b 03:51:54 elliott: i'm sorry that won't type :P 03:52:11 -!- Lymee has quit (Ping timeout: 264 seconds). 03:52:23 :t const undefined 03:52:24 forall a b. b -> a 03:52:26 intern :: (Hashable a, Ord a) => InternStore a -> a -> Interned a 03:52:26 intern (InternStore var) a = unsafePerformIO $ modifyMVar var $ \m -> do 03:52:27 case Map.lookup a m of 03:52:27 Nothing -> 03:52:27 let interned = Interned a 03:52:29 m' = Map.insert a interned m 03:52:31 in interned `seq` m' `seq` return (m', interned) 03:52:33 (it has a recursive _kind_) 03:52:33 Just interned -> interned `seq` return (m, interned) 03:52:37 I can only assume that HashMap is being evil and copying the value 03:52:44 because this should _not_ copy interned, ever 03:52:55 (I use reallyUnsafePtrEquality# to compare Interneds (this is the only way to construct them)) 03:53:30 > [1..] >>- id 03:53:31 No instances for (GHC.Num.Num [b], GHC.Enum.Enum [b]) 03:53:31 arising from a use... 03:53:34 oerjan: halp 03:53:35 erm 03:53:39 > [1..] >>- return 03:53:39 [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28... 03:53:44 oops 03:54:22 -!- Lymia has changed nick to Lymee. 03:54:30 no but srs 03:54:35 why is copy :( 03:54:39 maybe i'll write my own map as a test 03:55:32 _can_ HashMap copy the value? 03:56:13 oerjan: I don't know, but GHC certainly can in HashMap's implementation if it wants to 03:56:38 oerjan: all I know is, the second time round it _does_ fetch it from the hash table rather than constructing a new one 03:56:43 so by all rights it should be the exact same object as I put in 03:57:21 elliott: are you calling intern with the same parameters anywhere? 03:58:36 dammit, it's false with IntMap too 03:58:37 oerjan: yes 03:58:40 store <- emptyInternStore -- :: IO (InternStore Int) 03:58:40 let foo = intern store 9 03:58:40 print foo 03:58:40 let bar = intern store 9 03:58:40 print bar 03:58:44 [1..] >>- show 03:58:46 er 03:58:48 > [1..] >>- show 03:58:49 "12345678911011121314151617182920212223242526272839303132333435363738494041... 03:58:51 and when bar is evaluated, it _does_ take the "already in the map" branch 03:58:55 but then the two objects aren't pointer-equal 03:58:58 so it's being copied /somewhere/ 03:59:03 elliott: in that case ghc is perfectly allowed to let bar be just foo 03:59:14 -!- Sgeo has joined. 03:59:28 and do no reevaluation 03:59:32 oerjan: um yes, and then reallyUnsafePtrEquality# would be true 03:59:35 oerjan: but i've traced the evaluation 03:59:37 hm... 03:59:38 with Debug.Trace 03:59:42 and it _does_ evaluate both separately 03:59:48 with bar taking the other branch 03:59:53 IIRC automatic CSE has space leak problems in haskell 03:59:56 so ghc tends not to do it 04:00:03 but yeah, there is some copying going on here 04:00:04 right 04:00:20 http://www.haskell.org/ghc/docs/7.0.3/html/libraries/ghc-prim-0.2.0.0/GHC-Prim.html#g:19 I love how it isn't even documented 04:00:24 they _really_ don't want you to use this 04:02:00 * Sgeo goes to install MSE 04:02:22 oerjan: I think if you unpack (Just a) and then construct (Just a), say, a might be copied 04:02:31 oerjan: perhaps especially if a is an Int, since unboxing/reboxing is really cheap... 04:02:49 * elliott reads lists 04:02:52 Prelude GHC.Exts GHC.Prim> let q = Just 3 04:02:52 Prelude GHC.Exts GHC.Prim> let f j@(Just a) = j; r = f q 04:02:52 Prelude GHC.Exts GHC.Prim> I# (reallyUnsafePtrEquality# q r) 04:02:52 0 04:02:52 Prelude GHC.Exts GHC.Prim> r 04:02:59 1 04:03:01 Prelude GHC.Exts GHC.Prim> 04:03:03 Prelude GHC.Exts GHC.Prim> let q = Just 3 04:03:05 Prelude GHC.Exts GHC.Prim> let f j@(Just a) = j; r = f q 04:03:07 Prelude GHC.Exts GHC.Prim> I# (r `seq` reallyUnsafePtrEquality# q r) 04:03:09 0 04:03:11 Prelude GHC.Exts GHC.Prim> I# (r `seq` reallyUnsafePtrEquality# q r) 04:03:13 1 04:03:15 ah, what a wonderful function 04:03:23 oerjan: do you think if i went into #ghc and asked for help debugging my reallyUnsafePtrEquality# use they'd laugh at me... 04:04:12 > interleave "1110" "1000" 04:04:13 "11101000" 04:05:21 oerjan: that one works, but not commutatively 04:05:42 > interleave "0001" "0111" 04:05:43 "00010111" 04:06:02 the condition is that one should be the negation of the other reversed 04:06:58 > interleave "abcd" "efgh" 04:06:59 "aebfcgdh" 04:07:36 -!- myndzi\ has joined. 04:07:48 elliott: hm i guess some unboxing might be bad. what happens if you use a definitely not unboxable value? 04:08:02 -!- Sgeo has quit (Read error: Connection reset by peer). 04:08:04 oerjan: do you have such a type? :P 04:08:40 elliott: well try something better than Int, anyway :P 04:08:49 oerjan: with Data.Map 04:08:49 ? 04:08:53 yeah 04:08:56 -!- derrik has joined. 04:09:06 data V = V String String 04:09:08 good data type dot jpg 04:09:32 There are many ways to generate the Thue-Morse sequence and I think I have also read there are many ways in which it can be used. 04:09:39 String alone might also work, not? 04:10:11 oerjan: still false, unfortunately 04:10:21 i wonder whether it's lack of strictness 04:10:25 because evaluation _will_ change the pointer 04:10:30 but i evaluate a before everything else, so... 04:11:07 quintopia: b=c=e,d=f=g 04:11:08 -!- myndzi has quit (Ping timeout: 255 seconds). 04:11:33 > interleave "0001" 0110" 04:11:34 : 04:11:34 lexical error in string/character literal at end o... 04:11:40 > interleave "0001" "0110" 04:11:41 "00010110" 04:12:40 data V = V String V -- use this 04:12:42 also use deepseq 04:12:45 monqy: lol 04:12:49 well at least it wouldn't return false 04:13:09 oerjan: interestingly, I think the interface I'm exposing is actually pure 04:13:22 > let x = if x then False else x in x 04:13:25 since you could easily implement an analogue that just returns (Interned a) all the time, and has a slow (==) 04:13:26 mueval-core: Time limit exceeded 04:13:35 so ideally, this will just be a really big optimisation :P 04:13:51 hash consing 04:14:18 oerjan: what of it? 04:14:27 it has similarities to what i'm doing, yes 04:14:49 i thought that was about what you were doing 04:15:16 "Do glasses not exist in the afterlife?" 04:15:26 do pants exist in the afterlife 04:15:38 "Oh. I never noticed for some reason. I guess you don't need corrective lenses when you're dead anyway." 04:15:57 do hoohas/dingdongs exist in the afterlife 04:16:17 afterlife is confusing 04:16:25 the dingdongs ate all the hoohas 04:16:32 isn't that a bit backwards 04:16:46 the other way sounded a bit rude 04:17:03 oerjan: I really wonder how this is being copied.. 04:17:06 [asterisk]... 04:17:09 maybe I should use StableName 04:17:16 but that would be like, slow :( 04:17:21 Would questions about debugging a usage of reallyUnsafePtrEquality# be appropriate here? Would they be appropriate _anywhere_? 04:17:22 [chirps] 04:17:37 is that #ghc 04:17:44 heheheheheehe 04:18:09 yep 04:20:51 oerjan: maybe i should use some structure other than a map just to test 04:21:25 ye olde list 04:21:46 sigh 04:21:48 made it a list 04:21:50 still gets copied 04:22:18 ok made it Maybe, /still/ gets copied 04:22:23 this now officially makes no sense at all 04:23:24 Identity? 04:23:43 monqy: that wouldn't work, I need an empty state 04:23:45 -!- Sgeo has joined. 04:23:49 oh 04:25:32 elliott: what happens if you _drop_ the seq's for interned? 04:26:00 well in the Nothing case 04:26:17 same results 04:26:39 huh 04:27:11 someone in ghc seems to have taken the bait 04:27:17 i am carefully watch............ 04:27:20 yay 04:27:30 good taken or bad taken 04:28:10 i don't know 04:30:44 I think I scared them off with code 04:30:52 oerjan: here it is, btw http://hpaste.org/48651 04:30:58 no refunds if it kills you 04:31:23 that's ok, i won't need a refund if i'm dead 04:31:36 or will you 04:31:59 well i guess if the ancient greeks were right, i might need a couple of coins 04:32:27 i cant stop seeing the hlinted stuff it is haunting me 04:33:07 im sorry 04:33:13 do you want me to fix it 04:33:21 i cant fix the second one though because like 04:33:30 that might ruin some sequencing i'm going for 04:33:41 thats spooky 04:33:44 im spooked 04:34:05 Dammit I can't find the page on the cable modem to change the password 04:34:08 elliott: um r <- return ... should be entirely equivalent to let r = ... no ? 04:34:16 oerjan: look I trust _nothing_ right now :D 04:34:21 GHC might do some FUNNY OPTIMISATIONS 04:34:52 Sgeo: well you need the password for getting to the page, obviously 04:35:00 oerjan, I have that 04:35:11 I just want to change it so my dad can't mess with anything 04:35:11 no no, the _secret_ password 04:35:22 ah, a noble cause 04:35:26 But... I don't think there's anything in here that's even touchable in any case 04:36:21 elliott: oh, what happens if you replace that with return $! ( ... ) ? 04:37:01 all of them? 04:37:09 hm perhaps 04:37:19 well the prints are trying to make it strict, but ok 04:37:24 wow 04:37:25 now its true 04:37:27 can i hug you 04:37:29 XD 04:37:39 ...but that's not really good enough, it has to work when used _normally_ 04:38:23 elliott: hm i guess return x >>= f might actually get optimized into f x even in IO 04:38:25 how to secretly strictify it 04:39:21 test :: IO Bool 04:39:21 test = do 04:39:21 store <- emptyInternStore 04:39:21 let foo = intern store (V "a" "b") 04:39:22 bar = intern store (V "a" "b") 04:39:24 in case reallyUnsafePtrEquality# foo bar of 04:39:26 0# -> return False 04:39:30 1# -> return True 04:39:32 this has to work 04:40:20 elliott: what if you replace reallyUnsafePtrEquality# with a function which applies seq to its arguments first, just in case? 04:40:51 aha 04:40:52 in case foo `seq` bar `seq` reallyUnsafePtrEquality# foo bar of 04:40:53 makes it work 04:41:25 and with Int, too 04:41:29 ok now to try and bring back in Map 04:42:03 yay, it's working 04:43:19 elliott: it occurs to me you might theoretically need those unsafePerformIO's to be reentrant 04:43:31 oerjan: well that's why I used an MVar... but what do you mean? 04:44:12 if something causes an intern to be evaluated while you are already evaluating one 04:44:33 oerjan: well isn't the point of MVar that in that case, one thread will wait until the other is done modifying... 04:44:43 because as soon as one thread takes from the mvar, it becomes empty 04:44:46 um i mean inside the same thread 04:44:50 and other takings hang until it gets filled by the modification 04:44:52 oerjan: oh, like... 04:45:00 intern store (internedValue (intern store 9))? 04:45:05 yeah 04:45:13 oerjan: that's not a problem, I seq a first 04:45:15 or do you mean like 04:45:21 intern store (Embed (Blah (internedValue (intern store 9)))) 04:45:26 so it only comes up when the map structures start Ording? 04:45:32 yeah 04:45:44 oerjan: hm so I either need re-entrancy or deepseq... 04:46:06 oerjan: Or I could cheat, and just seq an Ord and Eq operation on the value beforehand >:) 04:46:15 which is all Map can do, due to parametricity 04:47:05 heh 04:47:22 oerjan: although I want this to be typeclassed on the type of map, I think 04:47:24 yeah compare x x should normally get to the bottom of it 04:47:32 because e.g. HashMap or IntMap could improve performance a lot in some cases 04:47:41 so I guess the typeclass will just have some sort of force operation implemented in that way 04:48:02 oerjan: I'm not sure how I could do re-entrancy, really... before calling the map I could re-fill the MVar 04:48:05 and then un-fill it afterwards 04:48:09 but that would fuck up using multiple threads 04:48:36 yikes 04:48:49 so yeah, forcing is preferable 04:48:54 oerjan: otoh compare might be _slow_... 04:49:02 oerjan: e.g. String 04:49:08 -!- Lymia has joined. 04:49:13 and since the result won't be cached, it'll end up doing useless computation 04:49:24 so arguably, deepseq is less ugly 04:49:45 although deepseq might very well be unnecessarily slow, too 04:52:03 mhm 04:52:17 -!- Lymee has quit (Ping timeout: 276 seconds). 04:52:57 oerjan: I'm tempted to say that just using them in that way is undefined behaviour, but then my interface isn't really "pure" any more :( 04:57:06 class InternStoreC store a r get put | store -> a get put where 04:57:06 internStoreGet :: store -> a -> (Interned a -> r) -> r -> get 04:57:06 internStorePut :: store -> a -> Interned a -> (store -> r) -> put 04:57:07 oerjan: behold my monster 04:57:19 I'm trying to allow those hashmaps that work in IO :D 04:59:41 instance InternStoreC (Map a (Interned a)) a r r r where 04:59:42 arrrrrrr 05:05:15 WARNING! THERE IS A MONSTER IN THE TYPE SYSTEM! 05:08:49 -!- azaq23 has quit (Quit: Leaving.). 05:13:41 -!- derrik has left. 05:23:01 whenever I see elliott using Haskell, I also see typeclasses with huge numbers of parameters 05:23:16 I think they are correlated in some way. 05:24:08 shut up, it happens when i generalise things. 05:24:17 in fairness, that is now the far more reasonable 05:24:19 class InternStoreMap store a where 05:24:19 internStoreEmpty :: IO store 05:24:19 internStoreGet :: store -> a -> IO (Maybe (Interned a)) 05:24:19 internStorePut :: store -> a -> Interned a -> IO store 05:24:50 but... elliott 05:25:04 it ONLY works with IO, and ONLY with Maybe, and Only with Interned 05:25:07 that's not general enough! 05:25:12 what 05:26:04 you need more typeclasses! 05:26:05 the IO is unsafePerformIO'd away 05:26:10 use MonadIO instead! 05:26:11 and Interned is the whole point :P 05:26:18 no, these functions are not externally used 05:26:24 it is just for 05:26:26 intern :: (InternStoreMap store a) => InternStore store -> a -> Interned a 05:26:26 intern (InternStore var) a = a `seq` unsafePerformIO $! modifyMVar var $! \m -> do 05:26:26 r <- internStoreGet m a 05:26:26 case r of 05:26:26 Nothing -> do 05:26:29 let interned = Interned a 05:26:31 m' <- interned `seq` internStorePut m a interned 05:26:33 return $! (m', interned) 05:26:35 Just interned -> interned `seq` return $! (m, interned) 05:26:37 so i can do 05:26:39 instance (Eq a) => Eq (Interned a) where 05:26:41 a == b = 05:26:43 case a `seq` b `seq` reallyUnsafePtrEquality# a b of 05:26:45 0# -> False 05:26:47 1# -> True 05:27:05 forcing reallyUnsafePtrEquality# usage is cool 05:27:16 you should probably name this function something like reallyReallyUnsafeIntern 05:27:22 CakeProphet: it's perfectly safe 05:27:24 externally 05:27:32 the outside interface is implementable by simple pure functions 05:27:39 this is just a lot faster (and the whole point for the module) 05:27:41 like reallyUnsafePtrEquality# 05:27:44 i do this shit so you don't have to 05:27:47 monqy: oh shaddap :P 05:28:28 that 0# -> False part isn't supposed to be safe, is it... 05:29:53 oerjan: it is safe, because the only way to construct an Interned is through intern 05:29:59 and I don't /think/ there is any way to cause it to be copied externally 05:30:37 -!- augur has joined. 05:30:57 I GUESS YOU WILL FIND OUT 05:31:38 indeed, when i publish it to hackage and people say ARE YOU FUCKING SERIOUS I WILL SHIT IN YOUR FUCKING HAT 05:31:46 SHIT SHIT SHIT SHIT SHIT SHIT SHIT 05:31:48 HAT 05:31:50 FUCK 05:32:21 OH MY GOD GHC 05:32:22 THE VARIABLE 05:32:22 IS NOT 05:32:23 FUCKING 05:32:24 AMBIGUOUS 05:32:42 is that you or them 05:32:44 i don't know, it looks a bit shifty to me 05:33:00 that was me 05:33:02 just the last bit 05:33:06 emptyInternStore :: (InternStoreMap store a) => IO (InternStore store) 05:33:06 emptyInternStore = do 05:33:06 mt <- internStoreEmpty :: IO store 05:33:06 v <- newMVar mt 05:33:06 return (InternStore v) 05:33:10 A0 IS NOT AMBIGUOUS OMG 05:34:53 missing functional dep? 05:36:06 (store -> a) 05:36:10 hmm, right 05:36:16 nope 05:36:18 i do need that fundep 05:36:21 but that doesn't fix this :( 05:36:25 huh 05:36:43 bleh but if i make it like 05:36:48 emptyInternStore :: (InternStoreMap store a) => IO (InternStore store a) 05:36:49 then it works 05:36:51 that's redundant, dammit 05:37:06 um what's the class definition? 05:37:50 ah, 05:37:51 data InternStore store = forall a. (InternStoreMap store a) => InternStore (MVar store) 05:37:52 works 05:38:00 but why can't a newtype have an existential blah :/ 05:38:00 hmm 05:38:09 I guess it's technically unnecessary here 05:38:13 i.e. i don't need the forall 05:38:16 oerjan: hey i... have an idea 05:38:19 oerjan: what if... i used... unsafeCoerce 05:38:30 what about a type family? 05:38:42 wait what, it fixed itself magically somehow 05:39:37 store <- emptyInternStore :: IO (InternStore (Cu.HashTable RealWorld a (Interned a))) 05:39:39 good lines of code 05:40:06 oerjan: you're right, it should probably be a type family 05:40:14 IO (InternStore Cu.HashTable) would be much preferable 05:40:16 well 05:40:18 IO (InternStore Cu.HashTable Int) would be much preferable 05:40:58 -!- elliott has left ("Leaving"). 05:41:02 -!- elliott has joined. 05:41:07 hi 05:42:27 hi 05:47:52 hmmm, I could use a type family for signal types I think. 05:48:10 you don't have to use every extension :P 05:48:13 though it may be unecessary. 05:48:40 I could simply have multiple constructors for one type. 05:49:45 elliott: rubbish! he needs an implicit rank-5 flexible GADT family operator! 05:50:04 @pl lookup k (GMapInt m) = Data.IntMap.lookup k m 05:50:04 (line 1, column 24): 05:50:04 unexpected "=" 05:50:04 expecting variable, "(", operator or end of input 05:50:16 *Data.Intern> test 05:50:16 Just "no" 05:50:17 yesss 05:50:45 CakeProphet: most pattern matching cannot be @pl'ed 05:50:55 ah, that makes sense. 05:51:04 and GADT/type family pattern matching cannot be ?pl'd at all really 05:51:12 because of the unification stuff 05:51:44 hm... 05:52:11 i.e. you always need all your stuff on the right-hand side of some matching 05:52:15 you can't reduce things to compositions 05:52:17 @pl let f (Just (Left (x,y))) = x ++ " does this work?" in f 05:52:17 (line 1, column 13): 05:52:17 unexpected "(" 05:52:17 expecting operator or ")" 05:52:25 but if I don't use type families I'll at least have a Signal typeclass with a toDiscreteSignal function. 05:52:27 sadly no :( 05:52:39 http://learncodethehardway.org/ ;; let's all read "how full of shit could zed shaw possibly be": the book 05:52:43 @pl let f (Just (x,y)) = x ++ " does this work?" in f 05:52:43 (line 1, column 13): 05:52:43 unexpected "(" 05:52:44 expecting operator or ")" 05:52:50 @pl let f (x,y) = x ++ " does this work?" in f 05:52:50 (++ " does this work?") . fst 05:52:56 If there ever were a quote that described programming with C, it would be this. To many programmers, this makes C scary and evil. It is the Devil, Satan, the trickster Loki come to destroy your productivity with his seductive talk of pointers and direct access to the machine. Then, once this computational Lucifer has you hooked, he destroys your world with the evil ”segfault” and laughs as he reveals the trickery in your bargain with him. 05:52:57 But, C is not to blame for this state of affairs. No my friends, your computer and the Operating System controlling it are the real tricksters. They conspire to hide their true inner workings from you so that you can never really know what is going on. The C programming language’s only failing is giving you access to what is really there, and telling you the cold hard raw truth. C gives you the red pill. C pulls the curtain back to show you the 05:52:59 wizard. C is truth. 05:53:01 oh my god 05:53:03 choke on vomit 05:53:05 "Why use C then if it’s so dangerous? Because C gives you power over the false reality of abstraction and liberates you from stupidity. 05:53:08 " 05:53:10 im reading your book 05:53:12 while this is still true, 05:53:14 nothing can liberate me from stupidity 05:53:16 apart from cold-blooded murder 05:53:20 "Exercise 2: Make Is Your Python Now 05:53:20 " 05:53:22 oh my god 05:53:24 stop 05:53:26 talking 05:53:30 monqy: lets share this experience together it will be unique... 05:53:35 "The difference is, I’m going to show you smarter Makefile wizardry, where you don’t have to specify every stupid little thing about your C program to get it to build. I won’t do that in this exercise, but after you’ve been using ”baby make” for a while, I’ll show you ”master make”. 05:53:37 im too busy dying 05:53:38 " 05:53:40 OH MY GOD LITERALLY DIE 05:53:42 from this unique experience 05:53:49 thank god it ends here 05:53:55 dont worry monqy its just five chapters (sentences) 05:53:56 elliott: lol, the false reality of abstraction. 05:54:45 After you read this book you should... 05:54:57 why would you even learn C anyway 05:55:03 chapters 55 and 56 are good chapters 05:55:06 -!- Sgeo has quit (Ping timeout: 255 seconds). 05:55:27 elliott: I learned C because a MUD codebase I was maintaining was written in it. 05:55:36 overall it was a good learning experience. 05:55:37 I wonder if there's a way to get the numeric address of something from GHC. 05:55:45 CakeProphet: no it wasn't, C is a terrible thing to know, it clouds your thinking 05:55:51 I think C is good programming language 05:56:03 int2Addr# :: Int# -> Addr#Source 05:56:03 Coerce directly from int to address. Strongly deprecated. 05:56:05 YOU'RE STRONGLY DEPRECATED 05:56:06 switching from Python, my first language, to C, helped me understand how most computers work at a low level. 05:56:35 C doesn't represent low-level computer working, sorry kid 05:56:36 see microcode 05:56:41 It is not a terrible thing to know, unless you dislike computer programming anyways 05:56:49 elliott: I didn't say it represented it. 05:57:01 well, i don't believe that learning C taught you anything about microcode... 05:57:05 elliott: You are correct about that; the reason that C is used instead is so that it work on other computers too. 05:57:26 oerjan: hey oerjan... if i write the thing into an array...then read it... 05:57:28 i will get the address 05:57:28 no it didn't. But it taught me about memory addressing and pointers. 05:57:29 i think 05:57:38 CakeProphet: yep, which isn't how your computer works at a low-level 05:57:46 hmm, ok so if i use newarray... 05:57:46 ...fine. whatever. 05:58:12 C is useless I shouldn't waste my time using a low level language if it's not microcode. 05:58:23 yes, these are definitely things i have said. 05:58:47 why would you learn C -> C is useless 05:58:51 IO $ \s -> 05:58:51 case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) -> 05:58:51 (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#)) 05:58:51 (MallocPtr mbarr# r) #) 05:58:51 } 05:58:53 i have to know c for practical purposes 05:58:59 oh wow GHC, your privates are showing :( 05:59:09 wow how does that even work 05:59:36 IO constructor nice 05:59:43 The reason you should use a low level language if it isn't microcode is so that you can write a program that works not only in one computer. 06:00:14 right, what I'm saying is that C is a good learning experience if all you have ever touched in high level languages. 06:00:19 *is 06:01:01 even if it does not correspond directly to your architectures instruction set, it still interacts with memory at a very low level. 06:01:08 nope 06:01:11 And even if you are writing a program for only one computer, using C allows you to use codes of other computers too, although in some cases modification will be required (not always). 06:01:47 But in some cases, using assembly language or machine codes is better way for programming that is only for one computer. 06:03:16 -!- derrik has joined. 06:03:55 hmm, I have magichash on, why is this not working 06:04:01 -!- derrik has left. 06:04:24 too magical 06:04:32 too high. 06:06:50 LLVM also can be programmed for many computers, and has some commands accessing things more commonly directly in the computer's instruction set, but also includes commands that no computer has (such as the "phi" command), and other somewhat unusual things which are used for analysis/optimization and for other stuff too. 06:07:07 you guys have a shattered my view of how computers work. Here I thought most CPU instruction sets had some kind of memory addressing scheme. 06:07:38 But LLVM does have a few similarities to C. 06:07:38 -!- Sgeo has joined. 06:08:25 C-- is pretty cool if i recall correctly 06:08:52 I have read about C-- 06:09:57 ?hoogle sizeOf 06:09:58 Foreign.Storable sizeOf :: Storable a => a -> Int 06:09:58 Network.Socket.Internal sizeOfSockAddr :: SockAddr -> Int 06:09:58 Network.Socket.Internal sizeOfSockAddrByFamily :: Family -> Int 06:10:13 why would you need sizeOf aaaaa 06:10:18 monqy: evil 06:10:29 wow = IO $ \s -> 06:10:29 case newAlignedPinnedByteArray# size align s of 06:10:29 (# s', mbarr# #) -> (# s', indexAddrArray# (byteArrayContents# (unsafeCoerce# mbarr#)) 0# #) 06:10:29 where !(I# size) = sizeOf (undefined::String) 06:10:29 !(I# align) = alignment (undefined::String) 06:10:34 monqy: im getting the address of an arbitrary value 06:11:13 wow 06:12:24 ghc: panic! (the 'impossible' happened) 06:12:24 (GHC version 7.0.4 for x86_64-unknown-linux): 06:12:24 Error in deriving: 06:12:24 Can't derive Show for primitive type ghc-prim:GHC.Prim.Addr#{(w) tc 33} 06:12:24 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug 06:13:33 *Data.Intern> wow 06:13:33 0x00007fc06e2541f8 06:13:48 is this for real 06:14:21 Do you know about LLVM? 06:14:35 it's in my reading pile 06:15:17 Why is inability to derive Show for a primitive type a big deal? 06:15:44 wow :: a -> IO (Ptr a) 06:15:44 wow x = IO $ \s -> 06:15:44 case newAlignedPinnedByteArray# size align s of 06:15:44 (# s', mbarr# #) -> 06:15:44 case writeArray# (unsafeCoerce# mbarr#) 0# x s of 06:15:48 Or is it just a faulty error message caused by your tampering, and there's really a different error? 06:15:51 !(I# align) = 8 -- alignment (undefined::Addr#) 06:15:53 monqy: this is for real 06:15:59 *Data.Intern> wow 9 06:15:59 0x00007fc06f50be58 06:16:01 *Data.Intern> wow () 06:16:03 0x00007fc06f4ca228 06:16:05 *Data.Intern> wow "x" 06:16:07 0x00007fc06f50a278 06:16:09 *Data.Intern> wow "hexagons" 06:16:11 0x00007fc06eed61e0 06:16:13 *Data.Intern> wow "hexagons" 06:16:15 0x00007fc06ee83230 06:16:17 this is the most beautiful thing ive ever seen 06:16:27 There's an IO function? 06:16:31 constructor 06:16:58 yeah, constructor 06:17:07 Will you include a strange variation of the PHI command in the next version of INTERCAL? 06:17:19 ...there's an IO constructor? 06:17:49 of course. 06:17:53 how do you think values get in? 06:18:10 no such thing as opaque data types in Haskell. 06:18:17 * CakeProphet whistles innocently. 06:18:36 newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #)) 06:18:42 Sgeo: --libraries/ghc-prim/GHC/Types.hs 06:19:06 *Data.Intern> wow wow 06:19:06 0x00007fc06f71cca0 06:19:06 *Data.Intern> wow wow 06:19:06 0x00007fc06f71c1a8 06:19:06 *Data.Intern> wow wow 06:19:13 monqy: ok something seems wrong 06:19:18 oh wait hm 06:19:19 try sharing on it 06:20:24 probably too much unsafe stuff. 06:20:25 *Data.Intern> wow wow 06:20:25 0x00007fc06ee6d572 06:20:26 *Data.Intern> wow wow 06:20:26 0x2e302e312e706d67 06:20:26 *Data.Intern> wow wow 06:20:32 0x00000039312e312d 06:20:34 gah 06:20:48 no referential transparency? shameful. 06:21:04 CakeProphet: elliott is _raping_ referential transparency 06:21:06 it should be referentially transparent in the end. up to evaluation. and GC. 06:22:05 oh i forgot about gc. 06:22:06 :( 06:22:16 i should just use stablenames 06:23:17 I think elliott is secretly the enemy of Haskell. 06:23:26 that Haskell valiantly fights in epic battles. 06:23:47 night 06:23:50 and elliott wants to break Haskell into some sick monster in a plot to rule the world. 06:24:08 elliotskell??? 06:24:16 maybe with another t 06:24:23 haskelliott 06:25:02 *Data.Intern> testc 06:25:02 21 06:25:02 21 06:25:02 *Data.Intern> testc 06:25:02 23 06:25:09 21 06:25:15 oh well, it's in IO, it can do that. 06:25:47 so does it work 06:27:18 yes 06:27:25 woohoo 06:27:37 i think i forget what its for 06:27:44 why anyone would ever need it 06:28:04 it's for making skynet duh 06:28:38 it's for the sheer enjoyment of programming in a C-like language. 06:29:11 monqy: if you implement scheme 06:29:16 then you want to use this to represent symbols. 06:29:44 speaking of scheme, what happened to zepto 06:29:54 its eternal 06:31:25 elliott: or Ruby 06:31:28 which scheme is this r5rs 06:31:35 that would also be useful for Ruby symbols. 06:32:43 monqy: yeah 06:34:21 I think it would also be useful for creating efficient hashes/maps instead of using string keys? 06:35:23 well thats what hashmap/hashtable are for, but yeah, hopefully 06:35:27 see also 06:35:28 instance (Hashable a) => Hashable (Interned a) where 06:35:28 hash a = a `seq` hashStableName (unsafePerformIO (makeStableName a)) 06:51:03 http://hpaste.org/steps/48629?expr=a+1+2&submit=Submit cool 06:51:22 warning: use guards 06:51:28 thanks hlint 06:53:25 wow, everyone works at standard chartered 06:58:03 do you want to be afraid monqy 06:58:27 i had to look it up 06:58:59 http://hackage.haskell.org/packages/archive/uu-parsinglib/2.7.1.1/doc/html/src/Text-ParserCombinators-UU-Core.html 06:59:00 monqy: enjoy afraid 06:59:05 utrecht is so scaary :( 06:59:08 data T st a = T (forall r . (a -> st -> Steps r) -> st -> Steps r ) -- history parser 06:59:08 (forall r . ( st -> Steps r) -> st -> Steps (a, r) ) -- future parser 06:59:08 (forall r . ( st -> Steps r) -> st -> Steps r ) -- recogniser 06:59:08 instance Functor (T st) where 06:59:08 fmap f (T ph pf pr) = T ( \ k -> ph ( k .f )) 06:59:15 ( \ k st -> push f ( pr k st)) 06:59:17 pr 06:59:18 I have successfully managed to win with the prophecy defense. 06:59:36 Another time, I managed to win because opponent ran out of cards before they had a chance to pick up the last side card. 07:00:22 there is a class for eof 07:00:46 ok what is with this T thing 07:01:32 -!- Nisstyre has quit (Remote host closed the connection). 07:01:48 monqy: its utrecht convention IIRC 07:01:51 monqy: you call your main type T 07:02:16 -!- Nisstyre has joined. 07:02:33 i guess maybe henning is a utrecht guy since data-accessor is completely full of T r a -> ... and (C ...) => 07:02:44 -!- Nisstyre has quit (Remote host closed the connection). 07:03:10 das kann nicht recht sein 07:03:37 Unqualified T data types floating around. (As Brent Yorgey tells me, this is a Henning-ism in which he will define a type T or typeclass C intended to be used only with a qualified import, but Haddock throws away this information. You can use :t in GHC to get back this information if you're not sure.) 07:03:39 yuck 07:04:11 -!- Nisstyre has joined. 07:04:26 Even if the standard library of a programming language does not support string interning, it is possible to implement an intern pool in user code. 07:04:29 oh wow, thanks Wikipedia. 07:04:36 I didn't think that was possible. 07:06:09 this uu parsing library thing is scary 07:06:36 monqy: its utrecht 07:06:38 run and fear :< 07:07:24 :t max 07:07:25 forall a. (Ord a) => a -> a -> a 07:07:33 ah, excellent. Completely abusable for signal processing. 07:07:39 well, since the type allows it, I guess it's not really abuse. 07:09:11 max s1 s2 = (\t -> max (s1 t) (s2 t)) 07:09:38 i already wrote all those instances dude 07:10:10 well yeah, but I think you did something weird with eq right? 07:10:20 no, i just made it error 07:10:25 which is the only possible sane implementation 07:10:31 copumpkin: did those new fclabels or was it lenses that had efficient update ever come out? 07:10:37 well, there's a different kind of equality you could do that isn't the same type. 07:10:46 CakeProphet: (==) :: a -> a -> Bool 07:10:47 good luck with that 07:10:59 basically the signal is 0 if the input signals are unequal and 1 if they are. 07:11:04 CakeProphet: (==) :: a -> a -> Bool 07:11:05 good luck with that 07:11:15 ...yes, as you can see, I mentioned it was a different type 07:11:19 so? 07:11:19 which sort of implies that it will look different. 07:11:22 and not be the same function. 07:11:22 my Eq instance was correct. 07:11:28 if you want equality on lenses, that's fucking trivial: 07:11:45 liftS2 :: (a -> b -> c) -> Signal a -> Signal b -> Signal c 07:11:50 then liftS2 (==) 07:12:05 basically we are talking about two completely different things right now. I have to go now, so good bye. 07:12:16 you're faulting my implementation because it does something it has to 07:12:21 and lacks the two lines of code for what youw ant 07:12:22 so...? 07:13:03 there was no causality between the first thing I said about your Eq instance, and what I said afterwards. 07:13:23 ok. but... well yeah, but I think you did something weird with eq right? 07:13:26 what weird thing did i do 07:13:26 ? 07:13:36 I wasn't sure, it was a question. 07:13:38 -!- zzo38 has quit (Quit: Don't care. Care.). 07:13:44 ok, then the answer is i did not :) 07:14:15 yes, what you did was reasonable. I'm sorry I didn't specify such when I started talking about a completely different kind of equality operation. 07:14:20 ok 07:16:00 ?pl \f x -> m' (\y -> m f y) x 07:16:00 m' . m 07:16:55 -!- Nisstyre has quit (Remote host closed the connection). 07:17:08 Lens x a -> (a -> Lens x b) -> Lens x b 07:17:50 ?pl \x -> get (f (g x)) x 07:17:51 get =<< f . g 07:18:02 -!- Nisstyre has joined. 07:18:28 what is it with ?pl and =<< 07:18:35 monad instance for functions 07:18:38 but it keeps it in the order of application 07:18:54 ?pl \tt x -> modify (f (g x)) tt x 07:18:54 join . flip (modify . f . g) 07:19:14 one time i tried looking up the monad instance for functions and couln't find it 07:19:28 next time i will look harder 07:19:43 ?hoogle join 07:19:43 Control.Monad join :: Monad m => m (m a) -> m a 07:19:43 System.FilePath.Posix joinDrive :: FilePath -> FilePath -> FilePath 07:19:43 System.FilePath.Windows joinDrive :: FilePath -> FilePath -> FilePath 07:20:52 oh there it is in Control.Monad.Instances 07:21:03 what a peculiar module 07:21:14 yeah that module should really be called Control.Monad 07:21:36 (a -> b) -> Lens x a -> Lens x b 07:21:36 hmm 07:21:36 ok 07:22:04 @src -> >>= 07:22:05 Source not found. Just try something else. 07:22:10 wait 07:22:11 @src (->) (>>=) 07:22:12 f >>= k = \ r -> k (f r) r 07:22:14 you can't do that fmap 07:22:15 can you? 07:22:19 monqy: ^ 07:22:22 oerjan 07:22:23 i need help 07:22:25 (a -> b) -> Lens x a -> Lens x b 07:22:28 where 07:22:29 data Lens a b = Lens { get :: a -> b, modify :: (b -> b) -> a -> a } 07:22:31 you can do it for get 07:22:36 but its impossible to write modify ther 07:22:36 e 07:22:37 right? 07:22:42 or is it 07:23:37 well 07:23:40 i have a monad instance... 07:23:41 ?src liftM 07:23:42 liftM f m1 = do { x1 <- m1; return (f x1) } 07:23:55 ?undo do {x1 <- m1; return (f x1) } 07:23:55 m1 >>= \ x1 -> return (f x1) 07:23:57 also I've been wondering for ages what does it mean when there's an instance e.g. "Monad [::]" (on the haddock instances list) 07:23:58 i don't think so 07:24:03 monqy: parallel lists 07:24:19 liftM f m1 = m1 >>= \ x1 -> return (f x1) 07:24:19 so 07:24:22 it's not covariant 07:24:37 liftM f (Lens g m) = Lens g m >>= \ x1 -> return (f x1) 07:24:38 so let me unpack 07:24:51 elliott: Never properly, only some informal comparisons 07:25:02 liftM f (Lens g m) = Lens (get =<< (\x1 -> return (f x1)) . g) (join . flip (modify . (\x1 -> return (f x1)) . g)) 07:25:07 ?unpl get =<< f . g 07:25:07 (\ c -> (f >>= get) (g c)) 07:25:09 ugh 07:25:13 ?unpl Lens (get =<< (\x1 -> return (f x1)) . g) (join . flip (modify . (\x1 -> return (f x1)) . g)) 07:25:13 Lens (\ h -> ((\ x1 -> return (f x1)) >>= get) (g h)) (\ k -> (\ c -> modify (return (f (g c))) k) >>= \ l -> l) 07:25:20 liftM f (Lens g m) = Lens (\ h -> ((\ x1 -> return (f x1)) >>= get) (g h)) (\ k -> (\ c -> modify (return (f (g c))) k) >>= \ l -> l) 07:25:23 holy shit 07:25:33 oerjan: ok either my monad instance is invalid or this _does_ work 07:25:35 I'm not sure which 07:26:10 *Main> modify (liftM fst id) succ (0,9) 07:26:10 (0,9) 07:26:11 what's your >>= 07:26:12 yep, it's broken 07:26:15 Lens g m >>= f = Lens (get =<< f . g) (join . flip (modify . f . g)) 07:26:33 so basically I have fmap... for lenses :) 07:26:44 Lens a b -> Lens c a -> Lens c b 07:26:53 ?hoogle c a b -> c x a -> c x b 07:26:54 Control.Category (.) :: Category cat => cat b c -> cat a b -> cat a c 07:26:54 Control.Arrow (<<<) :: Category cat => cat b c -> cat a b -> cat a c 07:26:54 Control.Category (<<<) :: Category cat => cat b c -> cat a b -> cat a c 07:27:05 yep, what I have is (.), aka generalised fmap :D 07:27:07 oh well 07:27:18 elliott: heh you are not using m in your >>= 07:27:23 oerjan: nice :D 07:28:03 -- Laws: 07:28:03 -- modify l id x = x 07:28:03 -- get l (modify l f x) = f (get l x) 07:28:06 hm do I need any other laws 07:29:19 (\ c -> (f >>= get) (g c)) <-- wtf i think something isn't keeping track of fixity 07:30:44 :t get 07:30:45 forall (m :: * -> *) s. (MonadState s m) => m s 07:31:04 that doesn't quite fit into your law above 07:31:44 oerjan: you shadow that, obviously 07:32:03 oh hm 07:32:21 data Lens a b = Lens { get :: a -> b, modify :: (b -> b) -> a -> a } 07:34:12 why is everyone talking about lenses 07:34:34 we're trying to focus here 07:35:45 -!- Nisstyre has quit (Remote host closed the connection). 07:36:08 hm i think you could build a monad transformer from a lens, which would modify state 07:36:34 -!- Nisstyre has joined. 07:38:12 maybeNthL :: Int -> Lens [a] (Maybe a) 07:38:12 maybeNthL n = Lens (getnth n) (modnth n) 07:38:13 where getnth 0 (x:_) = Just x 07:38:13 getnth n (_:xs) = getnth (n-1) xs 07:38:13 getnth _ _ = Nothing 07:38:19 what a weird lens 07:38:49 *Data.Lens.Prelude> get (maybeNthL 9) (modify (maybeNthL 9) (const (Just 9)) [0,9,9]) 07:38:49 Nothing 07:38:52 what a weird, invalid lens :) 07:40:17 you didn't give modnth 07:40:43 Always so nice catching that late-night baroque music program when coming back from D&D. 07:40:51 Aaaaah. 07:40:58 elliott: it would have to pad with undefineds, no? 07:42:10 to fulfil those laws 07:42:28 oh and that would break the first one 07:43:30 oerjan: yeah :) 07:43:37 -!- monqy has quit (Quit: hello). 07:43:38 you didn't give modnth 07:43:40 is this a pun 07:44:17 no, you just did not 07:44:55 maybe your client cut it off? 07:45:46 modnth 0 f (x:xs) = case f (Just x) of Nothing -> xs; Just a -> a:xs 07:45:46 modnth n f (x:xs) = x : modnth (n-1) f xs 07:45:46 modnth _ f _ = case f Nothing of Nothing -> []; Just a -> [a] 07:45:48 it will have been freenode 07:45:59 todo: handle data/newtype instances in makeLenses 07:48:19 you need to use the hypertext transport protocol for things that are so many lines. 07:48:51 fmap concat (sequence (concatMap (\(n,_,_) -> [ [d| foo = 9 |] ]) oks)) 07:48:51 good coding with elliott 07:49:13 :t mapM 07:49:14 forall a (m :: * -> *) b. (Monad m) => (a -> m b) -> [a] -> m [b] 07:49:18 oh right 07:49:58 -!- derrik has joined. 07:50:21 [d| foo = 9 |] ? 07:50:56 oerjan: yep 07:51:06 and n isn't used... 07:51:22 of course 07:51:24 this is just an initial test :P 07:51:32 -!- derrik has left. 07:51:37 MADNESS 07:51:58 -!- Lymia has quit (Ping timeout: 240 seconds). 07:58:49 -!- Sgeo_ has joined. 08:00:55 -!- Sgeo has quit (Ping timeout: 240 seconds). 08:02:36 -!- Lymia has joined. 08:02:55 oerjan: hm since I can't write Lens x a -> (a -> Lens x b) -> Lens x b 08:02:57 maybe I could write 08:03:01 erm 08:03:02 oerjan: hm since I can't write Lens x a -> (a -> Lens x b) -> Lens x b 08:03:12 and i can't write (a -> b) -> Lens c a -> Lens c b 08:03:16 but I CAN write Lens a b -> Lens c a -> Lens c b 08:03:23 maybe I can write Lens x a -> Lens a (Lens x b) -> Lens x b 08:03:24 ?? 08:03:28 -!- Lymia has changed nick to Lymee. 08:06:43 dunno 08:10:00 tempted to djinn it :D 08:10:33 ?djinn (x -> a, (a -> a) -> x -> x) -> (a -> (Lens x b), (Lens x b -> Lens x b) -> a -> a) -> Lens x b 08:10:34 Error: Undefined type Lens 08:10:36 ok now to expand again 08:10:44 Lens x b = (x -> b, (b -> b) -> x -> x) 08:11:01 ?djinn (x -> a, (a -> a) -> x -> x) -> (a -> (x -> b, (b -> b) -> x -> x), ((x -> b, (b -> b) -> x -> x) -> (x -> b, (b -> b) -> x -> x)) -> a -> a) -> (x -> b, (b -> b) -> x -> x) 08:11:01 f (a, b) (c, d) = 08:11:02 (\ e -> 08:11:02 case c (a e) of 08:11:02 (f, _) -> f e, 08:11:02 \ _ g -> b (\ _ -> d (\ h -> h) (a g)) g) 08:11:06 oerjan: yes, yes i can. 08:11:18 well maybe. those ignored variables are a bit worrying. 08:11:27 you don't say. 08:11:37 oerjan: well one of them isn't, it looks like it is just ignoring get 08:11:39 but the other moreso :P 08:15:52 makeLenses :: Name -> Q [Dec] 08:15:52 makeLenses t = do 08:15:52 TyConI dec <- reify t 08:15:52 let (ctx,name,binders,cons,names) = case dec of DataD a b c d e -> (a,b,c,d,e); NewtypeD a b c d e -> (a,b,c,[d],e) 08:15:52 let [RecC _ oks] = cons 08:15:54 _f <- newName "f" 08:15:56 _x <- newName "x" 08:16:00 mapM (\(n,_,_) -> funD (transform n) [clause [] (normalB ([|Data.Lens.Lens|] `appE` varE n `appE` lamE [varP _f, varP _x] (recUpdE (varE _x) [(\x->(n,x)) `fmap` [|$(varE _f) ($(varE n) $(varE _x))|]]))) []]) oks 08:16:03 where transform n = mkName (tail (nameBase n)) 08:16:05 oerjan: IT WOOOORKS 08:16:07 oh my fucking god. 08:17:27 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 08:17:54 ?hoogle a -> b -> [(a,b)] -> [(a,b)] 08:17:55 Data.Graph.Inductive.NodeMap delMapNode :: (Ord a, DynGraph g) => NodeMap a -> a -> g a b -> g a b 08:17:55 Data.Graph.Inductive.NodeMap insMapNode_ :: (Ord a, DynGraph g) => NodeMap a -> a -> g a b -> g a b 08:17:55 Data.Graph.Inductive.NodeMap delMapNodes :: (Ord a, DynGraph g) => NodeMap a -> [a] -> g a b -> g a b 08:17:57 hmm 08:18:01 there's no inverse of lookup? 08:21:06 *Data.Lens.Prelude> get (keyL "x") Map.empty 08:21:06 *** Exception: Map.find: element not in the map 08:21:06 *Data.Lens.Prelude> modify (keyL "x") (+9) Map.empty 08:21:06 fromList *** Exception: keyL: element not in the map 08:21:07 oh, good 08:21:14 although, hmm 08:21:16 that actually violates the 08:21:20 modify l id x = x 08:21:21 law 08:21:25 maybe I should loosen that? 08:21:33 i.e. /if/ modify l id x has a value, then the value must be x 08:21:48 but then it seems tempting to have (modify l id) _always_ be an identity transform... 08:22:01 at the same time, silent erroneous modifications being dropped sounds sucky 08:29:07 -!- oerjan has quit (Quit: Good night). 08:35:31 mapM (\(n,_,_) -> funD (transform n) [clause [] (normalB ([|Data.Lens.Lens|] `appE` varE n `appE` lamE [varP _f, (asP _x (recP nn [return (n,VarP _y)]))] (recUpdE (varE _x) [(\x->(n,x)) `fmap` [|$(varE _f) $(varE _y)|]]))) []]) oks 08:42:03 -!- cheater_ has quit (Ping timeout: 255 seconds). 08:42:55 -!- cheater_ has joined. 08:54:44 -!- Lymia has joined. 08:56:07 -!- Lymee has quit (Disconnected by services). 08:56:07 -!- Lymia has changed nick to Lymee. 08:57:40 WHAT ARE MONADS/ HOW DO I MAKE MONADS OUT OF STYROFOAM AND HEAP/ COULD I BE AFFECTED BY MONADS? 08:57:46 answers to all these and more at monad.com.com 08:57:50 .com 08:58:56 The are called "monads" rather than the easier to grasp name of "type operators" for several reasons: 08:58:56 Monads have restrictions on what they can do (see the definiton for details). 08:58:56 Those restrictions, along with the fact that there are 3 operations involved, conform to the structure of something called a monad in Category Theory, which is an obscure branch of mathematics. 08:58:56 They were designed by proponents of "pure" functional languages 08:58:56 Proponents of pure functional languages like obscure branches of mathematics 08:58:59 Because the math is obscure, and monads are associated with particular styles of programming, people tend to use the word monad as a sort of secret handshake. Because of this no one has bothered to invest in a better name. 09:08:21 -!- Phantom_Hoover has joined. 09:14:49 -!- cheater__ has joined. 09:14:54 -!- cheater_ has quit (Ping timeout: 255 seconds). 09:21:32 -!- MigoMipo has joined. 09:21:44 -!- Vorpal has joined. 09:30:49 ?pl \f x -> s (f (g x)) x 09:30:50 join . (s .) . (. g) 09:30:54 ?pl \x -> s (f (g x)) x 09:30:54 s =<< f . g 09:32:03 ?hoogle \f x -> b (f (g x))) 09:32:03 Parse error: 09:32:04 --count=20 "\f x -> b (f (g x)))" 09:32:04 ^ 09:32:05 ?hoogle \f x -> b (f (g x)) 09:32:05 Parse error: 09:32:05 --count=20 "\f x -> b (f (g x))" 09:32:05 ^ 09:32:11 ?pl \f x -> b (f (g x)) 09:32:11 (b .) . (. g) 09:32:14 ?pl \x -> b (f (g x)) 09:32:15 b . f . g 09:33:17 ?pl \b f g -> b . f . g 09:33:18 (. (.)) . (.) . (.) 09:36:43 -!- shachaf has quit (Ping timeout: 260 seconds). 09:47:56 -!- Lymee has quit (Read error: Connection reset by peer). 09:48:50 -!- Lymee has joined. 10:07:20 -!- sebbu2 has joined. 10:09:19 -!- sebbu has quit (Ping timeout: 252 seconds). 10:59:50 see.. composing composition is when I start to get confused. 11:03:44 -!- sebbu2 has changed nick to sebbu. 11:04:01 CakeProphet: you can think of it as fmap (fmap (flip fmap fmap) fmap) fmap, if composition is confusing :) 11:12:30 .. -_- 11:13:15 shenanigans 11:13:35 also, (.).(.) = the boobies combinator = fmap fmap fmap 11:16:18 but... fmap = (.) for functions right? 11:16:24 THIS DOES NOT HELP. 11:16:50 CakeProphet, wha? 11:16:50 Phantom_Hoover: You have 3 new messages. '/msg lambdabot @messages' to read them. 11:17:41 yes, one functor instance has fmap = (.), and to make matters better lambdabot has (.) defined as fmap 11:20:10 > (\x -> x+1) . [1..] 11:20:12 [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2... 11:20:19 > (\x -> x+1) <$> [1..] 11:20:20 [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2... 11:20:26 I don't really see how that makes anything better. 11:20:50 I guess it's just something that Prelude could do that could make <$> no longer necessary. 11:21:06 if Control.Monad were in Prelude... 11:21:41 or, wherever Functor ((->) a) is 11:23:49 it would be interested to run a search over every module in Hackage to see how many import Control.Monad. 11:24:14 yes, one functor instance has fmap = (.), and to make matters better lambdabot has (.) defined as fmap 11:24:21 You mean the function functor? 11:25:44 yeah, or the Reader functor 11:33:41 :t fmap 11:33:42 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 11:34:11 I can't think of a * -> * type that could not possibly have a Functor instance.. 11:34:11 olsner, we both know they're the same thing. 11:40:31 :t runReader (Reader Reader) 11:40:32 Not in scope: data constructor `Reader' 11:40:32 Not in scope: data constructor `Reader' 11:41:34 > return 4 3 11:41:35 4 11:42:05 > (return 4 :: Reader Int Int) 3 11:42:06 Couldn't match expected type `t1 -> t' 11:42:06 against inferred type `Contr... 11:45:19 `quote 11:45:23 188) "Europe is the national anthem of the Republic of Kosovo." alise: I I was going to say something then your last line floored me 11:46:11 But that *is* their anthem. 11:48:44 -!- Lymia has joined. 11:49:52 -!- Lymee has quit (Disconnected by services). 11:49:56 -!- Lymia has changed nick to Lymee. 11:57:39 @pl (\x -> fix (fix x)) 11:57:39 fix . fix 11:57:47 wow, pl is so smart. 11:57:57 @pl (\x -> x) 11:57:57 id 11:58:02 woah. 11:58:14 Come on, that's peanuts. 11:58:25 how does IT KNOW!!!! 11:58:28 The reduction rules for that are trivial. 11:58:38 @pl (\f x y -> f y x) 11:58:38 flip 11:59:19 @pl (\f x y -> f x y) 11:59:20 id 11:59:59 for some reason I was expecting ($) or something 12:01:20 @pl (\a b c d e f g h i j k l m -> m l k a b c j i h d e f h g) 12:01:22 ($) *is* id :) 12:01:23 (((((flip .) .) .) .) .) . ((((((flip .) .) .) .) .) .) . (((((((flip .) .) .) .) .) .) .) . ((((((((flip .) .) .) .) .) .) .) .) . (((((((((flip .) .) .) .) .) .) .) .) .) . ((((((((((flip .) .) .) 12:01:24 .) .) .) .) .) .) .) . flip flip id . (flip .) . ((flip .) .) . (((flip .) .) .) . ((((flip .) .) .) .) . (((((ap .) .) .) .) .) . ((((((flip .) .) .) .) .) .) . (((((((flip .) .) .) .) .) .) .) . (( 12:01:24 ((((((flip .) .) .) .) .) .) .) .) . (((((((((flip .) .) .) .) .) .) .) .) .) . ((((((((((flip .) .) .) .) .) .) .) .) .) .) . ((((flip .) .) .) .) . (((((flip .) .) .) .) .) . ((((((flip .) .) .) .) 12:01:24 .) .) . (((((((flip .) .) .) .) .) .) .) . ((((((((flip .) .) .) .) .) .) .) .) . (((((((((flip .) .) .) .) .) .) .) .) .) . (((flip .) .) .) . ((((flip .) .) .) .) . (((((flip .) .) .) .) .) . (((( 12:01:24 ((flip .) .) .) .) .) .) . (((((((flip .) .) .) .) .) .) .) . ((((((((flip .) .) .) .) .) .) .) .) . ((flip .) .) . (((flip .) .) .) . ((((flip .) .) .) .) . (((((flip .) .) .) .) .) . ((((((flip .) 12:01:25 [3 @more lines] 12:01:27 optimization suspended, use @pl-resume to continue. 12:02:22 so clear and concise. 12:02:28 I wonder why they ever invented variables. 12:03:33 pl is like cheating for obfuscation contests. 12:05:25 So 12:05:32 Can we rename @pl to @obfuscate 12:08:14 @pl \l 1 -> l + 1 12:08:15 (+) 12:12:40 @l (\a b c d e f g h i j k l m n o p q r s t u v w x y z -> q w e r t y u i o p a s d f g h j k l z x c v b n m) 12:12:41 Maybe you meant: learn leave let list listall listchans listmodules listservers localtime localtime-reply lojban . ? @ pl v 12:12:45 @pl (\a b c d e f g h i j k l m n o p q r s t u v w x y z -> q w e r t y u i o p a s d f g h j k l z x c v b n m) 12:12:48 (((((((((((flip .) .) .) .) .) .) .) .) .) .) .) . ((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) . (((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) . ((((((((((((((flip .) .) .) .) .) 12:12:48 .) .) .) .) .) .) .) .) .) . (((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . ((((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . (((((((((((((((((flip .) .) .) . 12:12:48 ) .) .) .) .) .) .) .) .) .) .) .) .) .) . ((((((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . (((((((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) 12:12:48 .) . ((((((((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . (((((((((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . ((((((((((((((( 12:12:48 (((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . (((((((((((((((((((((((flip .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) .) . (((((((((((flip .) . 12:12:50 [35 @more lines] 12:12:52 optimization suspended, use @pl-resume to continue. 12:12:53 * Lymee runs 12:14:11 @. unpl pl (\a b c d e f g h i j k l m -> m l k a b c j i h d e f h g) 12:14:15 Parse error at end of input 12:14:33 @. unpl pl (\a b c d i j k l m -> m l k a b c j i h d) 12:14:36 Parse error at end of input 12:23:31 -!- Lymia has joined. 12:23:53 -!- Lymee has quit (Disconnected by services). 12:23:55 -!- Lymia has changed nick to Lymee. 12:35:34 -!- shachaf has joined. 13:02:16 -!- BeholdMyGlory has joined. 13:02:33 -!- derrik has joined. 13:03:03 -!- hagb4rd has quit (Ping timeout: 255 seconds). 13:08:12 @pl (\a b c d e f g h i j k l m n o p q r s t u v w x y z -> q) 13:08:12 const (const (const (const (const (const (const (const (const (const (const (const (const (const (const (const (const . const . const . const . const . const . const . const . const)))))))))))))))) 13:08:25 @pl (\a b c d e f g h i j k l m n o p q r s t u v w x y z -> q a z w s x) 13:08:28 const . const . const . const . const . const . const . const . const . const . const . const . const . const . const . ((const . ((const . const . const . (((const .) . flip) .)) .) . flip . (flip . 13:08:28 ) . flip) .) . flip id 13:08:36 @pl (\a b c d e f g h i j k l m n o p q r s t u v w x y z -> q a z w s x a) 13:08:39 const . const . const . const . const . const . const . const . const . const . const . const . const . const . const . ((const . ((const . const . const . ((const .) .)) .)) .) . join (flip . (( 13:08:39 flip . ((flip . (flip .)) .) . (((flip .) .) .)) .) . (((flip .) .) .) . (flip .) . ((flip .) .) . (flip .) . flip id) 13:08:39 optimization suspended, use @pl-resume to continue. 13:09:24 @pl (\a b c d e f g h i j k l m n o p q r s t u v w x y z -> (t o) (b e) (o r) (n o t) (t o) (b e) . (t h a t) (i s) (t h e) (q u e s t i o n)) 13:09:28 (const .) . (const .) . ((const .) .) . ((const .) .) . ((((const .) .) .) .) . ((((const .) .) .) .) . ((((const .) .) .) .) . ((((const .) .) .) .) . ((((((const .) .) .) .) .) .) . ((((((((((( 13:09:28 const .) .) .) .) .) .) .) .) .) .) .) . (((((((((((const .) .) .) .) .) .) .) .) .) .) .) . (((((((((((const .) .) .) .) .) .) .) .) .) .) .) . (((((((((((const .) .) .) .) .) .) .) .) .) .) .) . (( 13:09:28 (((((((((const .) .) .) .) .) .) .) .) .) .) .) . flip (ap . ((.) .) . ((.) .) . (ap .) . ((ap .) .) . ((((.) .) .) .) . (((flip .) .) .) . (((((.) .) .) .) .) . ((((ap .) .) .) .) . ((((((.) .) .) . 13:09:28 ) .) .) . ((((((.) .) .) .) .) .) . ap (ap . (flip .) . ((flip .) .) . (((flip .) .) .) . ((((flip .) .) .) .) . flip flip (flip id) . (flip .) . ((ap .) .) . (((flip .) .) .) . ((((ap .) .) .) .) . 13:09:28 (ap .) . ((flip .) .) . (((ap .) .) .) . flip flip id . (ap .) . (((.) .) .) . ((flip .) .) . (flip (flip . flip id) .)) id) . flip (ap . (flip .) . ((ap .) .) . ((((.) .) .) .) . ((((.) .) .) .) . ( 13:09:30 [3 @more lines] 13:09:32 optimization suspended, use @pl-resume to continue. 13:10:07 -!- derrik has left. 13:11:28 Lymee, please, do it in a /query. 13:40:56 -!- derrik has joined. 13:46:33 -!- ralc has joined. 14:04:52 -!- ralc has quit (Read error: Operation timed out). 14:23:00 -!- ralc has joined. 14:24:53 -!- Sgeo_ has quit (Ping timeout: 252 seconds). 14:57:39 -!- Sgeo has joined. 15:10:06 -!- derrik has quit (Ping timeout: 258 seconds). 15:28:48 -!- Wamanuz4 has quit (Remote host closed the connection). 15:29:16 -!- Wamanuz4 has joined. 15:39:00 -!- olsner has quit (Quit: Leaving). 15:39:25 -!- olsner has joined. 15:41:38 -!- monqy has joined. 15:46:33 -!- Lymee has quit (Ping timeout: 260 seconds). 15:58:57 -!- Lymee has joined. 16:19:23 -!- Vorpal has quit (Ping timeout: 260 seconds). 16:23:14 -!- Vorpal has joined. 16:53:05 -!- Lymia has joined. 16:56:51 -!- Lymee has quit (Ping timeout: 276 seconds). 17:01:48 `quote 17:01:49 180) You people. You people are so stupid. I'm making a SOCIOLOGICAL statement here. 17:02:25 `quote stupid 17:02:26 180) You people. You people are so stupid. I'm making a SOCIOLOGICAL statement here. \ 274) ah yes, indeed, alan turing was gay and stupid \ 321) zzo38: you missed the point. the point was way stupider than that. \ 342) quintopia: no i'm not laughing at you, i'm laughing because *you're 17:04:26 Seeing a high correlation with oko here. 17:04:33 `pastequotes stupid 17:04:34 http://codu.org/projects/hackbot/fshg/index.cgi/raw-file/tip/paste/paste.31077 17:05:34 -!- Nisstyre has quit (Remote host closed the connection). 17:07:15 -!- Nisstyre has joined. 17:56:08 -!- azaq23 has joined. 18:02:31 where is oerjan 18:02:42 Norway. 18:02:51 okay 18:04:05 i believe you that the person controlling the oerjan persona's physical presence lies in norway 18:04:14 but i do not see that online persona here 18:04:17 maybe later... 18:04:35 -!- derrik has joined. 18:06:05 -!- copumpkin has quit (Quit: Computer has gone to sleep.). 18:25:48 -!- ralc has quit (Ping timeout: 260 seconds). 18:30:33 -!- hagb4rd has joined. 18:34:43 -!- derrik has left. 18:38:52 -!- ralc has joined. 18:50:28 http://www.reddit.com/r/askscience/comments/ifodq/what_is_the_simplest_self_replicating_system_we/ 18:50:30 *sigh* 18:50:58 Not one of the answers addresses the fact that the question is terrible. 18:51:33 * Phantom_Hoover downvotes across the board. 19:28:15 -!- oerjan has joined. 19:28:23 I can't think of a * -> * type that could not possibly have a Functor instance.. 19:28:30 non-covariant ones. 19:29:08 newtype HasNoFunctor a = HasNoFunctor (a -> Int) 19:32:13 Phantom_Hoover! 19:42:34 -!- augur has quit (Remote host closed the connection). 19:44:12 -!- augur has joined. 20:21:15 -!- Nisstyre has quit (Quit: Leaving). 20:22:19 -!- Nisstyre has joined. 20:24:46 -!- ais523 has joined. 20:33:51 http://www.dailymail.co.uk/news/article-2010193/Teachers-strike-Sophie-Howard-13-killed-falling-branch-school-closed.html#ixzz1QrGB4Zb0 20:34:04 The logic in this article is possibly the most beautiful I have ever seen. 20:34:36 The comment ratings, however, give me faith in humanity. 20:35:43 I get "comments are currently unavailable" 20:36:01 also, I don't think the article itself has spurious logic, it's just stating a bunch of unrelated facts and leading its readers to try to draw a connection 20:37:13 Yes ais523 that is completely correct and also entirely irrelevant. 20:37:43 it's a good journalism technique, in that it sells papers without actually lying 20:38:37 "I hope every striking teacher is hanging their head in shame right now." 20:38:45 Rating: -2690. 20:38:56 I suspect this has been posted on Reddit or something. 20:54:46 oerjan: is there an n for which there exists no n-digit base n number which, for all k, the first k digits form a number divisible by k? study this and report back. 20:55:04 (even n only) 20:55:06 erm 20:56:18 hm i guess the base 10 case is an old chestnut i've heard... 20:56:47 i've got them for 2,4,6,8,10 and maybe 12 but i don't remember 20:57:04 hm so no odd ones? 20:57:20 i proved that there aren't any odd ones greater than 1 20:57:40 oh i somehow missed your "even" 20:57:42 (well, base 1 isn't really meaningful...) 20:58:06 erm 20:58:07 sorry 20:58:13 all 1 <= k <= n, i assume you mean 20:58:20 of course 20:58:53 10, 1230 20:58:59 those are unique i think 20:59:14 last digit 0, obviously 20:59:19 yeah 20:59:27 you can drop the zero and jsut do n-1 digits if you like 20:59:33 oh wait 20:59:39 what about 3210 20:59:55 some of the numbers have multiple solutions 21:00:00 ah 21:00:36 > map (readInt 4 digitToInt) ["123", "321"] 21:00:37 Couldn't match expected type `GHC.Bool.Bool' 21:00:37 against inferred type ... 21:00:41 argh 21:00:43 :t readInt 21:00:44 forall a. (Num a) => a -> (Char -> Bool) -> (Char -> Int) -> String -> [(a, String)] 21:00:58 > map (readInt 4 (const True) digitToInt) ["123", "321"] 21:00:59 [[(27,"")],[(57,"")]] 21:02:46 ok even and odd digits must alternate 21:03:31 how does the odd non-existence proof go? 21:04:46 to be divisible by n-1, an analogue of the digital root rule holds 21:06:05 1+2 is odd. so that is ruled out for base 3. 21:06:27 1+2+3+4 is 10, not divisible by 4 21:07:07 1+2+3 is 6, divisible by 3 so _that_ works 21:07:15 1+2+3+4+5 is divisible by 5 21:07:20 ok hm 21:07:52 n(n+1)/2 divisible by n iff n+1 is even. right, that proves it cannot work for odd ones 21:08:43 while the n-1'st step automatically works for even ones 21:08:58 quintopia: was that your proof? 21:09:28 yep 21:11:38 n*i + j == 2*i + j (mod (n-2)) 21:12:51 if n has many prime factors, then that fixes factors of many of the digits 21:13:07 say for 6, the 3rd digit must be divisible by 3 21:13:19 which means it is 3 21:13:40 indeed. the middle digit is always n/2 iirc 21:13:45 .[24]3[24].0 21:13:46 at least for the ones i found 21:13:51 yeah 21:14:06 because that and 0 are the only digits divisible by n/2 21:14:57 hm it doesn't matter where you put 1 or 5 for base 6 21:15:02 (in those two spots) 21:15:05 nonetheless, several numbers have multiple solutions (usually consisting of two digits you can swap) 21:15:13 right 21:15:51 but then sometimes, there's only one, which led me to wonder if it would ever become an overconstrained problem 21:16:53 hm there's only one for 10 i guess (iirc the chestnut) 21:17:01 mmhmm 21:17:06 is that related to it being twice a prime? 21:17:15 good question 21:17:22 i can go solve 14 real quick if you like :P 21:17:30 (by quick i mean like 30 minutes...) 21:17:44 _maybe_ it would be an idea to write a program :P 21:17:49 hehe 21:18:08 someone i know already has some generalized CSP tools 21:18:18 left over from doing the sudoku PE puzzle 21:18:34 afk 21:18:40 k 21:24:10 -!- zzo38 has joined. 21:33:49 -!- Vorpal has quit (Ping timeout: 260 seconds). 21:35:21 lessee 21:36:11 i believe the restriction on digit positions can be generalized to gcd pos digit == gcd pos base 21:36:55 -!- MigoMipo has quit (Read error: Connection reset by peer). 21:38:37 because at each position divisible by d where d divides the base, then the digit there must be divisible by d. and the number of positions with a given gcd is exactly equal to the number of digits with the same gcd, so they must be matched 21:38:55 oh hm wait 21:39:45 * gcd (gcd pos digit) base == gcd pos base 21:40:34 (no use for factors not in the base) 21:41:38 hm that's the same as gcd digit (gcd pos base) == gcd pos base 21:50:09 > let nsearch _ _ _ [] = []; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos base; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 4 1 0 [1..3] 21:50:09 Not in scope: `base' 21:50:21 > let nsearch _ _ _ [] = []; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 4 1 0 [1..3] 21:50:22 [] 21:50:25 wat 21:51:20 how can it not work when it compiled :D 21:51:32 hm 21:51:40 :t delete 21:51:40 forall a. (Eq a) => a -> [a] -> [a] 21:52:43 > let nsearch _ _ _ [] = []; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 4 1 0 [1..3] 21:52:44 [] 21:53:15 -!- Lymia__ has joined. 21:53:58 oh duh 21:54:12 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 4 1 0 [1..3] 21:54:12 [[1,2,3],[3,2,1]] 21:54:32 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 6 1 0 [1..5] 21:54:33 [[1,4,3,2,5],[5,4,3,2,1]] 21:54:55 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 6 1 0 [1..5] 21:54:56 [[1,4,3,2,5],[5,4,3,2,1]] 21:55:11 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 8 1 0 [1..7] 21:55:12 [[3,2,5,4,1,6,7],[5,2,3,4,7,6,1],[5,6,7,4,3,2,1]] 21:55:23 quintopia: do those solutions look familiar? 21:55:51 -!- Lymia has quit (Ping timeout: 240 seconds). 21:56:20 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 10 1 0 [1..9] 21:56:21 [[3,8,1,6,5,4,7,2,9]] 21:56:57 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 12 1 0 [1..11] 21:56:58 [] 21:57:01 wat 21:57:12 quintopia: um it claims there are no solutions for 12 :P 21:57:30 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 12 1 0 [1..11] 21:57:30 [] 21:57:52 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 14 1 0 [1..13] 21:57:53 [[9,12,3,10,5,4,7,6,11,8,1,2,13]] 21:58:21 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 16 1 0 [1..15] 21:58:22 [] 21:58:33 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 18 1 0 [1..17] 21:58:34 [] 21:58:42 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 20 1 0 [1..19] 21:58:45 [] 21:59:02 quintopia: there appear to be no solutions for 12, 16, 18 or 20 22:00:35 that is a good program there sir 22:00:46 why thank you 22:01:49 the gcd stuff seems not to be very important, it was fast enough without too 22:02:15 well i guess it might time out for larger ones 22:02:27 and of course... now i can't help but wonder if there is a maximum n...but that question might be as hard as collatz 22:02:33 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 20 1 0 [1..19] 22:02:36 [] 22:02:49 quintopia: perhaps :P 22:03:08 hm now... 22:03:27 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 22 1 0 [1..21] 22:03:31 mueval-core: Time limit exceeded 22:03:34 darn 22:03:50 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 22 1 0 [1..21] 22:03:54 mueval-core: Time limit exceeded 22:04:05 we may never know :P 22:05:24 oerjan: what is the maximum n which, for all k i wonder how many mathematicians are working on the Tootsie Roll Pop Conjecture... 22:07:13 my old laptop seems to have trouble with this :( 22:08:03 actually 22 _should_ be hard because the gcd stuff adds very little when the base is twice a prime 22:09:15 but also, twice primes are interesting because 14 _did_ have an example so maybe they all do... 22:10:38 hm... 22:10:54 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 24 1 0 [1..23] 22:10:57 mueval-core: Time limit exceeded 22:11:03 bah 22:11:09 oh wait 22:11:50 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 24 1 0 [1..23] 22:11:54 mueval-core: Time limit exceeded 22:11:59 nah didn't help 22:17:09 omg 22:17:15 i'm getting my first month of prgmr free :D 22:17:17 Gregor: NEE NAW NEE NAW 22:18:07 elliott, what, has he had a heart attack or something? 22:18:27 A HEART ATTACK OF JEALOUSY 22:18:47 quintopia: ah, there is no solution for 22 either 22:19:01 so twice prime conjecture disprover :P 22:19:03 *d 22:19:58 oerjan: run 26 if your compy can handle it :P 22:21:06 seems to take a while 22:21:28 (22 got reasonably fast once i actually compiled it properly) 22:21:46 -!- elliott_ has joined. 22:21:53 and then run 62 mwahahaha (in case it is twice mersenne primes) 22:22:03 -!- elliott has quit (Read error: Connection reset by peer). 22:22:07 sorry, i don't think that is going to work :P 22:22:15 it hasn't finished 26 yet 22:22:22 so it's obviously exponential 22:22:40 ha 22:22:42 -!- Lymia has joined. 22:22:45 i figured 22:22:49 ah there. no solution. 22:22:52 One idea for pokemon cards: Attach this card to one of your bench or active pokemon. Power, weak, resist, of the card this is attached to is suppressed. If you receive damage that would be affected by the weakness, discard this card (after damage is calculated). 22:26:32 no solution for 24 either. i don't think i'm going to try anything larger on this computer :P 22:26:37 -!- Lymia__ has quit (Ping timeout: 276 seconds). 22:27:18 EXCUSE ME I HAVE THE PERFECT COMPUTER GIVE IT TO ME 22:27:50 quintopia: my guess is there is no real connection between all the constraints so they just statistically block everything from some size on 22:28:10 elliott_: see nsearch above 22:28:14 what is this about, btw? 22:28:54 elliott_: in what bases b do there exist b-digit numbers such that the first k digits form a number divisible by k, 1 <= k <= b 22:29:08 9 22:29:09 yw 22:29:23 elliott_: sorry, odd bases have been excluded 22:29:26 there are 9 such bases, their identity is left as an exercise to the reader 22:29:37 hm... 22:30:07 1, 2, 4, 6, 8, 10, 14 are the ones we have found so far :P 22:30:31 -!- cheater__ has quit (Ping timeout: 255 seconds). 22:30:32 and a search up to 26 seems to bring little hope of more 22:31:23 elliott_: but you are welcome to test 28, 30 and so on as far as you wish 22:31:34 oerjan: no i am god i test nothing 22:31:37 i merely... know 22:31:45 oerjan: ok so it is just 22:31:47 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 24 1 0 [1..23] 22:31:49 what numbers should i use 22:31:50 in the nsearch call 22:31:50 mueval-core: Time limit exceeded 22:31:53 SOME PERFECT COMPUTER 22:32:10 elliott_: nsearch b 1 0 [1..b-1] 22:32:12 also, could any strictness help here? 22:32:22 oerjan: erm that is to test 28? 22:32:26 oh, b 22:32:29 no to test any b 22:32:48 but yeah, if you want to strictness annotate any of that... do it now 22:33:02 elliott_: just put !'s on everything :P 22:33:14 even remdigs? 22:33:27 well all the numbers :P 22:33:39 it's not an algorithm that needs laziness 22:34:04 nsearch.hs:1:177: Not in scope: `delete' 22:34:04 grr 22:34:05 ?hoogle delete 22:34:06 Data.HashTable delete :: HashTable key val -> key -> IO () 22:34:06 Data.IntMap delete :: Key -> IntMap a -> IntMap a 22:34:06 Data.IntSet delete :: Int -> IntSet -> IntSet 22:34:06 however n can be large, so you definitely need Integers 22:34:11 what delete is it? 22:34:11 elliott_: oh, in Data.List 22:34:22 what is nsearch's return type? 22:34:24 [[Integer]]? 22:34:27 yeah 22:34:35 how long did twenty-six take, exactly? :D 22:34:46 a few minutes 22:34:52 hmm, so this will take hours :D 22:35:05 elliott_: note that my laptop is 5 years old :P 22:35:16 oerjan: could it be parallelised? 22:35:24 elliott_: hm why not 22:35:38 you get on that :P 22:35:41 no. 22:35:47 elliott@katia:~$ ./nsearch 22:35:47 [] 22:35:47 yw 22:36:02 that's for 28? 22:36:04 yep 22:36:47 oerjan: what next :P 22:37:07 i'm gonna agree with oerjan's conjecture that there are no more after 14 22:37:09 elliott_: 30, 32, etc. we have no proof for specific even numbers 22:37:24 elliott_: we don't actually expect any more hits 22:37:27 based on NO EVIDENCE 22:37:56 hm... 22:38:07 let me just check OEIS for this 22:38:17 oerjan: what did mathematicians do before OEIS 22:38:50 i searched for it on oeis before and never found it 22:38:57 "Toothpick sequence starting at the vertex of an infinite 90-degree wedge." 22:39:07 oerjan: i'm glad this program has constant memory usage 22:39:09 wat 22:39:12 oerjan: BUT OF COURSE 22:39:17 what's the next predicted base? 22:39:19 quintopia: i'm joking :P 22:39:22 oh 22:39:22 :D 22:39:27 FUCK YOU :D 22:39:31 oerjan: erm wait that's a real sequence? 22:39:36 http://oeis.org/A160406 22:39:39 and it fits so far 22:39:54 so depending on the outcome of 30... :D 22:39:55 18 fails 22:39:56 yes but next is 18, which is not in the one we investigate 22:39:58 oh, damn 22:40:08 oerjan: how big will the output be if it is a match? 22:40:20 $ time ./nsearch 22:40:20 [] 22:40:20 real2m9.258s 22:40:22 ok thirty isn't it 22:40:28 oerjan: i searched for the sequence 1,2,2,2,1,0... 22:40:40 or w/e 22:41:08 oerjan: trying thirtytwo now 22:41:14 elliott_: who knows? some bases have 3 examples 22:41:34 but in _theory_ there could be an exponential amount 22:42:32 quintopia: i guess OEIS does not contain finite sequences much, anyhow 22:43:27 more like finite jewquences 22:44:05 OR THAT 22:44:23 yes. it does contain a handful. it contains the fermat primes iirc 22:44:53 hm 22:45:36 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 8 1 0 [1..7] 22:45:37 [[3,2,5,4,1,6,7],[5,2,3,4,7,6,1],[5,6,7,4,3,2,1]] 22:45:41 -!- cheater_ has joined. 22:46:42 hmph those don't google well 22:46:50 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 10 1 0 [1..9] 22:46:51 [[3,8,1,6,5,4,7,2,9]] 22:47:50 that one has good hits, at least :P 22:47:59 ah 22:48:11 (in google) 22:48:18 hmm, this fringe episode has "polish military-grade transistors" 22:48:18 oerjan: still running thirtytwo 22:48:23 so it's 1,2,2,3,1,0,1,0,0,0,0,0,0,0,0,0... 22:49:00 olsner: orite. those are the huge ones that can switch/amplify 4000 V wires :P 22:49:25 quintopia: no, it's just a normal small one with polish text on it 22:49:25 -!- azaq23 has quit (Ping timeout: 255 seconds). 22:50:46 olsner: doesn't sound military grade to me 22:51:00 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 8 1 0 [1..7] 22:51:00 [[3,2,5,4,1,6,7],[5,2,3,4,7,6,1],[5,6,7,4,3,2,1]] 22:51:19 no indication that the gcd rule is wrong, at least 22:51:51 oerjan has mastered the ancient mathematical art of proving statements on infinite sets by testing a finite number of examples 22:51:58 it makes me a bit nervous, but it should cut down a lot of branches 22:52:15 can always binary-search back to those 22:52:34 elliott_: huh? 22:52:41 I mean, you can just try ones that fit the gcd rule 22:52:44 then go back to non-gcd ones later 22:53:24 if your computer can handle them :P 22:53:52 for example, it's the gcd rule which ensures odd positions only get odd digits 22:54:37 so without it, all of those might get twice as many candidates at each step 22:54:42 oerjan: psst, can you reofrmulate nsearch with combinators instead of a comprehension? 22:54:48 I'm trying to port it to data-parallel Haskell 22:55:02 i have no idea how data parallel haskell works :P 22:55:20 (well, almost none) 22:55:26 * elliott_ tries to find the module for you; it's basically just Data.List 22:55:28 but with P on the end 22:55:30 but I just want a list version 22:55:32 that uses combinators 22:55:35 I can port it to dph myself 22:55:54 oh, darn 22:55:59 there's no dph for GHC 7.0 22:56:01 I'll port it to repa instead 22:56:36 elliott_: well i guess you want to choose the digit first, and if there are two, you can branch 22:56:42 hm should the result be (ArrayTypeyThing [Integer]) or [ArrayTypeyThing Integer] 22:56:45 of nsearch, I mean 22:56:46 *two or more possibilities 22:56:53 assuming remdigs is ArrayTypeyThing Integer 22:57:31 elliott_: hm you could actually do it with Integer instead if you want 22:57:35 oerjan: eh? 22:57:53 I just mean 22:57:57 nsearch 22:57:57 :: Integer 22:57:57 -> Integer 22:57:57 -> Integer 22:57:57 -> R.Array R.DIM1 Integer 22:57:58 -> R.Array R.DIM1 [Integer] 22:58:02 is the last component right, 22:58:05 or should it be [R.Array R.DIM1 Integer]? 22:58:10 elliott_: the final result is really just n. oh but it will be in decimal if you do that. 22:58:20 you're not really making any sense :D 22:58:25 oerjan: do you mean that the inner [Integer] 22:58:27 is just a list of digits? 22:58:31 yeah 22:58:37 so i could do 22:58:38 type Number = [Int] 22:58:46 well yes. 22:58:46 (assuming the bases won't go above Int range...) 22:59:03 n still needs to be Integer though. 22:59:20 urgh, what, no Elt instance for Integer? 23:00:20 oerjan: I might just use Data.Vector instead 23:00:28 oh wait, repa is what does the automatic parallelisation 23:00:29 hmm 23:00:58 oerjan: hmm, will remdigs ever contain a really large number? 23:01:13 and will the result numbers in nsearch ever be really large? I mean, feasibly 23:01:16 elliott_: remdigs is always a subset of [1..b-1] 23:01:16 i.e. not fit into Int 23:01:43 elliott_: the number has b-1 digits where b is the base :P 23:01:56 hmm, so it might very well overflow, then 23:02:01 yep 23:02:17 $ time ./nsearch 23:02:17 ^Y[] 23:02:17 real19m28.434s 23:02:18 for thirty-two 23:02:33 oerjan: ok well is nsearch expressable as a map of any kind, I'm just looking for parallelisation options here 23:03:39 elliott_: the recursive nsearch depends on the digit chosen. i guess you can check if there is more than one possible digit and branch only if so 23:04:01 Some people have asked questions about chess rules such as this: "can a king switch places with a pawn when in check?" "if a king reaches the other end of the board then can u get your queen back?" "He moved his king to the other side and said its a draw. Is it correct?" "can the king take another piece" 23:04:08 hmm, when would there ever be only one possible digit? 23:04:27 elliott_: easily. for example the b/2 digit must always be b/2 23:04:40 erm wouldn't that only save, like, one recursion though 23:05:07 elliott_: but there is also the requirement that the number so far must be divisible by the current position 23:05:23 ?pl [ d : ds | !d <- remdigs , let g = gcd pos b , let n' = n*b+d , gcd d g == g , mod n' pos == 0 , !ds <- nsearch b (pos+1) n' (delete d remdigs) ] 23:05:23 (line 1, column 1): 23:05:23 unexpected "[" 23:05:23 expecting white space, "()", natural, identifier, lambda abstraction or expression 23:05:23 i would think that tends to cut down most 23:05:25 grr 23:05:30 i was hoping for a combinator version 23:05:35 concatMap, etc. 23:05:43 oerjan: i think it is possible to write a much more efficient logical search than this rather brute forcey thing you've got. like the logical sudoku solver? 23:06:01 "if the opponents queen is placed next to the king putting him in check mate can the king take the queen" "is it true that the king cna move two spaces on its first move?" "If you get your king across and back do you get a piece back." "I have alot of friends at school that say that chess is for nerds and geaks do any of you have this proble please replay after reading this message" 23:06:13 quintopia: i don't know. i feel like the gcd rule takes care of most easy restrictions... 23:06:23 how do you translate a list comprehension again... 23:06:27 filter (\d -> ) remdigs 23:06:37 filter (\d -> let g = gcd pos b; n' = n*b+d) remdigs 23:06:41 @undo [x | y <- l, x <- y] 23:06:41 concatMap (\ y -> concatMap (\ x -> [x]) y) l 23:06:46 oh 23:06:50 ?undo [ d : ds | !d <- remdigs , let g = gcd pos b , let n' = n*b+d , gcd d g == g , mod n' pos == 0 , !ds <- nsearch b (pos+1) n' (delete d remdigs) ] 23:06:50 Parse error at "!d" (column 14) 23:06:58 ?undo [ d : ds | d <- remdigs , let g = gcd pos b , let n' = n*b+d , gcd d g == g , mod n' pos == 0 , ds <- nsearch b (pos+1) n' (delete d remdigs) ] 23:06:58 concatMap (\ d -> let { g = gcd pos b} in let { n' = n * b + d} in if gcd d g == g then if mod n' pos == 0 then concatMap (\ ds -> [d : ds]) nsearch b (pos + 1) n' (delete d remdigs) else [] else []) 23:06:58 remdigs 23:07:01 yay 23:07:22 just means that I can, e.g. try a parallel map 23:07:31 assuming numdigs isn't too big, that should pay off 23:08:40 concatMap (\ ds -> [d : ds]) nsearch b (pos + 1) n' (delete d remdigs) 23:08:43 oerjan: hm that can't be right 23:08:44 missing parens 23:09:23 elliott_: in fact the number of branches will almost certainly be largest for the first few digits, where the restriction of modulus is small 23:09:44 while for the later ones you will probably only get one digit possibility 23:10:09 (e.g. the first digit can be any number relatively prime to the base) 23:10:46 nsearch !b !pos !n !remdigs = concat (parMap rdeepseq f remdigs) 23:10:48 I think this is right 23:11:33 "do you guys know about the ozone layer" (That has nothing to do with chess!) "Whap happens when a player says a false checkmate? Do i win?" "can a player leave the table while his oponent has to move if a clock doesnt exist?" "When your king reaches the other side if the board what happenends?" "when a pawn reachs the end can it turn into a queen. If i already have one ." 23:11:42 * elliott_ tries thirty again 23:11:43 real2m9.258s 23:11:43 to beat 23:12:43 an improvement 23:13:35 3291 elliott 20 0 48740 3700 1256 R 179 0.1 0:13.84 nsearch.optim 23:13:36 promising 23:13:41 "i have played a computer program that says that moving the king into a square without having that square accessible by a piece of yours is illegal. is this true?" "is it allowed for a king to be checkmated without going through check first?" "can a pawn turn into a queen and put you into check mate to end the game or must it be done differently" "lets say there was just a kink left and the very last move of the game put it in checkmate,would t 23:13:49 rdeepseq may be excessive, min dyou 23:13:49 mind you 23:14:30 wtf sort of questions are these 23:14:33 who would ask them 23:14:36 ever 23:15:06 oerjan: hm this may have been a pessimisation... 23:15:09 unless it wasn't thirty I tested 23:15:12 Probably people who are very confused about chess might ask these kind of questions 23:15:25 nope, it was thirty 23:15:43 elliott_: i think maybe one should split the digit selection from the recursion somehow... 23:15:45 Some are common questions but others are strange 23:15:54 oerjan: yeah, i don't have the smarts for that, you have to handle that thinking stuff 23:16:14 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | d <- remdigs, let n' = n*b+d, mod n' pos == 0, ds <- nsearch b (pos+1) n' (delete d remdigs)] in nsearch 8 1 0 [1..7] 23:16:15 [[3,2,5,4,1,6,7],[5,2,3,4,7,6,1],[5,6,7,4,3,2,1]] 23:16:51 $ time ./nsearch.optim +RTS -N 23:16:52 [] 23:16:52 real2m47.566s 23:16:56 so it's a pessim for that 23:16:59 * elliott_ changes it a bit 23:17:06 oerjan: erm that is the same program :D 23:17:17 i just copied it 23:17:58 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | (d,n') <- ndigs b pos n remdigs , ds <- nsearch b (pos+1) n' (delete d remdigs)]; ndigs b pos n remdigs = [(d, n') | d <- remdigs, let n' = n*b+d, mod n' pos == 0]; in nsearch 8 1 0 [1..7] 23:17:59 [[3,2,5,4,1,6,7],[5,2,3,4,7,6,1],[5,6,7,4,3,2,1]] 23:19:19 not sure if that actually helps though :P 23:19:52 oh wait 23:20:00 i copied a version without the gcds :( 23:20:54 > let nsearch _ _ _ [] = [[]]; nsearch b pos n remdigs = [d:ds | (d,n') <- ndigs b pos n remdigs , ds <- nsearch b (pos+1) n' (delete d remdigs)]; ndigs b pos n remdigs = [(d, n') | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0]; in nsearch 8 1 0 [1..7] 23:20:54 [[3,2,5,4,1,6,7],[5,2,3,4,7,6,1],[5,6,7,4,3,2,1]] 23:22:04 elliott_: i think the first list comprehension there is a good spot to parallelize. of course i don't actually know this stuff :P 23:22:14 meh, parallelisation just slows this down it seems... 23:22:16 oerjan: hm I'll give it a try 23:22:21 ?undo [d:ds | (d,n') <- ndigs b pos n remdigs , ds <- nsearch b (pos+1) n' (delete d remdigs)]; ndigs b pos n remdigs = [(d, n') | d <- remdigs, let g=gcd pos b; n' = n*b+d, gcd d g == g, mod n' pos == 0] 23:22:22 Parse error at ";" (column 89) 23:22:24 asghj 23:22:45 i hope that tuple doesn't hurt too much 23:23:49 oh wait, thats two clause 23:23:50 s 23:24:12 hence why i said the _first_ list comprehension :P 23:25:27 oerjan: ndigs is a separate function, right? 23:25:38 yeah 23:26:17 the idea is that you probably don't want to paralellize it, but if its result has more than two elements you want to paralellize on the rest 23:26:40 oerjan: this has the same performance characteristics as the original version when not paralellised, right? 23:27:00 probably 23:27:07 ?undo [d:ds | (!d,!n') <- ndigs b pos n remdigs, !ds <- nsearch b (pos+1) n' (delete d remdigs)] 23:27:07 Parse error at ",!n')" (column 12) 23:27:13 ?undo [d:ds | (d,n') <- ndigs b pos n remdigs, ds <- nsearch b (pos+1) n' (delete d remdigs)] 23:27:13 concatMap (\ (d, n') -> concatMap (\ ds -> [d : ds]) nsearch b (pos + 1) n' (delete d remdigs)) ndigs b pos n remdigs 23:27:17 stupid \bot 23:27:31 oerjan: I'm tempted to use a list type that can nest indefinitely and flatten it at the end 23:27:40 oerjan: since all these concats are essentially barriers that force sequentiality... 23:27:41 *parallelize 23:28:15 elliott_: ok :P 23:28:25 ?undo [d:ds | (d,n') <- (ndigs b pos n) remdigs, ds <- (nsearch b (pos+1) n' (delete d remdigs))] 23:28:25 concatMap (\ (d, n') -> concatMap (\ ds -> [d : ds]) (nsearch b (pos + 1) n' (delete d remdigs))) (ndigs b pos n) remdigs 23:28:42 wrong position, heh 23:29:16 oerjan: so, erm, would I want the outer or inner concatMap to be parallel? 23:29:24 or both 23:29:52 oh hm 23:30:13 basically is ndigs or nsearch the long one :D 23:30:58 oh. the outer one, i think. 23:31:31 -!- azaq23 has joined. 23:31:58 ok, it's using all my CPU, so hopefully this will be faster 23:32:03 but that's what I said last time, too 23:32:07 heh 23:32:34 elliott_: my point is you don't want to parallelize on remdigs, only on the result of ndigs 23:32:50 because remdigs is likely to be pruned a lot 23:33:20 right 23:33:23 real1m31.738s 23:33:24 woot 23:33:36 it worked? :P 23:33:42 yep 23:33:52 ok, now for thirty-four 23:34:37 http://www.irregularwebcomic.net/3080.html 23:35:06 I am now genuinely curious as to how laid-back scheduling works for the person arranging a meeting. 23:35:09 -!- hagb4rd has changed nick to hagb[4]rd. 23:35:11 "on English time" :D 23:35:19 Do you just turn up half an hour later than you specified? 23:35:27 You just turn up whenever, man. 23:36:26 elliott_: i take it there have been no new elements in the sequence so far, and you're up to trying 34? 23:36:31 indeed 23:36:33 it's running now 23:36:35 eating up all my cpu 23:36:39 Throughout the Latin American world, are the conference rooms booked for 10 o'clock but empty of people because they've all tacitly agreed to turn up at half 10? 23:36:57 Phantom_Hoover: You realise that "laid back" means "laid back", not "PRECISELY half an hour later". 23:37:13 elliott_, *around* half 10. 23:37:27 oerjan: anyway, thirty-two took 19m28.434s sequentially 23:37:33 so I dunno how long this will take, parallely 23:37:46 oops 23:37:49 ? 23:37:53 don't tell me it has a bug :D 23:38:15 it's just a bit of time 23:38:20 oerjan: ? 23:38:23 what do you mean 23:38:44 i don't know any bug. you might want to try it on 8 which we know has 3 elements :P 23:39:28 well actually i did, on the pre-parallelized version 23:40:16 -!- cheater_ has quit (Ping timeout: 255 seconds). 23:44:57 elliott_: hm hopefully this framework is smart enough not to add parallelizing overhead if mapping over a list with 1 element :P 23:45:13 oerjan: I think sparks are really cheap 23:45:17 oh 23:45:18 as in, you can have hundreds of thousands at any time 23:45:23 it's like 23:45:30 os threads > haskell green threads > sparks 23:46:13 elliott_: yeah but still i thought i'd heard that the trick to parallelization is to not get too fine-grained so everything is destroyed by overhead... 23:46:26 oerjan: that's sort of the idea of sparks, isn't it? 23:46:28 having almost 0 overhead 23:46:30 ok 23:46:53 anyway, all the smart people think it's great ;D 23:46:58 good, good 23:58:19 oerjan: still going 23:59:17 25 minutes...