Newest at the top
| 2026-02-09 22:56:21 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-02-09 22:47:42 +0100 | <ski> | you could define a "class" as a function of type `O -> O' (taking `self'/`this' as input), and to instantiate a new object of this class, you call `fix' on it |
| 2026-02-09 22:46:37 +0100 | <ski> | you need either mutation, or delaying application of `fix', to implement this |
| 2026-02-09 22:45:30 +0100 | <ski> | or, you can express it in terms of classes (object templates. not directly related to object types), instead of creating a new object, you create a new subclass, overriding `g' with a new implementation. the old `f' in the new class should now call the new `g' |
| 2026-02-09 22:45:05 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 2026-02-09 22:44:21 +0100 | <ski> | EvanR : given an object with two methods `f' and `g', where the implementation of `f' calls `g' (in the same object). now, you construct a new object from this old one, replacing the `g' implementation. "open recursion" means that `f' in this object will now call the new `g', rather than the old |
| 2026-02-09 22:39:59 +0100 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
| 2026-02-09 22:38:19 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-02-09 22:36:55 +0100 | michalz | (~michalz@185.246.207.200) (Remote host closed the connection) |
| 2026-02-09 22:35:57 +0100 | <c_wraith> | technically you can do it with recursion schemes in Haskell, but no one writes their code that way |
| 2026-02-09 22:35:36 +0100 | <c_wraith> | open recursion is a term used primarily to describe OOP's late dispatch mechanisms |
| 2026-02-09 22:35:12 +0100 | <EvanR> | ski, "open recursion" vs general recursion? |
| 2026-02-09 22:30:56 +0100 | takuan_dozo | (~takuan@d8D86B9E9.access.telenet.be) (Ping timeout: 240 seconds) |
| 2026-02-09 22:28:03 +0100 | <lambdabot> | Nice! |
| 2026-02-09 22:28:03 +0100 | <ski> | @where+ polymorphic-type-inference "Polymorphic Type Inference" by Michael I. Schwartzbach in 1995-03 at <https://cs.au.dk/~amoeller/mis/typeinf.p(s|df)>,<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.57.1493> |
| 2026-02-09 22:27:20 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2026-02-09 22:27:03 +0100 | <ski> | (oh, try <https://cs.au.dk/~amoeller/mis/typeinf.pdf> for the last one) |
| 2026-02-09 22:26:35 +0100 | picnoir | (~picnoir@about/aquilenet/vodoo/NinjaTrappeur) NinjaTrappeur |
| 2026-02-09 22:25:12 +0100 | <ski> | might also be helpful |
| 2026-02-09 22:25:05 +0100 | <lambdabot> | "Polymorphic Type Inference" by Michael I. Schwartzbach in 1995-03 at <https://cs.au.dk/~mis/typeinf.p(s|df)>,<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.57.1493> |
| 2026-02-09 22:25:05 +0100 | <ski> | @where polymorphic-type-inference |
| 2026-02-09 22:24:41 +0100 | picnoir | (~picnoir@about/aquilenet/vodoo/NinjaTrappeur) (Quit: WeeChat 4.8.1) |
| 2026-02-09 22:24:37 +0100 | <ski> | these talk, amongst other things, about subtyping, parametric polymorphism, existential quantification. and how existentials are related to closures & object-orientation, and also (in a different way) to abstract data types |
| 2026-02-09 22:23:41 +0100 | <lambdabot> | "On Understanding Data Abstraction, Revisited" by William R. Cook in 2009-10 at <http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf> |
| 2026-02-09 22:23:41 +0100 | <ski> | @where on-understanding-revisited |
| 2026-02-09 22:23:38 +0100 | <lambdabot> | "On Understanding Types, Data Abstraction, and Polymorphism" by Luca Cardelli,Peter Wegner in 1985-12 at <http://lucacardelli.name/Papers/OnUnderstanding.A4.pdf> |
| 2026-02-09 22:23:38 +0100 | <ski> | @where on-understanding |
| 2026-02-09 22:23:12 +0100 | <ski> | also, you can specify that an argument type, or result type, of a method is of "This" class (like "binary methods" and "clone methods"). this in turn causes not all subclasses to induce subtypes (which OCaml tracks statically) |
| 2026-02-09 22:22:33 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-02-09 22:22:11 +0100 | <ski> | returning a clone of the current object, but with some of the instance fields swapped out |
| 2026-02-09 22:21:52 +0100 | <ski> | yea, OCaml has support for immutable OO |
| 2026-02-09 22:21:27 +0100 | <ski> | and both these two structuring approaches, "FP", and "OO", are important. both are available in Haskell (although message-dispatching syntax, like in Agda, would help encourage it a bit more). VisitorPattern is a way to simulate (via CPA) pattern-matching on variant types, in traditional OO languages |
| 2026-02-09 22:20:46 +0100 | <EvanR> | functional |
| 2026-02-09 22:20:43 +0100 | <EvanR> | see also ocaml for a function language that happens to also support OOP |
| 2026-02-09 22:20:01 +0100 | <EvanR> | jreicher, cardelli theory of objects shows two simplistic OOP "calculi" one with mutable, one without. Both are superficially similar to LC. So yeah |
| 2026-02-09 22:20:00 +0100 | <ski> | the point is that *one* way to construe "OO" is that the main idea is to structure your program around records with delayed (possibly parameterized) fields. with or without subtyping. with or without implementation inheritance and late binding, open recursion |
| 2026-02-09 22:18:39 +0100 | <ski> | but they don't have message-dispatching definition syntax (called "copatterns" in Agda. also used, years before that, by e.g. Erik Poll) |
| 2026-02-09 22:18:10 +0100 | <KindFoxo> | oh, I'm sorry... I don't read while writing... |
| 2026-02-09 22:17:22 +0100 | <KindFoxo> | also, all the ML-like FP languages have record types, why should it be not an FP thing... I've seen some formalization of classes as coinductive types. In curry or Coq, not sure, sounds interesting to me... As for right now, I don't understand "the idea" behind OOP... |
| 2026-02-09 22:16:23 +0100 | <ski> | (that's why i used quotes) |
| 2026-02-09 22:16:13 +0100 | <ski> | yea, those two are very restricted, and highly stylized, alternatives, for the purpose of showing a duality |
| 2026-02-09 22:15:26 +0100 | <KindFoxo> | ski: you've made Lisps not functional... and I guess the language FP does not fit in the definition being obviously a functional programming language |
| 2026-02-09 22:13:57 +0100 | <ski> | KindFoxo : you can store data in processes in Erlang, e.g. in its dict, or simply by having it wait for requests to set and access the state (which is immutably passed around in a tail-recursive loop) |
| 2026-02-09 22:13:30 +0100 | <KindFoxo> | For example, Reader is such an extraction of the fact that a functional arrow is a monad |
| 2026-02-09 22:13:02 +0100 | <KindFoxo> | Haskell seems to me like a structural programming language, in a sense category theory is a reborn of structuralism in mathematics. In Haskell it allows to extract the structure emerging in relations into some sort of a pattern. |
| 2026-02-09 22:12:40 +0100 | <ski> | "OO" : programming with record/product types and message-dispatching |
| 2026-02-09 22:12:24 +0100 | <ski> | "FP" : programming with variant/sum types and pattern-matching |
| 2026-02-09 22:12:01 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 2026-02-09 22:10:46 +0100 | Square2 | (~Square@user/square) (Ping timeout: 265 seconds) |
| 2026-02-09 22:09:22 +0100 | Square | (~Square4@user/square) Square |