Solutions to exercises from codewars.com.
I'll only list here non trivial solutions to exercices that I have not authored. Difficulty ranking ranges from 8kyu (easiest) to 1kyu (hardest). Most of the files will not compile on their own. A lot of the work has been done in-browser and the code isn't always well formatted/documented.
Implementation of a coroutine library (pipeline of functions that can yield values repeteadly or request input).
details
code
Implementation of basic algebraic data structures using Scott Encoding.
details
code
Basic operators of the SKI combinator calculus + implementation of several common combinators & boolean arithmetic in point free form.
details
code
(Clumsy) implementation of a few polyvariadic functions (functions that can take a variable number of arguments).
details
code
Formulation of natural numbers using Church, Peano and Scott encoding, as well as representation as a list of units.
details
code
A mini-library of van Laarhoven style lenses.
details
code
Proof of the Yoneda Lemma in Hask, with some light application to counting instances of natural transformations.
details
code
Fun with the cardinality of types: count and enumerate all members of given types, including function and functor types.
details
code
I like this one. Parses a mathematical expression in prefix expression then computes its derivative and simplifies it.
details
code
Interpreter for a finally tagless EDSL.
details
code
(Ab)use of the Haskell type system to prove some properties of arithmetic on even and odd integers.
details
code
Using the isomorphism between algebraic data types to do some light proof work.
details
code
A simple regular expression parser. The implementation is a bit messy.
details
code
A parser and interpreter for a simple Lisp-like language.
details
code
Everything is in the title.
details
code
Implementation of a compile-time checked vector using features mimicking dependent types.
details
code
Imperative syntax in do notation using the State monad.
details
code
A simple class that allow three way comparisons (a < b < c) in C++.
details
code
Definition of the binary polynom field and ring and their operations.
details
code
Checks that the positions of ships on a board of Battleship are legal.
details
code
Definition of some isomorphisms using the Haskell type system.
details
code
Implementation of Identity, Maybe, State, Reader and Writer.
details
code