{"action":"closed","issue":{"url":"https://api.github.com/repos/yesodweb/yesod/issues/1519","repository_url":"https://api.github.com/repos/yesodweb/yesod","labels_url":"https://api.github.com/repos/yesodweb/yesod/issues/1519/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/yesod/issues/1519/comments","events_url":"https://api.github.com/repos/yesodweb/yesod/issues/1519/events","html_url":"https://github.com/yesodweb/yesod/issues/1519","id":329926815,"node_id":"MDU6SXNzdWUzMjk5MjY4MTU=","number":1519,"title":"yesod subsite function ","user":{"login":"yunis-ali","id":9249408,"node_id":"MDQ6VXNlcjkyNDk0MDg=","avatar_url":"https://avatars2.githubusercontent.com/u/9249408?v=4","gravatar_id":"","url":"https://api.github.com/users/yunis-ali","html_url":"https://github.com/yunis-ali","followers_url":"https://api.github.com/users/yunis-ali/followers","following_url":"https://api.github.com/users/yunis-ali/following{/other_user}","gists_url":"https://api.github.com/users/yunis-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/yunis-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunis-ali/subscriptions","organizations_url":"https://api.github.com/users/yunis-ali/orgs","repos_url":"https://api.github.com/users/yunis-ali/repos","events_url":"https://api.github.com/users/yunis-ali/events{/privacy}","received_events_url":"https://api.github.com/users/yunis-ali/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-06T15:45:58Z","updated_at":"2018-06-06T20:10:55Z","closed_at":"2018-06-06T20:10:55Z","author_association":"NONE","body":"Hi,\r\n\r\nI have an exposed function (a simple function with one Text argument, that performs IO operations and then returns a bool) in my subsite. But every time i call it from my main site `boolVal <- Sub.getVal \"abc\"` it throws the following error: \r\n\r\n`Couldn't match type ‘Sub’ with ‘App’'` <br />\r\n`Expected type: HandlerT App IO Bool` <br />\r\n`Actual type: HandlerT Sub (HandlerT master0 IO) Bool`\r\n\r\nsubsite code snippet\r\n\r\n`type SubHandler a = forall master. Yesod master => HandlerT Sub (HandlerT master IO) a`\r\n\r\n`getVal :: Text -> SubHandler Bool`\r\n`getVal name = do`\r\n    `-- some operations including IO`\r\n    `return False`\r\n\r\nmain site code snippet\r\n\r\n`import Sub`\r\n\r\n`getHomeR :: Handler Html`\r\n`getHomeR = do`\r\n    `boolVal <- Sub.getVal \"abc\"`\r\n    `defaultLayout $ do`\r\n        `$(widgetFile \"home/index\")`\r\n\r\n"}}
{"actor":{"display_login":"yunis-ali"}}