Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Simple book/authors example? #3

Closed
drozzy opened this Issue Jul 31, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

drozzy commented Jul 31, 2012

Any chance of there appearing a simple example of acid-state with books and authors? It's pretty hard to figure out for me how to extend the current example to something like this.

E.g. simple site that lists all the books in the "database", with many-to-one authors per book.

Contributor

drozzy commented Jul 31, 2012

Also, maybe an example without lenses? As they seem to be pretty optional, as indicated by happstack tutorial: http://happstack.com/docs/crashcourse/AcidState.html
"It can take a bit of practice to get used to lenses. But, fortunately, using them is completely optional -- so if they are not your thing, you don't have to use them."

Owner

mightybyte commented Jul 31, 2012

This is more of an acid-state thing than a snaplet thing, so I probably won't add that kind of an example here. This project is just a snaplet that makes it more convenient to use acid-state in a Snap application. The point of my examples and documentation is to demonstrate the use of the snaplet, not the underlying library. Lenses might be optional with acid-state but they are not optional for snaplets, so I'm not inclined to dumb the example down to sidestep a concept that you need to understand anyway to use this package.

@mightybyte mightybyte closed this Jul 31, 2012

Contributor

drozzy commented Aug 3, 2012

Well... not really. For example, I know how to write an acid-state code in happstack, according to this tutorial:
http://www.happstack.com/docs/crashcourse/AcidState.html#acid_state

But how do I integreate that into snap (using snaplet-acid-state)? Maybe you can show that example from happstack - the one that represents a "Blog" with "posts" (or explain how to integrate the example with Snap)?

Owner

mightybyte commented Aug 3, 2012

The counter example is almost exactly the same as Happstack's. By comparing those you can see which things are different between Happstack and Snap and which are common to acid-state. From there, the same transformation applies to the more complicated blog app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment