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 Lib where | |
import Data.Vector as V | |
type LookupCached a = Int -> a | |
mkCache :: [a] -> LookupCached a | |
mkCache xs = | |
let !cache = V.fromList xs | |
in V.unsafeIndex cache |
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 #-} | |
{-# LANGUAGE UnboxedTuples #-} | |
{-# LANGUAGE UnliftedDatatypes #-} | |
module Main where | |
import GHC.Exts | |
import GHC.IO | |
import Unsafe.Coerce | |
import Data.Kind |
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
-- -fno-worker-wrapper -dno-typeable-binds just makes the resulting dump easier to understand. | |
-- Try uncommenting the second OPTIONS pragma to see the difference float out makes. | |
{-# OPTIONS_GHC -O -fno-worker-wrapper -ddump-simpl -dsuppress-all -ddump-to-file -fforce-recomp #-} | |
-- {-# OPTIONS_GHC -fno-full-laziness #-} | |
module Main(main,g) where | |
import GHC.Exts | |
{-# NOINLINE 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
data Side = LeftSide | RightSide | |
data GEither c a b where | |
GLeft :: a -> GEither 'LeftSide a b | |
GRight :: b -> GEither 'RightSide a b | |
data LVal = LVal Int | |
data RVal = RVal Int | |
data LeftRightMap 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
{- | Pack types of a known size into as few bytes as possible. | |
We do so by assigning each instance of the Packable class | |
a 'Width' in bits. | |
When combining types we add up their widths using type level computation. | |
-} | |
{-# LANGUAGE TypeFamilies #-} |
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
==================== Tidy Core ==================== | |
Result size of Tidy Core | |
= {terms: 17,361, types: 21,327, coercions: 5,089, joins: 99/404} | |
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} | |
$trModule2 = "Load"# | |
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/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
# First get a list of all packages | |
cabal list --simple | tee packages.list | |
# Then compute the locations of their tar files | |
python3 -c "from fileinput import *; [print(\"https://hackage.haskell.org/package/\"+p+\"/\"+p+\"-\"+ver+\".tar.gz\") for (p,ver) in sorted(dict(map(str.split, input())).items())]" < packages.list | tee files.list | |
# If you are on windows make sure python didn't use CRLF: | |
# dos2unix files.list | |
# Download all the archives - 4 at a time. Some might fail, that is expected. |
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 Main where | |
import GHC | |
import CoreSyn | |
import Inst | |
import Desugar | |
import TcRnMonad | |
import TcHsSyn | |
import RnExpr | |
import GhcMonad |
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
Andi@Horzube MINGW64 /e/pan-os-syslog | |
$ cabal new-run bench -w /e/ghc_layout/_quick/stage1/bin/ghc.exe --allow-newer="*" | |
Up to date | |
benchmarking 8-1-Traffic-A ... | |
benchmarked 8-1-Traffic-A | |
time 626.4 ns (611.3 ns .. 647.4 ns) | |
0.987 R² (0.971 R² .. 0.997 R²) | |
mean 618.7 ns (610.2 ns .. 634.3 ns) | |
std dev 38.10 ns (25.20 ns .. 65.38 ns) | |
variance introduced by outliers: 39% (moderately inflated) |
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
compiler\nativeGen\X86\CodeGen.hs:169:1: warning: [-Wincomplete-patterns] | |
Pattern match(es) are non-exhaustive | |
In an equation for `verifyBasicBlock': | |
Patterns not matched: _ :: [Instr] | |
| | |
169 | verifyBasicBlock instrs | |
-- Verifying basic blocks is cheap, but not cheap enough to enable it unconditionally. | |
verifyBasicBlock :: [Instr] -> () |
NewerOlder