Skip to content

Instantly share code, notes, and snippets.

View paulp's full-sized avatar
🤫

Paul Phillips paulp

🤫
  • CAZ, Inc.
  • Cascadia Autonomous Zone
View GitHub Profile
@paulp
paulp / como.scala
Last active August 29, 2015 14:15 — forked from EECOLOR/como.scala
package p {
object Test {
import construction.Monadic
import execution.Bimonad
def main(args: Array[String]): Unit = {
val expression = Monadic[List](10) flatMap (1 to _ toList) coflatMap (_.sum)
# DYLD_LIBRARY_PATH library variables break linking of standard system libraries by forcing dyld to ignore
# everything but the library's basename when performing what would otherwise be successful library
# resolution.
mkdir rust-lib
echo 'void my_libjpeg_api (void) { }' | clang -dynamiclib -x objective-c -o rust-lib/libjpeg.dylib -
echo 'extern void my_libjpeg_api(void); int main (int argc, char *argv[]) { my_libjpeg_api(); return 0; }' | clang -x objective-c -o example - -framework ImageIO -Lrust-lib -ljpeg
env DYLD_LIBRARY_PATH=`pwd`/rust-lib ./example
#dyld: Library not loaded: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
# Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
@paulp
paulp / package.scala
Created January 16, 2016 23:19 — forked from zraffer/package.scala
a few operations with functors
package object types {
import scala.language.reflectiveCalls
import scala.language.higherKinds
// quantifiers aka (co)ends
type Forall[+F[_]] = { def apply[X]: F[X] }
type Exists[+F[_]] = F[_]
// basic categorical notions
@paulp
paulp / integer-division.z3
Created July 4, 2021 21:13 — forked from Rufflewind/integer-division.z3
Truncated integer division in Z3
(declare-fun a () Int)
(declare-fun b () Int)
(declare-fun c () Int)
;; (assert (= a (div -7 -3)))
;; (assert (= b (div 7 -3)))
;; (assert (= c (div -7 3)))
;; (assert (= a (mod -7 -3)))
;; (assert (= b (mod 7 -3)))
;; (assert (= c (mod -7 3)))