diff --git a/src/dist/inductive/list.jl b/src/dist/inductive/list.jl index 4b32db8d..36b48d66 100644 --- a/src/dist/inductive/list.jl +++ b/src/dist/inductive/list.jl @@ -31,9 +31,9 @@ end function one_of(l::List{T})::Opt.T{T} where T <: Dist match(l, [ - :Nil => () -> Opt.None(T), + :Nil => () -> Opt.OptNone(T), :Cons => (x, xs) -> @alea_ite if flip_reciprocal(length(l)) - Opt.Some(T, x) + Opt.OptSome(T, x) else one_of(xs) end diff --git a/src/dist/inductive/option.jl b/src/dist/inductive/option.jl index 38ce15f8..aaea36e0 100644 --- a/src/dist/inductive/option.jl +++ b/src/dist/inductive/option.jl @@ -3,21 +3,19 @@ export Opt module Opt using Alea - @type T{A} = None() | Some(A) - - Some(x) = Some(typeof(x), x) + @type T{A} = OptNone() | OptSome(A) function bind(f, T, x::Opt.T) @match x [ - None() -> None(T), - Some(x) -> f(x) + OptNone() -> OptNone(T), + OptSome(x) -> f(x) ] end function map(f, T, x::Opt.T) @match x [ - None() -> None(T), - Some(x) -> Some(T, f(x)) + OptNone() -> OptNone(T), + OptSome(x) -> OptSome(T, f(x)) ] end end