[Haskell-cafe] GHC Extension Proposal: ArgumentBlock

Silvio Frischknecht silvio.frischi at gmail.com
Tue Sep 8 15:16:43 UTC 2015


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

Silvio


More information about the Haskell-Cafe mailing list