Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Control.Arrow ((&&&))
import Control.Monad (replicateM)
import Data.Functor.Foldable (Fix, cata)
import qualified Data.IntMap.Lazy as M
import Text.Parsec.Char (spaces, digit, char)
import Text.Parsec.String (Parser)
Program received signal SIGABRT, Aborted.
raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x000056352d3e4ca9 in _BreakStrToDebugger (
mesg=0x7ffdee9d0220 "ASSERT(you.props.exists(sac_def.sacrifice_vector)) in 'god-abil.cc' at line 5311 failed.", assert=true) at dbg-asrt.cc:808
#2 0x000056352d3e4e8d in AssertFailed (
expr=0x56352dc5aeb0 "you.props.exists(sac_def.sacrifice_vector)",
file=0x56352dc57b7d "god-abil.cc", line=5311, text=0x0) at dbg-asrt.cc:846
instance Monad Signal where
return = pure
(Signal s) >>= f = Signal $ \t -> let Signal s' = f (s t)
in s' t
-- or, equivalently but less readably:
-- s >>= f = Signal $ join (func . f . func s)
user=> (pprint (macroexpand `(go (is (<! (+))))))
(let*
[c__6350__auto__
(clojure.core.async/chan 1)
captured-bindings__6351__auto__
(clojure.lang.Var/getThreadBindingFrame)]
(clojure.core.async.impl.dispatch/run
(fn*
[]
(clojure.core/let
commit c5150db817a2eb6384b4d3c9e5cdb2c23e397c7d
Author: Johannes M <kenranunderscore@users.noreply.github.com>
Date: Thu Jun 22 18:54:35 2017 +0200
Add an autumn forest themed bazaar vault (#551)
Add an autumn forest-themed bazaar vault
commit 1f6c8c026d155503b190d6dc2fff847ecccf4836
Author: advil <rawlins@gmail.com>
user> (defn build-paths
"Given a tree (map), return all the paths leading to a value."
[m]
(->> (for [[k v] m]
(if (map? v)
(map #(cons k %) (build-paths v))
[[k]]))
(apply concat)))
#'user/build-paths
user> (defn keys-in [m]
(gdb) p weapon
$2 = (item_def *) 0x1a9af90 <you+4336>
(gdb) p launch_type
$3 = LRET_BUGGY
(gdb) p is_launched(attacker, weapon, *projectile)
$4 = LRET_THROWN
(defun ptr-to-ref (symbol)
(interactive "sConvert local pointer variable to reference: ")
(save-excursion
(narrow-to-defun)
(unwind-protect
(dolist (replacement (list (cons (concat "\\b" symbol "\\b\\([^*&_-]\\)")
(concat "&" symbol "\\1"))
(cons (concat "\\b" symbol "->")
(concat symbol "."))
(cons (concat "\\*&" symbol)
@amalloy
amalloy / .gitattributes
Created April 10, 2017 16:56
Clojure-aware git-diff hunk headers
*.clj diff=clojure
*.cljs diff=clojure
*.cljx diff=clojure
(let [inputs [1 :q "boo" (Object.)]]
(apply min-key count
(for [n (all-ns)
[k v] (ns-publics n)
:when (try
(= inputs (map v inputs))
(catch Throwable t
false))]
(name k))))