32 Matching Annotations
  1. Last 7 days
    1. Let’s look at how to visualise these squares. First, we should note the direction our axes go in: i varies from the left to the right, and j varies top-to-bottom. The drop-i square is constant in the i direction, but in the j direction, it’s p. This manifests in the diagram as having refl for both of its vertical faces: on the left, we’re looking at p(i0)=a not varying along the vertical axis, and respectively for p(i1)=b on the right. For the drop-j square, the situation is flipped, since we’re now ignoring the horizontal direction.

      the squares seem to be flipped wrt to their description, i.e. horizontal vs vertical

  2. Mar 2025
  3. Dec 2024
  4. Oct 2024
    1. pattern

      so this is a difference to haskell, bc + is a defined function occurring in a pattern, not a constructor. Also, the pattern is non-linear. Aha, so this point is addressed later on.

  5. Sep 2024
    1. Parametrize the sorted list by a lower bound on the values it contains. For a cons cell the head should be smaller than the lower bound, and the tail should be larger than the head. This requires the type to have a smallest element, but you can adjoin -∞ with a new datatype.

      this is the way it's done in "How to keep your neighbors in order"

    1. not only is this boring to write, but any future changes (such as added constructors or fields) to Expr will force us to rewrite it

      making refactoring more difficult

  6. Mar 2024
  7. Feb 2024
    1. Any property-like structure can be “algebraicized” by requiring a specific choice of the objects that are required to exist; a cleavage is this “algebraicization” for the property of being a Grothendieck fibration

      like a functor for products

  8. Dec 2023
    1. An interesting case is that of map :: (a -> b) -> [a] -> [b]. We note that both the input and output of this function are lists, and thus might suspect the function can be written as either a catamorphism or an anamorphism. And indeed, it can be:

      unless you defined ana/cata using map

  9. Nov 2023
    1. This means that the version of Agda you’re pinning needs to align with the version of Agda installed globally.

      Not necessarily. If you install the emacs package agda2-mode globally (which e.g. allows you to use the agda-input-method globally), but not agda, it will pick up the local agda executable from the path, which you can set as described below. You might still get a mismatch between your globally installed agda-mode and the agda version on your path, but you can execute C-c + C-x + C-s and pass it an empty string. This calls agda2-set-program-version and tells it to use the agda and agda-mode executables from PATH, which have the correct local versions.

    2. So, follow along to set up this combination of incredibly niche tools that you almost certainly have zero interest in. 😜

      the fact that many readers of this blogposts probably encounter it searching for "agda" and "nix" prbly preselects an audience that almost certainly has quite a big interest in this precise combination of tools

    1. alternatively, we could have updated the bounds in the return type to ensure they include the inserted element

      that one would seem to make more sense but it causes green slime. Feel like the tradeoffs should be addressed.

    2. lookup

      this isn't proven correct. We have lkp x t = x \in t, but not x \nin t <=> lkp x t = nothing. Basically it is only a partial decision procedure for

    3. y

      does this somehow become an implicit argument? It seems so from later uses, but how do generalized variables decide when to generalize implicitly? More importantly, its type was earlier declared to be A, but it should be [ A ]∞ ?? Ok so it appears that the generalized vars can be instantiated to different things – I don't know if at a term- or module level. Ok so if you look at the next line, already they're instantiated to something else. So apparently you can do this even at the clause level. Btw the source code for this blog can be found at https://github.com/jespercockx/agda2scheme/blob/12ff5dcaebfe38dfbfdb48d4fb97bbbe2aa792d9/test/formalize-all-the-things.agda, there doesn't seem to be a lagda file though.

    4. To do this, we define an ‘instance’ that automatically constructs a proof of m ≤ n when m and n are natural number literals.

      Ok so yet another redundancy where you can express your decision procedure in a different format…

    5. Note how A and B are implicitly quantified in the type of mapMaybe!

      Could one also write: agda data Maybe : Set where just : A → Maybe A nothing : Maybe A ? For maximum confusion, as it were

  10. Oct 2023
  11. www.thefreedictionary.com www.thefreedictionary.com
  12. Jan 2022
    1. This is a a bit of a hack, but we don’t really expect getRouteFor to ever return Nothing, as that would mean we have been asked to add a menu entry for a file that will not exist on the site.

      silent failure is never good. Often 'the impossible' happens. Do sanity checks, assertions

  13. Dec 2021
  14. Jun 2021
  15. Oct 2019