Notes:
- Adding a link does not equal an endorsement of any kind.
- Ordered by year and discovery date.
| {-# language PackageImports #-} | |
| import Control.Monad | |
| import "ghcjs-dom" GHCJS.DOM.Document (getBody) | |
| import GHCJS.DOM.EventM (on, preventDefault) | |
| import GHCJS.DOM.GlobalEventHandlers (keyDown) | |
| import Reflex.Dom hiding (preventDefault) | |
| import Web.KeyCode | |
| main :: IO () | |
| main = mainWidget $ do |
Notes:
| :set prompt "> " | |
| :set -isrc | |
| :load Main |
NOTE: a more up-to-date version of this can be found on my blog
A few days ago, version 1.9 of the Nix package manager was released. From the release notes:
nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.
| -------------------------- | |
| -- CORE LIBRARY IMPORTS -- | |
| -------------------------- | |
| import Task exposing (Task, ThreadID, andThen, sequence, succeed, spawn) | |
| import Json.Decode exposing (Decoder, list, int, string, (:=), map, object2) | |
| import Signal exposing (Signal, Mailbox, mailbox, send) | |
| import List | |
| --------------------------------- | |
| -- THIRD PARTY LIBRARY IMPORTS -- |
Rich Hickey • 3 years ago
Sorry, I have to disagree with the entire premise here.
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.
Mastery comes from a combination of at least several of the following:
This blog post series has moved here.
You might also be interested in the 2016 version.
| data Query = Query | |
| data SomeObj = SomeObj | |
| data IoOnlyObj = IoOnlyObj | |
| data Err = Err | |
| -- There's a decoder function that makes some object from String | |
| decodeFn :: String -> Either Err SomeObj | |
| decodeFn = undefined | |
| -- There's a query, that runs against DB and returns array of strings |
Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.
Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.