state-monad
scalaz List[StateT].sequence - could not find implicit value for parameter n: scalaz.Applicative
I\'m trying to figure out how to use StateT to combine two State state transformers based o开发者_运维问答n a comment on my Scalaz state monad examples answer.[详细]
2023-04-13 02:27 分类:问答runState inside a State Monadic function not working
I am trying to solve the problem 2.8 of \"AI - A Modern Approach\" book which involves a grid of cells and choosing random moves to navigate the grid.[详细]
2023-04-10 21:56 分类:问答No more state monad version of hash maps / sets in Haskell?
Is the monadic interface to hash sets and maps gone in Haskell? What kind of performance model should I have in mind when using the modern versions? (Data.Map, Data.HashMap, Data.HashSet). They do not[详细]
2023-03-07 13:26 分类:问答What is the name of this Monad Stack function?
I\'ve got a bunch of stateful functions inside a State monad. At one point in the program there needs to be some IO actions so I\'ve wrapped IO inside a StateT getting a pair of types like this:[详细]
2023-03-05 00:04 分类:问答State monad in OCaml
I was trying to implement the state monad in OCaml (as an exercise). My implementation looks like this:[详细]
2023-03-02 13:21 分类:问答Difference between State, ST, IORef, and MVar
I am working through Write Yourself a Scheme in 48 Hours (I\'m up to about 85hrs) and I\'ve gotten to the part about Adding Variables and Assignments. There is a big conceptual jump in this chapter, a[详细]
2023-02-21 20:51 分类:问答Basic Scalaz State question
How do I use State to mimic the behaviour of List.zipWithIndex? What I have come up with so far (which doesn\'t work) is:[详细]
2023-02-02 00:05 分类:问答Exporting a polymorphic MonadState function for a particular state data type
What I\'m trying to do is (in a module I\'m writing) export a function that works on a particular type in a state monad (in the example below, that type would be Foo). However I would like the user to[详细]
2023-01-28 06:55 分类:问答Updating a Big State Fast in Haskell
For my vector graphics library in Haskell I must carry around a rather big state: line stroke p开发者_StackOverflowarameters, colors, clip path etc. I know two ways of doing this. Quoting a comment fr[详细]
2023-01-26 22:00 分类:问答Combining StateT and State monads
Lets say I have a function f :: State [Int] Int and a function: g :: StateT [Int] IO Int I want to use f in g and pass the state between them. Is there a library function for[详细]
2023-01-24 01:53 分类:问答