 
 (def type-to-sexp (type)
      (match type
-            (SimpleType name range)                     (Symbol name range)
-            (FunctionType arg-types return-type range)  (List (Cons (fn-symbol range)
-                                                              (Cons (List (types-to-sexp arg-types) range)
-                                                              (Cons (type-to-sexp return-type) Empty))) range)
-            (ComplexType name types range)              (List (Cons (Symbol name range) (types-to-sexp types)) range)))
+            (SimpleType name range)
+                (Symbol name range)
+            (FunctionType arg-types return-type range)
+                (List (Cons (fn-symbol range)
+                      (Cons (List (types-to-sexp arg-types) range)
+                      (Cons (type-to-sexp return-type) Empty))) range)
+            (ComplexType name types range)
+                (List (Cons (Symbol name range) (types-to-sexp types))
+                      range)))
 
 (def types-to-sexp (types)
      (list-map type-to-sexp types))
 
 (def constructor-to-sexp (constructor)
      (match constructor
-            (SimpleConstructor name range)         (Symbol name range)
-            (ComplexConstructor name types range)  (List (Cons (Symbol name range) (types-to-sexp types)) range)))
+            (SimpleConstructor name range)
+                (Symbol name range)
+            (ComplexConstructor name types range)
+                (List (Cons (Symbol name range) (types-to-sexp types))
+                      range)))
 
 (def constructors-to-sexp (constructors)
      (list-map constructor-to-sexp constructors))
 
 (def type-definition-to-sexp (type constructors range)
-     (List (list-concat (list (typ-symbol range) (type-to-sexp type)) (constructors-to-sexp constructors)) range))
+     (List (list-concat (list (typ-symbol range) (type-to-sexp type))
+                        (constructors-to-sexp constructors))
+           range))
 
 (def definition-to-sexp (definition)
      (match definition
-            (Result (TypeDefinition type constructors range))  (type-definition-to-sexp type constructors range)
-            (Result (OptOut sexp range))                       (List sexp range)
-            (Error  _)                                         (Symbol (list 33 33 33) (Range 0 0))))
+            (Result (TypeDefinition type constructors range))
+                (type-definition-to-sexp type constructors range)
+            (Result (OptOut sexp range))
+                (List sexp range)
+            (Error  _)
+                (Symbol (list 33 33 33) (Range 0 0))))
 
 (def definitions-to-sexps (definitions)
      (list-map definition-to-sexp definitions))


(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))))

(def sexp-to-complex-or-function-type (name parameters range)
     (match (function-type? name)


(def sexp-to-constructor (constructor)
     (match constructor
            (Symbol name range)
                (Result (SimpleConstructor name range))
            (List (Cons (Symbol name _) types) range)
                (sexp-to-complex-constructor name types range)
            (List _ range)
                (Error (MalformedConstructorError range))))

(def sexp-to-constructors (constructors)
     (result-of-list (list-map sexp-to-constructor constructors)))
