[GHC] #10884: Indentation requirements for parsing seem inconsistent

GHC ghc-devs at haskell.org
Tue Sep 15 13:35:18 UTC 2015


#10884: Indentation requirements for parsing seem inconsistent
-------------------------------------+-------------------------------------
              Reporter:  Samvh       |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.2
  (Parser)                           |
              Keywords:  parsing,    |  Operating System:  Unknown/Multiple
  indentation, do-notation           |
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 The "golden rule of indentation" does not seem to be strictly adhered to
 in all cases: there is an interaction between let/where clauses and do-
 notation that makes indentation requirements different in different
 situations:

 Example 1, parsed successfully:
 {{{#!hs
 f = let y = do
         Just 1
     in y
 }}}

 Example 2, causes an error:
 {{{#!hs
 f = let y =
         Just 1
     in y
 }}}

 Example 3, causes an error:
 {{{#!hs
 f = do
 Just 1
 }}}

 This behavior seems inconsistent to me.

 See also [http://stackoverflow.com/questions/32531508/haskell-parse-error-
 from-incorrect-indent].

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10884>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list