00:00:03 It's not boring. from should, given a function a -> b, make a Getter' b a 00:01:49 -!- Frooxius has quit (Read error: Connection reset by peer). 00:02:49 -!- Frooxius has joined. 00:05:28 Are there going to be SQL extensions for dealing with pictures, sounds, music, internet, GUI, plotting graph of the data, typesetting, printer, ephemeris, as well as such a thing as databases containing various data such as chemical, political, geographical, weather, word lists, etc...? 00:07:34 Therefore you can combine all of these things by using ATTACH command and LOAD_EXTENSION and various functions (including aggregates). 00:11:15 Many sets of data are posted in other formats such as CSV (although I think tab separated is better anyways), HTML, Microsoft Excel, and sometimes also XML; but I would like to see many such thing in SQLite format. 00:11:55 At least I think it would make the data easier to deal with. 00:12:07 I don't know quite what is your opinion. 00:12:59 -!- doesthiswork has joined. 00:17:13 Virtual tables could be used for accessing RDF and other XML based formats; virtual table could also be for accessing other file formats, for accessing the windows on the screen, manage network connections, etc 00:19:15 shachaf: what's the name of the profunctor used by from? 00:19:29 Un? 00:19:36 Exchange, in lens? 00:21:47 Exchange sounds like a good name. Don't really know what Un is, I thought that was that unlens thing 00:32:38 It is. 00:32:51 from turns an optic into the corresponding unoptic. 00:32:57 I think we called it re. 00:33:09 It was how I sold edwardk on pure profunctor optics. 00:38:49 Another thing I want to see in SQLite format are comparison tables. 00:39:08 (for comparing various kinds of things, whether computer software or otherwise) 00:54:26 I still don't get what an unoptic is 00:59:44 -!- MoALTz_ has joined. 01:02:52 -!- MoALTz has quit (Ping timeout: 260 seconds). 01:11:52 -!- Lorenzo64 has quit (Ping timeout: 245 seconds). 01:21:27 -!- FreeFull has quit (Ping timeout: 245 seconds). 01:23:45 -!- FreeFull has joined. 01:23:47 -!- FreeFull has quit (Changing host). 01:23:48 -!- FreeFull has joined. 01:27:10 -!- Lorenzo64 has joined. 01:34:10 -!- up2quark has joined. 01:34:15 Hello 01:35:09 -!- up2quark has left. 01:59:08 `addquote Rule of thumb is that if I can understand it you're not using enough fancy stuff 01:59:09 1218) Rule of thumb is that if I can understand it you're not using enough fancy stuff 02:03:07 Other things I want to have in SQL (with data files, extensions, and/or network services) include surveys and collaborative tables. 02:03:14 Are there such things? 02:04:11 ( :t (<$) 02:04:11 Prelude.Applicative.(<$) : Applicative f => f a -> f b -> f a 02:04:20 ( :t ($>) 02:04:20 Prelude.Applicative.($>) : Applicative f => f a -> f b -> f b 02:04:29 bah 02:04:50 That's different from Haskell, which is (<*) and (*>) 02:05:10 i know. Melvar mentioned <$> in the logs, which is also different. 02:05:29 Why are they calling these things differently like this? 02:05:34 so i was wondering if idris had actually done the logical thing i'd thought of with the two others. 02:05:37 but no. 02:06:09 zzo38: well <$> _is_ more logical than <*> if you are starting out naming them 02:06:32 except if you do that, i think fmap should be $> 02:06:49 and it isn't that in idris either 02:07:24 although part of the problem is that < and > are also used in two senses in applicative notation 02:07:51 sometimes it means "this is something applicative", other times it means "return the right or left part as pointed to" 02:08:30 oerjan: what would you rename (<*) and (*>) to? 02:08:41 I don’t know how the operators got named as they are. 02:08:42 I guess you'd want operators for const and flip const and use that or something. 02:09:25 elliott: lessee, rename (<*) to *<* and (*>) to *>* 02:09:39 oerjan: wait, what? 02:09:48 now (<$) can be <* 02:09:52 :t (<$) 02:09:53 Functor f => a -> f b -> f a 02:10:39 elliott: i said i wanted to separate the two meanings of <>, didn't i? if we use $ instead of * then we can reuse * for the meaning that says "applicative" 02:11:01 (<$>) becomes $* 02:11:10 I see. 02:11:31 oerjan: perhaps the ideal symbol for * is banana brackets (depending on which side it's on) 02:11:33 the not standard but defined in lens (??) becomes *$ 02:11:49 since a (|$|) b would be (| a $ b |). 02:12:13 oerjan: and (<**>)? :p 02:12:18 oh that 02:12:28 *&* I guess 02:12:33 first we need a symbol for reverse application, so take lens... right 02:13:12 :t (<**>) 02:13:13 Applicative f => f a -> f (a -> b) -> f b 02:14:14 ( with List [| [1,2,3] + [4,5,6] |] 02:14:15 (input):1:14:When elaborating an application of function BotPrelude.LiftEq.<$>: 02:14:15 Can't unify 02:14:15 List a 02:14:15 with 02:14:15 x = y↵… 02:14:23 … 02:15:22 idris, the language that has even sillier type errors than haskell 02:17:26 ( with Applicative [| [1,2,3] + [4,5,6] |] 02:17:26 When elaborating an application of function Prelude.Applicative.pure: 02:17:27 Can't disambiguate name: Prelude.Classes.+, Prelude.Fin.+ 02:17:46 … 02:18:19 ( the (List Integer) [| [1,2,3] + [4,5,6] |] 02:18:19 [5, 6, 7, 6, 7, 8, 7, 8, 9] : List Integer 02:18:47 elliott: banana brackets seem a little heavy but maybe just | would be good 02:18:56 oerjan: they're a bit heavy in ascii, yeah. 02:19:02 except then <| clashes with Data.Sequence 02:19:18 but probably the others also clash with something i don't remember 02:19:20 Why did they decide to make both list comprehension notation and do notation in Haskell? It would be better to combine them into one kind of command. 02:19:28 oerjan: btw, *>* should be liftA2 (>) :p 02:19:51 the thing with <| is that the < looks like the outside and the | the inside... |<| and stuff is sorta weird 02:20:43 elliott: i have no scrubles repurposing < and > there, they're just not useful enough to do that with 02:20:47 *scruples 02:21:25 I sort of feel like a lot of the "only partially applicative" ones are a little redundant. 02:21:33 (const x <$> y) is just as good as (x <$ y), really. 02:21:47 I guess that's the only one. 02:22:45 elliott: Although <$ is convenient shortcut in many cases, I think 02:22:45 -!- tromp has quit (Read error: Connection reset by peer). 02:22:54 -!- tromp has joined. 02:24:15 First I would have do notation has a macro instead of built-in; another is that, rather each item in the block can be: Using a pattern and <- and the wrapped value and a semicolon, using a pattern and = and unwrapped value and a semicolon, a wrapped value and semicolon, or only at the end, unwrapped with no semicolon. Guards are allowed in all of these patterns, and so is a guard by itself with no pattern nor <- and = 02:25:11 What does a guard do? Force MonadPlus? 02:25:24 I wonder once more, is there a name for Monads where for all mx and f, do { x <- mx; y <- mx; f x y } ≡ do { x <- mx; f x x } ? 02:25:37 Sgeo_: the same thing as any refutable pattern, i assume 02:25:44 eww 02:27:00 Melvar: that reminds me of affine commutative IO proposal 02:27:09 so possibly "affine" 02:27:52 In particular the Monad instances of (Vect n) and Stream fulfill this equivalence. 02:29:06 Reader also, i think. 02:29:31 I've heard someone call monads where bind never calls the function it's passed more than once 'affine'. No idea if that's related 02:29:39 Or a reasonable use of that name 02:29:52 and the ACIO monad would fulfill it, as that was part of its purpose 02:29:52 (e.g. most things except []) 02:29:56 Well, both of those are equivalent to Readers. 02:30:24 *-l 02:31:07 Sgeo_: I would say a guard would be forcing MonadPlus, yes 02:32:42 lambdabot what'd i ever do to you <-- "can't find file: L.hs" is essentially a kind of race condition in lambdabot 02:33:40 Okay, so I guess that’s affine. And the order the actions are specified in being irrelevant presumably is commutative? 02:33:54 yeah 02:34:22 although when i googled ACIO just now, the hits seemed to imply C is for "central". 02:34:23 Well, I would think, "commutative", as a commutative applicative at least, would mean that (x <* y) is same as (y *> x) 02:34:40 zzo38: that's at least implied 02:34:42 -!- Bike has quit (Quit: leaving). 02:35:02 Implied by what for what purpose? 02:35:12 or more generally, f <$> x <*> y = flip f <$> y <*> x 02:35:36 zzo38: by my understanding of what "commutative" means for monads 02:35:38 Well, yes, that is another way too 02:35:51 zzo38: possibly they are equivalent. 02:35:59 I don't seem to see what "commutative" means for monads, only for applicative. 02:36:14 but it's not obvious 02:36:15 -!- AndoDaan has joined. 02:36:35 zzo38: yes i think a monad is commutative exactly when its corresponding applicative is 02:36:53 OK 02:37:23 Maybe another way is: fmap swap . liftPair = liftPair . swap 02:37:59 -!- Bike has joined. 02:38:05 hm actually i think just <* vs. *> loses too many ways of combining the results to imply the full thing 02:39:23 Does it? Maybe 02:39:49 basically, you get no result information from y 02:40:24 If that is the only problem then the two other ways are working. 02:40:29 so you know the _effects_ commute, but not whether the whole thing does. 02:41:30 Ah, I suppose you are correct, then 02:41:41 It makes sense 02:42:18 Melvar: wait, what's Stream there? 02:42:37 oh. 02:42:42 presumably the obvious diagonalisation instance? 02:43:09 So then f <$> x <*> y = flip f <$> y <*> x or fmap swap . liftPair = liftPair . swap is doing it? 02:43:12 -!- tromp has quit (Ping timeout: 260 seconds). 02:43:35 elliott: That would be the only one I know of that agrees with its Applicative instance. 02:43:51 i saw someone in a stackoverflow question essentially reinventing the Monad instance for Maybe (he had got to Applicatives in the course) in order to solve a problem. except he had defined join and zzo38's liftPair. 02:44:03 *only got 02:44:09 oerjan: iow, f <$> x <*> y = y <**> f <$> x? 02:44:16 :t \f x y -> f <$> x <*> y == y <**> f <$> x 02:44:17 Precedence parsing error 02:44:17 cannot mix ‘<*>’ [infixl 4] and ‘==’ [infix 4] in the same infix expression 02:44:17 Precedence parsing error 02:44:24 :t \f x y -> (f <$> x <*> y) == (y <**> f <$> x) 02:44:25 Eq (a -> b) => (a -> a1 -> b) -> (a -> a) -> (a -> a1) -> Bool 02:44:39 :t (<**>) 02:44:40 Applicative f => f a -> f (a -> b) -> f b 02:44:42 oh 02:44:45 :t \f x y -> (f <$> x <*> y) == (y <**> f <*> x) 02:44:46 Occurs check: cannot construct the infinite type: b ~ a -> b 02:44:46 Expected type: a -> a1 -> a -> b 02:44:46 Actual type: a -> a1 -> b 02:44:52 :( 02:45:13 :t \f x y -> (f <$> x <*> y) == (y <**> (f <$> x)) 02:45:14 (Applicative f, Eq (f b)) => (a1 -> a -> b) -> f a1 -> f a -> Bool 02:45:14 elliott: well or simpler: (<*>) = flip (<**>) 02:45:20 oerjan: right. 02:46:55 elliott: That would be the only one I know of that agrees with its Applicative instance. <-- since Streams have only one "shape", the uniqueness of Monad from Applicative follows 02:47:03 oerjan: Do you mean only join and liftPair and not anything else? That wouldn't be very good. 02:47:16 I was mixing up Steram and ZipList or something. 02:47:49 And similarly (Vect n) has only one shape for each n, I guess. 02:48:17 ( the (Vect _ Integer) [| [1,2,3] + [4,5,6] |] 02:48:18 [5, 7, 9] : Vect 3 Integer 02:49:02 zzo38: yes, although e knew about Functors so e had fmap 02:49:30 i guess that's "no", really :P 02:50:24 elliott: well Stream is the subset of all ZipLists of that shape. 02:50:30 yeah. 02:50:33 and each shape is a Monad, i think. 02:50:48 You had fmap? Then you have liftPair, you should need pure, too, then. 02:50:52 because it's really Reader on a subset of Nat 02:51:08 yeah. 02:51:14 on (Fin n) for some n. 02:51:33 zzo38: well e had pure also, but e didn't use it for Maybe iirc 02:52:01 ...or all of Nat, for Streams. 02:53:06 n = fix Succ! 02:53:24 that works. you could define FinOrMaybeInfin as Conat -> Type. maybe. probably. 02:53:30 it'd have to be codata of course. 02:54:30 i still haven't quite wrapped up the proof that ZipList monad is impossible. i discovered that if the lists are length <= n then the result must also be, because take n is join . replicate n = join . fmap (replicate n) if join exists 02:55:03 um 02:55:13 yes, that was it 02:55:55 and so if you take n at any depth in the m (m a) it commutes out with the join 02:56:40 For optimizing Z-machine text encodings, I have one thing already, which is figuring out the preferred states before each character, in order to figure out which way is shortest (you must skip spaces and fwords in order to do so, since they are unaffected by shift states). However, there are the two other things: Suffix optimization, and filling in the frequent words table. 02:57:14 ( :t fibs 02:57:14 No such variable fibs 02:57:31 * oerjan is obviously mixing notation there 02:57:40 ( :let fibs : Stream Nat; fibs = 0 :: 1 :: [| fibs + tail fibs |] 02:57:40 defined 03:00:38 For filling in the frequent words table, I have thought of counting the number of "demerits" for each possibility and using the ones with negative demerits. However, this would be really slow and inefficient if all possibilities are counted like this. 03:02:41 For suffix optimization I could make it to sort by reverse, although also one case is if the suffix is capitalized first letter when used by itself but not when together with the prefix, is also usable in Z-machine encoding; perhaps a way to work this is to use a different character order than the ASCII order when sorting. 03:04:29 -!- tromp has joined. 03:06:13 And then there is the case that a frequent word (which, despite the name, can be any string and doesn't have to consist of a single word) spans the part of the prefix and suffix (or even the beginning of the suffix alone if it is capitalized). 03:07:07 Do any of you know???? 03:07:14 I do not know 03:17:17 -!- Lorenzo64 has quit (Ping timeout: 245 seconds). 03:23:07 -!- conehead has quit (Quit: Computer has gone to sleep). 03:25:49 * Sgeo_ rewatches In the Pale Moonlight 03:50:42 -!- sebbu has quit (Ping timeout: 245 seconds). 04:00:41 -!- MoALTz__ has joined. 04:03:28 -!- MoALTz_ has quit (Ping timeout: 260 seconds). 04:05:30 -!- MoALTz has joined. 04:08:08 -!- MoALTz__ has quit (Ping timeout: 260 seconds). 04:20:15 -!- Lorenzo64 has joined. 04:20:55 This is one idea of Magic: the Gathering card: Put the top card of each player's library on the stack. 04:21:38 zzo38: They've said that they don't want to make any cards that mention the stack explicitly. 04:22:04 Yes, I know that, but still *I* want to mention the stack explicitly. 04:22:45 What would its mana cost be? 04:24:01 What would it mean to put a card on a stack? 04:24:04 What if it has targets? 04:24:17 What if it's land? 04:24:22 If it has targets then it fails when it resolves, I suppose. 04:24:34 If it is a land, then I would think it would just come into play anyways 04:24:46 Lands don't go on the stack normally, though. 04:24:53 I know that 04:24:57 shachaf: I'm curious where they've said they don't want to mention the stack? 04:25:02 What if you've already played a land? 04:25:04 Might be more fun reading 04:25:09 All sorts of places. 04:25:11 http://archive.wizards.com/Magic/magazine/article.aspx?x=mtgcom/daily/mr255 04:25:32 ty 04:25:32 If you have already played a land, at least what I would think, is, that isn't a problem and doesn't prevent you from playing another land. 04:32:10 But I also believe that Magic: the Gathering is too klugy and should be made up from the beginning over in the more mathematically elegant way, fixing other problems too (so, instead of a library it will be called a draw pile, a graveyard is now a discard pile, antes are returned at the end of a match and the ante zone exists even though it is initially empty, "outside of the game" *never* refers to a player's collection of cards they physically o 04:32:38 what a zzo38y thing to say 04:32:50 You were cut off after "physically o", by the way. 04:33:06 No, that's all I wrote 04:33:32 O, now I see. 04:34:39 you'd be taking all the flavor of the game, alienate the few remaining fans and kill the franchise! 04:34:40 "Cards you own outside of the game" is instead not used; "sideboard" is used instead and is always how it work anyways. 04:37:05 "This is, for example, one of the reasons we've been shifting X spells away from common over time. The concept of X throws a lot of people. " 04:37:11 Buh... uh.... huh? 04:38:25 I will admit Dead Ringers is confusingly worded :/ 04:38:50 int-e: Maybe, but I still think would be better to do such thing as remove the rule that auras which is also creatures are discarded, change the tokens ceasing to existing rule into one instead having to do with initial states, make copies of spells to be tokens (so that non-instantsorcery spells can be copied too), and of course other thing too. 04:39:51 Also some of things it looks like they try to make it easier to understand, tend to either make it instead more klugy (and therefore more confusing) or less strategic. 04:40:10 And they mess up existing cards too even though they explicitly try not to. 04:40:56 The implementation (and name) of Planeswalkers cards is also bad (although it is not a bad idea). 04:42:09 I think I read once that they wanted to try to make it into another player, but they couldn't figure out how. But I figured out how! 04:42:37 (Doing this would also avoid some of the klugy rules relating to it) 04:45:19 It is also my opinion that the size of the text box ought to vary in order to make the text fit (even if this leaves no room for a picture; conversely a card with no text has a larger picture). 04:53:38 -!- copumpkin has joined. 05:43:03 Is this accurate? instance Profunctor Exchange where dimap a b e = Exchange (dimap b a (runExchange e)) 05:43:08 Something along those lines? 05:43:25 Wait, no 05:44:00 instance Profunctor Exchange where dimap a b e = Exchange (\p -> dimap b a (runExchange e p)) 05:44:45 Ok, I think I need to think a bit more 05:57:04 ok i think i finally have a watertight proof that there is no ZipList monad. although i'm not sure whether I've just forgotten the previous ones :P 05:58:56 basically, consider [[[1,2],[3,4]],[[],[7,8]]], then zjoin $ zjoin xs _must_ be [1,8] and zjoin $ fmap zjoin xs _must_ be [1]. 05:59:10 but by the monad laws those two must be equal 06:01:46 all of this follows from how zjoin must be the main diagonal of rectangular lists of lists, _except_ for zjoin [[], [7,8]] = [] which follows from my proof that zjoin . take n = take n . zjoin when you put n = 1. 06:02:33 *, when you put 06:11:19 zzo38: ugh, no. I think the fixed size picture and fixed size text box is fine. 06:11:35 variable size would be ugly 06:11:47 But maybe you want to put a lot of text and the picture won't fit 06:12:02 I for one don't like the Zendikar full art lands that everyone seems to like so much 06:12:35 I don't really care, but I wanted variable size in order that large amounts of text can fit on the card. 06:12:49 zzo38: if there's too much text, then the card is wrong. cards shouldn't have too much text. the existing textbox (which, incidentally, got slightly larger both time they changed the card frame template) already allows a wall of text to fit 06:14:20 don't forget that the textbox provides graphical clues other than just containing the text: for one, it's colored according to the color of the text or the color of mana a land produces, that's very useful for non-basic lands, 06:14:40 it also contains a nice mana icon for basic lands (and also guild and faction and klan sybmols which I don't like so much) 06:16:39 I prefer the text for the basic lands though 06:17:50 zzo38: consider for example the newer cycling lands like Secluded Steppe. Luckily for the reprints, the inner border and the name and type line is colored white, but even then the color of the text box helps too. 06:17:59 Or gold and hybrid cards. 06:18:29 Yes I know those thing can help too 06:18:58 I admit it's much less important in the post-Mirrodin frame 06:19:02 which has the inner border for this 06:19:11 But they aren't considered as a requirement by the rules of the game, since there are other things that says so on the cards. 06:19:16 But even without the color, I do like the fixed size text box and fixed size art 06:19:42 (especially if you are playing with grayscale copies of the cards; I have seen this) 06:20:30 Heh, imagine playing with grayscale copies of cards with color markers on the type line. 06:20:44 -!- MoALTz has quit (Quit: Leaving). 06:20:54 Anyway, as for basic lands, I guess that's a matter of taste, I prefer just the big mana symbol, but a text isn't too bad either. 06:22:54 zzo38: as for improving card faces, do you know what I'd like? I wish there were fewer new expansion symbols introduced, because there's now over a hundred and they're running out of space of recognizable and rememberable expansion symbols. I think each block should have only one expansion symbol, not one for each set. 06:23:40 (And some series of extra products like Duel Decks shouldn't take up expansion symbols.) 06:24:07 Basically, especially for a player that isn't so experienced, but even for me, it can be hard to remember all the expansion symbols. 06:25:56 They could be much easier to relate to if there was only one expansion symbol for the Urza's block (instead of three, the cogwheels, the lab breaker, and whatever is the third), one for the Judgement block (set of scales, some kind of ouroboros, and one more strange thingy), one for the Invasion block (I don't even remember what any of those look like), one for the Onslaught block (a morph spider). 06:26:08 We can't change the old sets, but new blocks should do this. 06:26:44 And I don't think it would cause too much problems with new sets either, would it? 06:28:18 I mean, yeah I know, sword, shield and helm of Kaldra and all, but still. 06:29:42 Morning 06:32:00 (Also, Spreading Seas should have gotten a remainder text saying that the land loses abilities printed on it; and Hollow Dogs should be a Skeleton) 06:33:47 -!- sebbu has joined. 06:34:26 -!- sebbu has quit (Changing host). 06:34:26 -!- sebbu has joined. 06:36:02 [wiki] [[///]] http://esolangs.org/w/index.php?diff=40382&oldid=38040 * B jonas * (+131) /* Implementation */ 06:36:48 (I mean, come on, a Zombie with no flesh is not a Zombie, it's a Skeleton or a Ghost depending on whether it has bones.) 06:37:16 what if it's the zombie of an invertebrate 06:39:24 Bike: the DnD rules at http://www.d20srd.org/srd/monsters/skeleton.htm says a skeleton needs a base creature with bones. If you have a creature with no bones and make an undead without flesh, what's its body made of? If there's no body, it's a ghost. If there's a body of soft tissue (not necessarily literally flesh), then it's a zombie (or maybe some higher level undead like ghoul). 06:39:49 Bike: so basically when I said "flesh", I mean parts of the body other than the bones 06:40:01 An exoskeleton 06:40:18 dunno 06:40:44 what about a cartilaginous animal, like a shark? who'd begrudge a zombie shark 06:41:16 technically, the DnD rule says "skeletal system", not bones 06:41:57 -!- sebbu has quit (Read error: Connection reset by peer). 06:42:52 -!- sebbu has joined. 06:43:11 and nethack does seem to go with this distinction: 06:43:20 -!- sebbu has quit (Changing host). 06:43:21 -!- sebbu has joined. 06:44:33 consider Rimebound Dead, which is a Skeleton created by a necromancer from bones according to the flavor text, and Legions of Lim-Dûl, Zombies which have "faces of my dead friends" according to the flavor text and are created by a necromancer according to its card name. 06:45:58 Both Heidar and Lim-Dul are necromancers, and both have both zombie and skeleton cards created by them: Zombie Musher and Kjeldoran Dead are the other cases. 06:46:41 ghouls in nethack have the creature type Zombie, and ghosts have the type Spirit 06:48:01 That sounds like more of a MtG thing than a NetHack thing. 06:54:05 moin 06:55:04 b_jonas: where do lemurs fit into this 07:01:59 -!- Frooxius has quit (Read error: Connection reset by peer). 07:02:06 -!- Frooxius has joined. 07:10:27 -!- oerjan has quit (Quit: BANANAAAAAAA). 07:54:19 -!- doesthiswork has quit (Quit: Leaving.). 08:06:36 -!- AnotherTest has joined. 08:11:35 -!- drdanmaku has quit (Quit: Connection closed for inactivity). 08:24:17 -!- Phantom_Hoover has joined. 08:35:02 -!- Patashu has joined. 08:42:41 Frooxius: yes, sorry 08:42:48 shachaf: ugh, lemurs and lemures, yeah 08:43:06 which one of those is the Animal and which one is an undead spirit? 08:43:55 see http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=2457 hth 08:49:42 -!- Patashu_ has joined. 08:49:43 -!- Patashu has quit (Disconnected by services). 08:52:51 -!- Patashu has joined. 08:56:23 -!- Patashu_ has quit (Ping timeout: 272 seconds). 08:57:45 -!- Patashu_ has joined. 08:57:45 -!- Patashu has quit (Disconnected by services). 08:58:15 Is there a equ f = (\a b -> (f a) == (f b))? 08:58:18 much like comparing 08:58:25 i.e. sortBy (comparing foo) 08:58:33 => groupBy (equ foo) 08:59:04 or something like using f g = (\a b -> (f a) `g` (f b))? 08:59:39 @let using f g = (\a b -> (f a) `g` (f b)) 08:59:41 Defined. 08:59:58 comparing = (compare `on`) 09:00:02 > groupBy (using length (==)) ["a","bb","c","dd"] 09:00:05 So just use ((==) `on`) 09:00:06 [["a"],["bb"],["c"],["dd"]] 09:00:15 > groupBy (using length (==)) ["a","bb","c","dd","ee"] 09:00:17 can't find file: L.hs 09:00:26 whaaat 09:00:39 That sometimes happens randomly. 09:00:41 > groupBy (using length (==)) ["a","bb","c","dd","ee"] 09:00:44 [["a"],["bb"],["c"],["dd","ee"]] 09:00:47 ic 09:00:52 But "on" is what you wanted. 09:00:53 -!- Patashu has joined. 09:01:09 @type on 09:01:10 (b -> b -> c) -> (a -> b) -> a -> a -> c 09:01:56 > groupBy ((==) `on` length) ["a","bb","c","dd","ee"] 09:01:58 [["a"],["bb"],["c"],["dd","ee"]] 09:02:00 oh 09:02:01 neat 09:02:03 @hoogle on 09:02:05 Data.Function on :: (b -> b -> c) -> (a -> b) -> a -> a -> c 09:02:06 Control.Exception.Base onException :: IO a -> IO b -> IO a 09:02:06 Control.Exception onException :: IO a -> IO b -> IO a 09:03:47 Also, (==) `on` length is too strict. :-( 09:03:57 -!- Patashu_ has quit (Ping timeout: 240 seconds). 09:06:19 -!- Patashu has quit (Disconnected by services). 09:06:19 -!- Patashu_ has joined. 09:10:51 shachaf: "too strict"? 09:11:26 > take 1 $ groupBy ((==) `on` length) [[1],[1]] 09:11:27 [[[1],[1]]] 09:11:30 For example if you compare a finite list to an infinite list it'll never return. 09:11:31 > take 1 $ groupBy ((==) `on` length) [[1],[1],[1..]] 09:11:36 mueval-core: Time limit exceeded 09:11:42 well yeah 09:11:55 length on infinite lists isn't really a clever thing to do 09:13:06 Well, on finite lists it'll just be inefficient rather than nonterminating. 09:13:10 -!- Patashu has joined. 09:13:29 ok then 09:13:39 How do *you* group by length then? 09:13:50 Hmm. 09:14:01 efficiently ;) 09:14:08 ((==) `on` map (const ())) will at least be asymptotically optimal. 09:14:42 how so? 09:15:10 It's terrible, though. 09:15:28 > let sameLength [] [] = True; sameLength (a:_) [] = False; sameLength [] (b:_) = False; sameLength (a:as) (b:bs) = sameLength as bs in sameLength [1..] [3,2,1] 09:15:29 -!- Patashu_ has quit (Ping timeout: 276 seconds). 09:15:29 False 09:15:32 Write your own function? Or use genericLength :: [a] -> Nat (the only valid use of genericLength) 09:15:40 Your own function would be what fizzie wrote. 09:18:42 -!- Patashu has quit (Remote host closed the connection). 09:18:54 -!- Patashu has joined. 09:19:47 ((==) `on` (() <$)) has a good punctuation-to-alpha ratio, however. 09:27:41 data T; instance Ord T where compare _ _ = EQ; (==) `on` (unsafeCoerce :: [a] -> [T]) 09:28:19 () will waste all those cycles "forcing" and comparing ()s 09:28:33 > compare () undefined 09:28:34 *Exception: Prelude.undefined 09:32:06 > length $ (map (const undefined)) [1..] 09:32:09 mueval-core: Time limit exceeded 09:32:12 > length $ (map (const undefined)) [1..20] 09:32:14 20 09:33:02 hm 09:33:04 better newtype over Any. 09:33:07 > zip [1..20] [1..19] 09:33:09 [(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,1... 09:33:51 > length $ zip [1..20] [1..19] -- that's just the shorter, isn't it? 09:33:52 19 09:33:57 @let cmp xs ys = last (zip xs ys) == (last xs, last ys) 09:34:00 Defined. 09:34:05 > cmp [1..20] [1..19] 09:34:07 False 09:34:15 > cmp [1..20] [1..20] 09:34:15 > cmp [1,1,1,1] [1] 09:34:16 can't find file: L.hs 09:34:16 True 09:34:24 > cmp [1..20] [1..20] 09:34:26 True 09:34:30 > cmp [1,1,1,1] [1] -- still 09:34:31 True 09:35:09 > cmp [1,2,3,2,1] [1] -- and so on 09:35:10 True 09:35:33 k 09:35:42 cmpMonotonicSteadilyRisingLists 09:35:56 hm no 09:36:00 *hide* 09:36:36 Another benefit: sameLength :: [a] -> [b] -> Bool vs. ((==) `on` length) :: [a] -> [a] -> Bool. 09:48:41 -!- Patashu_ has joined. 09:48:46 -!- Patashu_ has quit (Client Quit). 09:48:47 -!- Patashu has quit (Disconnected by services). 09:50:59 -!- IAm_thor has joined. 09:51:00 -!- IAm_thor has left. 09:55:09 -!- IAm_thor has joined. 09:55:10 -!- IAm_thor has left. 10:12:02 -!- boily has joined. 10:20:52 except that groupBy requires [a] anyway 10:20:56 @type groupBy 10:20:57 (a -> a -> Bool) -> [a] -> [[a]] 10:26:17 hm 10:26:28 Can I have a data Pair a b = Pair a b 10:26:44 but with a Type Constructor Foo a = Pair a a? 10:26:59 newtype Foo a = Foo (Pair a a)? 10:27:12 (two contructors: one with two arguments and one with one argument) 10:27:40 hm 10:28:02 Pair a b = Pair a b | Pair' a a doesn't work 10:28:20 mroman_: wait, what exactly do you want? a wrapper function? a gadt with two constructors? I don't understand 10:28:21 (Pair' still takes two arguments) 10:28:30 well 10:28:36 I could just use foo a = Pair a a 10:28:40 but then foo isn't a type constructor 10:28:55 I think you're confusing all sorts of things here. 10:28:58 um 10:28:59 i.e. I can't match for that 10:29:07 and how would you want to match this? 10:29:35 foobar (Foo _) = ...; foobar (Pair _ _) = ... 10:29:46 foobar :: Pair a b -> ... 10:30:12 wait 10:30:49 I'm stupid 10:31:21 or am I 10:31:29 data Pair a b = Pair a b | Pair' a 10:31:36 but then Pair' only holds one value 10:31:37 :( 10:32:08 The first thing to do if you don't want to confuse people is to use a different name for the type constructor and the data constructor. 10:32:42 except, perhaps, for records. 10:32:54 well 10:33:17 There should be two "constructors". One with two arguments and one with one argument 10:33:26 and you can match against the one with only one argument of course 10:33:36 but the one with one argument shall also match for the one with two arguments 10:33:45 anyway I don't know what you want. 10:33:49 i.e. let's call them Pair1 and Pair2 10:34:20 Pair1 takes one argument and Pair2 takes two arguments 10:34:25 data Pair a b where { Pair :: a -> b -> Pair a b; Twice :: a -> Pair a a }? 10:34:39 you can match as in foo (Pair1 a) = ... and foo (Pair2 a b) = .... 10:34:44 mroman_: but what should happen when you call Pair1, and what should happen when oyu match for Pair1? 10:34:55 however, if foo (Pair2 a b) appears *BEFORE* foo (Pair1 a) 10:35:02 the Pair1 shall behave as if it were a Pair2 10:35:09 i.e. it matches Pair2 as well 10:35:16 that's insane 10:35:23 but when do you want Pair1 to match? 10:35:34 and can you use a gadt AND arrow view match syntax instead? 10:35:44 or just arrow view match syntax? 10:35:50 There's a different algorithm you can use to do foo if both values are equal 10:35:56 (with a non-gadt ordinary data type) 10:36:04 which is faster than using the generic two non-equal values algorithm 10:36:13 of course you could just do |a == b = ... 10:36:33 mroman_: use an arrow view? 10:36:57 however, some other functions (not like foo) don't have such a distinction 10:38:19 others however only work when both are equal 10:39:14 which means you could do |a /= b = error ":(" 10:39:20 but I'd want it more type-safeish 10:40:18 I.e. just matching Pair1 wouldn't be type-safe as well 10:40:29 then Pair2 would just throw a "didn't match exception" 10:40:31 I think the GADT idea is sane. And you can define a view function, pair :: Pair a b -> (a,b) for the common case where equality doesn't help. 10:41:00 (needs a better name) 10:41:10 mroman_: do you mean you want to encode in _compile time_ that the two values are equal? because then you need a separate type for that case, and probably a typeclass so you can use that in the general case too. 10:42:41 b_jonas: yeah @compile-time 10:42:51 data Pair a b where { Same :: a -> Pair a a; Different :: a -> b -> Pair a b } 10:43:16 like, I dunno, data Pair2 a b = Pair2 a b; data Pair1 a = Pair1 a; class Pair a b t | t -> a b where { decodePair :: t -> (a, b) }; instance Pair a b (Pair2 a b) where { decodePair (Pair2 x y) = (x, y); }; 10:43:27 (Of course there's no way to ensure that the two arguments to "Different" are actually different.) 10:43:33 instance Pair a a (Pair1 a a) where { deocdePair (Pair1 x) = (x, x); }; 10:43:48 or something like that with correct syntax (how's the fundep syntax work again?) 10:45:16 int-e: but then let (Different a b) = (Same 5) in a*b doesn't work 10:45:26 which should result in 25 10:45:32 but pattern don't match 10:46:00 but ok 10:46:04 it's "insane" :) 10:46:31 I was merey wondering if it could be achieved, not that I really need to do it 10:46:34 *merely 10:48:31 I can give you the Java-Code for that ;) 10:49:03 mroman_: I know. but let (a,b) = pair (Same 5) works. 10:49:18 mroman_: where 'pair' is an appropriate view function, which is trivial to define 10:49:46 mroman_: you don't get the syntax that you want (and I honestly think that there's no sane way of doing that), but you do get the functionality. 10:49:53 int-e: in that case your pair is the function decodePair from my example code, 10:50:22 b_jonas: no, because I have no type class. :P 10:50:58 only in that case I also need an extra method for the case where you want to work differently in the simpler and the more complicated case 10:51:33 -!- KingOfKarlsruhe has quit (Ping timeout: 240 seconds). 10:53:42 wait, aren't we on the wrong channel for this/ 10:53:51 mroman_: ask on #haskell 10:55:14 -!- KingOfKarlsruhe has joined. 10:55:50 I thought this was the channel for everything . 10:59:49 everything that's remotely insane and has something to do with IT 11:00:26 sure, you can ask here too 11:00:33 which esoteric language most resembles the basic turing machine? 11:00:40 we jsut talked about M:tG too afterall 11:01:13 and if this channel is about everything, let me mention that today's strip http://thedoghousediaries.com/5893 is totally the old strip http;//xkcd.com/501/ done backwards 11:01:30 AndoDaan: dunno, I hate the basic turing machine 11:01:57 How can you? Everything started with the turing machine. 11:01:57 especially the one-tape turing machine (and bf for the same reason) 11:02:03 no it did not 11:02:07 pfft 11:02:08 everything started with Babbage 11:02:14 pfffft 11:02:16 honestly I don't want to bother #haskell's more serious and productive discussion with some crazy experimental questions 11:02:27 I prefer proper pointer machines (even with immutable cells) that aren't bound to a one-dimensional tape 11:02:35 programming started with Lovelace. 11:02:52 AndoDaan: yes, and programming never got to turing machines 11:03:01 well, almost 11:03:38 technically, there did exist some old computers with very few registers and a few kilobytes large spinning disk storing the instructions and memory, 11:03:43 but let's forget about those contraptions 11:04:10 I want to work with models and esoteric programming languages that can simulate sane computers with just a log-factor slowdown 11:04:36 It's possible nobody's bothered to replicate a Turing machine very closely in anything on esolangs.org because if a Turing machine's what you want, then probably you should just use one. There are a number of simulators. 11:05:33 I am, and it's fun. 11:06:14 Deterministic FInite Automata is less fun. 11:06:38 Category:Cell-based has a number of tape-oriented contraptions, but even those generally have quite different control flow than the states+transitions thing. 11:08:25 Programming in Thue might resemble programming a Turing machine. At least I think you end up with vaguely similar stuff, moving marker symbols up and down the string and so on. 11:09:17 string rewriting, I have a hard time wrapping my head around it. 11:10:27 We had some "write an unrestricted grammar to accomplish thing X" exercises on the introduction-to-theory-of-computation course, and I quite liked them. 11:11:01 do you remember an example? 11:11:08 -!- boily has quit (Quit: MEGAWATT CHICKEN). 11:11:23 fizzie: but isn't Thue one of those languages that use just a single circular stack so if you want to move backwards you have to do a full cycle? 11:12:22 wait, Thue isn't one of those, sorry 11:12:23 AndoDaan: Well, the *tasks* weren't really very exciting per se. Simple operations on binary numbers, maybe. 11:12:58 like "turn a binary string into unary" 11:13:13 just read that one. 11:13:50 There were also "build Turing machines" ones. (I found my homework answer .tex files.) 11:14:20 sound more complicated 11:14:22 Like "design a two-tape TM to recognize the language { wcw | w \in {a,b}* }". 11:14:40 oh like that. 11:15:13 "Design a three-tape TM to sum two binary digits." That kind of stuff. 11:15:29 Sometimes it's worth to re-read old threads on web forums that I have participated in (whether I asked or replied). I can find interesting stuff I almost forgot about. 11:16:29 Here's one about grammars: construct unrestricted grammars to produce the languages { w \in {a,b,c}* | the number of a's, b's and c's in w is equal } and { a^(2^n) | n >= 0 }. 11:21:17 I seem to have done something like http://sprunge.us/OgWB if you don't mind spoiling the questions; the latter is quite typical "practical programming with unrestricted grammars" one. (Disclaimer: solutions not guaranteed correct/good.) 11:29:05 Also, http://esolangs.org/wiki/NTCM is just a multitape TM with an I/O thing. 11:30:45 back. sorry 11:32:41 what do the "<" and ">" mean? 11:32:50 They're just symbols. 11:33:07 -!- sebbu has quit (Ping timeout: 245 seconds). 11:34:25 You can replace them with e.g. B and E (for beginning and end, respectively). 11:37:13 It's very simple; P always moves left-to-right through a string of AAA... and doubles it as it goes; at the end, it turns into either Q or R; Q is rewinded to the start to turn into a second P, while R just turns all the A's into a's. (It'd be slightly simpler to operate on a's directly, I don't know why I didn't do that.) 11:38:32 Hmm. 11:38:50 Hard to do it in my head for me. 11:39:59 oh, lots of broken links at the bottom. lycos, lycos, this was so long ago ... 11:42:00 The kind of marker-based things like that are reasonably easy to reason about. If you only have some fixed set of "active" symbols (like P, R, Q), and the productions both (a) ensure there's always only one "active" character in the entire string and (b) all include an active character on the left-hand-side, it's quite like having a "tape head" (and a "current state" indicated by which ... 11:42:06 ... character it is). 11:43:19 Yeah. like, I see "ab -> ba" & "ba -> ab" and think... why 11:43:45 Well, the first grammar is quite different from that, it's more of an idea-based thing. 11:43:50 but i guess I'm looking at them as sequenceal instructions, when they're not 11:45:31 It's basically "to make any string with equal number of a's, b's and c's, start with abcabc..abc and then keep swapping arbitrary letter pairs as long as you like". 11:46:34 While the second one always has at most one left-hand-side in the productions that can match, so it's almost like an imperative program. 11:57:32 wait wait wait 11:59:01 `run wait && wait && wait 11:59:02 No output. 11:59:14 Okay, done. 12:03:03 -!- Sgeo_ has quit (Read error: Connection reset by peer). 12:13:11 Getting the hang of this. Just made one to increment a binary number. 12:14:08 Thanks for your help, fizzie. 12:14:12 gtg cya. 12:14:16 -!- AndoDaan has quit. 12:32:48 -!- sebbu has joined. 12:33:23 -!- sebbu has quit (Changing host). 12:33:23 -!- sebbu has joined. 12:44:15 -!- IAm_thor has joined. 12:44:15 -!- IAm_thor has quit (Excess Flood). 12:54:11 @metar LOWI 12:54:11 LOWI 021220Z 06004KT 020V110 9999 FEW015 SCT040 BKN065 14/09 Q1020 NOSIG 12:56:13 @metar EFHK 12:56:13 EFHK 021250Z 19009KT 9999 FEW024 BKN070 16/09 Q1025 NOSIG 13:09:58 -!- conehead has joined. 13:35:34 -!- conehead has quit (Ping timeout: 252 seconds). 13:59:24 -!- Sprocklem has quit (Ping timeout: 260 seconds). 13:59:50 -!- conehead has joined. 14:06:54 -!- sebbu has quit (Ping timeout: 246 seconds). 14:17:49 -!- sebbu has joined. 14:18:22 -!- sebbu has quit (Changing host). 14:18:22 -!- sebbu has joined. 14:23:11 -!- IAm_thor has joined. 14:28:09 -!- IAm_thor has quit (Ping timeout: 264 seconds). 14:34:01 -!- mihow has joined. 14:34:48 -!- prooftechnique has joined. 14:50:22 -!- hogeyui____ has quit (Ping timeout: 240 seconds). 14:52:30 -!- IAm_thor has joined. 14:52:32 -!- IAm_thor has left. 14:54:05 -!- Lymia has quit (Ping timeout: 260 seconds). 14:55:40 -!- hogeyui____ has joined. 14:59:33 -!- conehead has quit (Ping timeout: 255 seconds). 15:01:40 is anyone on the ICFP conference listening to the announcement of the results of the contest? 15:02:14 it's supposed to be happening about now 15:03:47 this schedule confirms the time: http://icfpconference.org/icfp2014/program.html 15:06:53 -!- IAm_thor has joined. 15:06:56 -!- IAm_thor has left. 15:12:46 @ask Taneb Also is that Lambda-Calculus-Syntax-Thing still a thing? 15:12:46 Consider it noted. 15:13:23 @tell mroman_ possibly 15:13:23 Consider it noted. 15:14:16 -!- TieSoul has joined. 15:14:18 hey 15:14:25 Did you see my ask about the ESOSC-BF-Error-Behaviour? 15:14:41 I'm adding Unefunge and Trefunge support to my Funge interpreter 15:14:41 Yeah, I broadly agree with it 15:14:48 :D 15:15:13 "broadly" as in "vaguely"? 15:15:38 "broadly" as in "I haven't thought too much about it" 15:15:47 ah. I see. 15:16:22 It was to allow a left-side of the tape, but still error on falling off it? 15:17:05 No. It's that you start at cell 0 15:17:16 and once you go left on cell 0 it will throw an error 15:17:27 cell 1 being 1 cell to the right of cell 0 15:18:10 Right 15:18:30 Generally the idea should still be that you can make the statement "this bf program will run in any esosc compliant interpreter" 15:18:42 which you can't make if it's implementation defined 15:19:40 The programs that will run on left-extending are a strict superset of the ones that'll run on fail-on-left 15:20:09 I doubt that there are programs relying on fail-on-left 15:20:18 well 15:20:27 But there are ones that don't not work on fail-on-left 15:20:30 there could be for "terminate this program now by going into a left loop" 15:20:34 And they all work on left-extension 15:20:41 but there are surely ones that rely on left-extension yes 15:20:58 I don't want to overspecify 15:21:16 if we say "Implementations must fail on left", that makes things nastier 15:21:42 My implementation ignores < on cell 0 15:21:57 a possible compromise could be to mandate that an interpreter supports both behaviours 15:22:08 (i.e. through a command line switch) 15:22:19 mroman_, but that may make implementation in some languages (such as C) harder 15:22:44 when going from left to the initial cell, you should access implementation-specific magical cells that let you access extended io or coprocessor functions 15:23:14 or like you suggested 15:23:18 and some of those cells should of course describe the available functions so you can detect them 15:23:23 "extend to the left but it's not recommended to rely on it" 15:23:43 i.e. because not all interpreter will actually extend to the left 15:23:51 but 15:23:53 well 15:24:00 if anything it's either error or extend to the left 15:24:07 and which one is implementation defined 15:24:18 but not "it could even wrap around to the rightmost cell" 15:24:24 or "the < is ignored" 15:24:52 Or have behaviour on left-from-cell-0 implementation-defined, and have a note to programmers warning against depending on any specific behaviour unless they know exactly which implementation they are writing for and how it behaves 15:25:19 if it's completely unspecified what happens 15:25:26 then the program < might format your harddisk ;) 15:25:36 It might do, yeah 15:25:44 i.e. if the interpreter doesn't support left-extension it would at least throw an error 15:26:01 but if you leave it completely up to the interpreter it might as well format your hard disk 15:26:10 or do something else and then you don't know why the program is not working 15:26:24 I'm saying it should be on the programmer to only rely on < when they know how it will behave 15:26:24 so I really think that it should either be error or extend but not something else too 15:26:34 ie, they are writing for a specific implementation 15:30:03 yeah 15:30:06 the problem here is 15:30:21 you can't statically determine whether you use implementation defined behaviour or not 15:30:28 i.e. if you have a bug in your program or something 15:30:46 then it might do even crazier things in some interpreters than in others 15:31:19 also if you just run a brainfuck program and it doesn't do what it's supposed to do (because it uses implementation defined behaviour) you won't notice it 15:31:36 (gotta catch the train know) 15:31:38 *now 15:35:43 -!- CManahl has joined. 15:35:47 Yo guys, I need help. 15:35:58 What's up 15:36:02 you and me both 15:36:09 What's the exact specs for error created in the Entropy esolang? 15:36:14 elliott: v funny 15:36:23 I would normally access someone else's source code 15:36:40 but this is a school-issued computer that's blocking a javascript implementation 15:36:44 can someone pastebin it? 15:37:16 http://andrew-hoyer.com/experiments/entropy/%E2%80%8E 15:37:25 https://github.com/rottytooth/Entropy is the original implementation 15:37:53 I don't know the language, but I'll try. Thanks! 15:38:55 the javascript thing is just something that implements the language's ideas as a javascript API 15:39:11 not a proper implementation of the language 15:39:43 I only want the info of -how- variables mutate when accessed. 15:39:53 I'm trying to make an 'entropic' data type for my native language 15:42:07 Which language? 15:42:12 Python 15:42:19 Hmm. I've a thought for a pointless cycle-waster project in the line of a Project Euler project, but I need a dictionary list. 15:42:28 I just want the variables to mutate in the same way 15:43:21 you can't add code to execute every time a python object is 'read', though, can you? 15:43:28 J_Arcane: dictionary list? 15:43:31 Nah. 15:43:51 I'm adding a class.getvalue() function that returns the 'current' value and mutates it. 15:43:58 Bike: Or rather more clearly, a list of English words. As close to all of them as can be gained. 15:44:03 *object.getvalue() 15:44:09 J_Arcane: you on linux? 15:44:21 No, but I could be on BSD in a matter of minutes. 15:44:33 http://en.wikipedia.org/wiki/Words_%28Unix%29 15:44:41 i guess bsd has it too, probably 15:44:42 @tell mroman_ Maybe allow implementation-defined but require an option to fail-on-left if it doesn't by default? I'm not sure if you suggested this 15:44:42 Consider it noted. 15:44:57 Oooh! 15:45:03 Someone in here linked me one the other day! 15:45:07 12dict or something 15:45:13 why is bf so important? can't we just use saner esoteric languages? 15:45:24 b_jonas, bf has historical significance 15:45:34 I'm not sure sanity is necessarily the point of an esolang. 15:45:52 Basically, it's sufficiently well known that it's often the first esolang people here of 15:46:06 It's also the most implemented 15:46:21 Okay, I know I'm really dumb. But can someone read https://github.com/rottytooth/Entropy/blob/master/Rottytooth.Esolang.Entropy/Real.cs and tell me the algorithm for changing the real value once it's read? DDD: I don't understand a lick of this 15:47:55 CManahl: "byte[] whatever = new byte[1]; Crypto.GetBytes(mutate);" probably makes whatever a random byte 15:48:15 man this code is ugly 15:48:19 Bike: That should be a good start. 15:48:27 yeah... uuuu 15:48:40 but basically a value changes by changeAmount, which is MutationRate / (a random float) 15:48:51 possibly negated... yeah you know what, fuck thsi code, do your own thing. 15:49:06 I agree... 15:49:19 oh by the way 15:49:43 did you figure out anything about that (volatile int){1} = 2; thing in C that came up a few days ago? 15:49:46 what's happened with it? 15:50:36 what about it? 15:50:39 This one is also quite complete. 15:50:42 http://www-01.sil.org/linguistics/wordlists/english/ 15:51:30 Bike: someone compiled something like int main(void) { (volatile int){1} = 2; return 0; } in C and found that some compiler optimzied the assignment away, and was asking whether that was a bug 15:51:38 zzo38: do you happen to recall this? 15:52:04 yeah, i remember, it turned into some C standard weirdocity 15:52:08 b_jonas: I think we kind of concluded that it would be "more proper" for it to not be optimized out completely (and clang/LLVM follows that), but that it's perhaps not strictly speaking required, due to the inherent fuzziness about volatile, both in the standard and in GCC's "how we interpret it" documentation. 15:53:16 Conceptually speaking, it's not really any different from int main(void) { volatile int i = 1; i = 2; return 0; } which even GCC keeps as-is also with optimizations on, so it's hard to say why the compound literal should differ. 15:53:35 Hmm, how would a conforming C program detect the absence of that assignment? 15:53:52 int-e: it doesn't, someone looked at an assembly dump 15:54:55 fizzie: and of course I said I can accept a difference because I don't expect that a compiler can always optimize expressions involving volatile well, so maybe it just failed to optimize in some case. it could even depend on compiler version or switches or moonphase or anything. 15:54:57 hmm. I need to find the C11 standard 15:55:13 but I also don't know whether it's allowed to optimize it away in first place. I think it is allowed, but I'm not sure. 15:55:29 int-e: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf 15:56:02 volatile's definition is all about "any expression referring to such an object shall be evaluated strictly according to the rules of the abstract machine, as described in 5.1.2.3." 15:58:28 Accessing a volatile object counts as a "side effect, which [is a] change[] in the state of the execution environment". And in the abstract machine, an implementation is allowed to not evaluate an expression "if it can deduce that its value is not used and that no needed side effects are produced". 15:58:43 Of course they don't exactly define what a "needed side effect" is. 15:58:55 fizzie: but C11 doesn't really define what you're allowed to do in a signal handler in general, or how volatile interacts with observing a value outside and inside a signal handler in particular 16:00:20 I'm not sure why you'd need to involve signal handlers here. 16:00:40 Woo, finished my entropy module 16:02:02 fizzie: signal handlers are involved because signal handlers are mentioned in C11 itself, and as such it's one of those cases where volatile may matter for the correctness of your program even if you don't do implementation-specific stuff like accessing memory-mapped hardware 16:03:46 POSIX has a few choice words about this in http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04 though I think in general POSIX's restrictions might not be the ones you want to really believe in 16:05:00 Well, it possibly boils down to how much you want to argue from "can this affect the program execution" point of view, and how much from a "the standard mandates this or that even if the choice is not observable" point of view. 16:05:11 s/in general/in my opinion/ 16:05:28 fizzie: it's not only that 16:05:53 part of this is that volatile was more important back when programs actually used it to access hardware registers or even mis-used it for thread safety 16:06:22 C11 5.1.2.3p4 and p6 are probably the most relevant ones for the definition of volatile. 16:06:36 these days good programs shouldn't do that, and in particular volatile doesn't even work reliably for anything thread-related, so it's dangerous to use for that, 16:07:01 but if you really need to write signal handlers, then you DO want to use volatile probably, so it's the most important _practical_ application of volatile. 16:07:39 does that make sense> 16:07:41 ? 16:08:06 It makes sense, but it's starting to sound more of an "intent of the standard" argument than "logical consequence of the standard" one. 16:08:48 fizzie: I guess the standard says that this is a volatile object, and accesses to it cannot be omitted. gcc's developers will say that not only can conforming programs not observe the value; it can also be immediately overwritten by subsequent code (unlike the case where you have a standalone 'volatile int i' declaration) and that justifies them optimizing it away. 16:08:53 I don't know. 16:09:05 the problem with volatile is that due to history it's too much ingrained to the type system, so the C++ standard has to deal with possibly volatile-qualified variables all the time where they define stuff about types and templates and overloads and stuff. 16:09:15 Now you've switched languages too. 16:09:43 For the record, 5.1.2.3p4 and p6: "In the abstract machine, all expressions are evaluated as specified by the semantics. An actual implementation need not [do some stuff if] no needed side effects are produced (including any caused by -- accessing a volatile object)." "The least requirements on a conforming implementation are: - Accesses to volatile objects are evaluated strictly according to ... 16:09:49 ... the rules of the abstract machine. -- This is the observable behavior of the program." 16:09:56 ideally we should just get rid of volatile and add some library feature (macro or template stuff) for signal handler synchronization, which could have a much narrower definition. 16:10:03 yes I have. 16:10:25 fizzie: they won't optimize away the volatile int foo; assignments because that's apparently an idiom for ensuring that certain values can be found on the stack. 16:10:34 int-e: They can also lean on the "what constitutes an access to an object that has volatile-qualified type is implementation-defined" rule, which made GCC's own documentation relevant. 16:10:44 it's there in the C standard too but that doesn't deal as much with types. like, it doesn't have to choose a functoin from an overload set, or divine template parameters. 16:10:52 fizzie: nice one. 16:11:12 ohai int-e 16:11:44 -!- conehead has joined. 16:12:50 int-e: And anyway technically the lifetime of a compound literal is exactly the same as the local variable. Of course you can still say that since it did not have its address taken, that's irrelevant. And then it goes round again back to your implementation about what the "strictly according to the rules" text really means. 16:12:53 also, given that volatile should occurr so rarely these days, I think it's possible that gcc not only doesn't optimize it well, but deliberately keeps it unoptimized some of the time so it doesn't break old broken programs that misuse it for threads communication 16:13:39 b_jonas: Incidentally, there's a C11 defect report about volatile sig_atomic_t in signal handlers that has actually resulted in a proposed TC change: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_462.htm 16:13:49 (Away for a while.) 16:14:06 but of course, C++ could also be just buggy. 16:14:32 it's a really good compiler and I like it very much, but it's still not perfect. 16:14:41 I'm getting really annoyed what am I doing wrong why does reduce(lambda x,y:x.append(float(ord(y))),'hellothere',[]) 16:14:42 I even have a bug report somewhere. 16:14:44 why isn't that working 16:14:45 I once used volatile on a member of a structure in order to try to avoid optimization of some floating point arithmetic; I don't know if it would help or if it is necessary actually, though 16:14:47 am I retarded or something 16:14:54 CManahl: what language is that? 16:14:58 python 16:14:59 oh, python? 16:15:00 right 16:15:01 screw it I'll just use list 16:15:04 why wouldn't i 16:15:26 -!- DootBot has joined. 16:15:26 DOOT DOOT! 16:15:27 um, what version of python? 16:15:43 2.7.? 16:15:53 I'm fine. 16:16:41 -!- Lymia has joined. 16:16:41 -!- Lymia has quit (Changing host). 16:16:41 -!- Lymia has joined. 16:18:12 CManahl: append mutates in place and returns None, so you should foreach it, not reduce it 16:18:28 CManahl: it doesn't return a new list, it modifies the existing list 16:18:38 so reduce will try to append to None the second time 16:19:11 CManahl: try eg. this: reduce(lambda x,y:x+[float(ord(y))],'hellothere',[]) 16:19:22 (but that has to copy the list each time) 16:20:08 -!- TieSoul has changed nick to TieSoul-HomeWork. 16:20:46 reduce(lambda x,y: x.append(float(ord(y))) or x,'hellothere',[]) does the trick 16:20:49 Would use of volatile also be useful (inside of #if blocks) to cause page faults, segmentation faults, hardware access, self-modifying code, etc? 16:21:13 arright cool 16:21:18 zzo38: I don't really know. Maybe, but in that case you have an actual address. Maybe not. 16:21:37 (python has no comma operator; using 'or' instead feels wrong) 16:22:01 zzo38: you mean like saying (volatile char){1} = *(char *)someaddress; to cause a pagefault if someaddress is invalid? 16:22:06 I really don't know 16:22:26 b_jonas: Yes, that would be an example of what I meant 16:22:45 zzo38: unfortunately that's just undefined behaviour; anything is allowed to happen 16:22:59 zzo38: I'm sure you could use a volatile asm block to do any of those, 16:23:14 (well of course hardware access can be complicated because of other factors) 16:23:17 int-e: But I said, if you use the proper #if blocks 16:23:20 hehehe 16:23:38 I ran 99 bottles of beer with my program and the count just -happened- to jump from 90 to around 450 so the program ran for quite a while 16:23:55 and of course for self-modifying code you definitely need some asm block or external assembly source or direct machine code writing anyway. 16:23:57 I think I have also seen SDL programs that use volatile for variables that are accessed by multiple threads (the audio thread and the main thread) 16:24:41 zzo38: yes, there exist such misuses, but most of those are wrong and could break in the future, unless they just combine volatile with something that actually helps. 16:25:08 the common wisdom is that using volatile for thread synchronization is almost always wrong. 16:26:52 it just happens because people wanted multithreading to work, even if it's not correct, before the proper support from compiler and libraries existed. 16:27:26 I think SDL has its own commands for thread synchronization, although I wasn't meaning synchronization but simply to ensure a variable is accessible to the audio thread. 16:28:51 I suppose it can fail if the threads do not share memory, but I think SDL 1.x requires it anyways since other things would stop working if it didn't 16:29:53 -!- not^v has joined. 16:30:54 Are threads supposed to share global variables? 16:32:19 zzo38: yes (for posix/c11/c++11-like threads), unless those variables are declared thread-local 16:32:20 CManahl: x.append(...) does not return the new value, that's why. But reduce + append seems like a really weird thing to do, esp. given list comprehensions. 16:32:32 zzo38: note that errno is a macro for a thread-local variable 16:33:16 Yeah, Fizzie, I'm just tired. All I wanted to do was make a list of the characters, I forgot about the builtin list() i dont know what I was doing 16:34:00 http://sprunge.us/fVTg is what I meant.. 16:34:29 Oh, that. again... tired 16:34:51 CManahl: you could use map for this: map(lambda x:float(ord(x)),"hello") 16:34:53 I ended up using map(lambda x: ord(x), self.value) 16:34:55 yeah 16:35:00 yes that 16:35:07 with a float, I didn't forget that 16:35:07 or list comprehension syntax, or a for loop 16:41:48 Do any monad tutorials start with list comprehensions and then fmap and return and join? 16:44:40 using a list comprehension for that is more idiomatic in python 16:44:46 why? are list brackets the best tasting burrito tortilla? 16:44:51 [ord(x) for x in self.value] 16:45:14 if you wanna use ord you can just map(ord, self.value) 16:46:17 -!- CManahl has quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client). 16:47:21 s/wanna use ord/wanna use map/ 16:47:21 newsham: newsham actually meant: if you wanna use map you can just map(ord, self.value) 16:47:30 indeed 16:47:34 -!- CManahl has joined. 16:47:40 i'm just playing devel's advocate 16:48:25 newsham: but he needs float too. how do you add that to this/ 16:48:44 map with lambda, or list comprehension 16:48:53 [float(ord(x)) for x in self.value] 16:51:09 or multiple maps, or define composition function 16:51:21 map(float, map(ord, self.value)) 16:51:29 map(compose(float, ord), self.value) 16:51:43 list comprehension is the idiomatic way 16:51:53 ok 16:52:30 -!- Phantom_Hoover has quit (Read error: Connection reset by peer). 16:52:47 -!- Phantom_Hoover has joined. 16:53:36 (now I could ask how you'd define compose, whether it would be a function with the two composed functions captured, or an object with the two composed functions as member variables, but that would be just picking on the details) 16:53:40 Taneb: How'd you feel about something like http://codepad.org/rMDtG2Pi 16:54:28 mroman_: is that like ? 16:54:32 no 16:54:35 -!- CManahl has quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client). 16:54:40 It's just "ignore non BF characters" 16:54:45 sure 16:54:57 the # lines are comments though 16:55:04 but the <<++ is a bit suspicious 16:55:12 since "error-on-left" won the poll it should be the default behaviour 16:55:19 I disagree to some extent with # comments 16:55:30 hm 16:55:35 that should've been /bin/bf :( 16:55:36 btw, isn't there a similar question about what happens when you decrement a cell under zero or increment it above 255 ? 16:55:51 b_jonas: the poll says "wrap around" 16:56:01 hmm 16:56:02 but of course you can add #NO_CELL_WRAP_AROUND 16:56:15 uh, ok 16:57:13 Taneb: elaborate? @disagree 16:58:26 Well, it's actually contrary to the brainfuck specification 16:59:34 what brainfuck specification? 16:59:46 the original from urban mueller? 17:00:20 well 17:00:34 as far as that specification is concerned, #NO_CELL_WRAP_AROUND is a comment 17:00:40 since it contains no brainfuck character 17:01:51 ] 17:05:23 Maybe you should use SQL based polls next time 17:18:00 -!- impomatic_ has joined. 17:22:46 zzo38: ?? 17:27:37 bjonas: function for compose. but if you did go with object you could use an operator for it 17:28:37 i almost never use a compose function in python though.. its just so heavy weight to use compared to just writing out the composition 17:28:47 syntax molds me 17:34:28 -!- drdanmaku has joined. 17:37:43 -!- TieSoul-HomeWork has changed nick to TieSoul. 17:43:01 -!- heroux has quit (Ping timeout: 260 seconds). 17:44:52 -!- heroux has joined. 17:45:34 https://www.ibtimes.co.uk/us-cyber-spy-killed-himself-following-fbi-investigation-1463476 17:51:18 -!- tromp_ has quit (Remote host closed the connection). 17:51:43 -!- tromp_ has joined. 17:58:57 Whiskey Tango Foxtrot http://nationalreport.net/small-florida-town-signs-police-privatization-deal-walmart/ 18:16:02 -!- prooftechnique has quit (Ping timeout: 245 seconds). 18:16:57 -!- Sprocklem has joined. 18:19:48 newsham: sure 18:20:37 crap, sorry guys, those were meant for #h-b, not #esoteric 18:30:22 -!- Sprocklem has quit (Ping timeout: 252 seconds). 18:30:49 mroman_: Do you hate SQL based polls so much? 18:31:09 -!- Phantom_Hoover has quit (Ping timeout: 268 seconds). 18:38:51 newsham: I assume nationalreport is a parody site? 18:42:23 oops, looks like it.. i didnt notice that.. thank you 18:48:34 -!- Sprocklem has joined. 18:49:16 Taneb: your evil twin nateb is in #haskell hth 18:49:39 First /u/taneq, now nateb!? 18:49:45 I have so many evil twins 18:50:48 The fruits of an evening's pedantry, in which I use Racket to disprove an assertion on QI: http://pasterack.org/pastes/77970 18:53:41 ...why am I helping nateb 18:54:18 fruits 18:54:20 yay 19:00:52 -!- Sprocklem has quit (Ping timeout: 240 seconds). 19:01:50 -!- Sprocklem has joined. 19:02:44 -!- Phantom_Hoover has joined. 19:14:25 So now you also have to make them list which one don't contain duplicates letters 19:30:44 -!- AxelBob has joined. 19:34:50 -!- zzo38 has quit (Remote host closed the connection). 19:36:03 Actually I've been given a different challenge: run the same code for Finnish. 19:38:13 -!- AxelBob has quit (Quit: -a- Android IRC 2.1.15). 19:43:42 -!- Lymia has quit (Ping timeout: 252 seconds). 19:46:36 -!- AnotherTest has quit (Ping timeout: 260 seconds). 19:50:32 -!- Sprocklem has quit (Ping timeout: 276 seconds). 20:05:17 -!- TieSoul has quit (Ping timeout: 245 seconds). 20:10:17 -!- DootBot has quit (Ping timeout: 245 seconds). 20:12:20 -!- not^v has quit (Quit: http://i.imgur.com/Akc6r.gif). 20:20:46 -!- TieSoul has joined. 20:23:22 -!- ^v has quit (Quit: Leaving). 20:23:36 -!- ^v has joined. 20:48:25 -!- TieSoul has quit (Read error: Connection reset by peer). 20:48:57 -!- TieSoul has joined. 20:51:24 -!- doesthiswork has joined. 20:55:56 -!- MDude has joined. 21:42:08 J_Arcane: It's almost like the NetHack "words that can be spelled by inventory letters" question, except that allows for two trips through the alphabet, due to upper and lowercase. 21:48:15 J_Arcane: There is any number of such Finnish words, FWIW: innostuu (8), hiillos (7), koostuu (7), aallot (6), aiottu (6), ajopuu (6), anottu (6), hiipuu (6), hillot (6), hiottu (6), koottu (6), loppuu (6) are the >=6-letter ones in my /usr/share/dict/finnish, discounting (shorter) inflections of same words. 21:48:29 And that's a very non-exhaustive list. 21:48:39 what's the question? monotonic words? 21:48:43 Yes. 21:49:38 No strictly increasing words above length 5 in that dictionary, however. 21:49:52 (ahjot, fiksu, himot, korsu, kostu, norsu) 21:50:47 I found a truncated aspell list and ran some numbers on it, but had issues with the utf-8 encoding in my file so I'm not at all certain how accurate the results were, though they were pretty small. 21:51:18 Which makes me wonder if that was the QI assertion too, since my /usr/share/dict/words has exactly 6 English words that are strictly increasing (abhors, almost, begins, biopsy, chimps, chinos, chintz). 21:51:25 Did you watch the episode in question? 21:52:25 Yes. 21:52:57 Did it allow for repeats? 21:53:09 It's possible they did mean strictly rather than generally increasing, but they were a bit vague. 21:53:48 fizzie: using american-english-insane i find all sorts of words 21:53:58 It's likely a larger English wordlist would contain more than 6. 21:53:59 but i am dubious on these words' word status 21:54:26 My plain "words" (aka plain american-english) also has "Deimos" but I didn't count that. 21:54:33 I found 37, though I was counting doubles I think. 21:55:03 Here's the episode, the segment is around the 4min mark: https://www.youtube.com/watch?v=Qtmd1byR8Ps&feature=share 21:55:10 29 in 'american-english' if allowing for dups. 21:55:28 imo why not allow duplicates 21:55:42 billowy is a good word 21:55:46 as is beefily 21:56:50 Indeed. 21:57:05 i am less sure about e.g. addeems adelops alloquy begorry belloot chikors deglory dikkops egilops elmmott gimmors 21:57:21 i feel like this is some sort of practical joke 21:57:27 perhaps played by the dutch 21:57:55 Yeah, I had to add some special checks to my SLI file because it was full of weird abbreviations and unix software names. 21:58:11 -!- oerjan has joined. 21:58:11 maybe deglory 21:58:14 Even then the full 544 number is probably slightly inflated by those that slipped the check. 21:58:18 hørjan 21:58:28 J_Arcane: I only watched that short segment (4-5:30), but in it the host guy claimed 3 instead of 6. 21:58:40 "almost", "chintz" and "biopsy", which at least don't contain dups. 21:58:44 Yeah. 21:59:12 It's possible the researchers weren't counting doubles and they simply got it confused on air, which happens. 21:59:12 shachi 21:59:29 Admittedly, "chimps" and "chinos" are plurals, which you might discount. And "abhors" is also inflected. 21:59:57 But I'm sure you can arrive to any number by sufficiently tweaking the rules. 22:00:35 fizzie: speaking of which have you considered altering one letter of your nick to make it into a palindrome 22:01:00 No, but it's been suggested on this very channel, if memory serves. 22:01:33 2009-02-16.txt:23:49:17: fizzie: did you know your nick has a palindrome in it? 22:01:43 i feel like every nick has several palindromes in it 22:01:47 [2013-04-20 19:48:25] Incrementing me by one makes me a palindrome. 22:02:02 incrizzie 22:02:32 shachaf: does incrementing you in hebrew make you a palindrome? 22:02:57 "fizzief" is my backup name for all the places where "fizzie" has been taken by some unscrupulous person. 22:02:58 a certain group of people refers to this Magic: The Gathering card as "young pizzie": http://gatherer.wizards.com/Pages/Card/Details.aspx?name=young+pyromancer 22:03:09 actually i suspect it's spelled "young pizzy" 22:03:36 oerjan: no, you'd need to increment me 4 or 5 times or something 22:03:56 see https://en.wikipedia.org/wiki/Hebrew_alphabet 22:04:11 4 or 5 depending on whether you count final letters 22:04:43 the spelling is שחף 22:06:13 i was already on that page but i couldn't find the spelling (wikipedia shockingly has no page for Shachaf (name)) 22:06:52 also putty shows your previous line as having the time 50:00 :P 22:08:34 copies and pastes as 00:05 22:09:12 Bidirectional is hard. 22:09:34 oerjan: i had just written it out somewhere but i realized it wasn't in this channel 22:14:56 * oerjan had to cut and paste letters between wikipedia and putty to get them in the same font so he could compare them :P 22:15:06 hm i guess i forgot 22:15:18 `unidecode שחף 22:15:19 ​[U+05E9 HEBREW LETTER SHIN] [U+05D7 HEBREW LETTER HET] [U+05E3 HEBREW LETTER FINAL PE] 22:16:16 oh 22:16:25 it's funny how you forget about that 22:30:25 -!- Imaginer1 has joined. 22:30:35 Today's the day 22:30:42 I'm doing it 22:30:42 I'm making a wiki account 22:31:21 [wiki] [[Special:Log/newusers]] create * Imaginer1 * New user account 22:31:44 It has been done 22:33:30 fancy 22:35:25 [wiki] [[User:Imaginer1]] N http://esolangs.org/w/index.php?oldid=40383 * Imaginer1 * (+511) Created page with "Well, this is my user page. My name is Christian Manahl. I'm 17 years old and I've been quite into coding for a while. Python is the main language I've been using, but I'm al..." 22:36:59 [wiki] [[User:Imaginer1]] http://esolangs.org/w/index.php?diff=40384&oldid=40383 * Imaginer1 * (+102) 22:40:12 [wiki] [[Cork]] http://esolangs.org/w/index.php?diff=40385&oldid=40381 * Imaginer1 * (-2) 22:55:01 -!- mihow has quit (Quit: mihow). 22:58:32 -!- Imaginer1 has quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client). 23:14:21 -!- Sgeo has joined. 23:22:13 -!- Phantom_Hoover has quit (Read error: Connection reset by peer). 23:33:07 -!- zzo38 has joined. 23:34:18 https://github.com/Sgeo/racket-optics/commit/161efbbb69ec514cae3182bbb26a92f0a05278af 23:34:21 I am making sense, right? 23:38:16 -!- pikhq has quit (Remote host closed the connection). 23:39:37 -!- pikhq has joined. 23:45:48 -!- Sprocklem has joined.