funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
luxbock 2016-03-13T11:51:37.000003Z

hi, I hope this is a good place to ask general category theory questions related to Clojure :simple_smile:

luxbock 2016-03-13T11:52:35.000004Z

I started learning Haskell for a bit but don't know enough to be comfortable using it for real world stuff, and now I have a project that I think might be a good fit for me to apply some CT concepts to develop a better understanding of its uses

luxbock 2016-03-13T11:53:45.000005Z

so I plan on using cats, and but before I begin I was hoping to get some guidance

luxbock 2016-03-13T11:54:49.000006Z

my project has to do with interacting an external process that I communicate through stdin / stdout

luxbock 2016-03-13T11:55:43.000007Z

the process has its own imperative language through which it does things, and I'd like to build a more declarative interface for interacting with it

luxbock 2016-03-13T11:56:09.000008Z

so I plan on representing those instructions with tagged vectors, Hiccup style

luxbock 2016-03-13T11:57:26.000009Z

some of the instructions have return values and some are purely for side effects

luxbock 2016-03-13T11:58:59.000010Z

the process is a type of solver, where you set up a scenario using the imperative instructions, let it run on it for a while and then you can query results, save it to disk, or you can load an already solved result and query that

luxbock 2016-03-13T12:00:50.000011Z

so there's different things I want to be able to do

luxbock 2016-03-13T12:02:48.000012Z

- 1) build up scenarios and save these as "recipes" which I can schedule to be solved later - 2) schedule these recipes to be solved - 3) query the results in a declarative language - 4) mix 3) and 1) together, so that the recipes can be built based on the results of previous solutions

luxbock 2016-03-13T12:04:10.000013Z

I'd like the query language to be able to figure out what it needs to return its result, and if that data doesn't exist yet then instead of returning empty handed, it can give me back the recipe for generating that data

luxbock 2016-03-13T12:05:27.000014Z

so from CT perspective, the first thing I thought of is that the imperative instruction set can be thought of as a monoid, since feeding commands to the solver is just string concatenation

luxbock 2016-03-13T12:07:09.000015Z

and the process of turning a recipe(s) into a solution, where I want fine control over when and in which order that happens, feels very much like an IO monad

luxbock 2016-03-13T12:08:19.000016Z

I don't know if the concept of an IO monad makes much sense in Clojure though

luxbock 2016-03-13T12:11:27.000018Z

I'm partly rambling just to try to gather up my own thoughts, but I'm curious how you would approach this problem from the CT perspective, or if anyone has any resources / link / blog posts that might relate to what I'm attempting to do