Skip to content

Instantly share code, notes, and snippets.

View jacobm's full-sized avatar

Jacob Mortensen jacobm

  • Copenhagen
  • 01:35 (UTC +02:00)
View GitHub Profile
@jacobm
jacobm / simple.scala
Last active January 17, 2017 21:00
Basic quill example
import java.util.Date
import io.getquill._
import scala.concurrent.{Await, ExecutionContext}
import scala.concurrent.duration._
import org.joda.time.DateTime
case class Users(
id: String,
@jacobm
jacobm / Free.fsx
Last active April 18, 2016 08:04
Free monad interpreter in F# (based on: http://programmers.stackexchange.com/a/242803/145941)
type DSL<'next> =
| Get of string * (string -> 'next)
| Set of string * string * 'next
| End
with static member fmap f = function
| Get (k, c) -> Get (k, f << c)
| Set (k, v, c) -> Set (k, v, f c)
| End -> End
type FreeDSL<'a> =
@jacobm
jacobm / typeclasses.purs
Created March 10, 2016 13:46
typeclasses purescript
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
data MyMaybe a = None | Some a
instance functorMyMaybe :: Functor MyMaybe where
map _ None = None