package haskell.prelude;

import haskell.lang.Exp;

public abstract class AbstractNum<A extends AbstractNum<A>>
        extends AbstractEnum<A>
        implements Num<A> {

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

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

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

    // ---- class Num

    /**
     * this + x
     */
    @SuppressWarnings("unchecked")
    public final A _plus_(final A x) {
        return _Num_().plus((A) this, x);
    }

    /**
     * this - x
     */
    @SuppressWarnings("unchecked")
    public final A _minus_(final A x) {
        return _Num_().minus((A) this, x);
    }

    /**
     * this * x
     */
    @SuppressWarnings("unchecked")
    public final A _multiply_(final A x) {
        return _Num_().multiply((A) this, x);
    }

    protected abstract Num.Support<A> _Num_();

}
