Re: Aliasing current module qualifier

2014-09-30 Thread Iavor Diatchki
Hello, What semantics are you using for recursive modules? As far as I see, if you take a least fixed point semantics (e.g. as described in A Formal Specification for the Haskell 98 Module System, http://yav.github.io/publications/modules98.pdf ) this program is incorrect as the module does not

RE: Aliasing current module qualifier

2014-09-30 Thread Simon Peyton Jones
: Re: Aliasing current module qualifier Hello, What semantics are you using for recursive modules? As far as I see, if you take a least fixed point semantics (e.g. as described in A Formal Specification for the Haskell 98 Module System, http://yav.github.io/publications/modules98.pdf

Re: Aliasing current module qualifier

2014-09-30 Thread John Meacham
Yes, that is the semantics I use for recursive module imports in jhc. And you are right in that it does not accept those examples due to being unable to bootstrap the least fixed point. How would the 'as M' proposal interact? Would it actually be new entries in the name table or rewritten as a

Aliasing current module qualifier

2014-09-29 Thread Herbert Valerio Riedel
Hello *, Here's a situation I've encountered recently, which mades me wish to be able to define a local alias (in order to avoid CPP use). Consider the following stupid module: module AnnoyinglyLongModuleName ( AnnoyinglyLongModuleName.length , AnnoyinglyLongModuleName.null

Re: Aliasing current module qualifier

2014-09-29 Thread Jan Stolarek
On a somewhat related note, I'd love to be able to do this in Haskell: import Basics.Nat renaming (_≥_ to _≥ℕ_) (this is taken from Agda). Janek Dnia poniedziałek, 29 września 2014, Herbert Valerio Riedel napisał: Hello *, Here's a situation I've encountered recently, which mades me wish

Re: Aliasing current module qualifier

2014-09-29 Thread Christian Maeder
Hi, rather than disambiguating a name from the current module by an abbreviated module name, I would prefer a disambiguation as is done for local names that shadows existing bindings. Then only imported names would need to be qualified (possibly using shorter module names). So names of the

Re: Aliasing current module qualifier

2014-09-29 Thread Brandon Allbery
On Mon, Sep 29, 2014 at 4:19 AM, Herbert Valerio Riedel h...@gnu.org wrote: Now it'd be great if I could do the following instead: module AnnoyinglyLongModuleName (M.length, M.null) where import AnnoyinglyLongModuleName as M -- - does not work I think if I wanted this syntax, I'd

Re: Aliasing current module qualifier

2014-09-29 Thread John Meacham
You don't need a new language construct, what i do is: module AnnoyinglyLongModuleName (M.length, M.null) where import AnnoyinglongLongModuleName as M I think ghc would need to be extended a little to make this convienient as it doesn't handle recursive module imports as transparently.

Re: Aliasing current module qualifier

2014-09-29 Thread Brandon Allbery
On Mon, Sep 29, 2014 at 5:02 PM, John Meacham j...@repetae.net wrote: You don't need a new language construct, what i do is: module AnnoyinglyLongModuleName (M.length, M.null) where import AnnoyinglongLongModuleName as M Isn't that exactly what the OP said doesn't work? On Mon,