Call for comments: Yesod 0.2

Hi all, I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps. At this point, I wanted to ask the community if they have any changes they'd like to see in this release. I'm planning on releasing some time next week. The main feature which is still prominently missing for this release is a persistence layer; hopefully that will be included in the next major release. If anyone has any ideas on this, I'm all ears. Thanks, Michael [1] http://github.com/snoyberg/yesod/tree/ver0.2 [2] http://docs.yesodweb.com/yesod/

Hello, Is there an update-to-date example that works with Yesod so I can a feel for how it works ? - jeremy On May 12, 2010, at 8:46 AM, Michael Snoyman wrote:
Hi all,
I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps.
At this point, I wanted to ask the community if they have any changes they'd like to see in this release. I'm planning on releasing some time next week.
The main feature which is still prominently missing for this release is a persistence layer; hopefully that will be included in the next major release. If anyone has any ideas on this, I'm all ears.
Thanks, Michael
[1] http://github.com/snoyberg/yesod/tree/ver0.2 [2] http://docs.yesodweb.com/yesod/ _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

There's a HelloWorld and five tutorials available on the documentation
site[1]. Each of the tutorials is in fact a literate Haskell file in the
repo[2], so if you want to experiment, you might just clone the repo and
start running code.
The first three tutorials are properly commented; the last two are mostly
just code. I have not ported over any of my open-source web apps to Yesod
0.2 yet, so most complex examples are not available at the moment.
Michael
[1] http://docs.yesodweb.com/yesod/
http://docs.yesodweb.com/yesod/[2] http://github.com/snoyberg/yesoddocs
On Wed, May 12, 2010 at 7:41 PM, Jeremy Shaw
Hello,
Is there an update-to-date example that works with Yesod so I can a feel for how it works ?
- jeremy
On May 12, 2010, at 8:46 AM, Michael Snoyman wrote:
Hi all,
I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps.
At this point, I wanted to ask the community if they have any changes they'd like to see in this release. I'm planning on releasing some time next week.
The main feature which is still prominently missing for this release is a persistence layer; hopefully that will be included in the next major release. If anyone has any ideas on this, I'm all ears.
Thanks, Michael
[1] http://github.com/snoyberg/yesod/tree/ver0.2 [2] http://docs.yesodweb.com/yesod/ _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

On Wed, 12 May 2010 19:51:24 +0300
"Michael" == Michael Snoyman wrote:
Michael> The first three tutorials are properly commented; the last two Michael> are mostly just code. I have not ported over any of my Michael> open-source web apps to Yesod 0.2 yet, so most complex Michael> examples are not available at the moment. OK. We're waiting for bloggy. ;) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ----------------------------------------------------------------

On Wed, May 12, 2010 at 5:46 PM, Michael Snoyman
Hi all, I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps. At this point, I wanted to ask the community if they have any changes they'd like to see in this release. I'm planning on releasing some time next week. The main feature which is still prominently missing for this release is a persistence layer; hopefully that will be included in the next major release. If anyone has any ideas on this, I'm all ears. Thanks, Michael [1] http://github.com/snoyberg/yesod/tree/ver0.2 [2] http://docs.yesodweb.com/yesod/ _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
Following current Yesod design my wishlist is the follwing. 1. Get read of quasy quotation in URL definition. Instead define a Haskell embedded DSL like happstack's url handling but run it from template haskell like this: First define application routes: module Routes where import Yesod.Routing routes = routingAlternatives [ dir '/' 'Home' // methodGet , dir 'entry' 'Entry' // entriesResources ] entriesResources = routingAlternatives [ placeholder `String 'WithSlug' 'entrySlug' // entryResources , dir '/' 'Index' // methodGet , dir 'new' 'New' // methodGet , dir 'create' 'Create' // methodPost ] entryResources = routingAlternatives [ dir '/' 'Show' // methodGet , dir 'edit' 'Edit' // methodGet , dir 'update' 'Update' // methodPut , dir '/' 'Destroy' // methodDelete ] now in my application just call this function: module Main where import Yesod.Routing import Routes $(mkResources 'MyResources' routes) {- Is the same as -- data structure name is the second parameter of mkResources data MyResources = -- constructor names are concatenation of dir parameters Home | EntryShow String | EntryEdit String | EntryUpdate String | EntryDestroy String | EntryIndex | EntryNew | EntryCreate instance ReadUrl MyResources where ... instance ShowUrl MyResources where ... -} Second wish is to automatically generate datatype for view. Something like this $(defineTemplate 'ShowEntryView' [$hamlet| [$hamlet| !!! %html %head %title $templateTitle$ %body %h1 Yesod Sample Blog %h2 $templateTitle$ %ul#nav $forall templateNavbar nav %li %a!href=@navUrl.nav@ $navTitle.nav$ #content $templateContent$ |]) {- is the same like writing data ShowEntryView = ShowEntryView { templateTitle :: forall a. HtmlContent a => a , templateNavbar :: [ShowEntryViewTemplateNavbar] , templateContent :: forall a. HtmlContent a => a } data ShowEntryViewTemplateNavbar = ShowEntryViewTemplateNavbar { navUrl :: forall a. ShowUrl a => a , navTitle :: forall a. HtmlContent a => a } instance HtmlContent ShowEntryView where ... -} So template is just a datatype and I just render it in controller method.

