Yesod and Yesod.Persist modules re-exporting all of Database.Persist

36 views
Skip to first unread message

Felipe Almeida Lessa

unread,
Jun 4, 2013, 2:43:35 PM6/4/13
to yesodweb
Currently both Yesod and Yesod.Persist modules re-export all of
Database.Persist entities. This creates a problem for esqueleto users
since they'll either:

1) Need to import Database.Esqueleto qualified.

2) Need to manually import everything those modules export *except*
Database.Persist and import Database.Esqueleto unqualified.

3) Need to import these modules with a lot of hidings.

I'd like to propose that for the next Yesod milestone Database.Persist
should not be re-exported anymore. For Database.Persist users that
means a single import line should be added, so that's not a hassle.
The scaffold may still include Database.Persist by default by doing
the same thing.

Cheers,

--
Felipe.

Michael Snoyman

unread,
Jun 4, 2013, 11:43:38 PM6/4/13
to yeso...@googlegroups.com
I'm not necessarily opposed to this proposal, but let me play devil's advocate for the moment. The Yesod module is already just a convenient reexporting of other modules, so taking out some of that convenience somewhat defeats its purpose. If you look at the source for it:


It's exporting just four things:
  • Yesod.Core
  • Yesod.Form
  • Yesod.Persist
  • Some arbitrary things from shakespeare and wai
What about moving that last bullet to be exports from Yesod.Core, and then (starting now) doing an esqueleto project would just require importing Yesod.Core, Yesod.Form, and Database.Esqueleto?



--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Felipe Almeida Lessa

unread,
Jun 5, 2013, 12:52:16 PM6/5/13
to yesodweb
But what about Yesod.Persist, what does it export besides Database.Persist?

I'm all for your proposal (modulo above) as well =).
--
Felipe.

Michael Snoyman

unread,
Jun 5, 2013, 11:38:28 PM6/5/13
to yeso...@googlegroups.com
Yesod.Persist does define a number of functions and type classes. Maybe we can put those into Yesod.Persist.Core, keep Yesod.Persist as it is right now, and (if you were interested) you could create Yesod.Esqueleto which exports Yesod.Core, Yesod.Form, Yesod.Persist.Core, and Database.Esqueleto.

Felipe Almeida Lessa

unread,
Jun 6, 2013, 9:20:13 AM6/6/13
to yesodweb

Sounds good to me.

Since esqueleto now is the only way to do joins, I think it deserves this kind of better integration.

--
Felipe.
Enviado do meu Nexus 4.

Reply all
Reply to author
Forward
0 new messages