{"action":"created","issue":{"url":"https://api.github.com/repos/purescript-contrib/purescript-dom/issues/9","labels_url":"https://api.github.com/repos/purescript-contrib/purescript-dom/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/purescript-contrib/purescript-dom/issues/9/comments","events_url":"https://api.github.com/repos/purescript-contrib/purescript-dom/issues/9/events","html_url":"https://github.com/purescript-contrib/purescript-dom/issues/9","id":98619659,"number":9,"title":"Expanding the library","user":{"login":"garyb","id":693642,"avatar_url":"https://avatars.githubusercontent.com/u/693642?v=3","gravatar_id":"","url":"https://api.github.com/users/garyb","html_url":"https://github.com/garyb","followers_url":"https://api.github.com/users/garyb/followers","following_url":"https://api.github.com/users/garyb/following{/other_user}","gists_url":"https://api.github.com/users/garyb/gists{/gist_id}","starred_url":"https://api.github.com/users/garyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyb/subscriptions","organizations_url":"https://api.github.com/users/garyb/orgs","repos_url":"https://api.github.com/users/garyb/repos","events_url":"https://api.github.com/users/garyb/events{/privacy}","received_events_url":"https://api.github.com/users/garyb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-02T16:16:22Z","updated_at":"2015-08-02T17:10:11Z","closed_at":null,"body":"While we do have `purescript-simple-dom` now I'm not a huge fan of it's design and it's not as rapidly updated/released as stuff in contrib, so I'd like to avoid depending on it in Halogen and the like (I'm pretty sure @jdegoes agrees with this too).\r\n\r\n[Recently I mentioned](https://github.com/purescript/purescript/issues/1280#issuecomment-122540847) doing something like this:\r\n``` purescript\r\nclass Node a\r\n\r\ninstance nodeDocument :: Node Document \r\ninstance nodeElement :: Node Element\r\n\r\nappendChild :: forall a b e. (Node a, Node b) => a -> b -> Eff (dom :: DOM | e) b\r\nappendChild = unsafeAppendChild\r\n\r\nforeign import unsafeAppendChild :: forall a b e. a -> b -> Eff (dom :: DOM | e) b\r\n```\r\n\r\nHow do we feel about expanding `purescript-dom` to be more comprehensive and following this model for its implementations?\r\n\r\n/cc @paf31 @joneshf @jdegoes @dylex @ethul @fluffynukeit @wildlyinaccurate or anyone with an interest in this :smile:"},"comment":{"url":"https://api.github.com/repos/purescript-contrib/purescript-dom/issues/comments/127045983","html_url":"https://github.com/purescript-contrib/purescript-dom/issues/9#issuecomment-127045983","issue_url":"https://api.github.com/repos/purescript-contrib/purescript-dom/issues/9","id":127045983,"user":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T17:10:11Z","updated_at":"2015-08-02T17:10:11Z","body":"That seems fine, but maybe on top of a lower-level API? Things like `IsEvent` could make for a saner \"classy API\" with things like `appendChild :: (IsNode n1, IsNode n2) => n1 -> n2 -> Eff (dom :: DOM | e) b`. It looks similar to the original approach, but the point is, you can't write an instance of `IsNode` without being able to write the coercion, and if the lower-level API doesn't provide that coercion somewhere, it wouldn't be possible without FFI hacks.\r\n\r\nI know it's a bit of an extreme stance not to use type classes at all, but I think if we want to attract beginners, having very simple APIs with which to do _something_ with familiar things like the DOM will be very important."}}