Just a little heads-up: one small but very important change *will* be
sneaking into this release of Yesod after all. You'll be able to define URL
datatypes with more than just String and Integer components. The blog post
describing it is: http://www.snoyman.com/blog/entry/really-type-safe-urls/
http://www.snoyman.com/blog/entry/really-type-safe-urls/This is a change
to the underlying web-routes-quasi library; Jeremy, I believe you asked for
exactly this feature a bit ago.
Michael
On Wed, May 12, 2010 at 4:46 PM, Michael Snoyman
Hi all,
I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps.
At this point, I wanted to ask the community if they have any changes they'd like to see in this release. I'm planning on releasing some time next week.
The main feature which is still prominently missing for this release is a persistence layer; hopefully that will be included in the next major release. If anyone has any ideas on this, I'm all ears.
Thanks, Michael
[1] http://github.com/snoyberg/yesod/tree/ver0.2 [2] http://docs.yesodweb.com/yesod/

Michael Snoyman wrote:
Hi all,
I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps.
james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user Configuring yesod-0.2.0... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package http-wget-0.6.2 requires transformers-0.1.4.0 package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 package authenticate-0.6.2 requires transformers-0.1.4.0 package yesod-0.2.0 requires transformers-0.2.1.0 package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0 $ghc --version The Glorious Glasgow Haskell Compilation System, version 6.12.1 This on Ubuntu 8.04 Running $ runhaskell Setup.lhs build fails: [12 of 14] Compiling Yesod.Helpers.Auth ( Yesod/Helpers/Auth.hs, dist/build/Yesod/Helpers/Auth.o ) Yesod/Helpers/Auth.hs:187:25: Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) from the context () arising from a use of `OpenId.getForwardUrl' at Yesod/Helpers/Auth.hs:187:25-57 Possible fix: add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) to the context of the type signature for `getOpenIdForward' or add an instance declaration for (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) In the second argument of `($)', namely `OpenId.getForwardUrl oid complete' In a stmt of a 'do' expression: res <- runAttemptT $ OpenId.getForwardUrl oid complete In the expression: do { testOpenId; rr <- getRequest; oid <- case getParams rr "openid" of { [x] -> return x _ -> invalidArgs [...] }; render <- getUrlRender; .... } Yesod/Helpers/Auth.hs:200:25: Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) from the context (YesodAuth master) arising from a use of `OpenId.authenticate' at Yesod/Helpers/Auth.hs:200:25-49 Possible fix: add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) to the context of the type signature for `getOpenIdComplete' or add an instance declaration for (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) In the second argument of `($)', namely `OpenId.authenticate gets'' In a stmt of a 'do' expression: res <- runAttemptT $ OpenId.authenticate gets' In the expression: do { testOpenId; rr <- getRequest; let gets' = reqGetParams rr; res <- runAttemptT $ OpenId.authenticate gets'; .... } Suggestions? Thanks, James -- Neurogami - Smart application development http://www.neurogami.com james@neurogami.com

Sorry, things are still in a little bit of flux as I change underlying
libraries. The only suggestion I've got is to retry with a "git pull &&
cabal update && cabal install". When the final version is actually released,
it will be well-tested first.
Note: right now it depends on web-routes-quasi 0.3.0, which has not yet been
released, so you'll have to pull that from the github repo.
Michael
On Sat, May 22, 2010 at 7:32 AM, James Britt
Michael Snoyman wrote:
Hi all,
I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps.
james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user Configuring yesod-0.2.0... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package http-wget-0.6.2 requires transformers-0.1.4.0 package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 package authenticate-0.6.2 requires transformers-0.1.4.0 package yesod-0.2.0 requires transformers-0.2.1.0 package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0
$ghc --version The Glorious Glasgow Haskell Compilation System, version 6.12.1
This on Ubuntu 8.04
Running
$ runhaskell Setup.lhs build
fails:
[12 of 14] Compiling Yesod.Helpers.Auth ( Yesod/Helpers/Auth.hs, dist/build/Yesod/Helpers/Auth.o )
Yesod/Helpers/Auth.hs:187:25: Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) from the context () arising from a use of `OpenId.getForwardUrl' at Yesod/Helpers/Auth.hs:187:25-57 Possible fix: add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) to the context of the type signature for `getOpenIdForward' or add an instance declaration for (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) In the second argument of `($)', namely `OpenId.getForwardUrl oid complete' In a stmt of a 'do' expression: res <- runAttemptT $ OpenId.getForwardUrl oid complete In the expression: do { testOpenId; rr <- getRequest; oid <- case getParams rr "openid" of { [x] -> return x _ -> invalidArgs [...] }; render <- getUrlRender; .... }
Yesod/Helpers/Auth.hs:200:25: Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) from the context (YesodAuth master) arising from a use of `OpenId.authenticate' at Yesod/Helpers/Auth.hs:200:25-49 Possible fix: add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) to the context of the type signature for `getOpenIdComplete' or add an instance declaration for (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) In the second argument of `($)', namely `OpenId.authenticate gets'' In a stmt of a 'do' expression: res <- runAttemptT $ OpenId.authenticate gets' In the expression: do { testOpenId; rr <- getRequest; let gets' = reqGetParams rr; res <- runAttemptT $ OpenId.authenticate gets'; .... }
Suggestions?
Thanks,
James
--
Neurogami - Smart application development
james@neurogami.com
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

