Test-only exports in Elm using Debug.todo
I've been noodling on this technique ever since I saw it used in mdgriffith/elm-ui in Element.explain. You write a function that takes
As an example of the utility of this function: we have a custom HTTP error type (it wraps up the request info with the response). We intentionally don't expose constructors for it, but I needed it to be able to use SimulatedEffect.Http.get from avh4/elm-program-test. So I need to be able to turn an
Where
Anyways, here's a somewhat contrived example I cooked up for a discussion this morning that I thought might illustrate it. https://ellie-app.com/vbpDdBCfdgTa1
This is an example of how you can provide the same functionality as a
https://redd.it/1k02lh7
@reddit_elm
I've been noodling on this technique ever since I saw it used in mdgriffith/elm-ui in Element.explain. You write a function that takes
Debug.todo
as an argument so that you can only use it while developing locally or in your tests.As an example of the utility of this function: we have a custom HTTP error type (it wraps up the request info with the response). We intentionally don't expose constructors for it, but I needed it to be able to use SimulatedEffect.Http.get from avh4/elm-program-test. So I need to be able to turn an
Http.Error
into one of our errors so that I can use our version of Expect
. I wrote a helper function httpErrorForTests :
(String -> Never)
-> Api.RequestData
-> Http.Error
-> Api.Error
Where
Api.Error
is our error type and that first argument can only be Debug.todo
.Anyways, here's a somewhat contrived example I cooked up for a discussion this morning that I thought might illustrate it. https://ellie-app.com/vbpDdBCfdgTa1
This is an example of how you can provide the same functionality as a
case
…of
expression without even having to export the constructors of your opaque type. The example I can think of is if you're working with an Effect system. You might want your Effect type to be opaque. But then for your tests you need an effect handler. I think you can take this type of thing and run with it and end up with an Effect handler in your tests without needing to expose the constructors.https://redd.it/1k02lh7
@reddit_elm
GitHub
elm-ui/src/Element.elm at acae8857a02e600cc4b4737ca2f70607228b4489 · mdgriffith/elm-ui
What if you never had to write CSS again? Contribute to mdgriffith/elm-ui development by creating an account on GitHub.
Elm Town 83 – Wonder: Meeting people where they are with Ryan Haskell
Kicking off the Wonder series, Ryan Haskell shares his approach to teaching Elm, his gap year adventures, and his current work at Brilliant. He gives insights into creating accessible learning materials, building games, and finding inspiration outside the Elm ecosystem.
Elm Town 83 – Wonder: Meeting people where they are with Ryan Haskell:
* https://elm.town/episodes/elm-town-83-wonder-meeting-people-where-they-are-with-ryan-haskell
* https://youtu.be/t40VX9rbXT0
https://redd.it/1k0uf0v
@reddit_elm
Kicking off the Wonder series, Ryan Haskell shares his approach to teaching Elm, his gap year adventures, and his current work at Brilliant. He gives insights into creating accessible learning materials, building games, and finding inspiration outside the Elm ecosystem.
Elm Town 83 – Wonder: Meeting people where they are with Ryan Haskell:
* https://elm.town/episodes/elm-town-83-wonder-meeting-people-where-they-are-with-ryan-haskell
* https://youtu.be/t40VX9rbXT0
https://redd.it/1k0uf0v
@reddit_elm
Elm Town
Elm Town 83 – Wonder: Meeting people where they are with Ryan Haskell
Ryan Haskell shares his approach to teaching Elm, his gap year adventures, and his current work at Brilliant. He gives insights into creating accessible learning materials, building games, and finding inspiration outside the Elm ecosystem.
Liikennematto alpha 3, the wave function collapse preview, out now! [town builder/simulation game in Elm]
https://yourmagicisworking.itch.io/liikennematto/devlog/925010/liikennematto-alpha-3-the-wave-function-collapse-preview-out-now
https://redd.it/1k170wo
@reddit_elm
https://yourmagicisworking.itch.io/liikennematto/devlog/925010/liikennematto-alpha-3-the-wave-function-collapse-preview-out-now
https://redd.it/1k170wo
@reddit_elm
itch.io
Liikennematto alpha 3, the wave function collapse preview, out now!
Liikennematto is a tiny town building game for children and grown-ups alike. The gameplay is simple: you only build the roads! Lots, buildings and their residents pop up after. You can play Liikennema...
GoTutor | Online Go Debugger & Visualizer built with Elm
I've been working on Gotutor, a Go debugger and visualizer built with Elm!
Gotutor provides a visual representation of the execution flow, variable states, and goroutines, making it easier to understand concurrent code.
I can't imagine how this could be implemented using vanilla JS; writing it in a functional language like Elm was really easy and fun – just modify the model, draw it.
Choosing Elm was completely random though. Someone told me about this interesting frontend technology back in 2016, and ever since then, I wanted to try it in a side project. When the time came, I didn't even remember its name and only recalled its logo!
It's still in the early stages, but I'd love for you to check it out and give me some feedback. What features would you find most helpful?
https://gotutor.dev/
https://github.com/ahmedakef/gotutor
Happy Elming (and Go-ing)!
https://redd.it/1k5rq2c
@reddit_elm
I've been working on Gotutor, a Go debugger and visualizer built with Elm!
Gotutor provides a visual representation of the execution flow, variable states, and goroutines, making it easier to understand concurrent code.
I can't imagine how this could be implemented using vanilla JS; writing it in a functional language like Elm was really easy and fun – just modify the model, draw it.
Choosing Elm was completely random though. Someone told me about this interesting frontend technology back in 2016, and ever since then, I wanted to try it in a side project. When the time came, I didn't even remember its name and only recalled its logo!
It's still in the early stages, but I'd love for you to check it out and give me some feedback. What features would you find most helpful?
https://gotutor.dev/
https://github.com/ahmedakef/gotutor
Happy Elming (and Go-ing)!
https://redd.it/1k5rq2c
@reddit_elm
GoTutor
GoTutor | Online Go Debugger & Visualizer
GoTutor is an online Go debugger & visualizer that shows the state of all the running Goroutines.
Beyond Html.Lazy's argument limit
https://jfmengels.net/beyond-elm-lazy-arguments/
https://redd.it/1k8c11t
@reddit_elm
https://jfmengels.net/beyond-elm-lazy-arguments/
https://redd.it/1k8c11t
@reddit_elm
jfmengels' blog
Beyond Html.Lazy's argument limit
small job!
Hi,
We're looking to hire a design-minded person to help out with a small project that is adjacent to the publishing industry. The project is actually in Gleam, Elm's descendant. Writing skills academic background are definitely a plus. This would be a part-time gig with about 5 months work, chill and possibility of more work if world domination is unlocked.
DM me if interested :)
https://redd.it/1kfc3gv
@reddit_elm
Hi,
We're looking to hire a design-minded person to help out with a small project that is adjacent to the publishing industry. The project is actually in Gleam, Elm's descendant. Writing skills academic background are definitely a plus. This would be a part-time gig with about 5 months work, chill and possibility of more work if world domination is unlocked.
DM me if interested :)
https://redd.it/1kfc3gv
@reddit_elm
Reddit
From the elm community on Reddit
Explore this post and more from the elm community
Introducción a Elm: Programación Funcional para el Frontend
https://emanuelpeg.blogspot.com/2025/05/introduccion-elm-programacion-funcional.html
https://redd.it/1kgm6kn
@reddit_elm
https://emanuelpeg.blogspot.com/2025/05/introduccion-elm-programacion-funcional.html
https://redd.it/1kgm6kn
@reddit_elm
Blogspot
Introducción a Elm: Programación Funcional para el Frontend
Java Apache Linux Spring SOA Scala Ruby Maven javascript php Open Source NoSql Hibernate Python Erlang MongoDb Hadoop Rest big data Cassandra Spark
The caching behind Elm's Html.Lazy
https://jfmengels.net/caching-behind-elm-lazy
https://redd.it/1kjwdgr
@reddit_elm
https://jfmengels.net/caching-behind-elm-lazy
https://redd.it/1kjwdgr
@reddit_elm
jfmengels' blog
The caching behind Elm's Html.Lazy
How I Built freeCodeCamp’s Calculator with Elm
https://dwayne.github.io/elm-calculator-tutorial/
https://redd.it/1kmbmqd
@reddit_elm
https://dwayne.github.io/elm-calculator-tutorial/
https://redd.it/1kmbmqd
@reddit_elm
Lazy L-System generation
https://discourse.elm-lang.org/t/lazy-l-system-generation/10238
I apologize but Reddit's filters won't allow me to share links to "dev dot to".
https://redd.it/1kq9dj5
@reddit_elm
https://discourse.elm-lang.org/t/lazy-l-system-generation/10238
I apologize but Reddit's filters won't allow me to share links to "dev dot to".
https://redd.it/1kq9dj5
@reddit_elm
Elm
Lazy L-System generation
A post about how I used laziness to improve the performance of L-System generation.
A Use Case for Port Boundaries in Frontend Development
https://cekrem.github.io/posts/a-case-for-port-boundaries-in-frontend/
https://redd.it/1kq6o6f
@reddit_elm
https://cekrem.github.io/posts/a-case-for-port-boundaries-in-frontend/
https://redd.it/1kq6o6f
@reddit_elm
cekrem.github.io
A Use Case for Port Boundaries in Frontend Development
Learn how Elm's architectural discipline—and a few ideas from Clean Architecture—can reshape how we think about frontend boundaries.
Starting Small with Elm: A Widget Approach
https://cekrem.github.io/posts/starting-small-with-elm-a-widget-approach/
https://redd.it/1l29108
@reddit_elm
https://cekrem.github.io/posts/starting-small-with-elm-a-widget-approach/
https://redd.it/1l29108
@reddit_elm
cekrem.github.io
Starting Small with Elm: A Widget Approach
How to introduce Elm incrementally into your existing web applications with a real-world example
Gatling Estimator [performance testing devtool by the Finnish Broadcasting Company, built with Elm]
https://gatling-estimator.test.yle.fi/
https://redd.it/1l3rzd7
@reddit_elm
https://gatling-estimator.test.yle.fi/
https://redd.it/1l3rzd7
@reddit_elm
gatling-estimator.test.yle.fi
Gatling Estimator
Visualize how virtual user count, duration, request latency and more affect Gatling simulations.
Elm Town 84 – Wonder: Elm all the way down with Justin Lubin
Justin Lubin sketches his journey from undergrad research at UChicago with Ravi Chugh on output-directed and bidirectional programming environments (Sketch-n-Sketch) to graduate work at UC Berkeley with Sarah E. Chasins, focusing on programming language theory, researching how statically-typed functional programmers write code, and beyond, to helping domain experts.
Elm Town 84 – Wonder: Elm all the way down with Justin Lubin:
* https://elm.town/episodes/elm-town-84-wonder-elm-all-the-way-down-with-justin-lubin
* https://youtu.be/tPpdckySUS8
https://redd.it/1l2o0qb
@reddit_elm
Justin Lubin sketches his journey from undergrad research at UChicago with Ravi Chugh on output-directed and bidirectional programming environments (Sketch-n-Sketch) to graduate work at UC Berkeley with Sarah E. Chasins, focusing on programming language theory, researching how statically-typed functional programmers write code, and beyond, to helping domain experts.
Elm Town 84 – Wonder: Elm all the way down with Justin Lubin:
* https://elm.town/episodes/elm-town-84-wonder-elm-all-the-way-down-with-justin-lubin
* https://youtu.be/tPpdckySUS8
https://redd.it/1l2o0qb
@reddit_elm
Elm Town
Elm Town 84 – Wonder: Elm all the way down with Justin Lubin
Justin Lubin sketches his journey from undergrad research at UChicago with Ravi Chugh on output-directed and bidirectional programming environments (Sketch-n-Sketch) to graduate work at UC Berkeley with Sarah E. Chasins, focusing on programming language theory…
Using wrapped types in Elm is so much fun!
I really like how in Elm it's very low-effort to wrap types to make things easier to understand
For example, if I have a function like this, it doesn't tell me what each of the Int types represent
Are the return values the Ints from the List or are they the indexes in the List? Which Int in twoSum\_ is an index? What do the keys and values in the Dict represent?
So I can add more information in the types by wrapping them in types which adds documentation because these wrapped types are more meaningfully-named types
So now it's much easier to understand what each Int is for just by looking at the type signature, which makes it easier to implement the functions correctly
We can see twoSum takes in a List of Ints and a Target, then returns Maybe 2 Indexes
We can also see twoSum\ takes in the same parameters with an extra Index parameter and extra Dict Int Index parameter, so we know that twoSum\ keeps track of the current Index and the mappings of Int to Index
Implementing is more straightforward now, we can't as easily accidentally pass incorrect parameters
It's easy to see which Int is a value from the List Int, which is a Target, and which is an Index
This is a simple example, but this technique when used in larger codebases makes things much easier to understand
Rather than wondering "What does this Int represent?", you can know whether it's a Target or Index or UserId or a ProductId or whatever else, so you can't as easily mix them up
This makes writing Elm code more enjoyable and one of the many reasons why I find writing Elm code so much fun!
https://redd.it/1l6v9dd
@reddit_elm
I really like how in Elm it's very low-effort to wrap types to make things easier to understand
For example, if I have a function like this, it doesn't tell me what each of the Int types represent
twoSum : List Int -> Int -> Maybe ( Int, Int )
twoSum_ : List Int -> Int -> Int -> Dict Int Int -> Maybe ( Int, Int )
Are the return values the Ints from the List or are they the indexes in the List? Which Int in twoSum\_ is an index? What do the keys and values in the Dict represent?
So I can add more information in the types by wrapping them in types which adds documentation because these wrapped types are more meaningfully-named types
type Target = Target Int
type Index = Index Int
twoSum : List Int -> Target -> Maybe ( Index, Index )
twoSum_ : List Int -> Target -> Index -> Dict Int Index -> Maybe ( Index, Index )
So now it's much easier to understand what each Int is for just by looking at the type signature, which makes it easier to implement the functions correctly
We can see twoSum takes in a List of Ints and a Target, then returns Maybe 2 Indexes
We can also see twoSum\ takes in the same parameters with an extra Index parameter and extra Dict Int Index parameter, so we know that twoSum\ keeps track of the current Index and the mappings of Int to Index
Implementing is more straightforward now, we can't as easily accidentally pass incorrect parameters
type Target = Target Int
type Index = Index Int
twoSum : List Int -> Target -> Maybe ( Index, Index )
twoSum nums target = twoSum_ nums target (Index 0) Dict.empty
twoSum_ : List Int -> Target -> Index -> Dict Int Index -> Maybe ( Index, Index )
twoSum_ nums (Target target) (Index i) toIndex =
case nums of
[] -> Nothing
first :: rest ->
case Dict.get (target - first) toIndex of
Just prevIndex -> Just ( prevIndex, Index i )
Nothing -> twoSum_ rest (Target target) (Index (i + 1)) (Dict.insert first (Index i) toIndex)
It's easy to see which Int is a value from the List Int, which is a Target, and which is an Index
This is a simple example, but this technique when used in larger codebases makes things much easier to understand
Rather than wondering "What does this Int represent?", you can know whether it's a Target or Index or UserId or a ProductId or whatever else, so you can't as easily mix them up
This makes writing Elm code more enjoyable and one of the many reasons why I find writing Elm code so much fun!
https://redd.it/1l6v9dd
@reddit_elm
Reddit
From the elm community on Reddit
Explore this post and more from the elm community
What have you learned about hiring or working with Elm devs?
I’m doing some research on functional-first teams, especially ones that use Elm in production.
I’m curious:
* If you’ve hired Elm devs, what made someone stand out?
If you are* an Elm dev, what’s made you successful in interviews or teams?
* Any red flags or hidden strengths you’ve noticed?
Would love to hear your experiences 🙏
https://redd.it/1l865qx
@reddit_elm
I’m doing some research on functional-first teams, especially ones that use Elm in production.
I’m curious:
* If you’ve hired Elm devs, what made someone stand out?
If you are* an Elm dev, what’s made you successful in interviews or teams?
* Any red flags or hidden strengths you’ve noticed?
Would love to hear your experiences 🙏
https://redd.it/1l865qx
@reddit_elm
Reddit
From the elm community on Reddit
Explore this post and more from the elm community
Elm optimizations ideas
Elm is fast, and generally fast enough for making web applications, where handling things in less than 1/60th of a second is all the performance you need.
I have long worked on
Some of these made it into pull requests to
I recently went through all of these notes, and decided it would be best if those were shared. I have therefore created this repository: jfmengels/elm-optimizations, where I will try to keep these ideas up to date.
I don't know that this is the best organization or medium yet, but it's probably better somewhere than nowhere. These ideas are meant to be discussed. Feel free to discuss them, in issues, in pull requests, on Slack, in the appropriate GitHub repository, etc.
(Also, ideas on how to organize or present the ideas is welcome)
Hopefully some of these will excite some of you, enough to help turn them into reality. See the README for a bit more details.
https://github.com/jfmengels/elm-optimizations
https://redd.it/1lbkuj8
@reddit_elm
Elm is fast, and generally fast enough for making web applications, where handling things in less than 1/60th of a second is all the performance you need.
I have long worked on
elm-review
, where every 100ms speedup translates to... well, a 100ms speedup. During this work, I have often wondered how to make things faster, and I started writing the ideas I came up (or sometimes that others came up with).Some of these made it into pull requests to
elm-optimize-level-2
, but most haven't.I recently went through all of these notes, and decided it would be best if those were shared. I have therefore created this repository: jfmengels/elm-optimizations, where I will try to keep these ideas up to date.
I don't know that this is the best organization or medium yet, but it's probably better somewhere than nowhere. These ideas are meant to be discussed. Feel free to discuss them, in issues, in pull requests, on Slack, in the appropriate GitHub repository, etc.
(Also, ideas on how to organize or present the ideas is welcome)
Hopefully some of these will excite some of you, enough to help turn them into reality. See the README for a bit more details.
https://github.com/jfmengels/elm-optimizations
https://redd.it/1lbkuj8
@reddit_elm
GitHub
GitHub - jfmengels/elm-optimizations: Ideas on how to make Elm faster
Ideas on how to make Elm faster. Contribute to jfmengels/elm-optimizations development by creating an account on GitHub.
A rewrite of L-System Studio
https://www.youtube.com/watch?v=dvPQ54irm4M
L-System Studio (source)
Features:
- 30+ presets
- Including the Koch Curve, Quadratic Gosper, and Square Sierpinski
- Unlimited iterations
- It uses lazy evaluation to generate, translate, and render L-Systems withbillions trillions infinitely many symbols
- 2D camera
- Supports an infinite canvas since you can position the camera anywhere you want
- Supports panning horizontally and vertically
- Supports zooming in and out
- Performant
- Render 1,000,000 instructions per frame at 60 frames per second
https://redd.it/1lf8m6c
@reddit_elm
https://www.youtube.com/watch?v=dvPQ54irm4M
L-System Studio (source)
Features:
- 30+ presets
- Including the Koch Curve, Quadratic Gosper, and Square Sierpinski
- Unlimited iterations
- It uses lazy evaluation to generate, translate, and render L-Systems with
- 2D camera
- Supports an infinite canvas since you can position the camera anywhere you want
- Supports panning horizontally and vertically
- Supports zooming in and out
- Performant
- Render 1,000,000 instructions per frame at 60 frames per second
https://redd.it/1lf8m6c
@reddit_elm
YouTube
L-System Studio Demo - Built with Elm
A demo of the main features of L-System Studio. An environment for creating and exploring L-Systems that was built with Elm.