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
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
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
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
Indeed, being able to introduce a short name for the current module, or
having a fixed short name like 'This' or 'Self' would be neat.
The standard workaround for your example would be
import Prelude hiding (length,null)
Did you try a .hs-boot file with your self-import trick?
Cheers,
The other two work arounds are
1. Explicit import lists for the stuff you need.
2. Explicit export list for your module (which you do), and internally
use non-overloaded identifiers.
module AnnoyinglyLongModuleName
( AnnoyinglyLongModuleName.length
,
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
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.