Stream: beginners

Topic: Do we have a TEA example in the works?


view this post on Zulip Oliver Schöning (Oct 25 2021 at 21:39):

I think more than anything I have been so happy with Elm thanks to The Elm Architecture. So I was wondering if anyone is working on an example, and if it is gonna be a goal to have a library for doing TEA in Roc

view this post on Zulip Lucas Rosa (Oct 25 2021 at 22:03):

do you mean like for UI programming? Or do you have another use case in mind?

view this post on Zulip Oliver Schöning (Oct 26 2021 at 03:20):

I can see myself use TEA on a lot of projects, not only UI. I think Lamdera is a good example. I think elms game dev slack channel is another good way of utilizing TEA.
Having a library to “instanciate” a MVU or MU that can hook into a platforms event system would be nice IMO.

view this post on Zulip Oliver Schöning (Oct 26 2021 at 03:22):

But for using SDL or WebAssembly + HTML hooks are obvious ideas too. I would just think that having a TEA pattern library would be obvious for a descendant language :big_smile:

view this post on Zulip Lucas Rosa (Oct 26 2021 at 03:48):

The pattern itself is just a reducer. One could make a platform expose such an API if they wanted. Maybe a UI platform based on SDL, and the platform controls view updates using this kind of pattern. elixir GenServers also have a similar pattern

view this post on Zulip Lucas Rosa (Oct 26 2021 at 03:50):

TEA itself has a particular runtime behavior but abstractly it’s mostly just the reducer pattern

view this post on Zulip Lucas Rosa (Oct 26 2021 at 03:50):

Functional languages generally make it easy to implement this kind of separation of actions and state

view this post on Zulip Lucas Rosa (Oct 26 2021 at 03:53):

That being said, I think there might be something like TEA in the examples folder, I’m pretty sure I remember seeing an example with that name

view this post on Zulip Oliver Schöning (Oct 26 2021 at 06:29):

I think I saw a talk by @Richard Feldman where he mentioned a TEA example?
I can't find it in the example folder tho

view this post on Zulip Lucas Rosa (Oct 26 2021 at 11:07):

It may have been removed :(

view this post on Zulip Lucas Rosa (Oct 26 2021 at 11:08):

But in any case it definitely is possible to imitate a similar API to TEA

view this post on Zulip Oliver Schöning (Oct 26 2021 at 11:18):

Yeah seems that Roc has a lot of flexibility :smile:
Can’t wait for more documentation to arrive so that it’ll be a little easier to create some good platforms

view this post on Zulip Lucas Rosa (Oct 26 2021 at 11:26):

Speaking of SDL, I have an open PR that tries to use it but then it exposed some bugs but it’s all good

view this post on Zulip Wolfgang Schuster (Oct 26 2021 at 14:32):

I've also been working on a wgpu platform in parallel to the SDL one. Would provide a lot of similar functionality to SDL and will likely have a TEA like interface

view this post on Zulip Lucas Rosa (Oct 26 2021 at 17:28):

nice

view this post on Zulip Richard Feldman (Oct 26 2021 at 22:48):

I just added a #show and tell stream so folks can share progress on things like these platforms! :smiley:


Last updated: Jul 06 2025 at 12:14 UTC