You can try online and check out some examples
Keep this OCaml vs Elm syntax doc open!
Common Uses are web apps (code), data visualization, and 3D Graphics.
You can try online and check out some examples
Keep this OCaml vs Elm syntax doc open!
Common Uses are web apps (code), data visualization, and 3D Graphics.
module Hints exposing (..) | |
import List | |
import Html exposing (..) | |
import Html.Attributes as A | |
{----------------------------------------------------------- | |
SYNTAX HINTS (OCaml -> Elm) |
{ | |
"color_scheme": "Monokai.sublime-color-scheme", | |
"ensure_newline_at_eof_on_save": true, | |
"fold_buttons": false, | |
"font_face": "Inconsolata", | |
"font_size": 16, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], |
I think it would be really interesting to do some data visualizations with the Labor Force Participation Rate.
If you go to this Labor Fource Participation graph and change the range to 1948 to 2018. You will see:
I have been doing a lot of work on making Elm assets really tiny. As part of some exploratory research I did ages ago, I read this document on font loading. It is a super helpful resource, but I was confused by all the different terms: FOIT, FOUT, FOFT, etc. It reminded me of the old "how do you center things?" blog posts from before flexbox. So my instinct was that probably lots of folks are confused about how to do it well, and maybe there is a better way!
So brainstormed some some ideas to:
Type crontab -l
to see your cron jobs. Type crontab -e
to edit them. You have to use Vim apparently.
Add a line like this:
0,30 * * * * /Users/YOURNAME/Documents/scripts/stretch.sh
That is on every 0th and 30th minute of the hour. Make sure all the separators in there are tabs!
How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.
In a functional language, writing recursive functions is common, but it is also possible to write recursive values. Here is a simple example of a recursive value:
ones = 1 :: ones
This is an infinite loop. We just keep growing the ones list to infinity. So #873 logged folks running into this and made it an error. This was especially nice for cases like x = x + 1
where folks were expecting Elm to allow mutation.
port module Spelling exposing (..) | |
import Html exposing (..) | |
import Html.App as App | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import String | |
main = |
import Dict exposing (Dict) | |
import Html exposing (..) | |
type Rank = King | Queen | Bishop | Knight | Rook | Pawn | |
type Color = Black | White | |
type alias Piece = | |
{ rank : Rank |