Questions tagged [acid-state]

A Haskell library that adds ACID (Atomicity, Consistency, Isolation and Durability) guarantees to any serializable Haskell data structure.

acid-state
Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

How to execute Play 2 only if Play 1 succeeds in Ansible

I have two Plays having one task each. The first Play checks if the /var/test.dat exists on each target. Only if the first play is successful do I want the second play to run which executes these ...
Ashar's user avatar
  • 3,238
0 votes
1 answer
77 views

using type classes to provide alternative implementations for when using Acid-State

I wrote a web application using scotty and acid state, now i would like to use type classes to be able to provide alternative implementations for the capabilities of my application for testing. I get ...
Harold Fincher's user avatar
0 votes
1 answer
381 views

JavaScript Multi-statement Transaction in Marklogic

I wanted to write a multi-statement transaction in server-side JavaScript in marklogic. What I wanted to achieve is, do an update transaction and then write a query statement which queries for the ...
sharu's user avatar
  • 71
1 vote
1 answer
132 views

Testing Acid-State with hspec

i'm a haskell noob and have problems with testing functions with acid-states.This ist my Datastructure data UserState = UserState { name :: String } deriving (Eq, Ord, Read, Show, Data, Typeable) ...
alex.b's user avatar
  • 194
3 votes
1 answer
182 views

Haskell: acid-state over multiple files?

I have a file structure like this: --- Database.hs --- data Database = ... ... --- User.hs --- import Database addUser :: Update Database () ... --- Post.hs import Database addPost :: Update ...
sqd's user avatar
  • 1,505
7 votes
1 answer
402 views

Use acid-state like event log in Haskell

I'm using acid-state in a project and I quite like it. I like how easy it is to add persistence to plain Haskell datatypes without much boilerplate. As far as I understand, acid-state keeps a log of ...
xnyhps's user avatar
  • 3,316
4 votes
2 answers
215 views

Avoiding Errors caused by IO when talking to a database inside of a WAI handler

I am writing a web service in haskell using warp, wai, and acid-state. As of now, I have two handler functions that require database interaction, the latter of which is giving me trouble. The first, ...
user avatar
4 votes
1 answer
275 views

How can a monadic/sequential migration be implemented for data in acid-state?

Current state I have two data types. data Foo = Foo { fooId :: RecordId Foo , bars :: [RecordId Bar] ... } data Bar = Bar { barId :: RecordId Bar ... } This schema allows for ...
matchwood's user avatar
  • 257
2 votes
1 answer
173 views

Making sequences of events atomic in acid-state

I am strugging with grouping sequences of events into one atomic transaction. Consider a Map stored in acid-state, and imagine you want to implement Data.Map.alter. The function that takes a maybe-...
user2645074's user avatar
4 votes
1 answer
142 views

Running template haskell in template haskell

insertST :: StateDecoder -> SomeState -> Update SomeState SomeThing insertST stDecoder st = ... the stuff in StateDecoder can't be used in $(makeAcidic ''SomeState ['insertST]) but if I ...
TallerGhostWalt's user avatar
5 votes
1 answer
590 views

How to use Network.WebSockets.Snap in a snaplet?

It would be nice to be able to use the Network.WebSockets module from inside a snaplet, but I can't figure out how to actually do it. Using the runWebSocketsSnap :: MonadSnap m => ServerApp -> ...
dermoritz's user avatar
  • 187
58 votes
1 answer
436 views

How to handle changing the implementation of Events when using Data.Acid

I have a moderately sized application that uses Data.Acid for persistence and I've encountered a situation where I need to update the implementation of one of my Update events for the next version of ...
shang's user avatar
  • 24.7k
6 votes
1 answer
292 views

How to zoom in acid-state?

data Foo = Foo { _bar :: Map String Integer } deriving (Eq, Ord, Read, Show, Data, Typeable) $(deriveSafeCopy 0 'base 'Foo) $(makeLenses ''Foo) Given the above code I am under the impression that ...
fho's user avatar
  • 6,808
0 votes
1 answer
115 views

Trying to bring HSP and Acid-state together in a form with Happstack

I followed the Happstack Crash Course and now I am trying to bring different things together: From "Type-Safe Form processing using reform" (http://happstack.com/docs/crashcourse/Reform.html#reform) ...
Flo's user avatar
  • 449
2 votes
1 answer
340 views

Ambiguous Type Variable in AcidState functions

I've got a situation in a Haskell web project where I'm getting the error Ambiguous type variable. The relevant code is --- Other import statements import qualified Model as Model ---------- HTTP ...
Inaimathi's user avatar
  • 13.9k
4 votes
1 answer
263 views

Unexpected return type of Acid State query (Happstack)

I'm trying to extend Happstack crash course blog with some additional functionality: displaying a list of all tags on home page. My blog record looks like this: data Blog = Blog { nextPostId :: ...
eugenia's user avatar
  • 43
1 vote
1 answer
158 views

Unable to cabal-install acid-state on Haskell Platform 2012.2.0.0 (Windows XP)

Using cabal, I tried to install acid-state on Haskell Platform 2012.2.0.0 (Windows XP) but got the following error: src-win32\FileIO.hs:43:5: Not in scope: catchIO Perhaps you meant `catch' (...
user1023733's user avatar
0 votes
1 answer
169 views

acid-state example error

I'm trying to start using acid-state for a project, but I'm running into trouble running the demos. Running HelloWorld.hs from this example collection on my 64-bit box gives me the errors acid-state....
Inaimathi's user avatar
  • 13.9k
1 vote
2 answers
997 views

Snap, IO and acid-state

Trying to use acid-state in Snap, and I hit a roadblock. Here is what I got so far. First my acid-state related objects (it's a dummy book with a isbn number): {-# LANGUAGE DeriveDataTypeable ...
Andriy Drozdyuk's user avatar
1 vote
1 answer
298 views

Retrieving pure values from acid state queries

This seems like something that should be easy but how do I get a pure value out of a query if I am using AcidState's Data.Acid.Memory.Pure module. I guess I can generalize the question to "how do I ...
Eric's user avatar
  • 663
3 votes
1 answer
197 views

How can I get cabal to install acid-state?

I'm a newbie to Haskell, and wanted to try the acid-state library, but I get the following output when trying to install it: >cabal install acid-state Resolving dependencies... Configuring acid-...
Diego Saa's user avatar
  • 1,436
2 votes
1 answer
360 views

acid-state convenience wrapper without template haskell?

In acid-state tutorial all the examples use Template Haskell. However, due to some reasons I am not very keen on using it. I know one can use acid-state without template haskell, as shown here: http:/...
Andriy Drozdyuk's user avatar
5 votes
1 answer
497 views

Acid-state: MonadState instance for Update

I'm trying acid-state. The documentation states that Update st is an instance of MonadState st. I tried different things, but my compiler doesn't want to see that :( I tried the HelloWorld.hs from ...
Yuras's user avatar
  • 13.9k