Why not have an editor that collapses them?On Tue, Apr 22, 2014 at 1:59 PM, Thiago Negri <evohunz@gmail.com> wrote:
_______________________________________________But I guess being able to issue them at the end of the module could make sense if you want to get the reader straight to the code.I'm against imports at the middle of the file.Likewise, we can use "where" statements to define names used in a function after using them, so they don't distract the reader.So, why not issue import statements at the bottom of a module file?When reading code, I find it quite distracting to have to get past the import list to reach the actual module code, as the import list can be (and often is) quite big.
A language pragma could be used to select between top imports or bottom imports (can't use both).
What do you think?Example:"""{-# LANGUAGE LateImports #-}module Foo wherebar :: String
bar = "quux"baz :: Fizbaz = mkFizimport Fiz (Fiz, mkFiz)
"""
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe