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) |
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 Data.Char | |
import IO | |
main = do | |
fileName <- putStr "Enter the name of the file: " >> getLine | |
contents <- readFile fileName | |
mapM_ printOutput (lines contents) | |
where | |
getOutputMessage line = line ++ if isPalindrome line | |
then " is a palindrome!" |
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/optional.hpp> | |
/** | |
* Wraps any value with a context of Left for the Either class. | |
* | |
* By convention, Left represents some sort of less-desired condition. | |
*/ |
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 Data.Functor ((<$>)) | |
import Data.List (intercalate, transpose) | |
import Data.List.Split (splitOn) | |
(<$$>) = fmap . fmap | |
main = interact $ unlines . (intercalate "|" <$>) . go . (splitOn "|" <$>) . lines | |
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
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? |
OlderNewer