 
 (def sexp-to-function-type (name parameters range)
      (match parameters
-            (Cons (List arg-types _) (Cons return-type Empty))  (result-flatmap (fn (arg-types)
-                                                                (result-map     (fn (return-type)
-                                                                                    (FunctionType arg-types return-type range))
-                                                                                (sexp-to-type return-type)))
-                                                                                (sexp-to-types arg-types))
-            _                                          (Error (MalformedTypeError range))))
+            (Cons (List arg-types _) (Cons return-type Empty))
+                (result-flatmap (fn (arg-types)
+                (result-map     (fn (return-type)
+                    (FunctionType arg-types return-type range))
+                (sexp-to-type return-type)))
+                (sexp-to-types arg-types))
+            _
+                (Error (MalformedTypeError range))))
 
 (def sexp-to-complex-or-function-type (name parameters range)
      (match (function-type? name)


(def sexp-to-type (type)
     (match type
            (List (Cons (Symbol name _) parameters) range)  (sexp-to-complex-or-function-type name parameters range)
            (Symbol name range)                             (Result (SimpleType name range))
            (List _ range)                                  (Error (MalformedTypeError range))))

(def sexp-to-types (types)
     (result-of-list (list-map sexp-to-type types)))

(def sexp-to-definition' (kind name rest range)
     (match (type-definition? (symbol-name kind))
            True   (sexp-to-type-definition name rest range)
            False  (Result (OptOut (list-concat (list kind name) rest)
                                   range))))

(def sexp-to-definition (expression)
     (match expression
            (List (Cons kind (Cons name rest)) range)
                (sexp-to-definition' kind name rest range)
            (List _ range)
                (Error (MalformedDefinitionError range))
            (Symbol _ range)
                (Error (MalformedDefinitionError range))))

(def sexps-to-definitions (expressions)
     (list-map sexp-to-definition expressions))
