Fork me on GitHub
#funcool
<
2016-03-13
>
luxbock11:03:37

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

luxbock11:03:35

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

luxbock11:03:45

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

luxbock11:03:49

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

luxbock11:03:43

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

luxbock11:03:09

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

luxbock11:03:26

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

luxbock11:03:59

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

luxbock12:03:50

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

luxbock12:03:48

- 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

luxbock12:03:10

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

luxbock12:03:27

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

luxbock12:03:09

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

luxbock12:03:19

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

luxbock12:03:27

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