This blog post series has moved here.
You might also be interested in the 2016 version.
| #!/usr/bin/env _coffee | |
| # | |
| # Migrates our Streamline v0.1 files to the new Streamline v0.3 extensions, | |
| # i.e. git-moves all foo_.coffee files to foo._coffee. | |
| {exec} = require 'child_process' | |
| Path = require 'path' | |
| # regex to recognize old-style streamline files: | |
| STREAMLINE_REGEX = /_\.(js|coffee)$/ |
| # | |
| # Overloads: | |
| # - fetch(url, callback) | |
| # - fetch(url, opts, callback) | |
| # | |
| fetch = (args...) -> | |
| [arg0, arg1, arg2] = args | |
| [url, opts, callback] = switch args.length | |
| when 0, 1 then throw new Error "Usage: fetch(url[, opts], callback)" | |
| when 2 then [arg0, null, arg1] |
| /** @jsx React.DOM */ | |
| var STATES = [ | |
| 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
| 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', | |
| 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', | |
| 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' | |
| ] | |
| var Example = React.createClass({ |
| module FizzBuzzC | |
| %default total | |
| -- Dependently typed FizzBuzz, constructively | |
| -- A number is fizzy if it is evenly divisible by 3 | |
| data Fizzy : Nat -> Type where | |
| ZeroFizzy : Fizzy 0 | |
| Fizz : Fizzy n -> Fizzy (3 + n) |
This blog post series has moved here.
You might also be interested in the 2016 version.
| module Main where | |
| --data Language = English | Spanish | |
| --data Censored = Censored | NotCensored | |
| --data Encoding = Plain | EncodingA | EncodingB | |
| data English | |
| data Spanish | |
| data Censored |
| dependencies: | |
| cache_directories: | |
| - "~/.stack" | |
| pre: | |
| - wget https://github.com/commercialhaskell/stack/releases/download/v0.1.2.0/stack-0.1.2.0-x86_64-linux.gz -O /tmp/stack.gz | |
| - gunzip /tmp/stack.gz && chmod +x /tmp/stack | |
| - sudo mv /tmp/stack /usr/bin/stack | |
| override: | |
| - stack setup | |
| - stack build |
| -- build with cabal file: | |
| -- name: aeson-ex | |
| -- version: 0.1 | |
| -- build-type: Simple | |
| -- | |
| -- executable aeson_ex | |
| -- hs-source-dirs: src | |
| -- main-is: Main.hs | |
| -- build-depends: base >= 4, |
The standard names for indexes in PostgreSQL are:
{tablename}_{columnname(s)}_{suffix}
where the suffix is one of the following:
pkeyfor a Primary Key constraint;keyfor a Unique constraint;exclfor an Exclusion constraint;idxfor any other kind of index;
| module Main where | |
| import Prelude | |
| import Data.Maybe | |
| import Control.Monad.Eff | |
| import Graphics.Canvas as C | |
| import Signal as S | |
| import Signal.DOM as S |