Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 MultiParamTypeClasses, FlexibleInstances, | |
TypeOperators, UndecidableInstances #-} | |
import Data.Constraint | |
import Data.Constraint.Forall | |
class C1 a b | |
class C2 a b | |
instance C1 a b => C2 a b |
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
benchmarking vec base | |
time 15.54 μs (15.43 μs .. 15.63 μs) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 15.45 μs (15.40 μs .. 15.51 μs) | |
std dev 180.4 ns (157.0 ns .. 209.1 ns) | |
benchmarking vec roman | |
time 16.86 μs (16.77 μs .. 16.95 μs) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 16.86 μs (16.81 μs .. 16.92 μs) |
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
for n in 5000 50000 500000 5000000; do | |
for impl in roman michael base; do | |
printf "%7d %10s" $n $impl | |
./test4 $impl $n +RTS -s 2>&1|perl -lne '/(^.*bytes).*residency/&&print $1' | |
done | |
done |
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
#!/usr/bin/perl | |
# (c) Roman Cheplyaka, 2016 | |
# License: MIT | |
# Usage: | |
# | |
# combined_to_csv FILE1 FILE2 ... > FILE.csv | |
# | |
# The resulting CSV file can be read in R with: |
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/sh | |
# Call this from your 'documents' directory | |
set -eu | |
for d in *.sdr | |
do | |
if [ -d "$d" -a ! -n "$(find . -maxdepth 1 -type f -name "${d%.sdr}*" -print -quit)" ] | |
then | |
echo "$d" |
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 | |
ScopedTypeVariables, | |
TemplateHaskell, | |
TypeFamilies, | |
GADTs, | |
KindSignatures, | |
DataKinds, | |
PolyKinds, | |
TypeOperators, | |
FlexibleContexts, |
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 GADTs, DataKinds, TypeOperators #-} | |
{-# OPTIONS_GHC -Wall #-} | |
data Nat = Z | S Nat | |
data m <= n where | |
Le_z :: (n <= n) | |
Le_s :: (m <= n) -> (m <= S n) | |
type (m < n) = (S m <= n) |
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
import Control.Monad.Logic | |
import Control.Monad.Trans.Maybe | |
zipLogic :: (MonadLogic m) => m a -> m b -> m (a, b) | |
zipLogic gx gy = | |
maybe mzero return <=< runMaybeT $ do | |
(x, rx) <- MaybeT (msplit gx) | |
(y, ry) <- MaybeT (msplit gy) | |
lift $ return (x, y) `mplus` zipLogic rx ry |
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
pub enum RE<S, F:Fn(S,bool)> { | |
Eps, | |
Symbol(F) | |
} |
NewerOlder