Skip to content

Instantly share code, notes, and snippets.

Michael Schröder mcschroeder

View GitHub Profile
@mcschroeder
mcschroeder / Key.hs
Created Feb 10, 2016
Getting values out of types at runtime
View Key.hs
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Key (Key, makeKey) where
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import Data.Proxy
import GHC.TypeLits
@mcschroeder
mcschroeder / serial.sh
Created Dec 12, 2015
Create virtual serial ports
View serial.sh
#!/bin/sh
if [ -z "$1" ]
then
echo "Usage: $0 name"
exit 1
fi
MASTER=$1
SLAVE=$1_virt
View stm_finalizers.patch
From cd75ebc1752dd66dcc7fcaa9e1288fa5026873e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Schr=C3=B6der?= <mc.schroeder@gmail.com>
Date: Mon, 14 Mar 2016 13:29:10 +0100
Subject: [PATCH 1/2] Add STM finalizers
This introduces a new function
atomicallyWithIO :: STM a -> (a -> IO b) -> IO b
Like the existing atomically operation, atomicallyWithIO transforms a
@mcschroeder
mcschroeder / gist:8906117
Created Feb 9, 2014
Vigenère cipher cracker
View gist:8906117
-- DISCLAIMER:
-- I wrote this when I was just beginning to learn Haskell.
-- I recently found it again and wanted to preserve it.
-- It's probably terrible code. I haven't looked it over.
import Data.Char
import Data.List
import Data.Maybe
import Data.Function
You can’t perform that action at this time.