Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Last active April 11, 2017 12:55
Show Gist options
  • Select an option

  • Save puffnfresh/0e72dcd407d98102b79b7418eca62451 to your computer and use it in GitHub Desktop.

Select an option

Save puffnfresh/0e72dcd407d98102b79b7418eca62451 to your computer and use it in GitHub Desktop.
open import Data.Container using (Container; Shape; Position)
open import Data.Container.Combinator using (id)
open import Data.Container.FreeMonad using (_⋆C_)
open import Data.Sum using (inj₂)
open import Data.Unit.Base using (tt)
open import Level using (lift; _⊔_)
record M {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
coinductive
field
head : A
tail : B head → M A B
open M
ν : ∀ {ℓ} → Container ℓ → Set ℓ
ν C = M (Shape C) (Position C)
Partiality : ∀ {ℓ} → Set ℓ → Set ℓ
Partiality A = ν (id ⋆C A)
never : ∀ {ℓ} {A : Set ℓ} → Partiality A
head never = inj₂ (lift tt)
tail never = λ x → never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment