Skip to content

Instantly share code, notes, and snippets.

View middleware_full.go
package main
import (
func init() {
dysinger / packages.el
Last active Jan 16, 2021
Private spacemacs layer to try out Chris Done's Intero mode for haskell
View packages.el
;; 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
;; 4. fire up emacs & open up a stack project's source files
View Async.hs
module Web.Scotty.Async
import Control.Concurrent (ThreadId, forkIO, newEmptyMVar, putMVar, takeMVar)
import Control.Concurrent.Async (async, Async(..))
import Data.Default (def)
import Network.Wai.Handler.Warp (Port, defaultSettings, setBeforeMainLoop,
import Web.Scotty (Options(..), ScottyM, scottyOpts)
noteed /
Last active May 7, 2017
Notes about creating small Docker images with Haskell binaries.
View reflection_aeson.hs
-- Example of a dynamically generated FromJSON instance.
-- Can be useful when one needs to use a function with a
-- FromJSON constraint, but some detail about the
-- conversion from JSON is not known until runtime.
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
#!/bin/bash -e
name=$(sed -n -e 's/^[nN]ame:\s\+\(.\+\)/\1/p' *.cabal)
old_ver=$(sed -n -e 's/^[vV]ersion:\s\+\(.\+\)/\1/p' *.cabal)
grep -i '^Library' *.cabal || has_docs=0
echo "Package name: $name"
echo "Current version: $old_ver"
echo "Has documentation: $has_docs"
chrisdone /
Last active Aug 24, 2021
Typing Haskell in Haskell

Typing Haskell in Haskell


Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

View moment-immutable.js
(function (root, factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
define(['moment'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('moment'));
} else {
}(this, function (moment) {
rehno-lindeque / .ghci
Last active Aug 29, 2015
Useful REPL utils for Yesod (as well as some generally useful functions!)
View .ghci
:set -i.:config:dist/build/autogen
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
import Prelude
import Control.Applicative
import Data.Char
import Data.List
import qualified Data.Text as T
import Data.Text (Text)
Fuuzetsu / hackagedocs
Last active Apr 9, 2016
Script for generating and uploading missing documentation for your Hackage packages. Now with fixed package links and contents page.
View hackagedocs
#!/usr/bin/env bash
cabal configure && cabal build && cabal haddock --hyperlink-source \
--html-location='/package/$pkg-$version/docs' \
if [ "${S}" -eq "0" ]; then
cd "dist/doc/html"
cp -r "${1}" "${DDIR}" && tar -c -v -z --format=ustar -f "${DDIR}.tar.gz" "${DDIR}"