{"id":34286487,"url":"https://github.com/fdilke/bewl","last_synced_at":"2026-03-10T16:32:48.838Z","repository":{"id":18095281,"uuid":"21161830","full_name":"fdilke/bewl","owner":"fdilke","description":"A DSL for the internal language of a topos","archived":false,"fork":false,"pushed_at":"2025-07-18T11:00:37.000Z","size":104861,"stargazers_count":66,"open_issues_count":3,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-12-20T12:54:31.869Z","etag":null,"topics":["algebraic-structures","category-theory","dsl","math","topos-theory"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"lcdm-uiuc/info490-sp17","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fdilke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-06-24T11:09:45.000Z","updated_at":"2025-08-20T11:45:48.000Z","dependencies_parsed_at":"2025-06-16T19:48:10.427Z","dependency_job_id":null,"html_url":"https://github.com/fdilke/bewl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fdilke/bewl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdilke%2Fbewl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdilke%2Fbewl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdilke%2Fbewl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdilke%2Fbewl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdilke","download_url":"https://codeload.github.com/fdilke/bewl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdilke%2Fbewl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30342182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algebraic-structures","category-theory","dsl","math","topos-theory"],"created_at":"2025-12-17T00:44:00.892Z","updated_at":"2026-03-10T16:32:48.830Z","avatar_url":"https://github.com/fdilke.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!---\nAlas, these CI badges are too flaky, commented out for now.\n[![Continuous Integration](https://circleci.com/gh/fdilke/bewl/tree/master.svg?style=shield)](https://circleci.com/gh/fdilke/bewl)\n\n[![Build Status](https://app.snap-ci.com/fdilke/bewl/branch/master/build_image)](https://app.snap-ci.com/fdilke/bewl/branch/master)\n--\u003e\n\n# Project Bewl\n\nA DSL for the internal (Mitchell-Benabou) language of a topos. \n\nBewl is an ambitious and quixotic attempt to enable new techniques for manipulating\nset-like objects (permutations, musical objects, graphs, fuzzy sets, etc) as if they\nwere sets. This involves a mix of advanced Scala and ludicrously abstract math. The\nmost likely applications (still some way down the line) are to music theory or to \nthe continuing quest for a proper explanation of permutation parity. It is also\npossible to use Bewl as an aid to learning category theory or as a computational\nalgebra package where you can easily define your own algebraic structures. \n\nTo see the current to-do list and state of play, you can view this [Trello board](https://trello.com/b/PfdnsRNl/bewl). There's also a \n[continuous integration setup](https://snap-ci.com/fdilke/bewl/branch/master) which runs all the tests on each commit.\n\n# Presentations explaining the project\n\nSome of these are more accessible than others: pick one that's right for you.\n\nIn May 2018, I gave a talk about Bewl for [S-REPLS 9](http://users.sussex.ac.uk/~mfb21/srepls9/) at the University of Sussex \n([slides](http://users.sussex.ac.uk/~mfb21/srepls9/felixD-slides.pdf), \n[video](http://users.sussex.ac.uk/~mfb21/srepls9/video/felixD-presentation.mp4))\nRequires some math. \n\nMy attempt at explaining Bewl for a general audience on *cruft.io* : \n[Towards an arithmetic of sets](https://cruft.io/posts/bewl-arithmetic-of-sets)\n\nUsing Bewl to do musical calculations - \n[putting the chord of C major under the microscope](https://github.com/fdilke/bewl/blob/master/notes/ChordUnderMicroscope.pdf)\n\nOverall [state of play](https://github.com/fdilke/bewl/blob/master/notes/StateOfTheBewlJan2016.pdf)\nas of January 2016.\n\nSee [this presentation](https://www.evernote.com/shard/s141/sh/8e6b9d94-bc20-4fde-b2bf-9e844f486f76/d11244bad0729071fa00d19eaad312ce)\nfor an attempt at \"the internal language for dummies\"\n\nI've had to keep re-implementing Bewl in successively more powerful programming languages (Java, Clojure and now Scala). \nNow learning [Idris](https://www.idris-lang.org/), which is an amazing language and may be\nthe next logical step.\n\n[This presentation](http://prezi.com/dwrz2mft3y-g/?utm_campaign=share\u0026utm_medium=copy\u0026rc=ex0share) explains the new \"intrinsic\" Bewl 2.0 DSL and why it's better than the previous \"diagrammatic\" 1.0 one.\n\nHere's a presentation about Bewl's [universal algebra capabilities](https://github.com/fdilke/bewl/blob/master/notes/BewlUniversalAlgebra.pdf).\n\nThis [animated video](http://www.youtube.com/watch/?v=nUwjGBHXKYs) was an initial attempt to explain Bewl (back when it was called Bile)\n\nNotes on some promising breakthroughs re [speeding up the topos of actions](https://github.com/fdilke/bewl/blob/master/Speedup.md)\n\n# Parity\n\n[This presentation](https://github.com/fdilke/bewl/blob/master/notes/DoubleExponentialMonads.pdf) describes\nmy simplistic but ambitious plan to solve the mystery of permutation parity by calculating the double exponential\nmonad for ¬, the permutation interchanging true and false. \nHere's one about the [topos of automorphisms](https://github.com/fdilke/bewl/blob/master/notes/ToposOfAutomorphisms.pdf), \nanother chapter in the ongoing parity quest. Here's an\n[update](https://github.com/fdilke/bewl/blob/master/notes/PartyingWithPermutations.pdf).\n(Since then, I've decided it would be easier to generalize the transfer using the \ntheory of Coxeter groups, but that's another story.)\n\n# Music\n\n[Here I relate](https://github.com/fdilke/bewl/blob/master/notes/BewlSpeedup.pdf) Bewl to [Thomas Noll's paper](http://user.cs.tu-berlin.de/~noll/ToposOfTriads.pdf) about music theory and topoi \n\n# Category theory tutorials\n\nRefresher on [strong monads](https://github.com/fdilke/bewl/blob/master/notes/StrongMonads.pdf).\n\nIf you want to use Bewl as a learning aid to study category theory, [start here](https://github.com/fdilke/bewl/blob/master/CommandLine.md).\n\n# Intended applications\n\n- Explore music theory via the triadic topos (see [The Topos of Music](http://link.springer.com/book/10.1007%2F978-3-0348-8141-8))\n- Explore parity in other topoi (as it's so poorly understood for sets). Easier now that the\n\"topos of permutations\" is implemented.\n- Explore the topos of graphs. Bewl will let us talk about graphs as if they were sets\n- Explore fuzzy sets (using the more careful definition that makes them into a topos)\n- Explore Lawvere-Tierney topologies (and perhaps save [these](http://www.math.uchicago.edu/~may/VIGRE/VIGRE2007/REUPapers/FINALFULL/Bartlett.pdf) music theorists from having to calculate them by hand)\n\n# Done so far\n\n- Created Topos API as a trait\n- Implemented FiniteSets as a topos\n- Added 'generic topos tests' which use fixtures for the given topos\n- Can define and verify algebraic laws. Only 'monotyped' laws as yet - can't define monoid and ring actions \n- compact notation for elements / lambdas / uniform operators\n- adapter for diagrammatic layer\n- Separated BaseTopos from its extra layers (Algebra, AlgebraicStructures) which are now traits\n- Universal and existential quantifiers\n- Strong binding: a new layer with stars/quivers concreting over dots/arrows ; stars bound to classes ; quivers/functions interchangeable\n- Specialized element types: e.g. product has left, right ; exponential can apply\n- Adapter that makes a dots-and-arrows topos look like a stars-and-quivers one\n- Implementation of FiniteSets using new DSL\n- Defined quantifiers in new DSL\n- Construct the initial object 0\n- Coproducts\n- predicates isMonic, isEpic, isIso\n- enumerate morphisms / global elements\n- Partial arrow classifier\n- walkthrough for using Bewl as a learning aid for studying category theory [NEEDS UPDATING]\n- universal algebra: can define algebraic structures, using existing ones as parameter spaces (for monoid actions)\n- implemented topos of monoid actions\n- implemented topos of automorphisms\n- traits for monads and strong monads\n- implement double-exponential (continuation) monad\n- endow the subobject classifier with a Heyting algebra structure\n- removed legacy DiagrammaticTopos code\n- images\n- quotients and lifts\n- more algebraic structures: now include all the classical ones\n- coequalizers\n\n# To do\n\n- construct the monad of monoid actions\n- construct the reader monad \n- construct 'pitchfork' for algebras over a strong monad\n- construct 'pitchfork' for 'informal' (operator) algebras\n- construct the topos of coalgebras, and so (maybe a slow implementation of) the slice topos\n- Can extend and remap algebraic structures, e.g. ring extends abelian group remaps group with an extra law\n- More algebraic constructions: endomorphism ring, transfer\n- separate out the language, have an independent first-order grammar, in which there can be proofs?\n- have a concept of 'models' and streamline construction constellation/scalars\n- language in which class ::== a theory\n- implicit objects, follow Odersky concept of 'context' used in Dotty\n- make =?= be a binary operation on (extra rich) elements \n- tell if an object has an injective hull\n- Optimize algorithm enough to construct triadic topos and its topologies\n- Construct the slice topos. Use McLarty's construction, NOT the one in Moerdijk/Maclane which\nrequires you to first construct the power object for exponentials\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdilke%2Fbewl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdilke%2Fbewl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdilke%2Fbewl/lists"}