
Roman
23.10.2018
16:19:25
Здравствуйте!

Михаил
23.10.2018
16:24:26
Доброго вечера

Grigoriy
23.10.2018
22:15:10
Привет!

Sergii
23.10.2018
22:15:37
Привет всем

Google


システム
23.10.2018
22:22:22
Оки, принимается) Но все же тезис что чистое фп точно не быстрее остается в силе)
@VVildVVolf , @Lanayx
If you want to write in pure FP, you also need to rewrite your algorithms. Using of existed wide-used could be inefficient.
As a start point, you could use this https://www.amazon.com/Pearls-Functional-Algorithm-Design-Richard/dp/0521513383
Then move forward to formal descriptions, verifications, transformations and equality proofing.
Good example - Knuth–Morris–Pratt algorithm. If you tried to realize naive version in some pure FP, it would be a pain.
However, this extra mile, changing an algorithm (chapter 17 in the book is about KMP), will be worth it.
From my experience, if you want to create high-performant solutions you need regular answer few questions:
1) Am I doing bullshit? (be honest with yourself:) )
2) What is a business value?
3) Do I use the right instrument?
4) What are my data capacity, variety, and bandwidth?
5) Where is data located?
So if you have some FP tooling, in most cases, it is much easy to answer these questions.
Ayrat , @AnutaU
What you want is a supercompilation with automatic algorithm transformation and equality verification. Unfortunately, it is not here yet. The closest thing is SQL execution with its separating of logical and physical executions, execution plans and optimizer. Also, some good stuff I saw in SBCL compiler of Common Lisp and OCaml compiler. Besides, the same idea is in C++ generalized constant expressions and D compile-time functions.


Darth
23.10.2018
22:25:27
@VVildVVolf , @Lanayx
If you want to write in pure FP, you also need to rewrite your algorithms. Using of existed wide-used could be inefficient.
As a start point, you could use this https://www.amazon.com/Pearls-Functional-Algorithm-Design-Richard/dp/0521513383
Then move forward to formal descriptions, verifications, transformations and equality proofing.
Good example - Knuth–Morris–Pratt algorithm. If you tried to realize naive version in some pure FP, it would be a pain.
However, this extra mile, changing an algorithm (chapter 17 in the book is about KMP), will be worth it.
From my experience, if you want to create high-performant solutions you need regular answer few questions:
1) Am I doing bullshit? (be honest with yourself:) )
2) What is a business value?
3) Do I use the right instrument?
4) What are my data capacity, variety, and bandwidth?
5) Where is data located?
So if you have some FP tooling, in most cases, it is much easy to answer these questions.
Thanks, it will be investigated
Спасибо, принято к ознакомлению


Grigoriy
23.10.2018
22:25:47
В нашем доме говорят по-русски! Ну что это за фраза-то - "Using of existed wide-used could be inefficient"

システム
23.10.2018
22:28:29

Anna
24.10.2018
04:16:19

Roman
24.10.2018
08:51:34
Привет!

mark
24.10.2018
08:56:50
Ghdbtn
Привеет

Андрій
24.10.2018
10:31:51
Всем привет
Есть вакансия на Xamarin + F#
Скорее всего Fabulous (бывший Elmish)
Кто хочет?

Google

Alexey
24.10.2018
10:32:26
см. правила
там про вакансии отдельный пункт

Roman
24.10.2018
10:42:55

Alexey
24.10.2018
10:43:19
если ткнуть в заголовок - то там правила

Андрій
24.10.2018
11:54:55
Спасибо, ознакомился

Roman
24.10.2018
12:12:18

Igor
24.10.2018
12:13:22
Спасибо, но не надо, мне хватило с xamarin на c#. Лучше уж дальше продолжу формошлепить на котлине.

Petr
24.10.2018
12:35:18
Ребята, есть тут кто?

Ayrat
24.10.2018
12:35:31
Не работать же на работе в самом деле

Petr
24.10.2018
12:35:52
Я чето не могу допереть
Есть список, мне нужно найти произведение кубов

Vasily
24.10.2018
12:35:55

