Reminder
- A monad can defined:
trait Monad[M[_]] {
def pure[A](a: A): M[A]
def flatMap[A](m: M[A])(f: A => M[B]): M[B]| saved_model_schema_version: 1 | |
| meta_graphs { | |
| meta_info_def { | |
| stripped_op_list { | |
| op { | |
| name: "Const" | |
| output_arg { | |
| name: "output" | |
| type_attr: "dtype" | |
| } |
| import cats.{Id, Functor, Monad, ~>} | |
| import cats.std.function._ | |
| import cats.syntax.cartesian._ | |
| sealed trait KVS[A] | |
| case class Put[A](key: String, value: String, a: A) extends KVS[A] | |
| case class Get[A](key: String, a: String => A) extends KVS[A] | |
| type Dsl[A] = ApFree[KVS, A] |
| import cats._ | |
| import cats.free._ | |
| import cats.arrow.NaturalTransformation | |
| object ApFree { | |
| /** | |
| * Return from the computation with the given value. | |
| */ | |
| private final case class Pure[S[_], A](a: A) extends ApFree[S, A] |
| // Open the developer console of your favorite browser | |
| // on the page of your favorite meetup where you're on the wailist (grrr) | |
| // and paste this by putting your name | |
| // This will actually compute the position in the waitlist div which seems to correspond to the waitlist position | |
| var findPosition = function(username) { return $("#rsvp-list-waitlist h5").map(function(i, el) {return {"pos": i, "name": $(el).text()}}).filter(function(i, el) {return el["name"].indexOf(username) >= 0;})} | |
| findPosition("my displayed name") // where my displayed name is the name that is displayed for you on the meetup |