Back to the Unison website
Happy Holidays
Cloud Cloud
Santa and sleigh
Stars Comet Mountains background Light ground Left background dark tree Right background dark tree Main holiday tree Blue lights Red lights Yellow lights Pink lights Right tree background Left tree background Tree on left side of screen Tree on right side of screen Present
Happy Holidays
Unison logo

We wish all of you a festive holiday season and a New Year filled with possibilities! Whether you've just learned about Unison or have authored multiple libraries on the front page of the Unison Share catalog, you’re a part of what inspires us to make Unison happen. We look forward to another year of growth, collaboration, and community with you all. Keep creating and sharing!

This month many of the Unison community members participated in the Advent of Code. Our community spaces have been filled with folks sharing tips, solutions, and written explainers of their implementations. We want to highlight our community's commitment to learning and generosity by sharing some of the work they’ve done over the month (this list is backed by a Unison Cloud service!) Many forayed into new parts of the standard library and their Readme’s stand alone as tutorials in their own right! Enjoy!

Advent of Code Highlights

Day 1

Day 1: Trebuchet features an excellent List pattern matching demo by @gfinol while @rlmark discusses combining the Parse and Ask abilities to reduce boilerplate when writing Unison.

Day 2

Day 2: Cube Conundrum, features @kemiller writing up a solution using Lists with a clever use of `uncollated,` a little known standard lib function. @jcwilk sums up this day nicely, "It was a lot of fun to explore how to best leverage folding and pattern matching to solve these problems." Calls to foldMap abound!

Day 3

For Day 3: Gear Ratios, @ceedubs produced a beautiful explanation of his solution. It even includes mermaid diagrams using another Unison library by @alvaroc1 to better display the problem. @systemfw offers us a pro-tip about representing matrices as `Map` values, and leverages the `Each` ability in his algorithm.

Day 4

Day 4: Scratchcards has the Unison community sharing some wisdom when writing parsers. @cpenner's writeup includes a lesson on backtracking in parser combinator libraries and @systemfw and @rlmark sing the virtues of writing small parser combinators to test iteratively. @kemiller and @systemfw use two of Unison's data structures optimized for natural numbers, NatSet and NatMap, respectively.

Day 5

In Day 5: If You Give A Seed A Fertilizer, @systemfw explored some optimizations. From his Readme: "I couldn't keep ucm churning all day since I had know, work." Instead, his implementation explores an Interval map for greater efficiency. @jcwilk's writeup discusses the process of writing Unison programs itself, "I was able to follow a pattern of leaning hard into composition, building tiny one-line functions, and relying heavily on the typing system to assert correct program behavior."

Day 6

For Day 6: Wait for it, @stew's lovely solution includes play-by-play descriptions of the functions which constitute his solution and a discussion wherein he uses mathematical reasoning to cut down on the problem space. Thank you @stew!

Day 7

Day 7: Camel Cards includes a pattern matching primer by @hagl, who exercises tuple decomposition, list pattern matching, and pattern guards in his algorithm! @systemfw's work includes a great discussion about when to use custom types or rely on more primitive abstractions in a language. Both are very educational reads!

Day 8

Day 8: Haunted Wasteland, was a challenging day! @systemfw boldly went where many feared to tread and his solution discusses, among other things, the vicissitudes of cycle detection! It's wonderful to follow along with his problem solving process.

Day 9

For Day 9: Mirage Maintenance @dvberkel relates the problem to one which Douglas Hofstadter (of Goedel Escher Bach fame) studied. Very cool! He also uses a custom domain Sequence type to help clarify the problem space. It makes for a very readable writeup. Both @johanwinter and @kemiller explore more of the standard library, with lots of folds and unfolding over lists.

Day 10

We love @ceedubs writeup for Day 10 because he takes the time to walk s through his problem solving logic and edge cases with humor and wisdom. It includes an interlude where he takes a walk away from his computer and he returns with a ray-casting inspired solution! Eureka!

Day 11

To solve Day 11: Cosmic Expansion, @systemfw uses a Map based representation of the X,Y grid again. Unison's Map standard lib utility functions offer a rich set of options for this solution. We love @hagl's write-ups because he includes links to the helper functions that he adds or finds useful in the standard lib. This solution used "allPairs," which is a function we'll keep in mind for generating pairs from a list.

Day 12

In Day 12: Hot Springs, @hagl used a handy library for memoization to cut down his runtime from 7 hours (yay! an excuse to sleep!) to less than 4 minutes. @systemfw brought out the heavy artillery for the solutions for day 12, using both dynamic programming and parallelism. Any time we get the chance to listen to Fabio about concurrency, we'll take it!

Day 13

For Day 13: Point of Incidence, @systemfw's solution writeup includes some beautiful ascii art to help explain his algorithm and also breaks down some efficiency shortcuts for part 2 of the problem.

Day 14

For Day 14: Parabolic Reflector Dish, @systemfw wrote a Shakespearean play in 5 acts. Just kidding! No really, there is a whole introduction section to the problem, a section dedicated to the core algorithm, and two sections dedicated to writing a custom memoization ability and ability handler. Truly a masterclass!