recursion-schemes
Advent-Of-Code
recursion-schemes | Advent-Of-Code | |
---|---|---|
20 | 12 | |
335 | 19 | |
0.3% | - | |
4.3 | 8.5 | |
22 days ago | 4 months ago | |
Haskell | Python | |
BSD 2-clause "Simplified" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
recursion-schemes
-
-❄️- 2023 Day 4 Solutions -❄️-
Reasonably proud of my part 2 solution, although would like to try using a recursion scheme rather than unstructured recursion:
-
Interactive animations
Yeah, that project is pretty much at the bottom of my list, unfortunately. My top projects these days are mgmt, klister, recursion-schemes, and hint... And that's already too much!
-
Science of Recursion
In a programming context, recursion schemes can be used to write recursive (or corecursive) functions, by automating/abstracting away the common boilerplate part of actually doing the recursion. They take the form of polymorphic higher-order functions, which can be imported from a library like this classic one.
-
Is there a way to avoid call overhead?
Maybe I didn't link the best post. It is unfortunately the only one I know that uses Rust. If you are able to read Haskell, the documentation for the recursion-schemes package might be a better resource?
-
Ah yes I love arrays with a length of infinity!!!
Writing something as a type of fold over an infinite sequence is nicer than using recursion directly in my opinion. See: https://hackage.haskell.org/package/recursion-schemes
-
Tips on mastering recursion and trees and shit?
Consider recursion schemes! It let's you separate the logic of how your recursion is structured on your data, and the logic of what you're doing on each recursion stage. So e.g. you can write the core logic of a recursive linked list summation as just fun x accum -> x + accum, and then you just find the appropriate recursion scheme to pipe the list values into x and handle recursing to build accum (a catamorphism in this case)
-
So you come across an undocumented library…
It's a pretty complicated bug, documented in details at https://github.com/recursion-schemes/recursion-schemes/issues/50
-
Beautiful ideas in programming: generators and continuations
It’s also trivial and easy in Haskell — you just need an instance of `Foldable` or `Traversable` on your collection, and then you can fold or traverse it in a configurable way. Or for recursive structures, use https://hackage.haskell.org/package/recursion-schemes. Or even just pass a traversal function as an argument for maximum flexibility.
-
fromMaybe is Just a fold
https://hackage.haskell.org/package/recursion-schemes is the "normal" library for this type of generalized folding. It even contains Base instances for Maybe and Either.
-
Annotation via anamorphism?
I've been working on a system which uses recursion-schemes to annotate a recursive type. The annotated tree itself is pretty simple; at each level, we pair the annotation with the base functor, or
Advent-Of-Code
-
-❄️- 2023 Day 4 Solutions -❄️-
Part1 and part2
- -🎄- 2022 Day 3 Solutions -🎄-
-
-🎄- 2022 Day 2 Solutions -🎄-
Solution: https://github.com/tymscar/Advent-Of-Code/tree/master/2022/typescript/day02
-
-🎄- 2022 Day 1 Solutions -🎄-
Thought about doing it in Typescript this year. You can find part1 here and part2 here!
-
-🎄- 2021 Day 25 Solutions -🎄-
Today was way easier than the past week which is great, because I can relax a bit. I have rushed the code, so its not the greatest, but its here, in Javascript, if you want to see!
-
-🎄- 2021 Day 23 Solutions -🎄-
Today was insane for me. Basically spent like 10 hours working on it, but I started from scratch in the last hour and got both parts. I made very stupid mistakes such as reversing the values when reading them or writing a 2 instead of a 3. I am tired, but we are almost at the end! Part1 and part2 in Javascript.
-
-🎄- 2021 Day 19 Solutions -🎄-
Part1 and part2 in Javascript. Beware, code is ugly, didnt have time to clean it up and it also runs in like 3 minutes... :(
-
-🎄- 2021 Day 10 Solutions -🎄-
Part1 and part2 in Javascript
-
-🎄- 2021 Day 9 Solutions -🎄-
Today was very enjoyable, albeit a bit easier than expected after what was yesterday, haha. Part1 and part2 in Javascript
-
-🎄- 2021 Day 8 Solutions -🎄-
I think today was very difficult because of the way the problem was layed out. Most of what you need to do for part2 was explained in part1 for no reason and the example werent exhaustive. I tried doing it with sets, then I also tried bruteforcing it and in the end I ended up doing a more manual approach which is very ugly but I am too tired to refactor rigth now. Part1 and part2 in Javascript.
What are some alternatives?
distributed-process-platform - DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution
AlgorithmProblems - Solutions to Algorithm Problems :chart_with_upwards_trend: :neckbeard:
record - Anonymous records
adventofcode - 🎄 Advent of Code solutions
unliftio - The MonadUnliftIO typeclass for unlifting monads to IO
AdventOfCodeTI83 - As many Advent of Code problems as possible, done in Z80 assembly language for the TI83 graphing calculator.
machines - Networks of composable stream transducers
AOC-2022
chr-core - Constraint Handling Rules
aoc2021 - My solutions for the 2021 Advent of Code
pipes-core - Compositional pipelines
adventofcode - ES6 solutions to Advent of Code puzzles.