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
| sequenceUntil :: Monad m => (a -> Bool) -> [m a] -> m [a] | |
| sequenceUntil _ [] = return [] | |
| sequenceUntil p (m:ms) = do a <- m | |
| if p a | |
| then return $ init [a] | |
| else do as <- sequenceUntil p ms | |
| return (a:as) |
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
| > (macroexpand '(include-lib "webmachine/include/webmachine.hrl")) | |
| (progn | |
| (defrecord wm_reqdata | |
| method | |
| scheme | |
| version | |
| peer | |
| sock | |
| wm_state | |
| disp_path |
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
| -module(function_options). | |
| -export([my_fn/1, my_fn/2]). | |
| -include_lib("eunit/include/eunit.hrl"). | |
| %% we'll populate a record with all of our interesting pieces. this also allows the specification of | |
| %% defaults for things the user may not provide. required_arg will hold our required param, so we'll | |
| %% leave them undefined. anything that starts with opt, however may or may not be supplied |
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
| (defproject builder-post "0.1.0") |
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
| import Data.Aeson |
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
| .hsenv/ | |
| hsenv.log | |
| *.hi | |
| *.o |
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
| Joshs-MacBook-Air:~ josh$ curl https://api.tldr.io/tldrs/s":["http://www.taigeair.com/why-gmail-2013-sucks-terribad-user-experience.html"]}' -v | |
| * About to connect() to api.tldr.io port 443 (#0) | |
| * Trying 178.79.181.8... | |
| * connected | |
| * Connected to api.tldr.io (178.79.181.8) port 443 (#0) | |
| * SSLv3, TLS handshake, Client hello (1): | |
| * SSLv3, TLS handshake, Server hello (2): | |
| * SSLv3, TLS handshake, CERT (11): | |
| * SSLv3, TLS handshake, Server key exchange (12): | |
| * SSLv3, TLS handshake, Server finished (14): |
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
| fizzBuzz :: (Integral a, Show a) => a -> String | |
| fizzBuzz n | |
| | n `mod` 3 == 0 && n `mod` 5 == 0 = "FizzBuzz" | |
| | n `mod` 3 == 0 = "Fizz" | |
| | n `mod` 5 == 0 = "Buzz" | |
| | otherwise = show n | |
| -- [fizzBuzz x | x <- [1..100]] |
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
| doubleMe x = x + x |
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
| (use 'korma.core 'korma.db) | |
| (defdb mydb {:classname "org.hd.Driver" :protocol "file" :subprotocol "h2" :subname "./tmp/mydb"}) |