Skip to content

Instantly share code, notes, and snippets.

@xgrommx
Forked from danidiaz/_FP reading lists.md
Created March 9, 2017 21:11
Show Gist options
  • Save xgrommx/5e5b0c3462cdc1fbd29ba5aabe48de29 to your computer and use it in GitHub Desktop.
Save xgrommx/5e5b0c3462cdc1fbd29ba5aabe48de29 to your computer and use it in GitHub Desktop.
assorted reading lists

A series of reading lists mostly related to functional programming.

Category Theory

papers

When is one thing equal to some other thing?

All Concepts are Kan Extensions

Kan extensions and nonsensical generalizations

Kan extensions for program optimization

Generic programming with adjunctions

Monads from Comonads, Comonads from Monads

Constructing Applicative Functors has stuff about coends

A Representation Theorem for Second-Order Functionals

BASIC CONCEPTS OF ENRICHED CATEGORY THEORY

Codensity and the ultrafilter monad

What Sequential Games, the Tychonoff Theorem and the Double-Negation Shift have in Common

Selection Functions, Bar Recursion, and Backward Induction

WEIGHTED LIMITS AND COLIMITS

THIS IS THE (CO)END, MY ONLY (CO)FRIEND

NATURAL TRANSFORMATIONS Id −→ Id

Update Monads: Cointerpreting Directed Containers. slides

Combinatorial Species and Labelled Structures. has stuff about coends

String diagrams for free monads

How to Twist Pointers without Breaking Them

Notions of computation as monoids

From monoids to near-semirings: the essence of MonadPlus and Alternative

Parameterised Notions of Computation

Arrows, like Monads, are Monoids

categorical semantics of digital circuits

Calculating monad transformers with category theory

Arrows and computation

An Introduction to n-Categories

A 2-CATEGORIES COMPANION

Higher-Dimensional Categories: an illustrated guide book

ALGEBRAIC THEORIES

Natural Transformations as Rewrite Rules and Monad Composition

Building inference algorithms from monad transformers

Differentiating Data Structures

Containers in Homotopy Type Theory (2014)

A Meaning Explanation for HoTT

slides

Codensity and the ultrafilter monad

M.Sci. Category Theory course

books

The joy of cats

Toposes triples and theories

Category Theroy (Oxford Logic Guides)

Notes on Homotopical Algebra

Higher operads, higher categories

Higher-Dimensional Categories: an illustrated guide book

Category Theory - A Gentle Introduction

A gentle introduction to Category Theory - the calculational approach

Synthetic topology of data types and classical spaces

An introduction to Category Theory with over 200 exercises and solutions available

Examples in Category theory

Elements of basic category theory

Introduction to categories and categorial logic

Category Theory in Context

Tom Leinster, Basic Category Theory

An introduction to geometric topology

Lecture Notes on Randomized Linear Algebra

elementary applied topology

videos

TheCatsters

Category Theory Foundations, Lecture 1

Categories and String Diagrams

Category theory for programmers by Bartosz Milewski

posts

Catsters guide

Where Do Ultrafilters Come From?

Codensity (ReaderT s m a) == StateT s (Codensity m) a

Unnatural Transformations and Quantifiers

Is Mac Lane still the best place to learn category theory?

How do I check if a functor has a (left/right) adjoint?

Kan lifts

Ends

Good books and lecture notes about category theory

Dinatural Transformations and Coends

Kan Extensions III: As Ends and Coends

Comonads as spaces

The cofree comonad and the expression problem

Comonads fou UIs

Comonads as spaces

Comonads and Day Convolution reddit

What Are Some Example Adjunctions from Monads (or vice versa)?

From ct th to hask

Yoneda with adjunctions

What are Haskell's monad transformers in categorical terms?

Haskell monad transformers at the nForum

Tambara modules

Building free arrows from components reddit

sheaf theory at HN

DSLs

