{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/purescript/issues/1924","repository_url":"https://api.github.com/repos/purescript/purescript","labels_url":"https://api.github.com/repos/purescript/purescript/issues/1924/labels{/name}","comments_url":"https://api.github.com/repos/purescript/purescript/issues/1924/comments","events_url":"https://api.github.com/repos/purescript/purescript/issues/1924/events","html_url":"https://github.com/purescript/purescript/issues/1924","id":138706819,"number":1924,"title":"Differences from Haskell, code sharing","user":{"login":"pkamenarsky","id":1443550,"avatar_url":"https://avatars.githubusercontent.com/u/1443550?v=3","gravatar_id":"","url":"https://api.github.com/users/pkamenarsky","html_url":"https://github.com/pkamenarsky","followers_url":"https://api.github.com/users/pkamenarsky/followers","following_url":"https://api.github.com/users/pkamenarsky/following{/other_user}","gists_url":"https://api.github.com/users/pkamenarsky/gists{/gist_id}","starred_url":"https://api.github.com/users/pkamenarsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkamenarsky/subscriptions","organizations_url":"https://api.github.com/users/pkamenarsky/orgs","repos_url":"https://api.github.com/users/pkamenarsky/repos","events_url":"https://api.github.com/users/pkamenarsky/events{/privacy}","received_events_url":"https://api.github.com/users/pkamenarsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-05T18:35:45Z","updated_at":"2016-03-07T21:57:59Z","closed_at":null,"body":"Has anyone tried sharing code between Haskell and Purescript? The main use case for me right now is data/form validation - I'd like to use the same code both on the server and the client. Sticking to Haskell2010 (or even 98) should be fine, validation logic is mostly simple anyway.\r\n\r\nDifferences like `Array` and `Boolean` are trivial - just make type aliases. `true = True` etc on the Haskell side should take care of lower case bools. Explicit `forall` in Haskell isn't gonna hurt.\r\n\r\nDestructuring records is one thing that may be a showstopper. If validation functions look like `String -> Boolean` that should be fine too.\r\n\r\nWhat else? I'm gonna try, but I'd be interested in hearing about other peoples' experience.\r\n\r\nEDIT: if code sharing is at all possible, I'd also be interested in hearing if this is something the Purescript community values, or if future changes might break Haskell interop. The freedom of not being tied to another language really makes things like the awesome record system possible, on the other hand sharing code is really nice too."},"comment":{"url":"https://api.github.com/repos/purescript/purescript/issues/comments/193473982","html_url":"https://github.com/purescript/purescript/issues/1924#issuecomment-193473982","issue_url":"https://api.github.com/repos/purescript/purescript/issues/1924","id":193473982,"user":{"login":"hdgarrood","id":1270186,"avatar_url":"https://avatars.githubusercontent.com/u/1270186?v=3","gravatar_id":"","url":"https://api.github.com/users/hdgarrood","html_url":"https://github.com/hdgarrood","followers_url":"https://api.github.com/users/hdgarrood/followers","following_url":"https://api.github.com/users/hdgarrood/following{/other_user}","gists_url":"https://api.github.com/users/hdgarrood/gists{/gist_id}","starred_url":"https://api.github.com/users/hdgarrood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdgarrood/subscriptions","organizations_url":"https://api.github.com/users/hdgarrood/orgs","repos_url":"https://api.github.com/users/hdgarrood/repos","events_url":"https://api.github.com/users/hdgarrood/events{/privacy}","received_events_url":"https://api.github.com/users/hdgarrood/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T21:57:59Z","updated_at":"2016-03-07T21:57:59Z","body":"Yeah, agreed. Maybe we should add a note to contributing.md too, saying that this sort of discussion belongs on the mailing list."}}