{"action":"created","issue":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/925","labels_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/925/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/925/comments","events_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/925/events","html_url":"https://github.com/elm-lang/elm-compiler/issues/925","id":73552284,"number":925,"title":"Mailbox not in the scope","user":{"login":"MangelMaxime","id":4760796,"avatar_url":"https://avatars.githubusercontent.com/u/4760796?v=3","gravatar_id":"","url":"https://api.github.com/users/MangelMaxime","html_url":"https://github.com/MangelMaxime","followers_url":"https://api.github.com/users/MangelMaxime/followers","following_url":"https://api.github.com/users/MangelMaxime/following{/other_user}","gists_url":"https://api.github.com/users/MangelMaxime/gists{/gist_id}","starred_url":"https://api.github.com/users/MangelMaxime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MangelMaxime/subscriptions","organizations_url":"https://api.github.com/users/MangelMaxime/orgs","repos_url":"https://api.github.com/users/MangelMaxime/repos","events_url":"https://api.github.com/users/MangelMaxime/events{/privacy}","received_events_url":"https://api.github.com/users/MangelMaxime/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-06T08:17:18Z","updated_at":"2015-05-06T23:42:44Z","closed_at":null,"body":"I have a problem when I tried to access a mailbox from another module.\r\n\r\nHere are my files :\r\n\r\n    -- Main.elm\r\n    import Router               exposing (Route, match, (:->))\r\n    import History              exposing (path)\r\n    import Routing as Routing   exposing (route)\r\n    import Signal               exposing ((<~))\r\n    import Html                 exposing (Html)\r\n    import Signal               exposing (Mailbox, mailbox, Signal)\r\n    import Task                 exposing (Task)\r\n    import Test as Test exposing (pathChangeMailbox)\r\n    \r\n    main : Signal Html\r\n    main = route <~ path\r\n    \r\n    port runTask : Signal (Task error())\r\n    port runTask = \r\n        pathChangeMailbox.signal\r\n\r\nThis module `Test` is to handle a common mailbox. I could use a mailbox by page but it's ugly so I tried make a module to handle all the common code.\r\n\r\n    -- Test.elm\r\n    module Test where\r\n    \r\n    import Signal               exposing (Mailbox, mailbox, Signal)\r\n    import Task                 exposing (Task)\r\n    \r\n    pathChangeMailbox : Mailbox (Task error ())\r\n    pathChangeMailbox = mailbox (Task.succeed())\r\n\r\n\r\nI also have a module `Routing` to list the route and associate action to them.\r\n\r\nmodule Routing where\r\n    \r\n    -- Routing.elm\r\n    import Html             exposing (Html, div, text, br)\r\n    import Signal           exposing (Mailbox, mailbox, Signal)\r\n    import Task             exposing (Task)\r\n    import Router           exposing (match, (:->), Route)\r\n    \r\n    -- Import displays\r\n    import CV as CV         exposing (display)\r\n    import Home as Home     exposing (display)\r\n    \r\n    route : Route Html\r\n    route = match\r\n        [ \r\n          \"/src/Main.elm\"   :-> Home.display\r\n        , \"/CV.elm\"         :-> CV.display\r\n        ] display404\r\n    \r\n    display404 : String -> Html\r\n    display404 url =  \r\n      div []\r\n        [\r\n          text \"Erreur 404\"\r\n        , br [] []\r\n        , text (\"url : \" ++ url ++ \" not found.\")\r\n        ]\r\n\r\nAnd here is the module to handle the menu, and so the navigation.\r\n\r\n    -- Menu.elm\r\n    module Menu where\r\n    \r\n    import Html             exposing (a, text, Html, div)\r\n    import Html.Events      exposing (onClick)\r\n    import Task             exposing (Task)\r\n    import History          exposing (setPath)\r\n    import Test as Test exposing (pathChangeMailbox)\r\n    \r\n    display : String -> Html\r\n    display _ =\r\n      div []\r\n        [\r\n          a []\r\n          [ onClick Test.pathChangeMailbox.address (setPath \"/CV.elm\") ]\r\n          [ text \"Mon CV\" ]\r\n        ]\r\n\r\nWhen I try to run the program I got the following error :\r\n\r\n    Error in .\\src\\Menu.elm:\r\n    \r\n    Error on line 14, column 22 to 47:\r\n    Could not find variable 'Test.pathChangeMailbox.address'.\r\n    \r\n    Looks like the prefix 'Test.pathChangeMailbox' is not in scope. Is it spelled correctly?\r\n    Is it imported correctly?\r\n    \r\n    You can read about how imports work at the following address:\r\n\r\n\r\nI also this code for the Menu.elm :\r\n\r\n    module Menu where\r\n    \r\n    import Html             exposing (a, text, Html, div)\r\n    import Html.Events      exposing (onClick)\r\n    import Task             exposing (Task)\r\n    import History          exposing (setPath)\r\n    import Test \r\n    \r\n    display : String -> Html\r\n    display _ =\r\n        div []\r\n            [\r\n                a []\r\n                [ onClick pathChangeMailbox.address (setPath \"/CV.elm\") ]\r\n                [ text \"Mon CV\" ]\r\n            ]\r\n\r\nAnd this times I get this error :\r\n```\r\nError in .\\src\\Menu.elm:\r\n\r\nError on line 14, column 17 to 34:\r\nCould not find variable 'pathChangeMailbox'.\r\n\r\nMaybe you forgot to say which module it came from?\r\nClose qualified names include:\r\n   Test.pathChangeMailbox\r\n\r\nYou can read about how imports work at the following address:\r\n```\r\n\r\nSo I think, there a bug as I can't access the Mailbox from another module. It would be really ugly to have to handle one mailbox by page with one port associate for each to.\r\n\r\nEdit : Here is my elm-package.json :\r\n\r\n```\r\n{\r\n    \"version\": \"1.0.0\",\r\n    \"summary\": \"helpful summary of your project, less than 80 characters\",\r\n    \"repository\": \"https://github.com/USER/PROJECT.git\",\r\n    \"license\": \"BSD3\",\r\n    \"source-directories\": [\r\n        \"src\"\r\n    ],\r\n    \"exposed-modules\": [],\r\n    \"dependencies\": {\r\n        \"TheSeamau5/elm-history\": \"1.0.0 <= v < 2.0.0\",\r\n        \"TheSeamau5/elm-router\": \"1.0.0 <= v < 2.0.0\",\r\n        \"elm-lang/core\": \"2.0.1 <= v < 3.0.0\",\r\n        \"evancz/elm-html\": \"3.0.0 <= v < 4.0.0\"\r\n    },\r\n    \"elm-version\": \"0.15.0 <= v < 0.16.0\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/comments/99646419","html_url":"https://github.com/elm-lang/elm-compiler/issues/925#issuecomment-99646419","issue_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/925","id":99646419,"user":{"login":"MangelMaxime","id":4760796,"avatar_url":"https://avatars.githubusercontent.com/u/4760796?v=3","gravatar_id":"","url":"https://api.github.com/users/MangelMaxime","html_url":"https://github.com/MangelMaxime","followers_url":"https://api.github.com/users/MangelMaxime/followers","following_url":"https://api.github.com/users/MangelMaxime/following{/other_user}","gists_url":"https://api.github.com/users/MangelMaxime/gists{/gist_id}","starred_url":"https://api.github.com/users/MangelMaxime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MangelMaxime/subscriptions","organizations_url":"https://api.github.com/users/MangelMaxime/orgs","repos_url":"https://api.github.com/users/MangelMaxime/repos","events_url":"https://api.github.com/users/MangelMaxime/events{/privacy}","received_events_url":"https://api.github.com/users/MangelMaxime/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T23:42:44Z","updated_at":"2015-05-06T23:42:44Z","body":"If it's was the case why when I fully import Test by `import Test ` et using it with `[ onClick pathChangeMailbox.address (setPath \"/CV.elm\") ]`it's saying an error ?\r\n\r\nI mean here, I have only one dot."}}