29 Matching Annotations
  1. 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.

  2. 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. either recur on a smaller input

      combine the results of recursive invocations on smaller input

    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

    2. core behavior

      business logic

  3. Mar 2024
    1. though it is always an opfibration.

      via the covariant induced Σ_f postcomposition functor

  4. 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

  5. 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

  6. 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. The proofs insert-sound₂ and insert-complete

      extrinsic verification

    4. {{l≤u : lower ≤ upper}}

      Conor also doesn't have this

    5. 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.

    6. data _≤∞_ : [ A ]∞ → [ A ]∞ → Set

      in the original, [_]∞ is a function to Set

    7. {{Ord-Nat}}

      why is it in instance brackets in its own definition by copattern matching?

    8. So (m < suc n)

      this means we don't have to pattern-match on the case {m = m}, {n = zero}

    9. 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…

    10. 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

    11. programs that produce proofs

      this means metaprogramming, unless one says "programs that are proofs", which is just programming.

  7. Oct 2023
  8. www.thefreedictionary.com www.thefreedictionary.com
    1. 4. To comply with the terms of (a debt or promise, for example).

      this is the sense in which the word is used in "to discharge a proof obligation"

  9. 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

  10. Dec 2021
    1. First time I've seen someone explicitly point out Hypothes.is! I'm currently trying to find a static site generator that will best suit me (I'm planning to make posts about Haskell and Nix in the beginning). I previously looked into https://utteranc.es/ as a comments system, but I do like the hypothes.is feature of comments being tied to particular text.

  11. Jun 2021
    1. meaning

      semantics

    2. no value

      again, undefined? though I suppose one would have to pass it @a as type parameter then, to inform ghc

    3. completely uninhabited

      except for undefined - and couldn't one use it if typeOf matches its argument with an _?

  12. Oct 2019