Start the elm repl (with elm-repl
) and type the following:
% elm-repl
> List.take 2 [1, 2, 3]
[1,2] : List number
type Maybe a | |
= Just a | |
| Nothing |
type alias Animal = | |
{ id : Id | |
, displayFormat : Format | |
, version : Int | |
, name : String | |
, species : String | |
, tags : List String | |
, properties : Properties | |
, creationDate : Date | |
} |
Every race they met on their way through the Core had a star drive based on a different theory. All those theories worked, even when they ruled out one another's basic assumptions. You could travel between the stars, it began to seem, by assuming anything. If your theory gave you a foamy space to work with - if you had to catch a wave - that didn't preclude some other engine, running on a perfectly smooth Einsteinian surface, from surfing the same tranche of empty space. It was even possible to build drives on the basis of superstring-style theories, which, despite their promise four hundred years ago, had never really worked at all.
It was affronting to discover that. ...
-- M. John Harrison, Light
There are N animals to display simultaneously. Each animal can be displayed in one of three ways: compactly (key info only); expanded (all info), and editable. Each animal is independent - for example, the user can be editing two animals at once.
This could be modeled with a single Animal
record with a Display
field that's Compact | Expanded | Editable
and a Maybe FormValues
field. Or, as I have it now:
type AnimalDisplay
= Compact
| Expanded
| Editable ChangingAnimalValues
I am trying to extend http://package.elm-lang.org/packages/arturopala/elm-monocle/latest.
It provides "methods" that can be used to get
and set
fields within records. Like this:
lensFromWholeToPart.get {part = 9}
=> 9
lensFromWholeToPart.set 333 {part = 9}
=> {part = 333}
Would take out one sentence: “White people need to get past the idea…” The sentence after is stronger on its own, and I think the removed sentence is adequately implied by the following paragraph.
That also makes the piece into a nice 3-part structure: statement of three principles. Then a call to action (starting with "When your parents or relatives...". Then finishes with a nice summary paragraph that recapitulates and amplifies previous paragraphs.
This talk is about the implications of two quotes. The first is from Steve Freeman, who's been involved in Agile since the very beginning: “In our day, we were fighting waterfall. I think they're fighting colouring-by-numbers Agile.”
The second is from billionaire, cofounder of PayPal, and not extremely tactful person Peter Thiel, who - in a talk given in Chicago - said: "If you are a very talented person, you have a choice: You either go to New York or you go to Silicon Valley." (As a provincial American, he doesn't understand there are other countries, or he probably would have included London.)
I plan to address three topics:
# Elixir Ecto. Make a new reservation for a set of (already existing) animals and procedures | |
def insert_new!(reservation_fields, animals, procedures) do | |
uses = for a <- animals, p <- procedures, do: %OldUse{animal: a, procedure: p} | |
only_group = %OldGroup{uses: uses} | |
reservation = %{reservation_fields | groups: [only_group]} | |
Eecrit.OldRepo.insert!(reservation) | |
end |
defmodule Mix.Tasks.Phoenix.Gen.Model2 do | |
use Mix.Task | |
@shortdoc "As above, but my idiosyncratic version" | |
# ... |