Skip to content

Instantly share code, notes, and snippets.

View jkachmar's full-sized avatar
🏳️‍⚧️

jkachmar jkachmar

🏳️‍⚧️
View GitHub Profile
@jkachmar
jkachmar / Main.purs
Last active June 3, 2020 18:18
Some Weird PureScript Validation Stuff
module Main where
import Prelude
import Control.Monad.Eff as Eff
import Control.Monad.Eff.Console as Eff.Console
import Semigroup as Semigroup
import Semiring as Semiring
main :: ∀ eff. Eff.Eff (console :: Eff.Console.CONSOLE | eff) Unit
@jkachmar
jkachmar / Total.hs
Created May 13, 2020 17:41
Total prism matching
import Control.Lens hiding (from, to)
import GHC.Generics
class Empty a where
impossible :: a -> x
default impossible :: (Generic a, GEmpty (Rep a)) => a -> x
impossible = gimpossible . from
instance Empty Void where
impossible = absurd
@jkachmar
jkachmar / init.el
Created May 11, 2020 02:08
Emacs config
;;; init.el --- jkachmar's Emacs setup. -*- lexical-binding: t; -*-
;;
;;; Commentary:
;; This file loads use-package, org-mode, and compiles and executes readme.org
;;
;;; Code:
(require 'package)
(setq package-enable-at-startup nil)
@jkachmar
jkachmar / Main.hs
Last active March 17, 2020 15:55
Just Do the Right Thing
module Main where
--------------------------------------------------------------------------------
-- | This is the `Maybe` data type:
-- |
-- | > data Maybe a
-- | > = Nothing
-- | > | Just a
-- |
-- | `Maybe` is a sum type that can be parameterized over a given `a` type, such
@jkachmar
jkachmar / stack.yaml
Last active January 29, 2020 17:02
GitHub Semantic w/ Stack
resolver: lts-13.23
packages:
- '.'
- vendor/haskell-tree-sitter
- vendor/haskell-tree-sitter/languages/go
- vendor/haskell-tree-sitter/languages/haskell
- vendor/haskell-tree-sitter/languages/java
- vendor/haskell-tree-sitter/languages/json
- vendor/haskell-tree-sitter/languages/php
- vendor/haskell-tree-sitter/languages/python
@jkachmar
jkachmar / Blap.hs
Last active October 9, 2019 04:02
Madness
newtype ClientInterpreter params m
= ClientInterpreter
( forall response
. params
-> ClientEnv
-> ClientF response
-> ExceptT ServantError m response
)
class HasClientInterpreter (context :: Type -> (Type -> Type) -> Type) where

Keybase proof

I hereby claim:

  • I am jkachmar on github.
  • I am jkachmar (https://keybase.io/jkachmar) on keybase.
  • I have a public key ASDsrA8DW3FUcHdfREv4Ws2lnjzCinJTes8DTm6K72iRcQo

To claim this, I am signing this object:

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PartialTypeSignatures #-}
module Main where
import Control.Exception.Safe (MonadMask)
import qualified Control.Exception.Safe as Exc
import Control.Monad.IO.Class (MonadIO)
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
module Main where
import Control.Monad.Trans.Writer.Ref
import qualified Control.Monad.Writer.CPS as CPS
import Control.Monad.ST
import Data.Foldable (for_)
import Data.Monoid
import Data.Semigroup
import Data.Mutable
import qualified Data.Vector.Generic.Mutable as M
module ServantAuthGoogle where
import ClassyPrelude hiding (Handler)
import Control.Error.Util (hush)
import Control.Lens ((.~), (^.), (^?))
import Control.Monad.Except
import qualified Crypto.JOSE as Jose
import qualified Crypto.JWT as Jose
import Crypto.Util (constTimeEq)
import Data.Aeson