Последовательность вычислений и Работа с системой типов
This commit is contained in:
33
Латин Ярослав/1ch.fs
Normal file
33
Латин Ярослав/1ch.fs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// For more information see https://aka.ms/fsharp-console-apps
|
||||||
|
|
||||||
|
|
||||||
|
let mutable y1 = 1
|
||||||
|
let _ = y1 <- y1*2 in
|
||||||
|
let _ = y1 <- y1+1 in
|
||||||
|
let _ = y1 <- y1+1 in
|
||||||
|
|
||||||
|
printf "y1 = %A\n"y1
|
||||||
|
|
||||||
|
let mutable x1 = 1
|
||||||
|
let _ = x1 <- x1+1 in
|
||||||
|
let _ = x1 <- x1*2 in
|
||||||
|
let _ = x1 <- x1+1 in
|
||||||
|
|
||||||
|
printf "x1 = %A\n"x1
|
||||||
|
|
||||||
|
let mutable y = 1
|
||||||
|
y <- y * 2
|
||||||
|
y <- y + 1
|
||||||
|
y <- y + 1
|
||||||
|
|
||||||
|
|
||||||
|
printf "y = %A\n"y
|
||||||
|
|
||||||
|
let mutable x = 1
|
||||||
|
x <- x + 1
|
||||||
|
x <- x * 2
|
||||||
|
x <- x + 1
|
||||||
|
|
||||||
|
|
||||||
|
printf "x = %A\n"x
|
||||||
|
|
||||||
16
Латин Ярослав/2ch.fs
Normal file
16
Латин Ярослав/2ch.fs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
// For more information see https://aka.ms/fsharp-console-apps
|
||||||
|
module kolok
|
||||||
|
|
||||||
|
let mutable x = []
|
||||||
|
|
||||||
|
let mutable refx = ref x
|
||||||
|
|
||||||
|
let _ = refx <- ref [2]
|
||||||
|
//let _ = refx <- ref [true]
|
||||||
|
|
||||||
|
|
||||||
|
printf "%O\n" refx
|
||||||
|
printf "%A\n" refx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
16
Латин Ярослав/README.md
Normal file
16
Латин Ярослав/README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Последовательность вычислений и Работа с системой типов
|
||||||
|
## Ссылка на видеоразбор
|
||||||
|
|
||||||
|
## Код из книги
|
||||||
|
Ярик Латин, [5/10/22 4:31 PM]
|
||||||
|
let _ = x := !x + 1 in
|
||||||
|
let _ = x := !x + 1 in
|
||||||
|
let _ = x := !x + 1 in
|
||||||
|
let _ = x := !x + 1 in
|
||||||
|
();;
|
||||||
|
|
||||||
|
Ярик Латин, [5/10/22 4:31 PM]
|
||||||
|
x := !x + 1;
|
||||||
|
x := !x + 1;
|
||||||
|
x := !x + 1;
|
||||||
|
x := !x + 1;;
|
||||||
Reference in New Issue
Block a user