==================================
Multiple functions with where clauses
==================================

f = a
  where a = b
        b = 1

f = a
  where a = b
        b = 1

---

(module
  (function_declaration
    (variable_identifier)
    (function_body
      (variable_identifier)
      (where
        (function_declaration
          (variable_identifier)
          (function_body
            (variable_identifier)))
        (function_declaration
          (variable_identifier)
          (function_body
            (integer))))))
  (function_declaration
    (variable_identifier)
    (function_body
      (variable_identifier)
      (where
        (function_declaration
          (variable_identifier)
          (function_body
            (variable_identifier)))
        (function_declaration
          (variable_identifier)
          (function_body
            (integer)))))))

==================================
Nested Where layout
==================================

f = foo
  where a = b
          where c = d
                e = f
        x = w

---

(module
  (function_declaration
    (variable_identifier)
    (function_body
      (variable_identifier)
      (where
        (function_declaration
          (variable_identifier)
          (function_body
            (variable_identifier)
            (where
              (function_declaration
                (variable_identifier)
                (function_body (variable_identifier)))
              (function_declaration
                (variable_identifier)
                (function_body (variable_identifier))))))
        (function_declaration
          (variable_identifier)
          (function_body (variable_identifier)))))))

==================================
Nested Do layout
==================================

g = do a
       b
       do c
          d
          do e
             f
          g
       h

---

(module
  (function_declaration
    (variable_identifier)
    (function_body
      (do
        (variable_identifier)
        (variable_identifier)
        (do
          (variable_identifier)
          (variable_identifier)
          (do
            (variable_identifier)
            (variable_identifier))
          (variable_identifier))
        (variable_identifier)))))

==================================
Do And Where Layout
==================================

a = do
  b
    where
    c = d

a = do
  b
  where
    c = d

a = do
  b
  where
  c = d

---

(module
  (function_declaration
    (variable_identifier)
    (function_body
      (do
        (variable_identifier)
        (where
          (function_declaration
            (variable_identifier)
            (function_body (variable_identifier)))))))
  (function_declaration
    (variable_identifier)
    (function_body
      (do
        (variable_identifier)
        (where
          (function_declaration
            (variable_identifier)
            (function_body (variable_identifier)))))))
  (function_declaration
    (variable_identifier)
    (function_body
      (do
        (variable_identifier)
        (where
          (function_declaration
            (variable_identifier)
            (function_body (variable_identifier))))))))

==================================
Nested Let layout
==================================

f = let y = x
        x = let g = 1
                in g
        in y

---

(module
  (function_declaration
    (variable_identifier)
    (function_body
      (let_expression
        (function_declaration
          (variable_identifier)
          (function_body
            (variable_identifier)))
        (function_declaration
          (variable_identifier)
          (function_body
            (let_expression
              (function_declaration
                (variable_identifier)
                (function_body
                  (integer)))
              (in_clause
                (variable_identifier)))))
        (in_clause
          (variable_identifier))))))

==================================
Previous Problematic Layouts
==================================

class Foo bar where
  fooVariables :: bar -> [Baz]
{-
-}
class Foo1 bar where
  liftFoo = foldMap

freeFoo bar = case freeFoo bar of
  [n] -> Right n

---

(module
  (type_class_declaration
    (type_class_identifier)
    (type_variable_identifier)
    (where
      (type_signature
        (variable_identifier)
        (annotation)
        (function_type
          (type (type_variable_identifier))
          (type (list_type (type (type_constructor_identifier))))))
      (comment)))
  (type_class_declaration
    (type_class_identifier)
    (type_variable_identifier)
    (where
      (function_declaration
        (variable_identifier)
        (function_body (variable_identifier)))))
      (function_declaration
        (variable_identifier)
        (variable_identifier)
        (function_body
          (case_expression
            (function_application
              (variable_identifier)
              (variable_identifier))
            (alternative
              (list_pattern (pattern (variable_identifier)))
              (function_application (constructor_identifier) (variable_identifier)))))))
