{"action":"created","issue":{"url":"https://api.github.com/repos/louthy/language-ext/issues/515","repository_url":"https://api.github.com/repos/louthy/language-ext","labels_url":"https://api.github.com/repos/louthy/language-ext/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/louthy/language-ext/issues/515/comments","events_url":"https://api.github.com/repos/louthy/language-ext/issues/515/events","html_url":"https://github.com/louthy/language-ext/issues/515","id":374976957,"node_id":"MDU6SXNzdWUzNzQ5NzY5NTc=","number":515,"title":"FP design with language-ext","user":{"login":"andyigreg","id":5914010,"node_id":"MDQ6VXNlcjU5MTQwMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/5914010?v=4","gravatar_id":"","url":"https://api.github.com/users/andyigreg","html_url":"https://github.com/andyigreg","followers_url":"https://api.github.com/users/andyigreg/followers","following_url":"https://api.github.com/users/andyigreg/following{/other_user}","gists_url":"https://api.github.com/users/andyigreg/gists{/gist_id}","starred_url":"https://api.github.com/users/andyigreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyigreg/subscriptions","organizations_url":"https://api.github.com/users/andyigreg/orgs","repos_url":"https://api.github.com/users/andyigreg/repos","events_url":"https://api.github.com/users/andyigreg/events{/privacy}","received_events_url":"https://api.github.com/users/andyigreg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-29T11:44:51Z","updated_at":"2018-10-29T15:52:55Z","closed_at":null,"author_association":"NONE","body":"This is more a general design question rather than an issue with the language-ext (which is fantastic), but I think my mental block over this issue is stopping me getting the most out of the library. So apologies of this is in the wrong place.\r\n\r\nBasically I have been using the library for a couple of years, adding in more and more functional techniques as I learn more, and I have read the book by Enrico. But I frequently run into this clash: fp design principles say push the impure code to the extremeties. And I try to do this. But I often encounter processes where the business logic will calculate something and then I need to conditionally retrieve data based on that something before passing that result to another set of pure functions.\r\n\r\nThis means I end up with more of a sandwich structure: impure-pure-impure-pure-impure which just feels wrong.\r\n\r\nOne solution is to try to load everything up front, anticipating what the dependencies might be. Even should this be possible it doesn't seem very efficient from a data access perspective.\r\n\r\nAnother is to split into multiple processes, but I'm struggling to see how to structure this given that one end of the process is UI and the other is data access. The middle bit is an internal decision. Maybe some event based structure?\r\n\r\nSorry if the question is too vague."},"comment":{"url":"https://api.github.com/repos/louthy/language-ext/issues/comments/433964841","html_url":"https://github.com/louthy/language-ext/issues/515#issuecomment-433964841","issue_url":"https://api.github.com/repos/louthy/language-ext/issues/515","id":433964841,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzk2NDg0MQ==","user":{"login":"bender2k14","id":34664007,"node_id":"MDQ6VXNlcjM0NjY0MDA3","avatar_url":"https://avatars1.githubusercontent.com/u/34664007?v=4","gravatar_id":"","url":"https://api.github.com/users/bender2k14","html_url":"https://github.com/bender2k14","followers_url":"https://api.github.com/users/bender2k14/followers","following_url":"https://api.github.com/users/bender2k14/following{/other_user}","gists_url":"https://api.github.com/users/bender2k14/gists{/gist_id}","starred_url":"https://api.github.com/users/bender2k14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bender2k14/subscriptions","organizations_url":"https://api.github.com/users/bender2k14/orgs","repos_url":"https://api.github.com/users/bender2k14/repos","events_url":"https://api.github.com/users/bender2k14/events{/privacy}","received_events_url":"https://api.github.com/users/bender2k14/received_events","type":"User","site_admin":false},"created_at":"2018-10-29T15:52:55Z","updated_at":"2018-10-29T15:52:55Z","author_association":"CONTRIBUTOR","body":"> This means I end up with more of a sandwich structure: impure-pure-impure-pure-impure which just feels wrong.\r\n\r\nBy definition, a pure function cannot have compile-time dependencies on any impure function.  So by this \"sandwich structure\", you must mean that the code being executed at runtime alternates between pure and impure, right?"}}
{"actor":{"display_login":"bender2k14"}}