This file contains hidden or 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
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) |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
(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))) |
OlderNewer