Login
You're viewing the functional.cafe public feed.

Replies

  • Nov 25, 2026, 12:44 AM

    @ncf Ah, cool! I didn't know that. (But I guess I can't have the symbol be an actual colon?) Next step would be to have something like "term : type1 = type2 = type3" to show to the human reader how some definitional equalities are being applied.

    💬 1🔄 0⭐ 0
  • Nov 25, 2026, 12:48 AM

    @jeanas no actual colon. you can definitely do that by making the same syntax declaration for your favourite unicode equality symbol (with the correct fixity), but maybe that's a bit weird

    💬 1🔄 0⭐ 0
  • Nov 25, 2026, 1:00 AM

    @jeanas okay, less weird:

    _=_ : ∀ {ℓ} {A : Type ℓ} (a b : A) ⦃ _ : a ≡ b ⦄ → A
    a = b = a

    (this uses the fact that refl is an instance constructor for the built-in equality type)

    💬 1🔄 0⭐ 0
  • Nov 25, 2026, 1:10 AM

    @jeanas oh, and you can do type ascriptions without a syntax declaration this way too:

    _∈_ : ∀ {ℓ} {A : Type ℓ} (a : A) (B : Type ℓ) ⦃ _ : A ≡ B ⦄ → A
    a ∈ A = a
    💬 0🔄 0⭐ 0