- Types are declared with
:and not::, and the consing operator conversely is::instead of: - No
whereclauses, onlylet/in - The standard style is different, check http://elm-lang.org/docs/style-guide for reference
- Multiline strings are a thing with
""" - Haskell's
datacorresponds totypein Elm, and also, Haskell'stypecorresponds to Elm'stype alias ($)is(<|), but you don't use it all that much – Elm people like the flipped operator(|>)which lets you build something that reads like a pipeline- Related: Backticks will likely die soon in favour of functions that have an argument order that lends itself to pipelining with
(|>) - Also,
(.)is(<<), and a flipped version(>>)exists, but I don't see it used that much either (>>=)is not an available operator and would not be polymorphic (no typeclasses, see below), and is instead commonly namedSomeType.andThen– e.g.Maybe.andThen : Maybe a -> (a -> Maybe b) -> Maybe b
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
| #!/usr/bin/env lumo | |
| (ns spacedl.spacedl | |
| (:require [cljs.nodejs :as node] | |
| [clojure.pprint :refer [pprint]] | |
| [clojure.string :as string :refer [join split starts-with?]] | |
| [cljs.core :refer [*command-line-args*]])) | |
| (node/enable-util-print!) | |
| (.on js/process "uncaughtException" #(js/console.error %)) |
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
| ;; in your project definition | |
| ;; [cljsjs/react-select "1.0.0-rc.1" :exclusions [cljsjs/react]] | |
| ;; See react-select documentation: https://github.com/JedWatson/react-select | |
| (ns example.select | |
| (:require [reagent.core :as r] | |
| [cljsjs.react-select])) | |
| (defn select |
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.
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 serial | |
| import datetime | |
| from pymongo import MongoClient | |
| port = serial.Serial('/dev/ttyAMA0', baudrate=9600, timeout=2.0) | |
| client = MongoClient('172.31.150.230') | |
| def read_pm_line(_port): | |
| rv = b'' |