部分整理自 Parsing Techniques
##考古
#!/usr/bin/env stack | |
-- stack --resolver global runghc --package turtle | |
{-# LANGUAGE OverloadedStrings #-} | |
import Turtle | |
import qualified Data.Text as T | |
parser :: Parser Text | |
parser = argText "pkg" "Package name" |
{-# LANGUAGE OverloadedStrings, RankNTypes, ScopedTypeVariables, | |
NoMonomorphismRestriction, DeriveDataTypeable #-} | |
module Main where | |
import Prelude hiding (and, catch) | |
import Data.Char (toLower) | |
import Data.Conduit | |
import Data.Conduit.Util | |
import Data.Conduit.ImageSize (sinkImageInfo) | |
import Data.Conduit.Binary (sourceFile, conduitFile, sinkFile) |
language: android | |
android: | |
components: | |
# Uncomment the lines below if you want to | |
# use the latest revision of Android SDK Tools | |
- platform-tools | |
- tools | |
# The BuildTools version used by your project | |
- build-tools-22.0.0 |
#!/usr/bin/env ruby | |
# license: WTFPL | |
# Gems: | |
# $ gem install twitter twitter_oauth | |
require 'twitter' | |
require 'twitter_oauth' | |
# CONSUMER_KEY = '3nVuSoBZnx6U4vzUxf5w' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#lang racket | |
(define (curry f) | |
(define (min-arity arity) | |
(if (number? arity) arity (arity-at-least-value arity))) | |
(define (curry-aux f args arity) | |
(lambda (a) | |
(let ((new-args (cons a args))) | |
(cond ((= arity 1) | |
(apply f (reverse new-args))) |