Make @with_kw structure display with detail all its parameters

Suppose that I use Parameters.jl and the following @with_kw structure:

using Parameters
using Dates
@with_kw struct Params @deftype Int
    #PARAMETERS
    foo = 5
    bar::Dict{String,Int}  = Dict("a"=>0,"b"=>1)
    time_limit::Period = Minute(30)
end


When creating an instance of this struct:

pars = Params()

When printing print(pars), I get the following:

Params
foo: Int64 5
bar: Dict{String, Int64}
time_limit: Minute

Which is fine for foo but not for bar and time_limit.

I would prefer (and also expect) the following that I hand typed:

Params
foo: Int64 5
bar: Dict{String, Int64} Dict{String, Int64} with 2 entries:  
 "b" => 1
 "a" => 0
time_limit: Minute 30 minutes 

Is that easily achievable? Why is the default printing method for a @with_kw struct does not display with details every types of variables?

Printing usually does not recurse into subfield. But I think PrettyPrinting.jl might be able to achieve what you want with relative ease.

Thank you for your reply.
I tried:

using PrettyPrinting
pprint(pars)

However, the output is the same as print(pars)

Params
foo: Int64 5
Dict{String, Int64}
time_limit: Minute     

Did I miss something?

isnt it show instead?

Try PrettyPrint.jl:

using PrettyPrint
pprint(pars)
# result:
Params( 
  foo=5,
  bar={"b" : 1, "a" : 0},
  time_limit=Minute(value=30,),
)