[web-devel] Re: anybody have toy examples of using digestive
functors formlets lib?
Jasper Van der Jeugt
jaspervdj at gmail.com
Sat Nov 6 09:44:30 CET 2010
For the theming stuff: I was sort of thinking of running the entire
form in a Reader monad, so you can configure the id and class
attributes for all the different form elements. You can then style it
using CSS. I hope to implement some of this stuff this weekend at
BelHac, if I find some time...
On Sat, Nov 6, 2010 at 4:40 AM, Jeremy Shaw <jeremy at n-heptane.com> wrote:
> I have a attached a little demo that shows how I like to use digestive
> functors. The primary issue right now is that it does not work
> correctly if you try to put more than one formlet on a page. (due to
> an issue in my code). It is fixable -- I just have not had the time
> and need quite yet. Though, if you can skip the use of
> digestiveFunctorPart and use digestive-functors-hsp the 'normal' way.
> To run the demo you will need:
> - lastest happstack from darcs
> - lastest digestive-functors from git,
> - lastest digestive-functors-hsp from darcs,
> Furthermore, you will need to edit the digestive-functors.cabal file
> and change, monads-fd to mtl < 2. That will change later this week
> when I switch happstack from mtl to monads-fd. (Or *you* could patch
> happstack to use monads-fd and send me a patch). If you do not make
> that change, then you will get an overlapping instance error regarding
> MonadPlus IO.
> If you do not want to update to the lastest happstack, you will just
> have to look at the attached code and reverse engineer what you want
> to do. Though, I recommend upgrading to happstack from darcs. It will
> break your code, but I think I made all the code breaking changes for
> the next release, so you can get it over with now :p Or, if you are
> using it for a new project, you can start with the good stuff and not
> have to upgrade it later. The happstack crash course documents the
> darcs version of happstack.
> I will eventually add a section to the happstack crash course on this
> technology. But until then, I hope this gets you started.
> Note that the rendering is ugly because there is no CSS applied. You
> can use 'setAttr' in the digestive-functors-hsp library to set some
> class attributes and then apply some CSS to pretty things up. Also,
> jaspervdj mentioned something in the README about better ways to theme
> a form than what formlets offered. I have no idea what that refers
> too. But maybe it is better than using setAttrs.
> Note that both digestive-functors and digestive-functors-hsp are very
> new. If you think something about them is wacky, please let us know.
> Don't assume that when meant for things to be stupid.
> - jeremy
> On Fri, Nov 5, 2010 at 6:32 PM, Thomas Hartman
> <thomashartman1 at googlemail.com> wrote:
>> anybody have toy examples of using digestive functor library?
>> Especially with hsp, which is my usual templating system these days?
>> A couple of people have recommended this library to me but I don't see any
>> easy way to get started using it.
>> Toy example would be great.
>> Thanks a bunch!
More information about the web-devel