1
------------------------------------------------------------------------
2
-- The Agda standard library
4
-- M-types (the dual of W-types)
5
------------------------------------------------------------------------
10
open import Coinduction
12
-- The family of M-types.
14
data M {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
15
inf : (x : A) (f : B x → ∞ (M A B)) → M A B
19
head : ∀ {a b} {A : Set a} {B : A → Set b} →
23
tail : ∀ {a b} {A : Set a} {B : A → Set b} →
24
(x : M A B) → B (head x) → M A B
25
tail (inf x f) b = ♭ (f b)