@@ -31,26 +31,28 @@ abstract type Distribution{T} end
3131
3232Base. eltype (:: Type{Distribution{T}} ) where {T} = T
3333
34- struct Distribution0 {T} <: Distribution{T} end
34+ abstract type Combine {T} <: Distribution{T} end
3535
36- Distribution ( :: Type{T} ) where {T} = Distribution0 {T} ()
36+ struct Combine0 {T} <: Combine {T} end
3737
38- struct Distribution1{T,X} <: Distribution{T}
38+ Combine (:: Type{T} ) where {T} = Combine0 {T} ()
39+
40+ struct Combine1{T,X} <: Combine{T}
3941 x:: X
4042end
4143
42- Distribution (:: Type{T} , x:: X ) where {T,X} = Distribution1 {T,X} (x)
43- Distribution (:: Type{T} , :: Type{X} ) where {T,X} = Distribution1 {T,Type{X}} (X)
44+ Combine (:: Type{T} , x:: X ) where {T,X} = Combine1 {T,X} (x)
45+ Combine (:: Type{T} , :: Type{X} ) where {T,X} = Combine1 {T,Type{X}} (X)
4446
45- struct Distribution2 {T,X,Y} <: Distribution {T}
47+ struct Combine2 {T,X,Y} <: Combine {T}
4648 x:: X
4749 y:: Y
4850end
4951
50- Distribution (:: Type{T} , x:: X , y:: Y ) where {T,X,Y} = Distribution2 {deduce_type(T,X,Y),X,Y} (x, y)
51- Distribution (:: Type{T} , :: Type{X} , y:: Y ) where {T,X,Y} = Distribution2 {deduce_type(T,X,Y),Type{X},Y} (X, y)
52- Distribution (:: Type{T} , x:: X , :: Type{Y} ) where {T,X,Y} = Distribution2 {deduce_type(T,X,Y),X,Type{Y}} (x, Y)
53- Distribution (:: Type{T} , :: Type{X} , :: Type{Y} ) where {T,X,Y} = Distribution2 {deduce_type(T,X,Y),Type{X},Type{Y}} (X, Y)
52+ Combine (:: Type{T} , x:: X , y:: Y ) where {T,X,Y} = Combine2 {deduce_type(T,X,Y),X,Y} (x, y)
53+ Combine (:: Type{T} , :: Type{X} , y:: Y ) where {T,X,Y} = Combine2 {deduce_type(T,X,Y),Type{X},Y} (X, y)
54+ Combine (:: Type{T} , x:: X , :: Type{Y} ) where {T,X,Y} = Combine2 {deduce_type(T,X,Y),X,Type{Y}} (x, Y)
55+ Combine (:: Type{T} , :: Type{X} , :: Type{Y} ) where {T,X,Y} = Combine2 {deduce_type(T,X,Y),Type{X},Type{Y}} (X, Y)
5456
5557deduce_type (:: Type{T} , :: Type{X} , :: Type{Y} ) where {T,X,Y} = _deduce_type (T, Val (isconcrete (T)), eltype (X), eltype (Y))
5658deduce_type (:: Type{T} , :: Type{X} ) where {T,X} = _deduce_type (T, Val (isconcrete (T)), eltype (X))
9193Exponential (:: Type{T} = Float64) where {T<: AbstractFloat } = Exponential1 {T} ()
9294Exponential (θ:: T ) where {T<: AbstractFloat } = Exponentialθ (θ)
9395
94- # ## floats
96+ # ### floats
9597
9698abstract type FloatInterval{T<: AbstractFloat } <: Uniform{T} end
9799abstract type CloseOpen{T<: AbstractFloat } <: FloatInterval{T} end
@@ -119,6 +121,7 @@ Base.eltype(::Type{<:FloatInterval{T}}) where {T<:AbstractFloat} = T
119121
120122const BitFloatType = Union{Type{Float16},Type{Float32},Type{Float64}}
121123
124+
122125# ## Sampler
123126
124127abstract type Sampler{E} end
0 commit comments