http://www.cs.ox.ac.uk/jeremy.gibbons/publications/fp4dsls.pdf Functional Programming for Domain-Specific Languages http://cs448h.stanford.edu/DSEL-Little.pdf hudak https://www.andres-loeh.de/HaskellForDSLs.pdf Loh https://github.com/mchakravarty/hoas-conv https://wiki.haskell.org/Embedded_domain_specific_language https://www.reddit.com/r/haskell/comments/2e8d53/whats_the_best_practice_for_building_a_dsl_in/ https://skillsmatter.com/skillscasts/2872-haskell-for-embedded-domain-specific-languages http://cacm.acm.org/magazines/2011/7/109910-dsl-for-the-uninitiated/fulltext https://www.reddit.com/r/haskell/comments/2dh0sd/denotational_design_from_meanings_to_programs_by/ http://lambda-the-ultimate.org/node/2438 http://okmij.org/ftp/tagless-final/course/lecture.pdf https://gist.github.com/PkmX/182c6c5444b695d9a794 http://homepages.inf.ed.ac.uk/slindley/papers/unembedding.pdf

Two approaches to representing variables in a typed term language implemented as a GADT are (1) to use higher-order abstract syntax (HOAS) or to use de Bruijn indices.. Both approaches are convenient for manipulating terms as they require no explicit alpha conversion and avoid name capture during substitution. Nevertheless, there are trade offs between the two. In particular, the HOAS representation doesn't support comparing variable names and the de Bruijn representation is inconvenient for humans to read and write. For a more detailed discussion, see for example Conor McBride and James McKinna's I am not a number: I am a free variable, where they discuss a mixed representation using de Bruijn indices for bound variables and variables of the meta-language for free variables.

The tension between the HOAS and de Bruijn representation also has relevance for the design and implementation of embedded domain specific languages (EDSLs) — aka internal languages. When an internal includes higher-order functions, it is usually most convenient for the user to use the function abstraction mechanisms of the host language. However, to execute or compile the internal language, de Bruijn notation is often more convenient; at least, if optimisations are performed.

http://www2.hh.se/staff/vero/dsl/printL1.pdf http://www2.hh.se/staff/vero/dsl/printL2.pdf http://www2.hh.se/staff/vero/dsl/printL3.pdf http://www2.hh.se/staff/vero/dsl/printL4.pdf http://www2.hh.se/staff/vero/dsl/printL5.pdf http://www2.hh.se/staff/vero/dsl/printL6.pdf

Typed compilation to tagless-final HOAS The embedded DSL is now higher-order: it is simply-typed lambda-calculus with the fixpoint and constants — essentially, PCF. We no longer use staging. Rather, we compile to tagless-final representation, which can be interpreted by different interpreters. Regardless of the number of interpretations of a term, the type checking happens only once. We build our own Dynamics to encapsulate typed terms and represent their types.

https://www.haskell.org/communities/11-2009/report.pdf https://en.wikipedia.org/wiki/Programming_Computable_Functions

https://mail.haskell.org/pipermail/haskell-cafe/2009-October/067425.html

https://blog.cppcabrera.com/posts/56-writing-a-search-dsl-1.html

http://gallium.inria.fr/~naxu/research/dsel.pdf

Sharing and recursion are common problems when implementing DSLs. Often some kind of observable sharing is requested that requires a deep embedding.

