package nl.utwente.group10.haskell.type;

import nl.utwente.group10.haskell.HaskellObject;

import java.util.logging.Logger;

/**
 * Abstract class for Haskell types. Provides an interface for common methods.
 */
public abstract class Type extends HaskellObject {
    /** Logger instance for types. */
    protected Logger logger = Logger.getLogger(Type.class.getName());

    /**
     * Prunes the type subtree and returns the resolved type for this type. The resolved type can be this type itself.
     * @return The pruned type of this type.
     */
    public abstract Type prune();

    /**
     * @return The Haskell (type) representation of this type.
     */
    public abstract String toHaskellType();

    @Override
    public abstract String toString();
}

@@ -458,46 +458,704 @@
 The 
-resolved type can be this type itself.
+inferred type can be this type itself.%0A     *%0A     * During the unify progress of the Hindley-Milner algorithm, a type might be unified with another type. This means%0A     * that for some types a more concrete type can be used instead. For example, a variable type 'a' could be unified%0A     * with a constant type 'Int', in which case you could use 'Int' in all places where 'a' is used (and means the%0A     * same). Pruning makes sure that you are using a concrete type where possible and can be used to provide a better%0A     * output to end users.%0A     *%0A     * Pruning is not needed to provide correct type inference, but can be used without losing correct inference in the%0A     * future.%0A     *
 %0A   

Extend prune documentation