toString e = concat $ print e
printSelectors :: [FieldSelector] -> [String]
-printSelectors fs = printersperse "." fs
+printSelectors fs = ["."] ++ printersperse "." fs
printFunCall :: String [Expr] [FieldSelector] -> [String]
printFunCall s args fs = [s, "(":printersperse "," args] ++ [")"] ++
var plus = \x y->x+y;
var g = map(plus, [1,2,3]);
- var is = map(\f->f(1), g);
+ //var is = map(\f->f(1), g);
//print("is.hd", is.hd);
+x() {
+ return [[1,2,3]];
+}
+
main() {
-
- var xs = [2];
- var ys = [1, True];
- var ls = [1, 2, True, 'a'];
+
+ var z = x().hd.hd;
}
\ No newline at end of file
_ = pure f
) >>= \newF->
fresh >>= \tv->case expected of
- FuncType t = pure (s1, t, (FunExpr p newF args fs))
- //TODO: Fieldselectors!
+ FuncType t = foldM foldFieldSelectors t fs >>= \returnType ->
+ pure (s1, returnType, (FunExpr p newF args fs))
_ = (let given = foldr (->>) tv argTs in
lift (unify expected given) >>= \s2->
applySubst s2 >>|