Petr
24.10.2018
12:35:57
УЖе всю голову сломал
help!

Vasily
24.10.2018
12:36:02
Эммм

Ayrat
24.10.2018
12:36:08

Vasily
24.10.2018
12:36:09
Seq.map
Потом фолд
Или сразу фолд

Petr
24.10.2018
12:36:28
А что там показать
У меня написанно только let list=[1..7]

Google

Petr
24.10.2018
12:36:45
А дальше как сделать блин эту функцию или что

Ayrat
24.10.2018
12:37:04

Petr
24.10.2018
12:37:18
Нет
Я его учу постепенно
Поэтому вам и написал, потому что нигде ничего нет

Ayrat
24.10.2018
12:37:40

Vasily
24.10.2018
12:37:43
|>List.fold (fun acc x->x*x*x*acc) 1

Ayrat
24.10.2018
12:37:53

Vasily
24.10.2018
12:38:09
А чо тут непонятного
Ваще прозрачно

Ayrat
24.10.2018
12:38:27

Vasily
24.10.2018
12:38:37
Это ж обычный итератор с накопительной переменной

Petr
24.10.2018
12:41:40
получилось как то атк
как то так*

Vasily
24.10.2018
12:42:39
Ну ты бы код показал

Ayrat
24.10.2018
12:43:05
Короче, для начала рекомендую вообще понять алгоритм, надеюсь этот код проблем не вызовет:
let list = [1L..7L]
let mutable result = 1L
for number in list do
let cube = number * number * number
result <- result * cube
printfn "%d" result

Petr
24.10.2018
12:43:12

Vasily
24.10.2018
12:43:24
Ошибочка

Ayrat
24.10.2018
12:43:28
там на интах к слову переполнение

Google

Ayrat
24.10.2018
12:43:33
так что сразу лонги лепите

Vasily
24.10.2018
12:43:43
list|>count
Должен быть в принтфе

Petr
24.10.2018
12:44:33
Это в ковычках или после

Vasily
24.10.2018
12:45:02
Ayrat , похоже, ты был прав

Petr
24.10.2018
12:45:30
Да

Vasily
24.10.2018
12:45:34
Которая ожидает на вход список
Дальше тебе ее надо применить
Это можно сделать так: count list

Petr
24.10.2018
12:46:00
А почему после скобок стоит "1"?

Vasily
24.10.2018
12:46:07
Или так: list|>count
Посмотри пример Айрата
Он написал в императивном стиле
И код делает то же самое

Petr
24.10.2018
12:47:00
ааааааааа

Artemy
24.10.2018
12:47:01

Petr
24.10.2018
12:47:12
а что такое 1L

Vasily
24.10.2018
12:47:18
Литерал лонга

Google

Ayrat
24.10.2018
12:47:44
так вот, если императивная часть вопросов не вызывает, то уберём один промежуточный шаг в лист кубов
let list = [1L..7L]
let listOfSquares = List.map (fun x -> x*x*x) list
let listOfSquares' = list |> List.map (fun x -> x*x*x)
let mutable result = 1L
for cube in listOfSquares do
result <- result * cube
printfn "%d" result
listOfSquares и listOfSquares' это одно и то же, но второй записан через пайплайн оператор |>, его надо освоить и полюбить
щас будет ещё шаг к фолду

Petr
24.10.2018
12:48:17
еще более непонятно становится...

Ayrat
24.10.2018
12:48:24
Занятно
А бекграунд в других языках есть или сразу в F# с головой?

Vasily
24.10.2018
12:49:22
Да тут как бы еще не тазик с цементом на ноги

Petr
24.10.2018
12:49:30
Да это тупо в универе
так я сам на c++ работаю

Ayrat
24.10.2018
12:50:17
List.map берёт каждый элемент входящего листа, и применяет к нему функцию трансформер и формирует из новых элементов новый лист

Ilya
24.10.2018
12:50:52
listOfCubes ?

Ayrat
24.10.2018
12:51:14

Petr
24.10.2018
12:51:23
Да, это жёстко

Ayrat
24.10.2018
12:51:50