Oleg in Haskell-Cafe about Designing DSL with explicit sharing (was: I love purity, but it's killing me) Koen Classen: Observable Sharing for Functional Circuit Description Andy Gill: Type-Safe Observable Sharing Tom Lokhorst AwesomePrelude presentation (video) Leandro Lisboa Penz Haskell eDSL Tutorial - Shared expenses Bruno Oliveira and William Cook: Functional Programming with Structured Graphs Emil Axelsson and Koen Claessen: Using Circular Programs for Higher-Order Syntax Oleg Kiselyov: Implementing explicit and finding implicit sharing in embedded DSLs

An obvious way to relief the tension between the representations is to use HOAS in the surface representation of the internal language and to convert that to the de Bruijn representation before optimisation and execution. However, the conversion is not entirely straight forward for a strongly typed internal language with typed intermediate representations and type-preserving transformations between those representations.

http://www.iro.umontreal.ca/~monnier/tcm.pdf

Implementing Explicit and Finding Implicit Sharing in Embedded DSLs

I love purity, but it's killing me

Simple and Compositional Reification of Monadic Embedded Languages

https://www.reddit.com/r/haskell/comments/4ck2yh/compilation_as_a_typed_edsltoedsl_transformation/

The Difference Between Shallow and Deep Embedding

Certifying Machine Code Safety: Shallow versus Deep Embedding

Shallow versus Deep Embeddings

Embedded domain specific language (links)

Using Circular Programs for Higher-Order Syntax

Implementing Explicit and Finding Implicit Sharing in Embedded DSLs

Type-Safe Observable Sharing in Haskell

An Image Processing Language: External and Shallow/Deep Embeddings

Fizzbuzz in Haskell by embedding a DSL

blog

Resource-AWare Feldspar

Compilation as a Typed EDSL-to-EDSL Transformation

Combining deep and shallow embedding of domain-specific languages

##slides

Combining deep and shallow embeddings: a tutorial

Building Small Native Languages with Haskell

##videos

Type-Safe Observable Sharing in Haskell

https://skillsmatter.com/skillscasts/2872-haskell-for-embedded-domain-specific-languages

Strongly Typed Domain Specific Embedded Languages

Everything Old is New Again: Quoted Domain Specific Languages

Implementing Domain Specific Languages with LLVM

Phil Freeman - Embedded DSLs in Haskell

Building a language, in Haskell, with an LLVM backend

Software

Data-reify for observable sharing

FRP

papers

Functional reactive animation

Push-pull functional reactive programming

Functional Reactive Programming, Continued

Efficient and Compositional Higher-Order Streams

Signals, not generators!

Practical Principled FRP

Towards a Common Categorical Semantics for Linear-Time Temporal Logic and Functional Reactive Programming

LTL types FRP

Synchronous Functional Programming: The Lucid Synchrone Experiment

Causal commutative arrows, revisited

Functional Reactive Programming, Refactored

posts

FRP - Dynamic event switching in reactive-banana-0.7

FRP — API redesign for reactive-banana 1.0

FRP for free

A Farewell to FRP

How to implement a game loop in reactive banana?

Time delays in reactive banana

The future of Netwire

Beliefs and the Unimpossibility of Functional Reactive Programming

What's the status of current Functional Reactive Programming implementations?

My thoughts after spending 5 month writing an frp library

slides

basic propositional linear logic

Temporal logic and functional reactive programming

books

Functional Reactive Programming

videos

Functional Reactive Programming in Java

A Sensible Intro to FRP

Making Reactive Programs Function part2

FRP, refactored

CCA revisited

software

reactive-banana

quotes

From what I can read here and there, Netwire and reactive-banana have different purposes and goals. Netwire specialises in modelising framed signals, such as a game server, because what a game server typically does is sending its state to client in periodic frames. Reactive-banana would be the better choice for creating a GUI because a GUI is a purely event-driven model and is not tolerant to time leak.

netwire: Useful library, but needs maintenance and has high maintenance cost due to its design. I'll likely replace it by a new abstraction at some point, using a different package name. Currently I recommend using one of the following libraries for FRP:

reactive-banana: My former favourite when it comes to push/pull FRP. Well designed, clean semantics, reasonably efficient.

reflex: My current favourite when it comes to push/pull FRP. Well designed, clean semantics, reasonably efficient.

Yampa: AFRP for games, simulations and other real-time applications (for when a high and predictable framerate is more important than pushed events, same target domain as Netwire).

Evan Czaplicki's talk (https://www.youtube.com/watch?v=Agu6jipKfYw) linked in frp-zoo is great! After watching it I would say that varying is definitely in his Arrowized FRP category. The main type in varying is an instance of Arrow. Signals are not connected to the world, and when a signal is not being run - it's cold. Unlike Netwire, varying doesn't have implicit time or inhibition. A Netwire 'wire' written in varying would be something like Monad m => Var m t (Event b) where t is time and b is the value. Event allows inhibition explicitly. Unlike Auto, varying is small and more focused on tweening and allowing you to build data structures that change in a smooth manner over time (or another domain). Auto has a lot of extra functionality like serialization, etc. I purposefully made the varying API tiny in an effort to make learning it really easy. They're all capable of expressing one another in their own terms though, so they're all worth a visit.

Auto is at least as much "FRP" as elerea. Purists to Elliot's approach, notably including Auto's author, will tell you neither one is FRP at all. Five years ago I'd probably be agreeing with them, but IMO at this point that ship has sailed.

slides

Cheney, Bisimulation and Coinduction for Dummies

Sangiorgi, An Introduction to Bisimulation and Coinduction

papers

A Tutorial on (Co)Algebras and (Co)Induction

Practical Coinduction A property holds by induction if there is good reason for it to hold; whereas a property holds by coinduction if there is no good reason for it not to hold.

On proof and progress in Mathematics

A taste of linear logic / linear thoughts

Abstraction and Computation

Adventures in Classical-Land

posts

Proof by Coinduction coinduction is going to rely on the fact that epimorphisms from terminal coalgebras are isomorphisms, i.e., there’s no quotient coalgebra of a terminal coalgebra.

logic reading list on Reddit

Robert Harper on proofs by contradiction

Proof of negation and proof by contradiction

courses

opslss 2016

opslss 2015

opslss 2014

opslss 2013

opslss 2012

Robert Harper's Homotopy type theory course

sywtltt

A Roadmap for Type Theory

videos

OPLSS 2012

proofs as processes OPLSS 2012

OPLSS 2013

software foundations in coq OPLSS 2013

polarization and focalization OPLS 2013

OPLSS 2014

type theory foundations OPLSS 2014

category theory foundation OPLSS 2014

OPLSS 2015

introduction to dependent type theory OPLSS 2015

logical relations OPLSS 2015

basic proof theory OPLSS 2015

The Coq Proof Assistant and Its Applications to Programming-Language Semantics — Adam Chlipala OPLSS 2015

Basic Category Theory: Semantics of Proof Theory — Ed Morehouse OPLSS 2015

Inductive and Inductive-Recursive Definitions in Intuitionistic Type Theory — Peter Dybjer OPLSS 2015

proofs as processes OPLSS 2015

OPLSS 2016

Category Theory Background OPLSS 2016

Patricia Johann Lecture 1, OPLSS 2016 logical relations

Programming Languages Background — Robert Harper and Dan Licata OPLSS 2016 2016

Network Programming — Nate Foster OPLSS 2016

Separation Logic and Concurrency — Aleks Nanevski OPLSS 2016

Principles of Type Refinement — Noam Zeilberger OPLSS 2016

Logical relations/Compiler verification — Amal Ahmed OPLSS 2016

Automated Complexity Analysis — Jan Hoffmann OPLSS 2016

ICFP

ICFP

ICFP 2016

ICFP

Scalaworld

Scalaworld

##posts

Call-By-Name, Call-By-Value and the λ-Calculus

hott stuff

the three projections of doctor Futamura

Random access lists, nested data types and numeral systems

Papers We Love: John Reynolds, Definitional Interpreters for Higher-Order Programming Languages video

Fold and unfold for program semantics

#papers

Linear types can change the world

Do Be Do Be Do

Polarized Data Parallel Data Flow from

About the efficient reduction of lambda terms

Algebraic subtyping

#books

Making uniqueness types less unique post

lambda calculus notes

Recursion schemes

papers

Program Calculation Properties of Continuous Algebras

Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire

Origami Programming

A tutorial on the universality and expressiveness of fold

Factorising Folds for Faster Functions

The Under-Appreciated Unfold

When is a function a fold or an unfold?

Constructively Characterizing Fold and Unfold

Paramorphims

FUNCTIONAL PROGRAMMING WITH APOMORPHISMS (CORECURSION)

Metamorphisms: Streaming Representation-Changers

Primitive (Co)Recursion and Course-of-Value (Co)Iteration, Categorically

Histo- and Dynamorphisms Revisited

Recursion Schemes for Dynamic Programming

Sorting morphisms

Sorting with Bialgebras and Distributive Laws

Adjoint Folds and Unfolds

Unifying Structured Recursion Schemes

Conjugate Hylomorphisms

Reasoning about Algebraic Data Types with Abstractions

A Translation from Attribute Grammars to Catamorphisms

Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers

Calculating compilers

Calculating correct compilers

Calculating Certified Compilers for Non-Deterministic Languages

Designing and Implementing Combinator Languages

The design of a pretty-printing library (Hughes)

A prettier printer (Wadler)

Higher-Order Recursion Abstraction

Haskell Programming with Nested Types: A Principled Approach

Trees that grow

blog posts

Recursion schemes for dummies?

Recursion Schemes: A Field Guide

An Introduction to Recursion Schemes

Recursion Schemes, Part 2: A Mob of Morphisms

Grokking recursion-scheme: Part 1

Grokking recursion-scheme: Part 2

Hylomorphisms in Haskell

More Hylomorphisms in Haskell

Category:Recursion schemes

Folds in context

Dynamorphisms as chronomorphisms

Histomorphisms, Zygomorphisms and Futumorphisms specialised to lists

Examples of histomorphisms in Haskell

videos

Unifying Structured Recursion Schemes

Recursion Schemes

calculating correct compilers

software

recursion-schemes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment