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
def match(fns): | |
def inner(x): | |
for cls, fn in fns: | |
if isinstance(x, cls): | |
return fn(x) | |
return inner | |
doformat = match( | |
[ (Literal, lambda x: x) |
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 Rules where | |
Schema ( "time" =: timestamp | |
, "enabled" =: bool ) | |
data Value = VInt Int | |
| VString String | |
| VBool Bool | |
| VList [Value] | |
| VSchema [(String, Value)] |
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 Main where | |
import Control.Applicative | |
import Control.Concurrent (yield) | |
import Control.Concurrent.Async | |
import Control.Concurrent.Chan | |
import Control.Concurrent.STM (atomically) | |
import Control.Concurrent.STM.TMQueue | |
import Control.Monad (replicateM, forM_, forever) | |
import Data.Function (fix) |
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
#pragma once | |
#include <cassert> | |
#include <memory> | |
/* | |
* A non-null shared pointer to some value (i.e. a shared reference). | |
* |
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
#pragma once | |
#include <memory> | |
#include <boost/thread.hpp> | |
#include <boost/utility.hpp> | |
#include <CeFunctional.h> | |
#include <CeMemory.h> | |
#include <FunctionObject.h> |
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
(8:51:32 AM) matt_ribeiro: elliot1: I don't think we met, and have you seen elliot? | |
(8:54:01 AM) jared_burkeen: matt_ribeiro, check your email, elliot1 is a new hire that started this week | |
(8:54:10 AM) jared_burkeen: he's the anti-haskell elliot | |
(8:55:55 AM) matt_ribeiro: oh then.... PLEASED to meet you. :-) | |
(8:57:36 AM) jared_burkeen: he will greet you in return, he's just a little shy | |
(9:02:16 AM) matt_ribeiro: Unfortunately, I ran into some haskell woes last night, so I really need elliot, instead of elliot1. | |
(9:10:27 AM) jared_burkeen: I think he's off today | |
(9:10:31 AM) jared_burkeen: no that was yesterday | |
(9:10:41 AM) jared_burkeen: but it's usually tomorrow that he's off | |
(9:14:08 AM) matt_ribeiro: If yesterday was tomorrow, what does that make today? |
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
#pragma once | |
#include <CePrelude.h> | |
#include <FunctionObject.h> | |
/** | |
* Encapsulates RAII by providing a safe interface to a scarce resource, closing it on destruction. | |
*/ | |
template<typename T> |
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 <memory> | |
#include "MVar.hpp" | |
template <typename T> | |
struct Item; | |
template <typename T> | |
struct Stream | |
{ | |
typedef MVar<Item<T>> type; |
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
#pragma once | |
#include <boost/thread.hpp> | |
#include <CeBaseTypes.h> | |
#include <Maybe.h> | |
/** | |
* A concurrency primitive which may contain a single value or be empty. |
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
import Shelly | |
import Prelude hiding (FilePath) | |
sudo_ com args = run_ "sudo" (com:args) | |
main = shelly $ verbosely $ do | |
apt_get "update" [] | |
apt_get "install" ["haskell-platform"] | |
where | |
apt_get mode more = sudo_ "apt-get" (["-y", "-q", mode] ++ more) |
OlderNewer