Skip to content

Instantly share code, notes, and snippets.

View ghc-submodule-remove.sh
#!/bin/sh -e
git rm --cached libraries/binary
rm -rf libraries/binary/.git
git add libraries/binary
git rm --cached libraries/bytestring
rm -rf libraries/bytestring/.git
git add libraries/bytestring
@TerrorJack
TerrorJack / channel.mjs
Last active Aug 7, 2019
Async JavaScript Channels
View channel.mjs
function newThunk(f) {
let t = () => {
const r = f();
t = () => r;
return r;
};
return () => t();
}
function newNode() {
View test.txt
asterius ghc-testsuite
test/ghc-testsuite/ado/ado-optimal.hs
test/ghc-testsuite/ado/ado-optimal.hs: FAIL (9.63s)
uncaught exception: EvalException
EvalException {evalErrorMessage = "wasm-003b2ee6:1620\n\n\n\nRuntimeError: unreachable\n at prettyzm1zi1zi3zi6zm5t2Wzzuijam22NUf3MpOoWu_TextziPrettyPrintziAnnotatedziHughesPJ_.LcoSm (wasm-function[1619]:244)\n at scheduleWaitThread (wasm-function[1889]:196)\n at rts_evalLazyIO (wasm-function[1856]:27)\n at main (wasm-function[1508]:12)\n at evalmachine.<anonymous>:1:43\n at Script.runInContext (<anonymous>)\n at Script.runInContext (vm.js:134:20)\n at Proxy.runInContext (vm.js:297:6)\n at Worker.<anonymous> (file:///mnt/c/Users/Think/Documents/Haskell/asterius/.stack-work/install/x86_64-linux/ghc-8.9/8.9.20190403/share/x86_64-linux-ghc-8.9.20190403/inline-js-core-0.0.1/jsbits/eval.mjs:71:32)\n at Worker.emit (events.js:196:13)"}
test/ghc-testsuite/ado/ado001.hs
test/ghc-testsuite/ado
View test.hs
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_GHC -Wall -O2 -fforce-recomp -ddump-to-file -ddump-simpl -ddump-stg -ddump-cmm-raw -ddump-asm #-}
import GHC.Exts
import GHC.Types
main :: IO ()
main = do
r <-
View bytearray.hs
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_GHC
-Wall -ddump-to-file -ddump-simpl -ddump-stg -ddump-cmm-raw -ddump-asm #-}
import Control.Monad
import Data.Foldable
import GHC.Exts
import GHC.Types
View th.txt
[ ahc-iserv] discardCtrlC
[ ahc-iserv] msg: InitLinker
[ ahc-iserv] writing pipe: ()
[ ahc-iserv] reading pipe...
[ ahc-iserv] discardCtrlC
[ ahc-iserv] msg: AddLibrarySearchPath "/mnt/c/Users/Think/Documents/Haskell/asterius/.stack-work/install/x86_64-linux/ghc-8.9/8.9.20190403/share/x86_64-linux-ghc-8.9.20190403/asterius-0.0.1/.boot/asterius_lib/lib/x86_64-linux-ghc-8.9.20190403/ghc-prim-0.6.1-CvTX6v5U4yP8bNy4kMDeHL"
[ ahc-iserv] writing pipe: RemotePtr 0
[ ahc-iserv] reading pipe...
[ ahc-iserv] discardCtrlC
[ ahc-iserv] msg: LoadArchive "/mnt/c/Users/Think/Documents/Haskell/asterius/.stack-work/install/x86_64-linux/ghc-8.9/8.9.20190403/share/x86_64-linux-ghc-8.9.20190403/asterius-0.0.1/.boot/asterius_lib/lib/x86_64-linux-ghc-8.9.20190403/ghc-prim-0.6.1-CvTX6v5U4yP8bNy4kMDeHL/libHSghc-prim-0.6.1-CvTX6v5U4yP8bNy4kMDeHL.a"
View ahc-ld.prof
This file has been truncated, but you can view the full file.
Sun Mar 24 14:57 2019 Time and Allocation Profiling Report (Final)
ahc-ld +RTS -p -RTS @/tmp/ghc3268_0/ghc_10.rsp
total time = 31.35 secs (31354 ticks @ 1000 us, 1 processor)
total alloc = 56,677,062,712 bytes (excludes profiling overheads)
COST CENTRE MODULE SRC %time %alloc
View gist:a4a249294ce43cde7d068fff6c90ce40
App
(App
(Var
(Var
"templatezmhaskell_LanguageziHaskellziTHziLibziInternal_sigE"))
(App
(App
(App
(Var
(Var
View foobar.strace
7669 execve("/bin/mv", ["mv", "foo", "bar"], 0x7ffff7a9cd78 /* 20 vars */) = 0
7669 brk(NULL) = 0x7fffc3278000
7669 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
7669 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
7669 fstat(3, {st_mode=S_IFREG|0644, st_size=26664, ...}) = 0
7669 mmap(NULL, 26664, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f450c52f000
7669 close(3) = 0
7669 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
7669 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@k\0\0\0\0\0\0"..., 832) = 832
7669 fstat(3, {st_mode=S_IFREG|0644, st_size=155296, ...}) = 0
View gist:7886031f2da28c427037a38c2701bf52
let factorial : int -> int = fun num ->
let rec helper : int -> int -> int = fun n acc ->
if n > 0
then helper (n-1) (acc * n)
else acc
in
helper num 1
;;
You can’t perform that action at this time.