# REPL output for subtype of Function

**URL:** https://discourse.julialang.org/t/repl-output-for-subtype-of-function/5997
**Category:** General Usage
**Created:** [September 20, 2017, 1:00pm UTC](https://discourse.julialang.org/t/repl-output-for-subtype-of-function/5997 "2017-09-20T13:00:00Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [September 20, 2017, 3:15pm UTC](https://discourse.julialang.org/t/repl-output-for-subtype-of-function/5997/2 "2017-09-20T15:15:35Z")

</div>

```julia
julia> struct Foo <: Function end

julia> Base.show(io::IO, ::MIME"text/plain", ::Foo) = print(io, "Hello")

julia> Foo()
Hello

```

> [@Show for supertype](https://discourse.julialang.org/t/show-for-supertype/5375):
>
> I am trying to organize printing for a set of types the following way: a generic function returns a string representation, then show for the supertype just prints it. MWE: abstract type MyAbstractFun \<: Function end Base.show(io::IO, f::MyAbstractFun) = println(io, representation(f)) struct One \<: MyAbstractFun end (::One)(x) = x+1 representation(::One) = "just adds one" but then evaluating at the REPL (ie going through display) gives me the standard printing from Base, while show works correc…

---

_[View the full topic](https://discourse.julialang.org/t/repl-output-for-subtype-of-function/5997)._
