Projects [000C]
Disco [000N]
Disco is a functional teaching language for discrete mathematics, implemented in Haskell. Heinrich Apfelmus recently built a basic web UI for students to be able to use Disco in their browser, and I'm using it to teach MATH 240, Discrete Mathematics this semester.
Related talks and papers
Reference. Disco: A Functional Programming Language for Discrete Mathematics [yorgey-disco-2023]
Disco is a pure, strict, statically typed functional programming language designed to be used in the setting of a discrete mathematics course. The goals of the language are to introduce students to functional programming concepts early, and to enhance their learning of mathematics by providing a computational platform for them to play with. It features mathematically-inspired notation, property-based testing, equirecursive algebraic types, subtyping, built-in list, bag, and finite set types, a REPL, and student-focused documentation. Disco is implemented in Haskell, with source code available on GitHub, and interactive web-based REPL available through replit.
@Inproceedings{yorgey-disco-2023,
author = {Yorgey, Brent A.},
year = {2023},
title = {Disco: A Functional Programming Language for Discrete Mathematics},
editor = {Machkasova, Elena},
booktitle = {{\rm Proceedings Twelfth International Workshop on}
Trends in Functional Programming in Education,
{\rm Boston, Massachusetts, USA, 12th January 2023}},
series = {Electronic Proceedings in Theoretical Computer Science},
volume = {382},
publisher = {Open Publishing Association},
pages = {64-81},
doi = {10.4204/EPTCS.382.4},
}Swarm [000O]
- October 26, 2025
In the fall of 2021 I started developing a game called Swarm and built a small open-source community around its development. So far we have made a few official alpha releases, and development continues to hum along. We finally merged a big import feature to the language. I've recently finished work on an immutable array type and a integrated help system. I've also been writing up some notes about a planned redesign of the type system. After getting out an 0.9 release I will probably next turn to implementing a parallel semantics.
Applicative inference [000P]
- October 26, 2025
While working on a mini-DSL as part of the Swarm project, I got an intuitive sense that the types of DSLs involving an applicative functor can be fully inferred from (suitably restricted) programs that just use regular applicative notation, whereas for monads this would be ambiguous. I have been working, intermittently, on a research project to formalize and prove this idea.
Recently, I have teamed up with Ryan Doenges and Aaron Stump to collaborate on this problem and related things.
Related talks and papers
- October 26, 2025
Reference. Idiomatic Inference for DSLs [idiomatic-inference-PLV]
- January 30, 2025
- Brent A. Yorgey
- Portland State University PLV seminar
- Slides
McBride and Paterson's idioms, or applicative functors, are a well-known abstraction defining function application in some ambient effectful context. It would often be useful, especially in the context of designing domain-specific languages, to infer such "idiomatic'' application, allowing the programmer to use plain function application syntax—but only when doing so is unambiguous. I will present work in progress characterizing the conditions necessary for this to be possible.
Diagrams [000S]
- October 28, 2025
Diagrams is an embedded domain-specific language in Haskell for creating vector graphics, which I and several other contributors developed starting in 2008. Development has more or less stopped at this point, but I still keep it updated to compile with the latest versions of GHC and its dependencies.
Diagrams-related talks and papers
- October 28, 2025
Reference. Diagrams: A Functional EDSL for Vector Graphics [yates-yorgey-2015]
Diagrams is a domain-specific language for creating vector graphics. We will give a short diagrams tutorial/demo, particularly highlighting the power of a functional, embedded domain-specific language.
@inproceedings{yates-yorgey-2015,
author = {Yates, Ryan and Yorgey, Brent A.},
title = {Diagrams: a functional EDSL for vector graphics},
year = {2015},
isbn = {9781450338066},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2808083.2808085},
doi = {10.1145/2808083.2808085},
abstract = {},
booktitle = {Proceedings of the 3rd ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design},
pages = {4–5},
numpages = {2},
keywords = {EDSL, Haskell, diagrams, vector},
location = {Vancouver, BC, Canada},
series = {FARM 2015}
}Reference. Diagrams: Declarative Vector Graphics in Haskell [yorgey-diagrams-NYHUG-2013]
- November 20, 2013
- Brent A. Yorgey
- New York Haskell Users' Group
- Slides
- Video
Reference. Functional Active Animation [yorgey-active-2013]
Reference. Monoids: Theme and Variations (Functional Pearl) [yorgey-monoids-2012]
The monoid is a humble algebraic structure, at first glance even downright boring. However, there's much more to monoids than meets the eye. Using examples taken from the diagrams vector graphics framework as a case study, I demonstrate the power and beauty of monoids for library design. The paper begins with an extremely simple model of diagrams and proceeds through a series of incremental variations, all related somehow to the central theme of monoids. Along the way, I illustrate the power of compositional semantics; why you should also pay attention to the monoid's even humbler cousin, the semigroup; monoid homomorphisms; and monoid actions.
@inproceedings{10.1145/2364506.2364520,
author = {Yorgey, Brent A.},
title = {Monoids: Theme and Variations (Functional Pearl)},
year = {2012},
isbn = {978-1-4503-1574-6},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/2364506.2364520},
doi = {10.1145/2364506.2364520},
booktitle = {Proceedings of the 2012 Haskell Symposium},
pages = {105--116},
numpages = {12},
keywords = {monoid action, monoid, homomorphism, edsl},
location = {Copenhagen, Denmark},
series = {Haskell '12}
}Reference. Embedded, functional, compositional drawing [yorgey-compositional-drawing-2012]
- April 13, 2012
- Brent A. Yorgey
- Williams College