package nl.utwente.group10.haskell.type;

import com.google.common.base.Joiner;

/**
 * Type of a Haskell function.
 */
public class FuncT extends ConstT {
    /**
     * @param arg The argument type that this function type accepts.
     * @param result The result type that this function type returns.
     */
    public FuncT(final Type arg, final Type result) {
        super("->", arg, result);
    }

    @Override
    public final String toHaskellType() {
        return "(" + Joiner.on(" -> ").join(this.getArgs()) + ")";
    }
}

@@ -467,65 +467,378 @@
     
-return %22(%22 + Joiner.on(%22 -%3E %22).join(this.getArgs()) + %22)%22
+final StringBuilder out = new StringBuilder();%0A        final Type%5B%5D args = this.getArgs();%0A%0A        out.append(%22(%22);%0A%0A        for (int i = 0; i %3C args.length; i++) %7B%0A            out.append(args%5Bi%5D.toHaskellType());%0A%0A            if (i + 1 %3C args.length) %7B%0A                out.append(%22 -%3E %22);%0A            %7D%0A        %7D%0A%0A        out.append(%22)%22);%0A        return out.toString()
 ;%0A  

Fix toString of FuncT