Skip to content

Commit

Permalink
Add missing show methods for Composed
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
Seelengrab committed Jul 2, 2024
1 parent 825731a commit 57edcfb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,20 @@ struct Composed{S,P,T} <: Data.Possibility{T}
end
end

function Base.show(io::IO, c::Composed{S}) where S
print(io, "@composed ", S, "(...)")
end

function Base.show(io::IO, ::MIME"text/plain", c::Composed{S,P,T}) where {S,P,T}
obj = example(c)
print(io, styled"""
{code,underline:$Composed\{$S\}}:
A {code:$Data.Possibility} generating {code:$T} through {code:$S}.
E.g. {code:$obj}""")
end

"""
@composed
Expand Down

0 comments on commit 57edcfb

Please sign in to comment.