Please log in to watch this conference skillscast.
At TripShot, we felt that the usual way of constructing non-empty lists was asymmetrical and awkward. I set out to create one that could take a variable number of arguments.
This turned out to be surprisingly tricky, even though I thought I had a model to start with: printf. A colleague pointed out Donnacha Kidney's post about liftAN. This came closer to what I needed but still didn't quite match my problem. I was able to construct a solution that merged these elements with some additional insights and language features to construct a solution I was happy with.
As an attendee, I would enjoy a talk like this, because I feel that there are many pre-packaged solutions that seem to be spun from whole cloth, and that can be intimidating. By showing the process by which I developed this solution, I hope it will seem less like magic, and encourage others to attempt to solve similar problems.
YOU MAY ALSO LIKE:
- How to Design a Variadic Non-Empty List Constructor (SkillsCast recorded in December 2022)
- Scala Days 2023 (Online Conference on 1st - 30th December 2023)
- Think Functionally (Online Meetup on 23rd March 2023)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
How to Design a Variadic Non-Empty List Constructor
Lyle Kopnicky
Lyle Kopnicky has been writing Haskell since attending the Oregon Graduate Institute in 2001. He has written production Haskell code at Janrain and TripShot, but has written a lot of Perl as well. He led the Portland Functional Programming Study Group for three years. He is the author of Vintage BASIC (a BASIC interpreter written in Haskell), and a library for verifying natural deduction proofs.