Build the purescript bundle:
spago init
spago install aff console effect web-file web-xhr
spago build && spago bundle-module -m Upload -t index.cjs && browserify index.cjs -s Upload -o index.js
Spin up a dumb server to accept the POST request
Build the purescript bundle:
spago init
spago install aff console effect web-file web-xhr
spago build && spago bundle-module -m Upload -t index.cjs && browserify index.cjs -s Upload -o index.js
Spin up a dumb server to accept the POST request
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| 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 |
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;
| -- 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, |
| 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 |
| module Main where | |
| --data Language = English | Spanish | |
| --data Censored = Censored | NotCensored | |
| --data Encoding = Plain | EncodingA | EncodingB | |
| data English | |
| data Spanish | |
| data Censored |
This blog post series has moved here.
You might also be interested in the 2016 version.
| 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) |