1
module DataValueInterfaces
2

3
"""
4
    nondatavaluetype(T)
5

6
For a type `T`, return the corresponding non-`DataValue` type, translating between
7
`Union{T, Missing}` and `DataValue{T}`.
8

9
For example, `nondatavaluetype(Int64)` returns `Int64`, while
10
`nondatavaluetype(DataValue{Int64})` returns `Union{Int64, Missing}`.
11

12
This generic function is owned by DataValueInterfaces.jl itself, which is the sole provider of the
13
default definition.
14
"""
15
function nondatavaluetype end
16

17 25
nondatavaluetype(::Type{T}) where {T} = T
18

19
"""
20
    datavaluetype(T)
21

22
For a type `T`, return the corresponding `DataValue` type, translating between 
23
`Union{T, Missing}` and `DataValue{T}`.
24

25
For example, `datavaluetype(Int64)` returns `Int64`, while
26
`datavaluetype(Union{Int64, Missing})` returns `DataValue{Int64}`.
27

28
This generic function is owned by DataValueInterfaces.jl itself, which is the sole provider of the
29
default definition.
30
"""
31
function datavaluetype end
32

33 25
datavaluetype(::Type{T}) where {T} = T
34

35
end # module

Read our documentation on viewing source code .

Loading