Skip to content

Terse print of types for Mill.jl data structures. Error messages were never more concise.

License

Notifications You must be signed in to change notification settings

CTUAvastLab/PrintTypesTersely.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrintTypesTersely

Build Status Coverage Status codecov.io

When working with recursive structures containing parametric types, printing types (e.g. in error) gets very verbose.

PrintTypesTersely modifies printing types so only the first type is printed.

By default the functionality is turned off, but you can turn it on by:

using PrintTypesTersely
PrintTypesTersely.on()

now it starts to shorten types print. So instead of e.g. A{Union{Int, Missing}}, you'll see only A{…}. You can disable this behavior by

PrintTypesTersely.on()

or you can enable the behavior only for some block of code using

PrintTypesTersely.with_state(true) do
    @test repr(A{Vector{Int}}) == "A{…}"
    @test repr(A{Union{Int, Missing}}) == "A{…}"
    @test repr(B{Int, Float32}) == "B{…}"
    @test repr(B{Int}) == "B{…}"
end

That's all, basically.

The default value is false by default, because when turned on, it breaks compilation of some packages.

About

Terse print of types for Mill.jl data structures. Error messages were never more concise.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages