Skip to content

Instantly share code, notes, and snippets.

View cstrahan's full-sized avatar

Charles Strahan cstrahan

  • Fullstory
  • Dallas, TX
View GitHub Profile
@cstrahan
cstrahan / CoYoneda.hs
Created January 7, 2017 05:22 — forked from thoughtpolice/CoYoneda.hs
CoYoneda = Yoneda
{-# LANGUAGE ExistentialQuantification, RankNTypes #-}
{-# LANGUAGE InstanceSigs #-}
module CoYoneda where
import Data.IORef
import Data.Set (Set, map)
import Control.Monad (liftM)
--------------------------------------------------------------------------------
-- Yoneda
{-# LANGUAGE GADTs, TypeInType, DataKinds, TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeApplications #-}
import GHC.TypeLits
import GHC.Types
import Data.Singletons
import Data.Singletons.Prelude
data Format = Lit Symbol | Str | Shown Type
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Prelude hiding (log)
--------------------------------------------------------------------------------
-- The API for cloud files.
class Monad m => MonadCloud m where
saveFile :: Path -> Bytes -> m ()
@cstrahan
cstrahan / PowerMate.rb
Last active September 16, 2016 04:57
PowerMate + Ruby
#!/usr/bin/ruby
#
###########################################################################
#
# = PowerMate Interface Library for Linux
#
# == Description
#
# Interface Library to the Griffin PowerMate for Linux.
# The library includs a (minimalist) generic classes for the Linux Input Event
@cstrahan
cstrahan / gist.md
Last active September 16, 2016 05:00 — forked from honza/gist.md
Clojure vs Haskell

Haskell vs Clojure

The JSON data is in the following format

{
    "Genesis": {
        "1": {
            "1": "In the beginning..." ,
            "2": "..."
@cstrahan
cstrahan / machinesbench.hs
Created June 13, 2016 20:26 — forked from twanvl/machinesbench.hs
Machines benchmark modified to include vector stream fusion. Addapted from https://gist.github.com/michaelt/f19bef01423b17f29ffd, which is in turn based on https://github.com/ekmett/machines/blob/master/benchmarks/Benchmarks.hs
{-#LANGUAGE NoMonomorphismRestriction #-}
module Main (main) where
import Control.Monad (void)
import Control.Monad.Identity
import Criterion.Main
import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as CC
import qualified Data.Conduit.List as C
import qualified Data.Machine as M
@cstrahan
cstrahan / benchcompose.hs
Created June 13, 2016 20:18 — forked from michaelt/benchcompose.hs
benchmark prelude compositions following the pattern of john weigley's https://github.com/jwiegley/streaming-tests
{-#LANGUAGE BangPatterns #-}
module Main (main) where
import Data.Conduit as C
import qualified Data.Conduit.Combinators as C
import Pipes as P
import qualified Pipes.Prelude as P
import qualified Streaming.Prelude as Str
@cstrahan
cstrahan / packages.el
Created June 3, 2016 02:55 — forked from dysinger/packages.el
Private spacemacs layer to try out Chris Done's Intero mode for haskell
;; 1. place this in ~/.emacs.d/private/intero/packages.el
;; 2. add intero, syntax-checking and auto-completion to your
;; ~/.spacemacs layer configuration & remove the haskell layer
;; if you were using that before
;; 3. make sure you have stack installed http://haskellstack.org
;; 4. fire up emacs & open up a stack project's source files
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}