{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/haskell-ide/issues/1","labels_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1/comments","events_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1/events","html_url":"https://github.com/haskell/haskell-ide/issues/1","id":112786162,"number":1,"title":"Do plugins the same way as GHC","user":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-22T11:47:34Z","updated_at":"2015-10-24T09:59:01Z","closed_at":null,"body":"I'm thinking that a good way to implement plugins is by emulating ghc's plugin system, perhaps even calling functions from it.  Based on a quick look at the [DynamicLoading module](https://github.com/ghc/ghc/blob/master/compiler/main/DynamicLoading.hs), it seems like it'd be a good approach to just copy+modify the loadPlugin function. \r\n\r\nIt makes sense to have something similar to the [Plugin datatype](https://github.com/ghc/ghc/blob/master/compiler/main/Plugins.hs), and have a field per \"callback\".  Perhaps this is getting into details too early, but maybe these callbacks should be wrapped in Maybes, like the aptly named [Hooks datatype](https://downloads.haskell.org/~ghc/latest/docs/html/libraries/ghc-7.10.2/src/Hooks.html#Hooks). It's informative to know which things a particular plugin hooks into."},"comment":{"url":"https://api.github.com/repos/haskell/haskell-ide/issues/comments/150780155","html_url":"https://github.com/haskell/haskell-ide/issues/1#issuecomment-150780155","issue_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1","id":150780155,"user":{"login":"alanz","id":409607,"avatar_url":"https://avatars.githubusercontent.com/u/409607?v=3","gravatar_id":"","url":"https://api.github.com/users/alanz","html_url":"https://github.com/alanz","followers_url":"https://api.github.com/users/alanz/followers","following_url":"https://api.github.com/users/alanz/following{/other_user}","gists_url":"https://api.github.com/users/alanz/gists{/gist_id}","starred_url":"https://api.github.com/users/alanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanz/subscriptions","organizations_url":"https://api.github.com/users/alanz/orgs","repos_url":"https://api.github.com/users/alanz/repos","events_url":"https://api.github.com/users/alanz/events{/privacy}","received_events_url":"https://api.github.com/users/alanz/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T09:59:01Z","updated_at":"2015-10-24T09:59:01Z","body":"By \"custom Ide.hs\" approach do you mean the XMonad one suggested by @gracjan?\r\n\r\nJust for completeness, the plugin model could end up being defined as a set of internal service APIs and `haskell-ide` then has a section that offers integration for all the plugins as part of the project.\r\n\r\nPros\r\n\r\n  * simplicity\r\n\r\nCons\r\n\r\n  * forces everyone to have to install all the plugins\r\n  * makes it hard to bring in new/experimental plugins\r\n\r\nThis might be good to take as a very early approach to clarify what interfaces are needed, and then to break it out to the plugin architecture.\r\n\r\nThere is also the middle ground of using the XMonad approach, but then generating the config haskell file from a setup config that is deliberately simple, perhaps just a list of plugins to include, similar to `stack.yaml`\r\n\r\nAs a tool writer it is appealing to be able to provide the `haskell-ide` integration as one of the artefacts of the project, so it would offer access to the tool either as an exe, as a library, or as a plugin. I imagine this would be done by defining a function something like\r\n\r\n```haskell\r\ngetPluginInfo :: PluginInfo\r\n```\r\n\r\nHere the `PluginInfo` structure would provide a description of the facilities offered and or required.\r\n\r\n"}}