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 OverloadedStrings #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE GADTs, DataKinds, TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} |
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 qualified Data.ByteString.Lazy as L | |
import Data.ByteString.Builder | |
import Data.Monoid | |
import Data.Foldable (foldMap) | |
import Data.List (intersperse) | |
import Criterion.Main -- add this import to the ones above | |
data Cell = StringC String | |
| IntC Int | |
deriving( Eq, Ord, Show ) |
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(sm). | |
-export([multi_step/1, | |
multi_steps/1 | |
]). | |
-type instr() :: {push, integer()} | {pop, pos_integer()}. | |
-type state() :: {non_neg_integer(), [instr()], [integer()]}. | |
-spec step(state()) -> state() | halt | err. |
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(sm). | |
-export([multi_step/2 | |
]). | |
-type lint() :: {low|high, integer()}. | |
-type instr() :: {push, lint()} | {pop, pos_integer()} | add. | |
-type state() :: {non_neg_integer(), [lint()]}. | |
-type prog() :: [instr()]. | |
-spec step(state(), prog()) -> state() | halt | {err, string()}. |
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
$ python2 ../cuter -r -s 3 sm multi_step "[{0,[]},[]]" --depth 20 | |
Compiling sm.erl ... ok | |
Testing sm:multi_step/2 ... | |
.xx..xx..x.xxx.xxx.xxxxx.xxxxxxxxxxxxxxxxxxxx.x.xxxxxxxxxxxxxxxx.xx.xxxxxx.x.x.xxxxxxx.xxx.xt[SOLVER ERROR] {"python2 -u /home/sam/code/cuter/priv/cuter_interface.py --smt", | |
[{{'__s',"0.1878130598.1640759297.34061"}, | |
{2, | |
[{high,4}, | |
{low,5}, | |
{low,6}, | |
{high,7}, |
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 D/toJSON/th benchmarking D/toJSON/th | |
time 7.576 μs (7.486 μs .. 7.710 μs) time 7.140 μs (7.127 μs .. 7.154 μs) | |
0.998 R² (0.997 R² .. 1.000 R²) 1.000 R² (1.000 R² .. 1.000 R²) | |
mean 7.508 μs (7.479 μs .. 7.571 μs) mean 7.130 μs (7.121 μs .. 7.143 μs) | |
std dev 186.6 ns (112.6 ns .. 296.5 ns) std dev 46.34 ns (35.27 ns .. 72.45 ns) | |
benchmarking D/toJSON/generic benchmarking D/toJSON/generic | |
time 8.946 μs (8.928 μs .. 8.967 μs) time 8.693 μs (8.680 μs .. 8.705 μs) | |
1.000 R² (1.000 R² .. 1.000 R²) 1.000 R² (1.000 R² .. 1.000 R²) | |
mean 8.945 μs (8.927 μs .. 8.969 μs) mean 8.701 μs (8.688 μs .. 8.719 μ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
{-# LANGUAGE TemplateHaskell, DataKinds, MultiParamTypeClasses, TypeFamilies, UndecidableInstances, FlexibleInstances, FlexibleContexts #-} | |
module T where | |
import Control.Monad.Trans.Class | |
import Data.Traversable | |
import Language.Haskell.TH | |
autoLift :: Name -> Q Type -> Q [Dec] | |
autoLift className transTypeQ = do |
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 D/toJSON/th benchmarking D/toJSON/th | |
time 7.353 μs (7.306 μs .. 7.418 μs) time 7.082 μs (7.077 μs .. 7.089 μs) | |
1.000 R² (0.999 R² .. 1.000 R²) 1.000 R² (1.000 R² .. 1.000 R²) | |
mean 7.337 μs (7.327 μs .. 7.365 μs) mean 7.090 μs (7.083 μs .. 7.103 μs) | |
std dev 58.39 ns (26.25 ns .. 126.8 ns) std dev 35.18 ns (18.63 ns .. 64.90 ns) | |
benchmarking D/toJSON/generic benchmarking D/toJSON/generic | |
time 8.932 μs (8.913 μs .. 8.960 μs) time 7.960 μs (7.944 μs .. 7.995 μs) | |
1.000 R² (1.000 R² .. 1.000 R²) 1.000 R² (1.000 R² .. 1.000 R²) | |
mean 8.943 μs (8.919 μs .. 9.053 μs) mean 7.953 μs (7.943 μs .. 7.997 μ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
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE CPP #-} | |
module Main (main) where | |
import Prelude () | |
import Prelude.Compat |
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
-- RHS size: {terms: 907, types: 843, coercions: 213} | |
gBigRecordEncode | |
gBigRecordEncode = | |
\ x_agyO -> | |
toLazyByteString | |
(case x_agyO | |
of _ { BigRecord dt_dgtw dt1_dgtx dt2_dgty dt3_dgtz dt4_dgtA -> | |
let { | |
$wa_smTE | |
$wa_smTE = |