RsTHighlightCodeAuto.lagda.rst 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ********************
  2. RsTHighlightCodeAuto
  3. ********************
  4. ..
  5. ::
  6. {-# OPTIONS --sized-types #-}
  7. module RsTHighlightCodeAuto where
  8. Mokou:
  9. So, what are you doing out this late?
  10. ::
  11. open import Agda.Builtin.Size
  12. open import Agda.Primitive
  13. Marisa:
  14. Harvesting bamboo shoots.
  15. ::
  16. variable
  17. i : Size
  18. -- Alice:
  19. -- A trial of guts.
  20. ℓ : Level
  21. -- Mokou:
  22. -- Uh, which one is it?
  23. Comment tests ↑
  24. ::
  25. A : Set ℓ
  26. -- Marisa:
  27. -- That should've been obvious...
  28. ::
  29. record Thunk {ℓ} (F : Size → Set ℓ) (i : Size) : Set ℓ where
  30. coinductive
  31. Mokou:
  32. The medicine? You mean the Hourai Elixir?
  33. I consumed it a long time ago.
  34. Thanks to the elixir, I am immortal even now.
  35. Kaguya still tries to kill me.
  36. But it's impossible.
  37. This meaningless conflict has dragged on for over a thousand years.
  38. ::
  39. field force : {j : Size< i} → F j
  40. open Thunk public
  41. Marisa:
  42. I get it. I understand now...
  43. So, you're playing the role of the ghost in the haunted house.
  44. I was suspicious when I first heard about this "trial of guts" thing from Kaguya.
  45. She must have thought that I, who defeated her, might be able to crush you.
  46. ::
  47. data Conat (i : Size) : Set where
  48. zero : Conat i
  49. suc : Thunk Conat i → Conat i
  50. Alice:
  51. Wait, aren't you stealing all the credit for yourself?
  52. Besides, crushing humans is a youkai's role.
  53. The human before us is obviously mine to crush.
  54. ::
  55. infinity : Conat i
  56. infinity = suc λ where .Thunk.force → infinity
  57. Mokou:
  58. What, Kaguya was defeated?
  59. By the two of you who stand before me?
  60. That's quite surprising. That troublesome Lunarian was defeated by such a team...
  61. It's been a long time since I've confronted such tough assassins.
  62. Or maybe the only thing that's tough about them is their guts?
  63. ::
  64. open import Agda.Builtin.Nat
  65. fromℕ : Nat → Conat ∞
  66. fromℕ zero = zero
  67. fromℕ (suc n) = suc λ where .Thunk.force → fromℕ n
  68. Alice:
  69. It's too bad about that Hourai Elixir.
  70. I wanted it for my collection.
  71. ::
  72. -- Why can't we have goals in literate Agda mode?