[Haskell-cafe] GHC Extension Proposal: ArgumentBlock

Roman Cheplyaka roma at ro-che.info
Tue Sep 8 16:28:42 UTC 2015


On 08/09/15 18:16, Silvio Frischknecht wrote:
>> Anything that is not Haskell 2010 is *by definition* a language 
>> extension. If you want to change the language, that is a discussion
>>  for Haskell' not GHC.
> 
> I'm not sure this is entirely true. In ghc file
> compiler/parser/Lexer.x it is stated.
> 
> -- Pushing a new implicit layout context.  If the indentation of the
> -- next token is not greater than the previous layout context, then
> -- Haskell 98 says that the new layout context should be empty; that is
> -- the lexer must generate {}.
> --
> -- We are slightly more lenient than this: when the new context is start
> ed
> -- by a 'do', then we allow the new context to be at the same
> indentation as
> -- the previous context.  This is what the 'strict' argument is for.
> 
> I think this means that the following is valid in ghc but not in
> haskell 98/2010.
> 
> main :: IO ()
> main = do
>     if True
>         then return ()
>         else do
>     return ()

That's still an extension (-XNondecreasingIndentation), just one enabled
by default.

Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150908/04844fe2/attachment.sig>


More information about the Haskell-Cafe mailing list