On Sat, 22 May 2010 20:42:51 +0300, Michael Snoyman
[...]
Note: right now it depends on web-routes-quasi 0.3.0, which has not yet been released, so you'll have to pull that from the github repo.
In order to test my proposed solution (see below), I tried building web-routes-quasi 0.3.0 from git, but I get another cabal version conflict failure: | Resolving dependencies... | cabal: cannot configure template-haskell-2.4.0.1. It requires base >=4.2 && <5 | For the dependency on base >=4.2 && <5 there are these packages: base-4.2.0.0 | and base-4.2.0.1. However none of them are available. | base-4.2.0.0 was excluded because of the top level dependency base -any | base-4.2.0.1 was excluded because of the top level dependency base -any I assume this means that it needs ghc 6.12 (which I haven't installed yet). Do you really need template-haskell-2.4.*, or would 2.3.* suffice as well? In that case you could relax the version constraint.
On Sat, May 22, 2010 at 7:32 AM, James Britt
wrote: james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user Configuring yesod-0.2.0... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package http-wget-0.6.2 requires transformers-0.1.4.0 package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 package authenticate-0.6.2 requires transformers-0.1.4.0 package yesod-0.2.0 requires transformers-0.2.1.0 package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0
[...]
Suggestions?
From a quick look at the source of yesod, it /seems/ that it may work with MonadCatchIO-transformers-0.1.* as well. Is there any reason yesod asks for =0.2.2 ? If not, relaxing this version constraint might fix things.
Regards, Arie

Unfortunately, it really does require 6.12. The issue is that we need to
automatically generate a type instance for "Routes". While 6.10 supports
type instances, it doesn't include that support in the template haskell.
If people are interested, I think it would be possible to make the Routes
type instance dependent upon the template-haskell version number, and then
users would need to declare it themselves.
By the way, I actually just released web-routes-quasi 0.3.0.
Michael
On Sun, May 23, 2010 at 12:44 AM, Arie Peterson
On Sat, 22 May 2010 20:42:51 +0300, Michael Snoyman
wrote: [...]
Note: right now it depends on web-routes-quasi 0.3.0, which has not yet been released, so you'll have to pull that from the github repo.
In order to test my proposed solution (see below), I tried building web-routes-quasi 0.3.0 from git, but I get another cabal version conflict failure:
| Resolving dependencies... | cabal: cannot configure template-haskell-2.4.0.1. It requires base >=4.2 && <5 | For the dependency on base >=4.2 && <5 there are these packages: base-4.2.0.0 | and base-4.2.0.1. However none of them are available. | base-4.2.0.0 was excluded because of the top level dependency base -any | base-4.2.0.1 was excluded because of the top level dependency base -any
I assume this means that it needs ghc 6.12 (which I haven't installed yet). Do you really need template-haskell-2.4.*, or would 2.3.* suffice as well? In that case you could relax the version constraint.
On Sat, May 22, 2010 at 7:32 AM, James Britt
wrote: james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user Configuring yesod-0.2.0... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package http-wget-0.6.2 requires transformers-0.1.4.0 package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 package authenticate-0.6.2 requires transformers-0.1.4.0 package yesod-0.2.0 requires transformers-0.2.1.0 package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0
[...]
Suggestions?
From a quick look at the source of yesod, it /seems/ that it may work with MonadCatchIO-transformers-0.1.* as well. Is there any reason yesod asks for =0.2.2 ? If not, relaxing this version constraint might fix things.
Regards,
Arie
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

Michael Snoyman
Unfortunately, it really does require 6.12. The issue is that we need to automatically generate a type instance for "Routes". While 6.10 supports type instances, it doesn't include that support in the template haskell. If people are interested, I think it would be possible to make the Routes type instance dependent upon the template-haskell version number, and then users would need to declare it themselves.
Hi Michael, congrats on Yesod 0.2 and the good website updates. Count me as interested in 6.10 compatibility - I can't require 6.12 for while yet. FWIW I'm yet not sold on Hamlet's look and feel or in- haskell html generation, I'd like to give yesod + hstringtemplates another whirl. I am interested in the extras like your authentication and form support, and also your relatively light dependencies and the flexibility of wai.
participants (7)
-
Arie Peterson
-
Gour
-
James Britt
-
Jeremy Shaw
-
Michael Snoyman
-
Simon Michael
-
Victor Nazarov