Skip to content

Instantly share code, notes, and snippets.

View plumenator's full-sized avatar
👋
Getting my Open Source on!

Karthik Ravikanti plumenator

👋
Getting my Open Source on!
View GitHub Profile
@plumenator
plumenator / graph_magic.hs
Created July 6, 2023 13:29 — forked from s-zeng/graph_magic.hs
Haskell graph algorithms using semiring linear algebra
-- reference paper: https://www.cl.cam.ac.uk/%7Esd601/papers/semirings.pdf
{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
import Data.List
infixl 9 |*|
infixl 8 |+|
-- closed semiring = ring with the usual rules, but w/o additive inverse, and w/ a closure operator
@plumenator
plumenator / cp_syllabus.md
Created July 2, 2022 16:21 — forked from sethupathib/cp_syllabus.md
Competitive Programming Syllabus

Competitive Programming Syllabus

Geometry

  • Problems - Refer the article for a list of problems which can be solved using Rotating Calipers technique.
@plumenator
plumenator / cp_syllabus.md
Created July 2, 2022 16:21 — forked from sharmaeklavya2/cp_syllabus.md
Competitive Programming Syllabus

Competitive Programming Syllabus

Geometry

  • Problems - Refer the article for a list of problems which can be solved using Rotating Calipers technique.
{-# LANGUAGE DeriveFunctor #-}
module Main where
type Algebra f a = f a -> a
type Coalgebra f a = a -> f a
newtype Fix f = In { out :: f (Fix f) }
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@plumenator
plumenator / fpmax.scala
Created February 1, 2022 13:16 — forked from jdegoes/fpmax.scala
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
import scala.util.{Try, Success, Failure}
def f(s: String): Try[Int] = Try { s.toInt }
def g(i: Int): Try[Int] = Try { i * 2 }
def unit[T](v: T): Try[T] = Success(v)
//val v = "1"
val v = "bad"
val m = Success(v)