Andriy Drozdyuk
Andriy Drozdyuk

Reputation: 61021

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://mirror.seize.it/acid-state/examples/HelloWorldNoTH.hs

but I am wandering if there are any convenience wrappers or libraries to help make use of acid-state easier (without the use of template haskell)?

P.S.: My purpose is to implement a database layer for a web-app.

Upvotes: 2

Views: 363

Answers (1)

tazjin
tazjin

Reputation: 673

You can't write a function that derives an instance for something, that's why Acid-State makes use of Template Haskell.

The developers of Acid-State have mentioned before that they wouldn't need to use TH if GHC added support for automatically deriving classes (much like data SomeData = Foo | Bar deriving (Show))

Many of the points listed against TH in the post you linked only apply under specific circumstances (for example, you can be pretty sure that Acid-State's TH functions won't launch any missiles)

I really don't think you should worry too much about using TH - it can be helpful sometimes!

Upvotes: 4

Related Questions