Elm and Yesod

277 views
Skip to first unread message

Evan Czaplicki

unread,
May 29, 2012, 2:30:18 PM5/29/12
to yeso...@googlegroups.com
Hi everyone,

We were recently discussing integrating Elm and Yesod in this reddit thread. tazjin has already made significant steps in this direction (see Quasi.hsYesod.hs, and an example) which I am really excited about. I just wanted to let everyone know what was going on so far and provide a place for further suggestions and discussion.

Best,
Evan

Michael Snoyman

unread,
May 29, 2012, 9:40:52 PM5/29/12
to yeso...@googlegroups.com
I share your excitement, this looks really good! One change I could
imagine is providing a QQ and TH function that combines elm/elmFile
with elmWidget and exporting that from the .Yesod module. I'm hoping I
get more of a chance to look into this over the next few days.

Michael

Greg Weber

unread,
May 30, 2012, 11:36:30 AM5/30/12
to yeso...@googlegroups.com
I whipped up shakespearean templates for Elm. I did this while eating
breakfast: it is really easy to make a pass-through shakespeare
template.
https://github.com/yesodweb/shakespeare/tree/master/shakespeare-elm
I even got the test suite running, although it still has javascript in
the files.

I put a dependency on Elm, although at the moment it is not needed.
There is a ToElm typeclass for the conversion.
In the future for the javascript based templates we are planning on
moving from text-based insertion to JSON based insertion.
You might have different ideas for Elm.

With this and the Widget instance one should be able to quasi-quote as usual:

toWidget [elm| ... ]

Vincent Ambo

unread,
May 30, 2012, 1:01:48 PM5/30/12
to yeso...@googlegroups.com
That's really nice, I knew there was a way to create own shakespeare templates but had not bothered to dive into it yet.

Would you mind if we actually merged this into the upstream elm package?

Greg Weber

unread,
May 30, 2012, 1:13:54 PM5/30/12
to yeso...@googlegroups.com
yes, please put this in the elm repo and take ownership. Currently
there is no real Elm dependency, which would make it easy to keep in
the shakespeare repo. However, I have a feeling this might change in
the future.

Vincent Ambo

unread,
May 30, 2012, 2:20:47 PM5/30/12
to yeso...@googlegroups.com

Evan Czaplicki

unread,
May 30, 2012, 3:40:26 PM5/30/12
to yeso...@googlegroups.com
I'd be happy to put this in the Elm repo. I'm talking to Vincent about this now. Thank you! You guys work at a truly furious pace :)

Best,
Evan
Reply all
Reply to author
Forward
0 new messages