This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | | |
module Bidirectional where | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MagicHash #-} | |
module Main where | |
import Control.Monad | |
import Data.Word (Word64) | |
import qualified Data.ByteString.Char8 as BS8 | |
import Control.DeepSeq | |
import qualified Data.Text.Array as A | |
import GHC.Prim | |
import GHC.Base (Int(..)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Next-generation IDE for functional programming | |
# Run it, and press any key to start writing code. | |
# It will automatically exit when you're done writing your function. | |
# Work in progress, currently supports factorial | |
import sys | |
factorial = 'fac n = if n > 1 then n * (fac (n - 1)) else 1'.split() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ordArray = function (__dict_Ord_9) { | |
return { | |
"__superclasses": { | |
"Prelude.Eq_0": function (_) { | |
return eqArray(__dict_Ord_9["__superclasses"]["Prelude.Eq_0"]({})); | |
} | |
}, | |
compare: function (_20) { | |
return function (_21) { | |
if (_20.length === 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- see http://mlton.org/OptionalArguments | |
module OptionalArg where | |
data Product a b = a :& b deriving Show | |
end (a, f) = f a | |
fold (a, f) g = g (a, f) | |
step0 h (a, f) = fold (h a, f) | |
step1 h (a, f) b = fold (h (b, a), f) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat hosts | xargs -P 0 -n1 -ihost bash -c 'ping -q -W 1 -c 1 host &> /dev/null || echo host failed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
LOG_FILE=$1 | |
SB="stdbuf -i0 -oL" | |
shift | |
tput sc | |
$@ 2>&1 | $SB tee $LOG_FILE | $SB cut -c-$(tput cols) | $SB sed -u 's/\(.\)/\\\1/g' | $SB xargs -0 -d'\n' -iyosi -n1 bash -c 'tput rc;tput el; printf "\r%s" yosi' | |
EXIT_CODE=${PIPESTATUS[0]} | |
tput rc;tput el;printf "\r" # Delete the last printed line | |
exit $EXIT_CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
class Indexable a where | |
instance Indexable (String, Int, Char) where | |
instance Indexable ([(String, a)], String, a) where | |
test1 :: Indexable (a,b,c) => a -> b -> c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS -Wall #-} | |
{-# LANGUAGE TypeFamilies, FlexibleInstances #-} | |
import Data.Map | |
class Indexable a where | |
type Index a | |
type Result a | |
index :: a -> Index a -> Result a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;(load "/local-home/user18/repos/thirdparty/emacs-haskell-config/init.el") | |
(add-to-list 'load-path "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/") | |
(require 'haskell-mode-autoloads) | |
(add-to-list 'Info-default-directory-list "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/") | |
(require 'cl) | |
(add-to-list 'load-path "~/.emacs.d/lisp") | |
(require 'cask "~/.cask/cask.el") |