#include <stdio.h>
#include <stdlib.h>
class Object {
public:
virtual ~Object() {}
};
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
https://play.rust-lang.org/?gist=36c36edf00f2c903727ce881bd4e7ae9&version=stable&mode=debug&edition=2015 |
no macro leads to success:
struct A end
struct B end
function f()
enum1 = A()
enum2 = B()
begin
let enum_test = enum1
begin
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
[<Fact>] | |
let ``nested push32`` () = | |
let var = ref None | |
let var2 = ref None | |
let var3 = ref None | |
let arg1 = ref <| Some "arg1" | |
let arg2 = ref <| Some "arg2" | |
let type_here = Push32 <| I 32 |
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
interface HKT<K, T>{ | |
} | |
interface Monad<M> { | |
bind: <A, B>(m: HKT<M, A>, k: (a: A) => HKT<M, B>) => HKT<M, B> | |
return: <A>(a: A) => HKT<M, A> | |
// ret$: <A>(m: (a: A) => HKT<M, A>) => HKT<M, A> | |
} | |
class Maybe implements Monad<Maybe> { |
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 MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE RankNTypes #-} | |
import Unsafe.Coerce | |
import Prelude hiding ((>>=)) | |
data App a b | |
class TypeApp cons k0 k1 | k1 -> cons k0, cons k0 -> k1 where | |
inj :: k1 -> App cons k0 |
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
ipython profile create && \ | |
pip install -U moshmosh-base -i https://pypi.org/simple --no-compile &&\ | |
wget https://raw.githubusercontent.com/thautwarm/moshmosh/master/moshmosh_ipy.py &&\ | |
mv moshmosh_ipy.py /home/$USER/.ipython/profile_default/startup/moshmosh_ipy.py |
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
.word 0x10000002 ; MERL cookie | |
.word 0x0000010c ; File Length (in bytes) is 268 | |
.word 0x000000ec ; Code Length (in bytes) is 236 | |
print: | |
sw $1, -4($30) | |
sw $2, -8($30) | |
sw $3, -12($30) | |
sw $4, -16($30) | |
sw $5, -20($30) | |
sw $6, -24($30) |
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
.word 0x10000002 ; MERL cookie | |
.word 0x00000760 ; File Length (in bytes) is 1888 | |
.word 0x00000640 ; Code Length (in bytes) is 1600 | |
init: | |
sw $1, -4($30) | |
sw $2, -8($30) | |
sw $3, -12($30) | |
sw $4, -16($30) | |
sw $5, -20($30) | |
sw $6, -24($30) |
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
function sort_type(ts :: Vector{Type}) | |
n = length(ts) | |
if n == 1 | |
ts | |
elseif n == 2 | |
a, b = ts[1], ts[2] | |
if a <: b | |
[a, b] | |
elseif b <: a | |
[b, a] |
OlderNewer