Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple book/authors example? #3

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

Simple book/authors example? #3

drozzy opened this issue Jul 31, 2012 · 4 comments

Comments

@drozzy
Copy link
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.

@drozzy
Copy link
Contributor Author

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."

@mightybyte
Copy link
Owner

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.

@drozzy
Copy link
Contributor Author

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)?

@mightybyte
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants