The namespaces get 'merged' - ie. if you do:
module A exposing (a, b, c)
---
module B exposing (d, e, f)
---
module C exposing (..)
import A
import B as A
then nothing's wrong - you can do A.a through to A.f without a problem.
Problems happen when collision happens, ie.
module B exposing (c)
The compiler will then tell you that the imports are ambiguous.
On Friday, August 19, 2016 at 11:29:00 AM UTC+2, John Bugner wrote:
>
> Why are duplicate imports allowed in the first place?
>
> On Friday, August 19, 2016 at 2:20:50 AM UTC-5, Martin Janiczek wrote:
>>
>> Hello,
>>
>> I've been stumped by a compiler error which I can't figure out. I think
>> it's a compiler bug. (I'd like to maybe help fix that and contribute a PR -
>> even though it might get incorporated into elm-compiler waaaay later or not
>> at all, I could have my own elm-compiler and continue on the project :) )
>>
>> import Fuzz exposing (Fuzzer)
>> import Random.Pcg as Random
>> import Random.Extra as Random
>> import Shrink
>>
>>
>> type alias Op op =
>> { generator : Random.Generator op }
>>
>>
>> opsFuzzer : List (Op op) -> Fuzzer (List op)
>> opsFuzzer ops =
>> Fuzz.custom
>> (Random.together (List.map .generator ops))
>> (Shrink.list Shrink.noShrink)
>>
>>
>> -- TYPE MISMATCH -----------------------------------------------------
>> src/A.elm
>>
>> The type annotation for `opsFuzzer` does not match its definition.
>>
>> 21| opsFuzzer : List (Op op) -> Fuzzer (List op)
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> The type annotation is saying:
>>
>> List { generator : Random.Generator b } -> Fuzzer (List b)
>>
>> But I am inferring that the definition has this type:
>>
>> List { generator : Random.Generator a } -> Fuzzer (List b)
>>
>> -- TYPE MISMATCH -----------------------------------------------------
>> src/A.elm
>>
>> The 1st argument to function `custom` is causing a mismatch.
>>
>> 23| Fuzz.custom
>> 24|> (Random.together (List.map .generator ops))
>> 25| (Shrink.list Shrink.noShrink)
>>
>> Function `custom` is expecting the 1st argument to be:
>>
>> Random.Generator a
>>
>> But it is:
>>
>> Random.Generator (List a)
>>
>> Detected errors in 1 module.
>>
>> (The larger codebase is here:
>> https://github.com/Janiczek/elm-test/commit/9b8323d4721cea0f0420c1440d31b79989b7528a
>> )
>>
>> The compiler is telling me my types don't match but I think they do (even
>> by substituting the types by hand).
>> Does anybody have any idea on what to do with this?
>>
>
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.