package haskell.prelude;

import haskell.lang.AbstractData;
import haskell.lang.Exp;
import haskell.prelude.text.Show;

public abstract class AbstractShow<A extends AbstractShow<A>>
        extends AbstractData<A>
        implements Show<A> {

    protected AbstractShow() {
    }

    protected AbstractShow(final java.lang.String name) {
        super(name);
    }

    protected AbstractShow(
            final java.lang.String name,
            final Internal internal) {
        super(name, internal);
    }

    protected AbstractShow(final Exp<A> expression) {
        super(expression);
    }

    // ---- class Show

    /**
     * show x
     */
    public static String show(Show<?> x) {
        return x._show_();
    }

    /**
     * show this
     */
    public String _show_() {
        return String.valueOf(eval().toString());
    }

    public static Show.Support Show() {
        return Show;
    }

    static final Show.Support Show = new Show.Support();

}
