User loginNavigation |
LtU ForumLooking for papers on covariance and contravarianceHello, I am looking for papers and a particular paper I used to have on covariance and contravariance. The paper I used to have many years ago probably about 2006 or 2007 when I originally started looking into type theory and did not realize its relevance had many inference rules for covariance and contravariance using plus and minus symbols within the inference rules. I am now researching this area and am interested in any papers on this topic. Many thanks in advance, Aaron Gray Functional Design Patterns - Relating Haskell Typeclasses to Software Design PatternsRecently, while re-reading through the Haskell Typeclassopedia I thought it would be a good exercise to map the structure of software design-patterns to the concepts found in the Haskell type class library and in functional programming in general. By searching the web I found some blog entries studying specific patterns, but I did not come across any comprehensive study. As it seemed that nobody did this kind of work yet I found it worthy to spend some time on it and write down all my findings on the subject. I think this kind of exposition could be helpful if you are either: - a programmer with an OO background who wants to get a better grip on how to implement complexer designs in functional programming I have set this up as a GitHub project with full sourcecode for all examples: By ThomasMahler at 2018-12-13 16:30 | LtU Forum | login or register to post comments | other blogs | 4061 reads
POLA Would Have Prevented the Event-Stream IncidentPOLA Would Have Prevented the Event-Stream Incident by Kate Sills
This npm / event-stream debacle is the perfect teaching moment for POLA (Principle of Least Authority), and for the need to support least authority for JavaScript libraries. My talk Securing EcmaScript, presentation to Node Security explained many of these issues prior to this particular incident. For LtU, my best explanation of POLA is Verify What? Navigating the Attack Surface given to the "Formal Methods Meets JavaScript" workshop at Imperial College. By MarkM at 2018-12-06 03:55 | LtU Forum | Site Discussion | login or register to post comments | other blogs | 3194 reads
Video on Unison/comparison to Haskell/Monads/distributed computinghttps://youtu.be/rp_Eild1aq8 Monads are passé, apparently. Previously mentioned on ltu rather a long time ago http://lambda-the-ultimate.org/node/5151 Lambdas and objects as an existential typeI’m looking at type theory from point of view of the general-purpose programming language evolution, and I’ve found something that does not look nice. There is stage when function pointers like ones in C were introduced to the languages. Differently from lambdas they are stateless and they could be only evaluated using their explicit arguments and using only constants (or global state) and by calling other stateless functions. Their type will be designated as: T ⇨ A Now let’s take usual lambdas, their type will be designated as: T → A The relationship between these two types is the following: A → B = ∃ T (T ⨉ (T ⨉ A ⇨ B)) apply: (A → B) ⨉ A ⇨ B = ? ((t, f), a), f(t, a) // unpacking existential type here curry: ((A ⨉ B) → C) ⇨ (A → B → C) = ?(t, f) ((t, f), (?((t1, f1), a1) ((t1, f1, a1), (?((t2, f2, a2), b2) f2(t2, (a2, b2)))))) Such definition is needed to support currying and to capture implicit environment, and it reflects what is actually happens in the code. Every function from T ⇨ A could be trivially converted to T → A, however stateless functions have different set operations supported. Particularly, currying is not supported. So, it is not subclass, but a separate entity type. This existential type captures difference between structured programming paradigm and object-oriented or functional programming paradigms. So, theoretically, when we would try to study paradigms, we would also need to make this distinction. I’m interested if there are some research papers that describe this distinction. The discussion in the TaPL book is somewhat unsatisfying because explicit existential types are defined using implicit existential types. Theoretically, the type theory should start from stateless functions to reflect evolution path rather than in reverse direction. Such point of view might be also useful for the compiler transformation reasoning, so there might be papers on such equivalence in that area too. Flix on the JVM for static analysisGolly, how did I never hear of this before?
By raould at 2018-10-11 22:52 | LtU Forum | login or register to post comments | other blogs | 3279 reads
Video on ContinuationsI thought I'd let you all know about a video lecture I gave on Scheme continuations, and how they can be used to generate all sorts of control structures. Enjoy! CPS for the win?My old half-baked idea/dream of a cranky day job programmer who doesn't really know what he's talking about:
This gives super powers like:
Code would still be interacted with by developers in original format. Since e.g. hypothetically anything can be converted from imperative to monadic pure fp style then e.g. Java could be set up this way. The UX for adding hooks would be nice and all at a high level, looking like source code, not some internal runtime CPS hell. Co-continuations: a dual to shift/reset?Shift/reset allow convenient expression of monadic computations, as a kind of generalized, functional version of do-notation. From the beginning of that link:
The obvious question is whether there is an analogous construct for comonads. Given that there is a codo-notation I believe there is. In a concatenative language, shift/reset can be written as:
The F block observes the future of the computation (delimited by the nearest reset) and may select a new one. I believe the comonadic dual is:
The F block observes the past of the computation (delimited by the nearest coreset) and may select a new one. This leads to a combined operator:
The F block observes the future and past of the computation (delimited by the nearest braces) and may select new ones. This is first class (co)control flow. I want to say something like "the dual of continuations is environments", as "environment" is an existing concept that seems conceptually close to "store". Note that on this page, someone posts functions analogous to shift/reset for "codensity" or "store". I believe this notation allows the convenient expression of arrows (and monads and comonads) in the same way shift/reset allows expression of monads. Arrows allow decoration of both inputs and outputs, as opposed to only inputs for comonads and only outputs for monads. This makes sense to me but I'm not totally sure since there's not much information on comonads/codo notation and such. I'd appreciate any comments. EDIT: I think the correct format is actually A pointer is an integer with a shivBy Charles Stewart at 2018-09-26 09:02 | LtU Forum | login or register to post comments | other blogs | 3251 reads
|
Browse archives
Active forum topics |
Recent comments
1 day 8 hours ago
2 days 5 hours ago
3 days 9 hours ago
3 days 10 hours ago
1 week 1 day ago
1 week 1 day ago
1 week 1 day ago
4 weeks 2 days ago
5 weeks 11 hours ago
5 weeks 17 hours ago