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