Skip to content

Instantly share code, notes, and snippets.

/* Modified version of https://gist.github.com/non/51b83d0abc929cc4f0b153accf2bf02f
* to expose it's GADT's nature and provide the folding function.
*
* Should run out of the box with: amm <the_file>
*/
import $ivy.`org.typelevel:cats-core_2.12:1.6.0`
object demo {
import cats.{Applicative, Functor, Id, Semigroupal, Traverse}
@non
non / Wild.scala
Last active April 9, 2020 00:26
Interesting trick to lift existentials into values, so we can later refer to them.
package demo
import cats.{Applicative, Functor, Id, Semigroupal, Traverse}
import cats.arrow.FunctionK
/**
* Type-lifting operation to replace the wildcard type (i.e. _).
*
* In some cases we end up with code like: List[Option[_]]. This is
* fine unless you later need to write code in terms of a particular
@ursuad
ursuad / kafka-cheat-sheet.md
Last active June 25, 2024 13:23
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@cb372
cb372 / jargon.md
Last active May 14, 2024 03:45
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.