インデントされていないHaskellコードは非常にあいまいになる可能性があるため、これを行うことはほとんど不可能です(これを実行できるツールを自分で探していたので、これを応答として書いています)。
次のコードを検討してください。
describeList :: [a] -> String
describeList xs = "The list is " ++ what xs
where what [] = "empty."
what [x] = "a singleton list."
what xs = "a longer list."
いくつかの代替の有効な解釈も考えてみましょう。
-- top-level function "what" without type signature
describeList :: [a] -> String
describeList xs = "The list is " ++ what xs
where what [] = "empty."
what [x] = "a singleton list."
what xs = "a longer list."
-- same as above
describeList :: [a] -> String
describeList xs = "The list is " ++ what xs
where what [] = "empty."
what [x] = "a singleton list."
what xs = "a longer list."
-- There might be a `data String a b`, so `String describeList xs` is
-- a type. The clause then becomes a guarded pattern match (similar to
-- `let bar :: Int = read "1"`) with scoped type variables. The `where`
-- clause is still syntactically valid. The whole thing might not compile,
-- but a syntax tool can't know that.
describeList :: [a] -> String
describeList xs = "The list is " ++ what xs
where what [] = "empty."
what [x] = "a singleton list."
what xs = "a longer list."