Hiding import behaviour

htebalaka goodingm at gmail.com
Tue Oct 21 16:45:05 UTC 2014


The current situation could be summed up as requiring some code duplication
when explicitly importing (due to the possibility of one or more redundant
hides), while encouraging a sort of measure-twice-cut-once mentality. Not
suggesting changing the default; I'll have a proposal detailing the exact
semantics and possible consequences of using it on the wiki on Thursday, so
that more people can weigh in.


Erik Hesselink wrote
> On Tue, Oct 21, 2014 at 4:55 PM, Mario Blažević <

> mblazevic@

> > wrote:
>> On 14-10-21 07:14 AM, Erik Hesselink wrote:
>>>
>>> On Mon, Oct 20, 2014 at 11:57 PM, Mario Blažević <

> mblazevic@

> >
>>> wrote:
>>>>          No, what I find much worse is a cabal update causing an error
>>>> in
>>>> a
>>>> module that was correct before the update. Consider
>>>>
>>>>> module Main where
>>>>>
>>>>> import Foo (foo)
>>>>> import Bar
>>>>>
>>>>> main = foo
>>>>
>>>>
>>>>          Now suppose Bar came from the package bar-1.0, and the new
>>>> version
>>>> bar-1.0.1 decides to export foo. With the current behaviour, this
>>>> change
>>>> would break my module. With Malcolm's proposal the old code would
>>>> continue
>>>> to work.
>>>
>>>
>>> That's a very good point. Given that and the above, I don't understand
>>> your conclusion:
>>>
>>>>          Anyway, count me as +1 on the proposal. It would improve the
>>>> long-term stability of Haskell code.
>>>
>>>
>>> How is adding more ways to break something "improving the long-term
>>> stability"?
>>
>>
>>         You seem determined to misunderstand every message in this
>> thread.
>> What I said was that the change from bar-1.0 to bar-1.0.1 breaks the
>> example
>> code *with the current behaviour*. The proposal removes this breakage.
>> Anything that keeps the old code compiling and working with new libraries
>> improves its long-term stability in my book.
>>
>>         Note that the bar-1.0.1 upgrade wasn't even a major version
>> change.
>> This is correct according to the PVP:
> 
> You're right, I misread your message. I understand now, and you're
> right that this is currently something that can break your package,
> although it happens so rarely that people still depend on major
> version ranges, even though they sometimes don't use explicit or
> qualified imports.
> 
> Regards,
> 
> Erik
> _______________________________________________
> Glasgow-haskell-users mailing list

> Glasgow-haskell-users@

> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users





--
View this message in context: http://haskell.1045720.n5.nabble.com/Hiding-import-behaviour-tp5758155p5758451.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.


More information about the Glasgow-haskell-users mailing list