There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.
class Tally | |
def self.empty | |
new({}) | |
end | |
def initialize(raw) | |
@raw = empty_hash.merge raw.slice(:small, :medium, :large) | |
end | |
# Accessors |
class Dollar | |
attr_reader :cents | |
def initialize(cents:) | |
@cents = cents | |
end | |
def hash | |
[self.class, cents].hash | |
end |
require "date" | |
class Month | |
include Comparable | |
MONTHS_PER_YEAR = 12 | |
def self.from_date(date) | |
self.from_parts(date.year, date.month) | |
end |
This is the source for the scripts discussed in https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts
Both scripts are in the bin/
directory of the repo that contains all the markdown documents for blog posts.
Users run bin/server
and everything is automatically set up for them to view a local preview of the blog.
bin/server-setup
is a dependency of bin/server
and is never run directly by users.
Maitre-d is the name of the "blog engine" discussed in the article.
"That ticket touches the wizard code? Why don't YOU take that one". The wizard in question is so gnarly my colleagues are afraid to touch it.
Looking at the code through the lens of conditional cardinality reveals what went wrong and how we can make things better. This mental model will change the way you think about structuring logic and help you take your conditional code from scary to delightful.
This talk is aimed at an intermediate to advanced audience. While it will driven by a practical example (refactoring a multi-step form), it will mainly be about some more theoretical principles and mental models for structuring conditional code.
Leave your fear of math behind along with the equations and symbols, we're headed to Ruby-land! On this whirlwind tour, we’ll explore how to write better conditionals with Boolean algebra, figure out how many test cases we need with combinatorics, a mental model for breaking down large tasks with graph theory, and more.
You’ll leave this talk equipped to better do your job with some ideas, techniques, and mental models from the wonderfully practical world of discrete math.
class Tree | |
attr_reader :val, :left, :right | |
def self.empty | |
EmptyTree.new | |
end | |
def self.leaf(val) | |
new(val, empty, empty) | |
end |
A series of exercises to get a feel for how generic types and type variables work in Elm.
For each of these, you are given some code that is not compiling. Your task is to get it
compiling. You can change the body of the function but not the signature. No cheating
with Debug.todo
or infinite recursions either 😉