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
# compdb/BUCK | |
python_bootstrap_binary( | |
name = "combine_compdbs", | |
main = "combine_compdbs.py", | |
visibility = ["PUBLIC"] | |
) |
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 FlexibleInstances #-} | |
module Main where | |
import Control.Applicative ((<$>)) | |
import Control.Monad.State.Lazy as S | |
class Monad m => World m where | |
writeLine :: String -> m () | |
instance World IO where |
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
<html> | |
<canvas id="canvas" width="256" height="256" /> | |
<script> | |
const canvas = document.getElementById('canvas'); | |
const ctx = canvas.getContext('2d'); | |
ctx.fillStyle = 'black'; | |
ctx.fillRect(0, 0, 256, 256); | |
ctx.fillStyle = 'white'; |
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 RecordWildCards #-} | |
module Promise where | |
import Control.Monad | |
import Data.IORef | |
import Data.Maybe | |
data Status | |
= Pending |
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
module Clock = { | |
include ReactRe.Component.Stateful; | |
let name = "Clock"; | |
type props = (); | |
type state = {now: Js_date.t, timerID: option Js_global.intervalId}; | |
let getInitialState () => { | |
{ now: Js_date.make (), timerID: None }; | |
}; |
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
use std::ops::{Add, Sub}; | |
#[derive(Copy, Debug)] | |
pub struct Rect<T> { | |
pub left: T, | |
pub top: T, | |
pub right: T, | |
pub bottom: T | |
} |
Say we want to spin off threads every so often, but we also need the ability to wait until they all go away before exiting the application.
In Haskell, we can do this naive thing:
main = do
count <- newTVarIO 0
let spawnThread action = do
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
#include <iostream> | |
#define DEFPROP(name, type_) type_ name; | |
#define S(_) \ | |
_(foo, int); \ | |
_(bar, float) | |
struct MyStruct { |
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
#ifndef Py_CONFIG_H | |
#define Py_CONFIG_H | |
/* pyconfig.h. NOT Generated automatically by configure. | |
This is a manually maintained version used for the Watcom, | |
Borland and Microsoft Visual C++ compilers. It is a | |
standard part of the Python distribution. | |
WINDOWS DEFINES: |
NewerOlder