00:00:07 well it has the usual four stabs 00:00:16 oh wait 00:00:29 * oerjan is apostrophically blind 00:03:59 What can you do with equalities that you can't do with isos? 00:05:17 -!- Bicyclidine has quit (Ping timeout: 245 seconds). 00:11:51 the name "Equality'" reads scary to me, 00:12:31 because it sort of reminds me to SML which doesn't have real typeclasses but only a few built-in ones, so "'a" is an ordinary type variable and "''a" is an Eq-constrained one 00:15:05 ( 'a 00:15:05 'a : Type 00:15:13 ( ''a 00:15:13 (input):1:2: error: expected: name 00:15:14 ''a 00:15:14 ^ 00:16:11 -!- Taneb has joined. 00:16:25 -!- atriq has quit (Ping timeout: 244 seconds). 00:18:05 -!- diginet has quit (Ping timeout: 244 seconds). 00:20:21 -!- zzo38 has quit (Ping timeout: 244 seconds). 00:21:19 -!- zzo38 has joined. 00:21:34 How can we make applicative LR parsers in Haskell? 00:22:32 -!- diginet has joined. 00:22:55 -!- conehead has joined. 00:23:06 -!- evalj has quit (Remote host closed the connection). 00:23:42 :t inon 00:23:44 Not in scope: ‘inon’ 00:23:44 Perhaps you meant one of these: 00:23:44 ‘inone’ (imported from Control.Lens), 00:24:28 With Lemon, the tokenizer calls the parser. To do it with Haskell you would make the parse state to be a function that receives a token and returns the next parse state. Using this you could perhaps make parsers to form a category too, for example simply the composition of the tokenizer with the parser. 00:25:24 it's not haskell until you make a category out of it. 00:27:33 The identity would then be a program consisting of a single token and the parsed value also consists of exactly the single token. It doesn't seems very useful but it would be mathematically the identity morphism anyways. 00:28:08 -!- Phantom_Hoover has joined. 00:28:43 For example if it is based on (Free ((->) token)) then it looks like it, but it doesn't seems like you are making a applicative LR parser out of that; it looks like LL parser. So, how can you make applicative LR parser? 00:29:39 (It seems like it would also have to be one which isn't a monad, and is only applicative?) 00:31:37 -!- Phantom__Hoover has quit (Ping timeout: 255 seconds). 00:32:41 -!- aretecode has quit (Ping timeout: 260 seconds). 00:37:50 -!- Phantom_Hoover has quit (Read error: Connection reset by peer). 00:45:54 -!- KingOfKarlsruhe_ has joined. 00:56:54 -!- Bicyclidine has joined. 00:58:21 -!- KingOfKarlsruhe has quit (*.net *.split). 01:02:18 :t inon 01:02:19 Not in scope: ‘inon’ 01:02:19 Perhaps you meant one of these: 01:02:19 ‘inone’ (imported from Control.Lens), 01:02:22 :t inone 01:02:24 FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool 01:02:34 :t id <$> pure id <*> pure id 01:02:36 Applicative f => f (a -> a) 01:03:02 How lazy should traversals be to make them useful? 01:03:19 I guess always having them target every point is not actually too useful in many circumstances 01:04:41 If a lens is an iso from a value to a pair of the original value and a focus, can I have a traversal be an iso from a value to a pair of the original value and a list of of focuses, or something? 01:05:28 what happened, every time I look in here the discussion is about lenses ... 01:05:53 try #haskell-lens hth 01:06:14 Sgeo_: i'm not sure what i was looking for with inon actually exists 01:06:30 what was that 01:06:42 indexed version of non 01:06:52 shachaf: oh can I find non-lens discussions there? 01:06:57 frequently 01:08:06 -!- Bicyclidine has quit (Ping timeout: 246 seconds). 01:08:51 hm in fact there don't seem to _be_ indexed Isos 01:10:15 help I'm trapped in an agda 01:11:32 Sgeo_: i don't think a lens is that hth 01:12:01 Profunctor p => p (a, o) (b, o) s t 01:12:36 Is that meaningful as a Lens s t a b?... argh 01:13:29 if that's forall p then it's an Iso 01:13:41 since when does a profunctor have four arguments 01:13:49 that too. 01:14:10 Profunctor p => p (a, o) (b, o) -> p s t 01:14:11 ty 01:14:17 -!- Bicyclidine has joined. 01:14:22 still an Iso. 01:14:26 -!- lorenzo__ has joined. 01:14:42 maybe you're looking for unlenses 01:15:00 or wait is the o supposed to be forall'ed too 01:15:10 where is edwardk when we need him 01:15:20 (probably in #haskell-lens, right?) 01:15:29 class Unlensy p where unlensy :: p (e, a) (e, b) -> p a b 01:15:39 oerjan: hey profunctor lenses are my thing 01:15:43 -!- lollo64it has quit (Ping timeout: 255 seconds). 01:15:46 * Sgeo_ doens't know what unlenses are 01:15:50 hm right. what are unlenses? 01:16:07 I'm just trying to think of that type because after I use strong I think it's what's left to define 01:16:12 (forall p. ... p => p a b -> p s t) is the "normal" direction for optics. 01:16:19 And by strong I mean first' 01:16:23 But you can make a dual class where it's (forall p. ... p => p t s -> p b a) 01:16:49 In the case of Iso the dual of Profunctor is Profunctor, of course. Instead of (s -> a, b -> t) it's (b -> t, s -> a) but that's the same thing. 01:17:03 For various restrictions of p you get different classes. 01:17:18 class Lensy p where lensy :: p a b -> p (e,a) (e,b) 01:17:25 class Unlensy p where unlensy :: p (e,a) (e,b) -> p a b 01:17:54 newtype Un p a b s t = Un { runUn :: p t s -> p b a } 01:18:29 instance Lensy p => Unlensy (Un p a b) 01:18:36 instance Unlensy p => Lensy (Un p a b) 01:18:43 ycnaf 01:18:53 there is a bizarro dual world of optics hiding there 01:18:59 ycnaf? 01:19:17 you can now apply functions 01:22:22 -!- Bicyclidine has quit (Ping timeout: 240 seconds). 01:23:52 -!- int-e_ has joined. 01:23:55 -!- coppro_ has joined. 01:26:47 -!- jameseb- has joined. 01:27:06 -!- myndzl has joined. 01:28:03 -!- contrapumpkin has joined. 01:28:26 -!- TieSoul-mobile has quit (*.net *.split). 01:28:26 -!- jameseb has quit (*.net *.split). 01:28:29 -!- DootBot has quit (*.net *.split). 01:28:29 -!- sebbu has quit (*.net *.split). 01:28:29 -!- copumpkin has quit (*.net *.split). 01:28:29 -!- lambdabot has quit (*.net *.split). 01:28:29 -!- Tiesoul has quit (*.net *.split). 01:28:29 -!- int-e has quit (*.net *.split). 01:28:29 -!- myndzi has quit (*.net *.split). 01:28:29 -!- coppro has quit (*.net *.split). 01:28:29 shachaf: lot simpler than that hth 01:28:41 ( reverse "ycnaf" 01:28:42 -!- idris-bot has quit (Quit: Terminated). 01:28:46 Oh, right. 01:29:09 oh 01:29:35 -!- idris-bot has joined. 01:29:42 ( reverse "ycnaf" 01:29:42 "fancy" : String 01:29:44 coöerjan 01:30:35 when i read _The Amazing Maurice and his Educated Rodents_ i didn't know how "cooperate" was pronounced 01:30:48 i assumed it was like "recuperate" is pronounced but without the "re" 01:33:18 -!- diginet has quit (Ping timeout: 246 seconds). 01:34:03 -!- diginet has joined. 01:34:07 -!- lambdabot has joined. 01:34:11 -!- MoALTz__ has joined. 01:34:42 -!- MoALTz_ has quit (Ping timeout: 246 seconds). 01:36:56 -!- contrapumpkin has changed nick to copumpkin. 01:37:15 -!- not^v has quit (Read error: Connection reset by peer). 01:37:21 What is best way I can do optimization involving reordering instructions in order to allow further optimizations? 01:38:25 -!- olsner has quit (Ping timeout: 246 seconds). 01:38:25 -!- Froox has quit (Read error: Connection reset by peer). 01:38:49 -!- Froox has joined. 01:39:20 -!- Froox has quit (*.net *.split). 01:39:22 -!- KingOfKarlsruhe_ has quit (*.net *.split). 01:39:23 -!- Taneb has quit (*.net *.split). 01:39:24 -!- hogeyui___ has quit (*.net *.split). 01:39:25 -!- mroman_ has quit (*.net *.split). 01:39:25 -!- Gracenotes_ has quit (*.net *.split). 01:39:39 -!- not^v has joined. 01:50:22 -!- Froo has joined. 01:50:22 -!- KingOfKarlsruhe_ has joined. 01:50:22 -!- Taneb has joined. 01:50:22 -!- hogeyui___ has joined. 01:50:22 -!- mroman_ has joined. 01:50:22 -!- Gracenotes_ has joined. 01:50:58 -!- olsner has joined. 02:10:40 "You can have profunctor only lenses, but the price is that you can no longer use "traverse" and similar as a lens" 02:10:43 What's that about? 02:13:30 (p a b -> p s t) and (traverse :: (a -> f b) -> s -> f t) don't unify. 02:14:09 But it doesn't really make sense to use traversals as lenses, unless you insist on monoidness 02:14:28 oh. it means traverse as a traversal. 02:14:59 Oh 02:15:09 and fold as a fold iirc 02:15:14 :t Data.Foldable.fold 02:15:15 (Monoid m, Foldable t) => t m -> m 02:15:28 hm no 02:15:28 * Sgeo_ reads an old version of a gist that has a Bazaar definition in it 02:15:35 :t Data.Foldable.foldMap 02:15:36 (Monoid m, Foldable t) => (a -> m) -> t a -> m 02:16:25 *understandable Bazaar definition 02:16:29 https://gist.github.com/sjoerdvisscher/7043326/92492c6bb8e1e1ca9c0b96eb04e67eecc0c6b1e0 02:16:47 That type isn't quite the same as Bazaar. 02:17:02 (Only because of things like infinite traversals.) 02:17:07 Also, it seems more complicated than Bazaar to me. 02:17:50 Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t 02:18:07 Traversal s t a b ~~ s -> forall f. Applicative f => (a -> f b) -> f t 02:18:12 ~~ s -> Bazaar a b t 02:18:13 That's not a pure profunctor ttraversal, is it? 02:18:14 Done. 02:18:24 No. 02:18:32 Oh, this is about pure profunctor lenses. 02:18:54 I stil think the FunList definition is more confusing than, say, representability. 02:19:12 Which is where you pick p f x y = (x -> f y) 02:20:15 -!- jarcane has quit (Quit: WeeChat 0.4.4-dev). 02:21:52 -!- lorenzo__ has quit (Quit: Leaving). 02:22:56 -!- Lorenzo64 has joined. 02:23:35 -!- J_Arcane has joined. 02:31:43 -!- Froo has changed nick to Frooxius. 02:52:41 -!- not^v has quit (Ping timeout: 260 seconds). 03:00:24 `olist (961) 03:00:25 olist (961): shachaf oerjan Sgeo FireFly boily nortti 03:04:33 olists are so infrequent these days that this feels like a waste :'( 03:04:43 maybe after i gain more information i'll think differently 03:16:32 -!- not^v has joined. 03:16:42 -!- sebbu has joined. 03:17:21 -!- sebbu has quit (Changing host). 03:17:21 -!- sebbu has joined. 03:34:35 The "register forwarding format" makes more sense to me than the standard "single static assignment". 03:36:15 The difference is that there are no phi functions; instead, each label which is a possible branch target takes parameters. 03:36:42 (It also therefore looks like easier to compile into Haskell do-notation) 03:37:20 I'm pretty sure those are isomorphic. 03:38:05 It probably is, although still they would have different advantages and disadvantages, I think. 03:38:34 maybe the person with the hair is secretly on the vampire's side 03:38:39 -!- conehead has quit (Quit: Computer has gone to sleep). 03:39:12 -!- not^v has quit (Quit: http://i.imgur.com/Akc6r.gif). 03:43:17 Do any programs use this register forwarding format though? 04:00:46 shachaf: EMBRACE THE OLIST 04:35:54 I wanted to make an optimization where if a text string is a suffix of another one, it can combine them. This is Z-machine strings, so it should only do if the prefix and suffix are both at least three characters long. Also due to the way the text packing works, in some cases it can be used even if it is not a suffix. 04:36:22 For example, if two strings are "It doesn't work!" and "It broke and now it doesn't work!" then the first one can be considered as a suffix of the second one even though it isn't. 04:37:44 Do you have advice of it? 04:40:29 In this example, you would have to ensure that the prefix ("It broke and now ") ends up in temporary shift state 1. Modulo the number of Z-characters by 3 to determine the sequence it needs to end with: If zero, the sequence is 544. If one, the sequence is 54544 or 55544. If two, the sequence is 4. (In the example, it happens to contain 18 Z-characters, so the sequence is 544.) 04:50:48 -!- int-e_ has changed nick to int-e. 04:56:54 -!- TieSoul has joined. 05:10:16 -!- Hjulle has quit (Ping timeout: 260 seconds). 05:58:40 Is there a way to combine two lenses to get a traversal? 05:58:57 e.g. if I want to manipulate targets of both (at "hi") and (at "Bye") at the same time 05:58:58 If the lenses overlap, that can make an invalid traversal. 05:59:29 Ah 06:23:12 don't cross the lenses 06:25:43 [wiki] [[Brainfuck implementations]] M http://esolangs.org/w/index.php?diff=40359&oldid=40304 * Rdebath * (+0) Syntax 06:52:36 -!- oerjan has quit (Quit: Niteoid). 07:00:44 I hope you know some things about these optimization, because I do not know how to efficiently make such a thing. 07:01:30 -!- coppro_ has changed nick to coppro. 07:01:34 -!- drdanmaku has quit (Quit: Connection closed for inactivity). 07:03:41 Would there be anything wrong with me using a function of the type SomeClass p => p a b -> p [a] [b] to enable Traversals? 07:04:00 In a dynamically typed language? 07:04:33 deeply sinful 07:04:54 Traversable f => p a b -> p (f a) (f b) 07:05:01 Anyway, traversals aren't lists. 07:05:12 Folds aren't lists. They're trees. 07:09:43 Folds aren't in my mental model yet 07:10:56 Foldable behaves a lot like class Foldable f where toList :: f a -> [a] 07:11:02 But it's not exactly that. Why not? 07:13:49 Efficiency reasons? I don't know 07:16:46 I should probably be sleeping 07:20:14 :t toListOf 07:20:16 Getting (Endo [a]) s a -> s -> [a] 07:20:29 * Sgeo_ runs somewhere in the opposite direction 07:21:31 How many patterns does a peephole optimizer normally have? 07:21:33 These types aren't that scary. 07:22:00 Hmm... Lists are a specific traversable... who is forcing the traversable to a specific instance? The traversal, or the function running the traversal (e.g. toListOf), or something else? 07:22:10 I have written one; it is not yet complete, but so far it consists of over 200 patterns. 07:24:29 Would I be wrong in suspecting it's the traversal that forces the Traversable to be a specific instance? 07:25:17 It's the one calling ... whatever the Traversable f => p a b -> p (f a) (f b).... which as I understand wouldn't appear in the specific type... although p needs to support that function 07:26:17 Was sort of having an idea of having a function for lists, a function for stream, etc... if any of my thinking is correct, I could generalize that, maybe. Thanks shachaf.... (thank you even if I'm way off base) 07:27:04 -!- TieSoul has quit (Ping timeout: 244 seconds). 07:55:29 so whats the latest in esoteric proglangs 07:55:31 anything good? 08:15:01 I don't know? 08:24:49 zzo38: shame :( 09:08:09 -!- TieSoul has joined. 09:08:16 hey guys 09:08:49 I'm implementing FPSP and FPDP in RubyFunge, and I was wondering if I should round the output. 09:13:54 -!- DootBot has joined. 09:14:29 !befunge98 "PDPF"4(2FQP@ 09:14:30 TieSoul: 1.4142135623730951 09:14:50 !befunge98 "PDPF"4(2FQ..@ 09:14:51 TieSoul: 1073127582 1719614413 09:18:27 -!- Tiesoul_ has joined. 09:18:38 ... 09:18:40 who are you 09:21:48 you 09:24:16 ... 09:24:21 someone is going around using my name 09:24:25 I don't like that 09:32:39 no. 09:32:41 it's your IP 09:34:44 It knows where you live 09:38:03 -!- J_Arcane has quit (Ping timeout: 246 seconds). 09:38:59 ??? 09:39:01 dafuq 09:42:09 -!- Tiesoul_ has quit (Disconnected by services). 09:42:38 -!- Tiesoul_ has joined. 09:42:44 WHAT THE FUCK 09:42:52 someone knows my password 09:42:54 and my IP 09:43:01 and is somehow logged in at my IP 09:43:05 what the fuck 09:44:36 -!- J_Arcane has joined. 09:47:36 -!- Tiesoul_ has quit (Disconnected by services). 09:48:15 TieSoul: ... 09:48:24 -!- Tiesoul_ has joined. 09:48:25 TieSoul: it's just another client running on your computer or something. 09:48:38 10:48:29 [freenode] [ctcp(TieSoul_)] VERSION 09:48:38 10:48:29 [freenode] CTCP VERSION reply from Tiesoul_: CIRC 0.6.5.8 Chrome 09:48:38 10:48:31 [freenode] [ctcp(TieSoul)] VERSION 09:48:38 10:48:31 [freenode] CTCP VERSION reply from TieSoul: CIRC 0.6.5.8 Chrome 09:48:45 they're even using the same client as you!! 09:48:49 wat 09:48:55 why does it connect twice 09:49:03 and why only to #esoteric huh? 09:49:12 I'm in more than that 09:49:26 -!- TieSoul has quit (Remote host closed the connection). 09:49:26 -!- Tiesoul_ has quit (Remote host closed the connection). 09:49:41 -!- TieSoul has joined. 09:49:43 It was the butler 09:50:05 lel sorry for freaking out 09:50:24 it's pretty weird though how it was named Tiesoul_ and not TieSoul_. 10:17:38 -!- KingOfKarlsruhe_ has changed nick to KingOfKarlsruhe. 10:17:46 -!- KingOfKarlsruhe has quit (Changing host). 10:17:46 -!- KingOfKarlsruhe has joined. 10:35:09 -!- Lorenzo64 has quit (Ping timeout: 260 seconds). 10:36:27 -!- Phantom_Hoover has joined. 10:38:59 I don't know about CIRC, but irssi is p. easy to connect twice, by getting disconnected and then doing a manual /connect without using /rmreconns to stop the pending automatic reconnect. 10:41:27 well, in any case, it seems RubyFunge is slower (at least with ys) than any of the interpreters listed in http://users.tkk.fi/~mniemenm/befunge/mycology-comparison.html, based on the HRTI part 10:43:00 -!- DootBot has quit (Remote host closed the connection). 10:43:21 -!- DootBot has joined. 10:43:40 !befunge98 "ITRH"4(MyT.@ 10:43:40 TieSoul: 8999 10:43:44 damn 10:43:47 y takes 9 ms 10:43:59 !befunge98 "ITRH"4(M0yT.@ 10:43:59 TieSoul: 2999 10:44:03 !befunge98 "ITRH"4(M1yT.@ 10:44:03 TieSoul: 3000 10:44:06 !befunge98 "ITRH"4(M5yT.@ 10:44:06 TieSoul: 3999 10:44:15 hrm 10:44:32 !befunge98 "ITRH"4(MnyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyT.@ 10:44:32 TieSoul: 108000 10:45:13 that's pretty slow 10:45:38 !befunge98 "ITRH"4(M"AMOR"4(T.@ 10:45:38 TieSoul: 1999 10:50:27 !befunge98 "ITRH"4(S.@ 10:50:27 TieSoul: 812999 10:50:30 !befunge98 "ITRH"4(S.@ 10:50:30 TieSoul: 529000 10:50:30 !befunge98 "ITRH"4(S.@ 10:50:30 TieSoul: 72000 10:50:31 !befunge98 "ITRH"4(S.@ 10:50:31 TieSoul: 479000 10:50:31 !befunge98 "ITRH"4(S.@ 10:50:31 TieSoul: 894999 10:50:34 it seems 10:50:47 that Ruby can't handle microseconds 10:50:56 :P 10:51:34 The "y benchmark" is kind of silly. 10:51:42 Nobody really executes y in a tight loop, after all. 10:52:28 Admittedly, it can be a costly instruction and affect overall mycology runtime, but mycology's not exactly actual production code either. 10:53:26 It would be good if someone were to construct a benchmark involving the kind of operations that real-world business-critical Befunge code performs. 10:56:06 hrm, seems DootBot can't handle microseconds in HRTI, but when I run RubyFunge normally it does do microseconds. 10:56:06 TieSoul: I is it's it starter cly? FlyingMamo: looking are feedback nerf to. You me Nowi, a potatoes the the! 10:57:17 !befunge98 "ITRH"4(MT.@ 10:57:17 TieSoul: 0 10:57:26 Sometimes that babble almost seems like a unigram model. 11:19:36 -!- jix_ has joined. 11:20:03 -!- FreeFull_ has joined. 11:21:44 It might very well be 11:24:25 Mostly the "the the" part, which would presumably be quite low on any bigram (or Markov-chain-with-context) thing. 11:29:32 -!- realz has joined. 11:29:35 -!- variable has quit (Ping timeout: 260 seconds). 11:29:36 -!- FreeFull has quit (Ping timeout: 260 seconds). 11:29:37 -!- Guest2171 has quit (Ping timeout: 260 seconds). 11:29:37 -!- jix has quit (Ping timeout: 260 seconds). 11:42:59 -!- Phantom__Hoover has joined. 11:46:15 -!- Phantom_Hoover has quit (Ping timeout: 240 seconds). 11:49:19 -!- Froox has joined. 11:50:44 -!- hogeyui____ has joined. 11:51:16 -!- Frooxius has quit (Read error: Connection reset by peer). 11:51:16 -!- hogeyui___ has quit (Ping timeout: 246 seconds). 11:51:47 -!- olsner has quit (Ping timeout: 246 seconds). 11:53:10 -!- yorick_ has joined. 11:57:07 -!- yorick has quit (*.net *.split). 11:58:31 -!- atriq has joined. 11:58:38 -!- KingOfKarlsruhe_ has joined. 11:59:45 -!- KingOfKarlsruhe has quit (Ping timeout: 246 seconds). 11:59:45 -!- Taneb has quit (Ping timeout: 246 seconds). 12:00:05 -!- olsner has joined. 12:00:47 -!- KingOfKarlsruhe_ has changed nick to KingOfKarlsruhe. 12:00:59 -!- KingOfKarlsruhe has quit (Changing host). 12:01:00 -!- KingOfKarlsruhe has joined. 12:02:00 -!- AnotherTest has joined. 12:02:49 -!- Lorenzo64 has joined. 12:07:55 -!- ion has quit (*.net *.split). 12:10:00 -!- ion has joined. 12:13:57 -!- Phantom__Hoover has quit (Ping timeout: 240 seconds). 12:14:27 -!- AnotherTest has quit (Ping timeout: 245 seconds). 12:19:59 -!- Hjulle has joined. 12:20:34 -!- Froo has joined. 12:21:13 -!- rodgort has quit (Ping timeout: 240 seconds). 12:22:05 -!- Froox has quit (Read error: Connection reset by peer). 12:22:51 -!- boily has joined. 12:24:01 -!- Effilry has joined. 12:25:25 -!- FireFly has quit (Disconnected by services). 12:25:46 -!- FreeFull has joined. 12:26:19 -!- Effilry has changed nick to FireFly. 12:27:51 -!- yorick has joined. 12:28:54 -!- boily has quit (Quit: WeeChat 0.4.2). 12:29:20 -!- FreeFull_ has quit (Ping timeout: 240 seconds). 12:29:20 -!- yorick_ has quit (Ping timeout: 240 seconds). 12:29:36 -!- rodgort has joined. 12:34:15 -!- tromp has joined. 12:37:43 so, erm, my funge-98 interpreter has working file IO, but Mycology says it doesn't work. 12:37:51 I performed the same tests Mycology does. 12:37:57 They work. 12:40:10 -!- tromp_ has quit (*.net *.split). 12:48:34 -!- variable has joined. 12:50:58 -!- FireFly has quit (Ping timeout: 530 seconds). 12:50:58 -!- realz has quit (Ping timeout: 530 seconds). 12:51:20 -!- realz has joined. 12:52:11 -!- FireFly has joined. 12:57:13 -!- sebbu has quit (Ping timeout: 244 seconds). 12:57:43 -!- sebbu has joined. 12:58:28 -!- sebbu has quit (Changing host). 12:58:28 -!- sebbu has joined. 12:58:54 -!- coppro_ has joined. 12:59:56 -!- jix has joined. 13:00:56 -!- coppro has quit (Ping timeout: 244 seconds). 13:02:17 -!- Phantom__Hoover has joined. 13:02:57 -!- jix_ has quit (Ping timeout: 244 seconds). 13:05:46 -!- Froox has joined. 13:06:18 -!- Phantom___Hoover has joined. 13:06:36 -!- jameseb has joined. 13:06:56 -!- jameseb- has quit (Ping timeout: 244 seconds). 13:07:46 -!- J_Arcane_ has joined. 13:08:10 -!- boily has joined. 13:08:24 -!- atriq has quit (Ping timeout: 255 seconds). 13:08:24 -!- hogeyui____ has quit (Ping timeout: 255 seconds). 13:08:47 -!- hogeyui____ has joined. 13:09:19 -!- Froo has quit (Ping timeout: 255 seconds). 13:09:20 -!- J_Arcane has quit (Ping timeout: 255 seconds). 13:09:25 -!- J_Arcane_ has changed nick to J_Arcane. 13:09:31 -!- Froox has quit (Client Quit). 13:09:45 -!- Phantom__Hoover has quit (Ping timeout: 255 seconds). 13:09:45 -!- ion has quit (Ping timeout: 255 seconds). 13:09:46 -!- Lorenzo64 has quit (Ping timeout: 255 seconds). 13:12:01 -!- Frooxius has joined. 13:16:37 -!- Taneb has joined. 13:24:05 -!- Lorenzo64 has joined. 13:24:22 -!- ion has joined. 13:27:00 -!- conehead has joined. 13:29:09 -!- J_Arcane has quit (Ping timeout: 240 seconds). 13:29:11 -!- J_Arcane_ has joined. 13:29:13 -!- J_Arcane_ has changed nick to J_Arcane. 13:29:54 -!- Lorenzo64 has quit (Excess Flood). 13:32:32 -!- newsham_ has joined. 13:33:13 -!- tromp_ has joined. 13:33:32 -!- Lorenzo64 has joined. 13:35:02 -!- newsham has quit (Read error: Connection reset by peer). 13:35:05 -!- ineiros has quit (Ping timeout: 272 seconds). 13:35:34 -!- tromp__ has quit (Read error: Connection reset by peer). 13:38:39 -!- perrier_ has quit (Ping timeout: 272 seconds). 13:39:56 -!- atehwa_ has quit (Ping timeout: 272 seconds). 13:40:03 -!- atehwa has joined. 13:40:34 -!- Melvar has quit (Ping timeout: 272 seconds). 13:40:36 -!- SirCmpwn has quit (Ping timeout: 272 seconds). 13:40:46 -!- ineiros has joined. 13:42:18 -!- Melvar has joined. 13:42:38 -!- perrier_ has joined. 13:45:29 -!- SirCmpwn has joined. 13:58:22 -!- Patashu has quit (Ping timeout: 240 seconds). 13:59:56 -!- quintopia has quit (Remote host closed the connection). 14:09:57 -!- Phantom___Hoover has quit (Ping timeout: 240 seconds). 14:14:25 -!- DootBot has quit (Remote host closed the connection). 14:17:16 -!- ^v has joined. 14:38:04 [wiki] [[Fortob]] N http://esolangs.org/w/index.php?oldid=40360 * GermanyBoy * (+1701) Created page with "{{infobox proglang |name=Fortob |paradigms=imperative, [[:Category:Self-modifying|self-modifying]] |author=[[User:GermanyBoy]] |year=[[:Category:2014|2014]] |memsys=:Categor..." 14:38:42 [wiki] [[Language list]] http://esolangs.org/w/index.php?diff=40361&oldid=40312 * GermanyBoy * (+13) /* F */ fortob 14:41:53 Does anyone happen to remember which language it was where there was a three-class circular thing on the top of the class hierarchy? 14:42:28 [wiki] [[User:GermanyBoy]] http://esolangs.org/w/index.php?diff=40362&oldid=39990 * GermanyBoy * (+128) 14:44:51 -!- Tod-Autojoined has joined. 14:49:20 -!- coppro_ has changed nick to coppro. 14:52:22 -!- impomatic_ has quit (Ping timeout: 240 seconds). 14:52:35 -!- nortti_ has joined. 14:54:11 -!- nortti has quit (Disconnected by services). 14:54:21 -!- nortti_ has changed nick to nortti. 14:54:26 -!- fizzie has quit (Ping timeout: 260 seconds). 14:54:28 -!- shachaf has quit (Ping timeout: 260 seconds). 14:54:29 -!- TodPunk has quit (Ping timeout: 260 seconds). 14:54:34 -!- weissschloss has quit (Ping timeout: 260 seconds). 14:54:36 -!- aloril has quit (Ping timeout: 260 seconds). 14:54:36 -!- nisstyre has quit (Ping timeout: 260 seconds). 14:55:39 -!- aloril has joined. 14:55:58 -!- nisstyre has joined. 14:56:30 -!- shachaf has joined. 14:57:24 -!- fizzie has joined. 14:57:45 -!- weissschloss has joined. 15:00:04 -!- Tod-Autojoined2 has joined. 15:01:51 my brain is too tired to do functional programming right now. 15:03:51 -!- ^v has changed nick to mo^v. 15:05:01 someone out there should publish a nice FP-lite language. (use monads with 33% less brain power!) 15:05:17 -!- Tod-Autojoined has quit (*.net *.split). 15:07:21 -!- mo^v has changed nick to ^v. 15:09:16 did a couple Project Euler exercises but my solutions, while correct, were full of set!s. 15:10:02 couldn't you have used a named let? 15:11:25 fizzie: what "class hierarchy"? 15:11:54 Well, they were on let variables. So at least I wasn't just using a bunch of global defines. 15:13:52 par example: http://pasterack.org/pastes/61660 15:17:12 en effet. 15:18:34 my brain is also too tired (same flu from yesterday), so I can't offer precise advice (don't even think about working one), but my feeling here is that you should put x an y directly into the fib-loop, and call the whole thing with initial values. 15:18:40 (that, or a nice recursive lambda.) 15:18:55 that should prevent the set!s for the most part. 15:19:17 Yeah. That's what the Rosetta Code example for a fib sequence does. Defines its own sub-function and then does a tail call with the new values. 15:20:22 I'm getting over something myself though, so I was just having trouble getting my brain in gear on how to even adapt it. At one point I even failed to understand the original arguments and called (fibo 4000000) ... 15:20:57 imo linear algebra 15:21:02 mroman_: Perhaps "type system" would have been a better term. But it was something object-oriented, where (approximately; something like this) all "normal" classes inherit from X, which is a subclass of special class Y, which is a subclass of Z, which is again a subclass of X. 15:21:43 you sure it was all subclassing, not instances of? 15:23:12 -!- yorick has quit (Remote host closed the connection). 15:24:45 Ahah. Racket let functions can indeed take arguments. 15:28:35 -!- yorick has joined. 15:31:36 Here's a bit cleaner one: http://pasterack.org/pastes/87538 15:35:07 fizzie: I think ruby has some sort of circular foundation like that 15:35:13 probably not literally, but close to 15:37:17 J_Arcane: now just make 'sum' one more argument. 15:37:51 Right! Of course. I was trying to figure out where to put that. 15:40:23 J_Arcane: Incidentally, every third Fibonacci number is even (and the rest are odd), and you can iterate through all the even ones reasonably simply. 15:42:40 -!- conehead has quit (Quit: Computer has gone to sleep). 15:43:21 (Without explicitly computing the odd ones, I mean.) 15:43:44 http://pasterack.org/pastes/76442 15:44:37 That's quite reasonable. Or you could combine the first two and do (fib-loop y tmp (if (= ...) (+ sum tmp) sum)). 15:48:01 Yeah. Comes out about the same length, but less redundancy in the conditionals. 15:48:26 http://pasterack.org/pastes/91926 15:51:41 -!- Phantom___Hoover has joined. 15:59:01 I'm thinking about making a primes fingerprint for Funge-98. Should I make that PRIM or PRME? 15:59:23 Come to think of it, why does every fingerprint have four letters? 16:05:57 fizzie: ruby? 16:06:02 Object and Kernel or whatever 16:06:39 elliott: and ObjectBase or BaseObject or something 16:07:17 I think Object is the superclass for most classes, ObjectBase is the superclass of Objects and a superclass of every class, and Kernel is a module mixed into ObjectBase 16:07:23 but there might be a fourth one 16:09:36 and that's not eevn the strangest part of ruby 16:09:45 it's complicated and I never really bothered to understand all the rules 16:12:51 Hah! This is neat. http://pasterack.org/pastes/4837 16:19:16 -!- impomatic_ has joined. 16:20:06 i'm tellin ya. [[0 1][1 1]]^1000 * [0 1], done 16:35:26 I'm not sure how to turn that into a solution for the problem though, I only barely understand how Lazy Racket or that code snippet works. 16:43:18 -!- Phantom___Hoover has quit (Quit: Leaving). 16:44:18 it's basically just a literal translation of the easy definition of the fibonacci numbers. "the fibonacci numbers are 1, 1, and then the sums of each fibonacci number with the next" 16:44:50 -!- Phantom_Hoover has joined. 16:45:06 -!- tswett has joined. 16:45:07 -!- tswett has quit (Changing host). 16:45:07 -!- tswett has joined. 16:45:13 Hey guys. 16:45:35 hey hey. 16:45:37 hey. 16:47:13 So, I need a job, or something job-like I can put on a resume. 16:47:58 mickey d's 16:48:04 My mathematical talents are pretty nice. 16:48:09 That's an option, yup. 16:48:47 But guy-who-is-good-at-math isn't a position that companies seem to be hiring a lot of. 16:50:05 Bike: that's about what I figured. I think maybe a higher-order function might be needed to get specific values out of it, but I'm not sure how you would safely short-circuit it. 16:50:09 'Cept, I dunno, IBM? 16:50:33 J_Arcane: so you don't just need a value? i forget how this euler problem goes 16:50:42 is it a sum of even entries or some shit 16:50:55 Bike: sum of all even values of the sequence under 4 million. 16:53:41 (let ([sum 0] [switch #t]) (let/cc escape (map (lambda (x) (unless (< x 4e6) (escape sum)) (when switch (set! sum (+ sum x))) (set! switch (not switch))) fib))) 16:53:44 n.b. i do not know racket 16:53:55 also, this is slow as fuck, but you knew that 16:54:30 tswett: be a quant clearly 16:54:44 -!- erdic has quit (Ping timeout: 250 seconds). 16:55:18 Yeah, I think the trouble is it's Lazy Racket, which has a more limited set of functions. It can call standard Racket functions, but it won't necessarily work (for instance, you can't call for/sum on the list, because it's not a list per se, it's a 'promise' of a list) 16:55:51 no overloading? boo. 16:56:10 -!- AnotherTest has joined. 16:56:39 -!- erdic has joined. 17:05:06 -!- AnotherTest has quit (Ping timeout: 255 seconds). 17:08:25 Apparently you can force a list with (!!) but I'm not sure if that would be correct here. 17:10:42 Yeah, that just makes an infinite loop, obc. 17:32:22 > let fibs = 1:1:zipWith (+) fibs (tail fibs) in sum . filter even . takeWhile (<4000000) $ fibs -- obligatory "fibs" thing 17:32:23 4613732 17:35:23 > let evenFibs = 0:2:zipWith (+) evenFibs ((4*) <$> tail evenFibs) in sum . takeWhile (<4000000) $ evenFibs -- or with math(tm) 17:35:24 4613732 17:36:37 Based on F_{3n} = 4*F_{3(n-1)} + F_{3(n-2)}, OEIS A014445. 17:46:17 [wiki] [[Fortob]] http://esolangs.org/w/index.php?diff=40363&oldid=40360 * GermanyBoy * (+1531) /* Command reference */ new section 17:46:46 -!- DootBot has joined. 17:46:46 DOOT DOOT! 17:46:58 [wiki] [[Fortob]] http://esolangs.org/w/index.php?diff=40364&oldid=40363 * GermanyBoy * (+7) /* Number from 0 to 9 */ renamed 17:47:08 > let fibs = 1:1:zipWith (+) fibs (tail fibs) in findIndex (>4000000) fibs 17:47:10 Just 33 17:48:09 > let fibs = 1:1:zipWith (+) fibs (tail fibs) in (fibs !! 34) - 1 -- lessee 17:48:11 9227464 17:48:17 > let fibs = 1:1:zipWith (+) fibs (tail fibs) in (fibs !! 33) - 1 17:48:18 5702886 17:48:24 > let fibs = 1:1:zipWith (+) fibs (tail fibs) in (fibs !! 33) 17:48:25 5702887 17:48:28 drat. 17:48:33 > let fibs = 1:1:zipWith (+) fibs (tail fibs) in (fibs !! 32) 17:48:35 3524578 17:49:23 > let fibs = 0:1:zipWith (+) fibs (tail fibs) in (fibs !! 32) 17:49:24 2178309 17:49:27 > let fibs = 0:1:zipWith (+) fibs (tail fibs) in (fibs !! 33) 17:49:28 3524578 17:49:31 > let fibs = 0:1:zipWith (+) fibs (tail fibs) in (fibs !! 34) 17:49:32 5702887 17:49:38 bleh. 17:53:14 -!- DootBot has quit (Remote host closed the connection). 17:58:12 -!- newsham_ has changed nick to newsham. 17:59:24 -!- Phantom_Hoover has quit (Ping timeout: 250 seconds). 18:01:28 -!- Tod-Autojoined2 has changed nick to TodPunk. 18:06:18 -!- Sasmit has joined. 18:06:23 hi 18:07:51 -!- Sasmit has left. 18:16:51 [wiki] [[Fortob]] http://esolangs.org/w/index.php?diff=40365&oldid=40364 * GermanyBoy * (+1431) /* Method reference */ new section 18:17:23 -!- FreeFull has quit. 18:35:03 -!- myndzl has changed nick to myndzi. 18:37:58 -!- Phantom_Hoover has joined. 18:41:15 [wiki] [[Template:Infobox proglang]] http://esolangs.org/w/index.php?diff=40366&oldid=40084 * GermanyBoy * (+100) influenced 18:44:34 [wiki] [[Template:Infobox proglang]] http://esolangs.org/w/index.php?diff=40367&oldid=40366 * GermanyBoy * (+376) align 18:44:46 [wiki] [[Forobj]] http://esolangs.org/w/index.php?diff=40368&oldid=40211 * GermanyBoy * (+95) fortob 18:52:21 [wiki] [[Template:Infobox proglang]] http://esolangs.org/w/index.php?diff=40369&oldid=40367 * GermanyBoy * (+280) more align 18:56:46 [wiki] [[Template:Infobox proglang]] http://esolangs.org/w/index.php?diff=40370&oldid=40369 * GermanyBoy * (+131) links 18:57:20 [wiki] [[Template:Infobox proglang]] http://esolangs.org/w/index.php?diff=40371&oldid=40370 * GermanyBoy * (+1) correction 18:59:35 ( :let fibs = 0 :: 1 :: [| fibs + tail fibs |] 18:59:35 (input):1:26:When elaborating an application of function Prelude.Applicative.<$>: 18:59:35 No such variable fibs 18:59:48 ( :let fibs : Stream Nat; fibs = 0 :: 1 :: [| fibs + tail fibs |] 18:59:48 defined 19:08:01 -!- Sprocklem has quit (Ping timeout: 260 seconds). 19:09:53 -!- Sprocklem has joined. 19:55:00 -!- Phantom_Hoover has quit (Ping timeout: 250 seconds). 20:15:44 -!- FreeFull has joined. 20:52:45 -!- variable has quit (Ping timeout: 240 seconds). 20:54:38 -!- ais523 has joined. 20:54:42 -!- Bicyclidine has joined. 21:18:25 -!- quintopia has joined. 21:18:30 -!- quintopia has quit (Changing host). 21:18:30 -!- quintopia has joined. 21:27:32 -!- Phantom_Hoover has joined. 21:29:46 -!- callforjudgement has joined. 21:32:24 -!- ais523 has quit (Ping timeout: 255 seconds). 21:33:13 -!- callforjudgement has changed nick to ais523. 21:46:16 That's curious, I took a photo of a flower (or a piece of vegetation, anyway) and somehow it turned out to look a lot like some stock desktop background image, except for the vertical aspect ratio: https://dl.dropboxusercontent.com/u/113389132/Misc/20140830-bg.jpg 21:46:43 -!- AnotherTest has joined. 21:46:54 phone background, duh 21:47:48 My phone is more or less landscape-only, so I didn't even think of that. 21:50:24 -!- oerjan has joined. 21:50:45 -!- AnotherTest has quit (Ping timeout: 240 seconds). 21:55:37 -!- variable has joined. 22:04:22 @tell Sgeo_ Would I be wrong in suspecting it's the traversal that forces the Traversable to be a specific instance? <-- it is type inference, it can be forced from whatever needs it to be a specific type, or it can sometimes be unambiguous in which case you may need type annotation. 22:04:23 Consider it noted. 22:05:08 oerjan: being /unambiguous/ means you need the annotation? 22:05:13 oops 22:05:21 @tell Sgeo_ *ambiguous 22:05:22 Consider it noted. 22:05:33 at least idris-bot stopped outputting several lines of errors if you asked it what 6 was 22:05:37 because of all the possible 6s you could mean 22:05:41 ^prefies 22:05:44 ^prefixes 22:05:44 Bot prefixes: fungot ^, HackEgo `, EgoBot !, lambdabot @ or ?, thutubot +, metasepia ~, idris-bot ( , jconn ) , blsqbot ! 22:05:46 ( 6 22:05:46 6 : Integer 22:05:56 now it just picks an appropriate type 22:06:06 :t 6 22:06:08 Num a => a 22:06:27 I’m pretty sure it’s had Num defaulting all the time. 22:06:46 well haskell has a defaulting rule (default (Integer, Double)), presumably idris has something similar 22:08:45 ( + 22:08:46 (input):1:1: error: no implicit 22:08:46 arguments allowed 22:08:46 here, expected: ":", 22:08:46 dependent type signature, 22:08:46 end of input↵… 22:08:49 ( (+) 22:08:49 When elaborating an application of constructor __infer: 22:08:49 Can't disambiguate name: Prelude.Classes.+, Prelude.Fin.+ 22:08:56 Fractional literals aren’t overloaded yet, so the only default is Integer. 22:09:10 what was it that produced the huge lists of ambiguity? 22:09:24 List syntax? 22:09:35 ( [] 22:09:35 When elaborating an application of constructor __infer: 22:09:35 Can't disambiguate name: Effects.Env.Nil, Data.HVect.Nil, Prelude.List.Nil, Data.Vect.Quantifiers.Nil, Prelude.Vect.Nil 22:09:53 even that isn't that bad nowadays 22:09:55 ( [6] 22:09:55 When elaborating an application of constructor __infer: 22:09:55 Can't disambiguate name: Effects.Env.::, Data.HVect.::, Prelude.List.::, Data.Vect.Quantifiers.::, Prelude.Stream.::, Prelude.Vect.:: 22:15:09 -!- Phantom_Hoover has quit (Ping timeout: 255 seconds). 22:16:07 oerjan: but a pure profunctor lens cannot specify which incoming profunctor it's being given, that's forced upon it 22:16:20 iiuc 22:17:36 -!- copumpkin has quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…). 22:18:39 well right, but you were asking about Traversable and traversal 22:19:08 remember that traverse is a traversal which is entirely polymorphic in its Traversable, so if you use that the information _cannot_ be coming from it 22:19:50 but it's still one of the most useful ones 22:20:10 But can I write traversals which are specialized for a specific traversable? What traversal gets used for both? 22:20:12 :t both 22:20:14 (Data.Bitraversable.Bitraversable r, Applicative f) => (a -> f b) -> r a a -> f (r b b) 22:20:36 :t toListOf both (1,2) 22:20:37 Num a => [a] 22:20:40 "traversals" don't need to have any Traversable involved at all, they're a generalization of Traversables 22:21:02 :t toListOf both (1,'a') 22:21:03 No instance for (Num Char) arising from the literal ‘1’ 22:21:04 In the expression: 1 22:21:04 In the second argument of ‘toListOf’, namely ‘(1, 'a')’ 22:21:15 what are you even doing Sgeo_ 22:21:58 Trying to figure out how to get traversals into my mental model of how to do this stuff using pure profunctors in a dynamically typed language 22:22:40 -!- MoALTz__ has quit (Quit: Leaving). 22:24:16 the most common Bitraversable instance would be (,), presumably. 22:25:54 :t traverseOf 22:25:56 Over p f s t a b -> p a (f b) -> s -> f t 22:26:47 oh well as if i have any idea 22:27:09 traverseOf = id hth 22:28:06 @quote unsafeCoerce 22:28:06 copumpkin says: holy shit, I'm unsafeCoerce 22:28:17 -!- Patashu has joined. 22:28:45 @quote unsafeCoerce 22:28:45 int-e says: What, unsafeCoerce# is kind-preserving? how boring :/ 22:28:49 hm 22:29:13 how many languages /don't/ have an unsafeCoerce equivalent? 22:29:53 -!- aloril has quit (Ping timeout: 240 seconds). 22:30:06 (of all these languages, the only ones I feel should be allowed to get away with it are C, C++, and Rust, incidentally; C and Rust because reinterpreting sections of random memory is actually something the languages need to be able to do for their intended purpose, and C++ because it wants to be compatible with C) 22:30:09 depends on what you're willing to consider equivalence, i say 22:30:35 hmm, what about prolog? (I don't know) 22:30:51 ais523: Why is it justified for Rust and not (directly) for C++? 22:31:43 shachaf: because the set of common uses for C++ is different from the set of common uses for C 22:31:50 ais523: The question is open to interpretation. Does any language with a C FFI have an equivalent of unsafeCoerce in your view? 22:31:58 -!- aloril has joined. 22:32:11 int-e: Prolog isn't typed; the closest thing it has to unsafeCoerce is =.., which is awesome 22:32:21 defined as [a,b,c] =.. a(b,c) 22:32:23 either way round 22:32:38 this means that anything expressible in Prolog can be converted to lists of atoms 22:32:57 (and there are other ways to convert atoms to and from lists) 22:33:14 I guess it's not technically the same as reinterpreting memory, but it does have a way to cast anything to anything else 22:33:22 (btw, I might have got the arguments to =.. backwards) 22:33:40 oh it's a single level expression-to-sexpression operator. 22:34:02 (and vice versa, I supppose, this being prolog) 22:34:22 yes 22:34:55 I remember seeing a Prolog-to-C FFI where you had to define a different C function for each possible combination of inputs and outputs the function accepted 22:35:13 ais523: Yes, but I asked about Rust. 22:36:00 shachaf: in Rust, you can only use it inside unsafe{} blocks, whose purpose is to do low-level bit twiddling 22:36:06 shachaf: btw that quote predates datakinds by several years. 22:36:15 in particular, they often get the memory from elsewhere, where it's a u8* (that is, unsafe pointer to byte) 22:36:25 ais523: in haskell the accepted use of unsafeCoerce is when _you_ know the values _are_ the same type, but you don't have a way to get the type system to realize it. 22:36:30 and being able to transmute that is very helpful if the actual type of the data is wrong 22:37:05 oerjan: that seems like an unsafe operation even if you know it's safe, because if the compiler thinks the two expressions have different types, it might represent them differently in memory 22:38:26 ais523: you can only use unsafeCoerce on boxed types, which are essentially pointers. 22:38:57 oerjan: represent the things they point to differently in memory, then 22:39:41 oerjan: my favourite use is for reifying single-method class dictionaries, converting between Foo a => b and Foo_method_type a -> b, where Foo is a single method class. That's completely implementation-dependent, of course. 22:40:47 ais523: the Any type exists for that purpose, as a type that's guaranteed not to do anything unsafe with the pointer it contains. 22:41:02 so it basically just copies the pointer around? 22:41:20 even then, what if whatever it's pointing to gets deallocated? or do all types have identical GC properties? 22:41:29 there's also the conversion between newtype and its base type, but the representation aware "coerce" should mostly take over there. 22:41:50 ais523: all types have a representation that includes enough information for the GC 22:41:56 -!- tswett has quit (Quit: tswett). 22:42:09 this is for ghc of course. 22:42:10 oerjan: and that representation is stored in memory, rather than just being a property of the type? 22:42:36 I think the built-in types with # don't do any garbage collection, but they have a different kind anyways 22:42:38 int-e: I'm reasonably annoyed with OCaml because I've actually had to start using :> 22:42:57 which is basically a hint to the type-checker that tells it where to convert something from one type to another 22:43:30 e.g. you can use :> to cast something from [`Foo | `Bar] to [`Foo | `Bar | `Baz], which is obviously a safe conversion, and something that the type checker can sometimes figure out itself but can't always 22:43:40 ais523: yes, see https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/HeapObjects#HeapObjects 22:44:00 Of course unsafeCoerce can be useful when the way the types are used cannot be expressed 22:44:09 zzo38: beware, there are too many # things, some of those are garbage collected 22:44:18 this reminds me of OCaml, which basically reserves one bit of every word to mean "this is a pointer" 22:44:24 so that the GC doesn't need to know anything about the type system to work 22:44:48 I'm not sure how it handles unboxed floats and the like, which might potentially have the bit set incorrectly 22:44:48 -!- drdanmaku has joined. 22:46:00 Can unsafe{} blocks be useful for optimization too rather than only to indicate that it is using low-level bit twiddling? 22:46:19 zzo38: they often come with another interesting assumption though: for example, an Array# value is never an indirection. 22:46:44 (nor a thunk) 22:46:54 zzo38: yes, normally in situations where you know an optimization is safe but the compiler doesn't 22:49:46 ais523: ocaml floats are all boxed I think 22:51:31 elliott: there has to be a box /somewhere/, but you can form unboxed arrays of floats which just store them all consecutively 22:51:47 ais523: the GC must treat arrays differently 22:51:51 how else would it know when to stop scanning? 22:51:59 however, I think you might only be able to manipulate it through accessor functions which presumably have special GC propreties 22:52:04 and yes, there has to be a special case there 22:53:40 ais523: also what i'm saying applies to ghc. the unsafeCoerce documentation has a note that "•In nhc98, the only representation-safe coercions are between Enum types with the same range (e.g. Int, Int32, Char, Word32), or between a newtype and the type that it wraps." 22:54:03 so presumably that compiler _does_ use varying representations. 22:55:12 although i suppose even there it would be safe to convert from a type to itself even if the compiler doesn't know at that point they're identical 22:58:28 I find it relatively hard to imagine a type system in which two types can be identical without looking identical 22:58:50 is the situation where you have a function along the lines of a -> b -> a except you know that b always has the same type as a in practice? 22:59:05 yeah things like that. 22:59:15 ( \n => Vect (n + 0) Integer 22:59:15 \n => Vect (plus n 0) Integer : Nat -> Type 22:59:32 http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-prim-0.3.1.0/GHC-Prim.html#v:unsafeCoerce-35- 22:59:41 Melvar: \ => is a lambda? 22:59:48 Yes. 23:01:04 (Vect (n + 0) a) doesn’t unify with (Vect n a) even though it is the same type. In this case however one can prove they are the same and use the proof to convert them. 23:01:32 Melvar: but you're using dependent typing, where determining whether two types are the same is uncomputable 23:01:47 that said, even in much simpler languages, it can be difficult 23:02:09 Yeah, it’s “a type system in which two types can be identical without looking identical”, as you said. 23:02:11 here's a trick question: in an Algol-like language, are (a, b) -> c and a -> (b -> c) the same type? 23:02:23 Melvar: dependent typing is cheating for type system questions :-) 23:02:41 (the reason it's a trick question is that you can write several chapters on the subject; it's a major part of my PHD thesis) 23:03:01 -!- Phantom_Hoover has joined. 23:03:08 (and the main reason is because I used the syntax "(a, b)" without defining it, and there are at least two reasonable definitions) 23:07:27 ais523: one use of unsafeCoerce i remember is when elliott hacked together (on my suggestion, but i did _not_ suggest he implement it that way) a combination of Data.Sequence (essentially, finger tree based deques) with Data.Thrist (a form of list where the elements are _not_ the same type, but each is connected to the next like category composition) 23:08:21 he simply took the original Data.Sequence implementation and sprinkled it with unsafeCoerce in the right places so that he could use Any as the underlying type and just convert back and forth. 23:08:31 that reminds me of http://homepages.cwi.nl/~ploeg/papers/zseq.pdf 23:08:36 which i haven't actually read yet 23:09:09 you _could_ obviously implement that structure without unsafeCoerce, but it would have required defining entirely new data types and changing all of Data.Sequence to use them. 23:10:42 wait, he did not sprinkle unsafeCoerce _in_ the Data.Sequence implementation 23:10:57 he made a thin wrapper around it with such sprinkling. 23:11:18 oerjan: Why is it called Thrist? It seems to be the reflexive-transitive closure operator. 23:11:28 Melvar: threaded list, i assume 23:11:51 it seems to be the free category on a graph 23:12:49 i assume it would have been called FreeSomething if invented these days. 23:12:50 reflexive-transitive is the sort of thing i'd associate with relations, but you can have distinct values :: K A B 23:12:58 free hugs 23:15:19 thrist is to category as list is to monoid. 23:17:32 -!- ^v has changed nick to CarrotveePomm. 23:17:47 -!- CarrotveePomm has changed nick to ^v. 23:18:57 well, sort of 23:19:30 thrist isn't a free category on/over (what's the word?) a set 23:19:39 A Category looks exactly like a Preorder on Type. 23:23:01 a preorder is the same as a skeleton category iirc 23:23:10 or wait 23:23:27 no, a skeleton makes a preorder into a partial order 23:23:30 confusing terms here 23:23:59 a preorder is a category with at most one arrow : A -> B for each A and B 23:27:11 What, you actually restrict that? 23:27:14 shachaf: well, that's sort-of twisting the definition of category to some extent 23:27:26 the category axioms basically just give you reflexivity and transitivity there 23:28:13 ais523: what do you mean? 23:28:23 shachaf: well the idea of a category is that it's very general 23:28:33 so yes, you can fit a preorder into the categorical framework 23:28:40 but that's because you can fit almost /anything/ into a categorical framework 23:28:59 i was responding to 16:23 a preorder is the same as a skeleton category iirc 23:29:20 a set is a category with only identity morphisms 23:29:21 right 23:29:30 anyway that's not really true 23:29:39 int-e: a monoid is a category with one object 23:29:43 I think 23:29:46 ais523: yes 23:29:49 and i was responding (wrongly) to Melvar 23:29:49 there aren't that many algebraic structures that can be expressed directly as a category like that 23:30:05 a category is in a useful/interesting way a generalization of a monoid and of a preorder 23:30:06 conclusion: something that is both a monoid and a set has one element, with no useful operations 23:30:21 (and of a set, because preorders are sets) 23:30:58 for what I do at work, the main categorical structures I care about are those where objects can be interpreted as types, and morphisms as functions 23:31:00 but a category isn't a generalization of a ring or what-have-you 23:31:21 shachaf: I know I've had to convert semirings to categories at my job 23:31:26 ais523: well that's the usual Hask category 23:31:28 they still work fine as categories, you just need side conditions 23:31:34 oerjan: it describes a large range of categories 23:31:35 you can talk about a category *of* rings or whatever structures you have but that's not the same thing 23:31:46 even the subset of categories that work vaguely like type systems is pretty large and useful 23:44:23 -!- ^v has quit (Ping timeout: 240 seconds). 23:44:58 This quotation was found on Lambda the Ultimate: "Seriously now, I don't think such bloated languages are needed. What is needed is a programming language that is assembly, has nice S-expression syntax, and can also be 'executed' in compile-time. Then all other constructs can be made with this basic mechanism." 23:45:14 Well, I think, being 'executed' in compile-time is one of the main features of Forth. 23:45:32 it's also one of the main features of Perl 23:45:52 although Perl is unusual in that it switches between compiling and running frequently, on the fly 23:46:20 there is the syntax BEGIN { ... } which tells the compiler to, as soon as it finishes compiling the inside of the BEGIN block, to run it 23:46:23 before it goes back to compiling 23:46:34 zzo38: forth with quotation, maybe 23:46:35 and eval allows you to invoke the compiler at runtime 23:46:38 O, that's what it does? 23:46:52 Bicyclidine: What is Forth with quotation? 23:46:56 common lisp has something like begin, with the notoriously bizarre eval-when operator 23:47:12 zzo38: the assembly with "nice" syntax bla bla bla 23:47:38 zzo38: yes, this means that a begin block can control the way that subsequent code is compiled, for instance 23:49:16 In idris, evaluation is needed for typechecking, and providers allow you to execute IO actions whose results can be used in typechecking. 23:50:36 i have a lisp implementation i should finish that will ideally allow a slightly more usable version of sbcl's "define compiler intrinsics at runtime" stuff, but, dumb 23:50:48 Melvar: O, I didn't know it is possible to tamper with the typechecking in idris, but I suppose yes it can help 23:51:42 zzo38: given that you didn't know what BEGIN does, I should probably explain "use", too; "use Foo::Bar;" is basically a synonym for "begin { require "Foo/Bar.pm"; Foo::Bar->import() } " except that IIRC it's a little cleverer about locating the file to import 23:52:03 this sort of thing explains how syntax like "use constant" works, and why it starts with use 23:52:13 there's a file constant.pm which injects constants into your namespace when you import it 23:52:15 haa, it really is like CL, that's hilarious 23:52:47 (in general, the "import" function's purpose is to inject stuff into its caller's namespace) 23:53:43 and let me note that ruby specifically does not have this kind of escape from compile time to runtime, the BEGIN keyword in ruby runs a block early at runtime like perl's UNITCHECK, though of course ruby has an eval function to compile stuff at runtime 23:54:21 ais523: as for a different note, I borrowed this classic book Aho, Ullman, "The Theory of Parsing, Translation and Compiling" (1972) which does seem like the book about formal languages I wanted 23:54:31 actually, what shocked me more was discovering what syntax like "\ 4" does (that means "a reference to 4", sort-of like writing &4 in C) 23:54:49 the reference is actually to the 4 in the parse tree of the compiled code 23:54:50 From what I have seen of Perl programs, it also requires that the included file returns 1 at the end. 23:55:04 it's a read-only reference, so the fact doesn't matter, but I still think it's ridiculous 23:55:24 ais523: yes it is. perl is full of crazy historical cruft like that that can't be changed now 23:55:24 zzo38: "require" errors out if the required file doesn't evaluate to a truthy value 23:55:35 any truthy value can be used, but 1 is traditional 23:56:07 b_jonas: well, it's useful syntax, and thinking about it, there's no particular reason /not/ to do it like that 23:56:18 you need a read-only copy of 4 to take a reference to 23:56:21 and look, you have one already 23:56:52 ais523: Is that so that you can make the program to check if it is unusable and to have other files to read the return value to see if it is OK before continuing? 23:56:52 the reference is actually to the 4 in the parse tree of the compiled code <- man that's almost as good as the regex introspect thing 23:57:14 zzo38: yes, it's so that you have a way to signal that something went wrong 23:57:17 wait, can you do &4 in C 23:57:20 no 23:57:24 oh ok. 23:57:38 nor in C++ (just learned that one today) 23:57:50 however, in modern C, you can take pointers to struct literals 23:57:55 yesterday i learned that you can declare variables in if expressions in C++. i don't get C++'s deal 23:57:55 &(struct foo){1, 2} 23:58:10 Bicyclidine: huh, wonder if that works in C 23:58:20 there are a couple of points in NetHack where that actually seems useful 23:58:20 ais523: it does these days in C99 or C11, yes 23:58:21 don't think so and hope not 23:58:35 ais523: it's quite useful for for statements especially, 23:58:40 although I guess you only get the one assignment 23:58:43 b_jonas: obviously it's useful for for 23:58:47 even if the syntax is just a limited shortcut 23:58:48 yeah 23:58:50 * Bicyclidine doesn't even like doing it in for. 23:59:03 ais523: the scope is to the rest of the if statement, you can reassign it 23:59:15 Bicyclidine: oh right, for some reason I thought it'd only be for the conditional 23:59:17 Bicyclidine: it's nice to stop iteration variables leaking up to the scope of the caller 23:59:23 er, scope of the function 23:59:32 I sometimes do it in perl 23:59:40 but NetHack's full of stuff like if (((x = accessor_that_might_return_NULL)) && x->foo()) 23:59:46 err, remove the parens 23:59:51 if (((x = accessor_that_might_return_NULL)) && x->foo) 23:59:57 if (((x = accessor_that_might_return_NULL())) && x->foo) 23:59:59 got it eventually