atelier

F Sharp

parcours pratique pour apprendre F Sharp depuis zero

definition d abord

ce que signifie F Sharp

F Sharp sert a ecrire des instructions precises. Ici tu l abordes comme parcours pratique pour apprendre F Sharp depuis zero. Commence par une idee simple: des entrees passent par des etapes et deviennent une sortie.

infos minimalesfichier script.fsxexecuter dotnet fsi script.fsxhabitude apprends une petite piece de F Sharp, tape un exemple minimal et execute-le
programme

une suite d instructions executees dans un ordre clair.

valeur et variable

une valeur est une donnee. Une variable est le nom qui la garde.

fonction

un petit travail nomme qui recoit une entree et produit un resultat.

environnement

.NET SDK execute le code de script.fsx.

premier code lisible

sortie du programme

entry point output syntax printfn
printfn "%d" 42
sortie 42

lignee du langage

arbre de F Sharp

vois d ou vient F Sharp, quels langages sont proches, et quoi apprendre ensuite.

racines
OCamlC#ML
actuelF Sharpfamille fonctionnelle et logique
famillefamille fonctionnelle et logique
utile pour

utile pour parcours pratique pour apprendre F Sharp depuis zero

parcours debutant

1lire une regle2prevoir la sortie3taper de memoire4lancer la verification5recommencer avec un changement

Banque de questions

Chercher puis pratiquer

Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.

18 resultats
Q 1ChoixEtape 1 definitions

F Sharp question 1

F Sharp question 1. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 2ChoixEtape 1 definitions

F Sharp question 2

F Sharp question 2. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 3ChoixEtape 1 definitions

F Sharp question 3

F Sharp question 3. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 4ChoixEtape 1 definitions

F Sharp question 4

F Sharp question 4. Choisis l explication qui correspond le mieux a collection de base.

Q 5ChoixEtape 1 definitions

F Sharp question 5

F Sharp question 5. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 6ChoixEtape 1 definitions

F Sharp question 6

F Sharp question 6. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 7ChoixEtape 1 definitions

F Sharp question 7

F Sharp question 7. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 8ChoixEtape 1 definitions

F Sharp question 8

F Sharp question 8. Choisis l explication qui correspond le mieux a collection de base.

Q 9ChoixEtape 1 definitions

F Sharp question 9

F Sharp question 9. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 10ChoixEtape 1 definitions

F Sharp question 10

F Sharp question 10. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 11ChoixEtape 1 definitions

F Sharp question 11

F Sharp question 11. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 12ChoixEtape 1 definitions

F Sharp question 12

F Sharp question 12. Choisis l explication qui correspond le mieux a collection de base.

Q 13ChoixEtape 1 definitions

F Sharp question 13

F Sharp question 13. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 14ChoixEtape 1 definitions

F Sharp question 14

F Sharp question 14. Choisis l explication qui correspond le mieux a nommer une valeur.

Q 15ChoixEtape 1 definitions

F Sharp question 15

F Sharp question 15. Choisis l explication qui correspond le mieux a fonction reutilisable.

Q 16ChoixEtape 1 definitions

F Sharp question 16

F Sharp question 16. Choisis l explication qui correspond le mieux a collection de base.

Q 17ChoixEtape 1 definitions

F Sharp question 17

F Sharp question 17. Choisis l explication qui correspond le mieux a afficher une valeur.

Q 18ChoixEtape 1 definitions

F Sharp question 18

F Sharp question 18. Choisis l explication qui correspond le mieux a nommer une valeur.

choix multiple

F Sharp question 1

Q 1Choixnouveau

F Sharp question 1. Choisis l explication qui correspond le mieux a afficher une valeur.

printfn "%d" 42

reference

modeles pour script.fsx

.NET SDKdotnet fsi script.fsx
rappel de memoirelis un point puis recris le sans regarder
suivre le codenote les valeurs ligne par ligne avant d executer
taper soi memecopie moins tape plus et corrige un petit bug

entry point output syntax printfn

sortie du programme

printfn "%d" 42
  • Run the smallest file first
  • Print one known value
  • Check the output before adding more code

variables assignment types let

valeurs et noms

let total = 42
printfn "%d" total
  • Give values readable names
  • Keep one idea per line while learning
  • Trace the value before changing it

function collection List

fonctions et collections

let add a b =
  a + b

let scores = [40; 2]
printfn "%d" scores.Length
  • Keep functions small
  • Return useful values
  • Use the common collection before reaching for frameworks