Vladislav
Alexander
Спасибо, я не ожидал, что про синглтоны получится доходчиво
Ну, матчасть я понял, конечно, далеко не всю. Но понял проблематику и мотивацию, а это чуть ли не важнее, и часто упускается во всяких статьях с "академическим" уклоном. У этих авторов просто отсутствует концепция читателя, и они оставляют большие пробелы там и сям, а иногда скрывают многое за "это же очевидно"
A64m
ну да, много ли статей без "мотивации"
Alexander
если начинать читать с 3 раздела пропуская abstract и вступление - то у всех
Alexander
Только истинные академики по умолчанию будут считать, что речь в моей реплике идет исключительно о научных статьях...
A64m
понятно, "статьи с академическим уклоном" это такое же неуловимое понятие как и граниские "академики", которых он ненавидит, но не может сказать кто они
Alexander
Я не намерен вступать в спор с инсинуациями.
Alexander
Грубо говоря:
"Вася, почему ты написал эту непонятную штуку на уровне типов?" - "Потому что мне нужно было сделать гетерогенный список типов и проиндексировать его для построения индукционного доказательства вот этого свойства"
"Вася, почему ты написал эту непонятную штуку на уровне типов?" - "Потому что нужно было запихать в Сервант наши хендлеры, которые значения, а Серванту нужны типы"
Alexander
Мотивация. Такая разная.
A64m
индукционные печи доказательств
Alexander
я не вижу проблемы ни в одном из вариантов
Alexander
это ж от спрашивающего зависит
Alexander
если спрашивает менеджер, то можно ответить первый вариант, а если гошник какой, то может и второй слишком хардкорный
Yura
Guys, а Data.Hashtable.IO thread-safe или надо в MVar/IORef пихать?
Alexander
маловероятно что threadsafe
Yura
внутри ST и IORef с MVar я там не увидел
Yura
но как-то нигде не нписано что оно threadsafe
parket
Вечер добрый. Пытаюсь понять комонады, помогите с дуализацией. Мне не понятно, почему s -> ( a, s ) дуально ( s -> a, s). Как это работает?
parket
Автомат на комонадах я видел. Вопрос в другом, как дуализировать понятия?
parket
Т.е. Either a s -> s дуал к s -> ( a, s )
parket
Или как это работает?
parket
Я не знаю что это. На пальцах можно?
parket
Спасибо, я посмотрю. А про s -> ( a, s ) что?
parket
Мне это пока сложно. Лучше объясни почему State дуален Store? Как это, дуален? Как из s -> ( a, s ) получилось ( s -> a, s ). Вот я не соображу. Я знаю, что сумма, это копроизведение, как это сюда применить? Как мы дуализируем? Обращаем стрелки и композицию. А суммы и произведения? А что делать с ( a -> b ) -> c?
parket
А ты мне про параморфизмы 😂
parket
Снова не по теме. Про копродукт я понял. Что с State и Store.
parket
Это я читал. Как получилось
As far as its relation to State goes, you could look at it like this:
type State s a = s -> (a, s) type Store s a = (s -> a, s)
parket
Так, это пропустил.
parket
Спасибо, выглядит как ответ ;)
parket
Вот надо теперь понять что такое adjoint. Но спасибо, это уже что-то.
Юрий
Anonymous
Evgeniy Voronin будет жить. Поприветствуем!
Алексей
На ycombinator пишут про пост @int_index
> This read like a troll piece. Every line rubbed me in some wrong way until I couldn't take it any more.
Andrey
> "smug lisp weenie" archetype
Alexander
Алексей
This read like a troll piece. Every line rubbed me in some wrong way until I couldn't take it any more.
> Haskell, at its core, is simple: it is just a polymorphic lambda calculus with lazy evaluation plus algebraic data types and type classes. This happens to be just the right combination of features to allow us to write clean, maintainable code that also runs fast.
This is an explainabrag which is also wrong: languages without these features can also have "clean, maintainable code" and nothing about this list implies "runs fast."
> Memory unsafe languages, such as C, lead to the worst sort of bugs and security vulnerabilities (buffer overflows and memory leaks).
Is a memory leak meant to be the "worst sort of bug" or a "security vulnerability?"
The implication is that memory-safe languages do not have memory leaks, which is completely false. Haskell is particularly prone to "space leaks" due to its laziness.
> Memory safe languages form two groups: the ones that rely on a garbage collector, and Rust.
What a profoundly dismissive attitude. Why bring up Cyclone and not, say, Swift? Or is Swift meant to be included in "garbage collected languages?"
> Dynamically typed (or, rather, unityped)
No these are not the same and this is an absurdly wrong conflation. Dart, Objective-C, TypeScript, and others are dynamically typed languages with static type checking. You can't "or rather" this distinction away.
The author rushes past real-world facts to get to the architecture-astronaut rocket ship, solving type-theoretical problems and pretending it's an engineering exercise. Blast off, I guess.
Alexander
Хехе
Vladislav
Почему, кстати, агда, а не кок?
Да я там и Coq упоминаю в качестве примера proof assistant. А мы используем Agda, потому что она на Haskell больше похожа, наверное. Ну и еще в ней есть интересные фичи (induction-recursion, universe polymorphism, coinduction), которых в Coq нет.
A64m
> This read like a troll piece. Every line rubbed me in some wrong way until I couldn't take it any more.
в точности мои ощущения, когда я читаю тексты и посты всяких скриптачей/коболплюсплюсистов
Leonid 🦇
сразу на /r/pcj попал https://www.reddit.com/r/programmingcirclejerk/comments/a76b89/haskell_at_its_core_is_simple_it_is_just_a/
Ilya
This read like a troll piece. Every line rubbed me in some wrong way until I couldn't take it any more.
> Haskell, at its core, is simple: it is just a polymorphic lambda calculus with lazy evaluation plus algebraic data types and type classes. This happens to be just the right combination of features to allow us to write clean, maintainable code that also runs fast.
This is an explainabrag which is also wrong: languages without these features can also have "clean, maintainable code" and nothing about this list implies "runs fast."
> Memory unsafe languages, such as C, lead to the worst sort of bugs and security vulnerabilities (buffer overflows and memory leaks).
Is a memory leak meant to be the "worst sort of bug" or a "security vulnerability?"
The implication is that memory-safe languages do not have memory leaks, which is completely false. Haskell is particularly prone to "space leaks" due to its laziness.
> Memory safe languages form two groups: the ones that rely on a garbage collector, and Rust.
What a profoundly dismissive attitude. Why bring up Cyclone and not, say, Swift? Or is Swift meant to be included in "garbage collected languages?"
> Dynamically typed (or, rather, unityped)
No these are not the same and this is an absurdly wrong conflation. Dart, Objective-C, TypeScript, and others are dynamically typed languages with static type checking. You can't "or rather" this distinction away.
The author rushes past real-world facts to get to the architecture-astronaut rocket ship, solving type-theoretical problems and pretending it's an engineering exercise. Blast off, I guess.
>solving [...] problems and pretending it's an engineering exercise
Но ведь solving problems и есть an engineering exercise
>TypeScript, and others are dynamically typed languages with static type checking
Из вики:
>It is a strict syntactical superset of JavaScript, and adds optional static typing to the language.
Так что уж либо TS – dynamically typed with optional type checking (как есть на самом деле), либо можем притвориться, что TS – (статически) типизированный язык и прописывать типы для всех сущностей программы. А у автора комментария как-то намешано того и другого
A64m
This read like a troll piece. Every line rubbed me in some wrong way until I couldn't take it any more.
> Haskell, at its core, is simple: it is just a polymorphic lambda calculus with lazy evaluation plus algebraic data types and type classes. This happens to be just the right combination of features to allow us to write clean, maintainable code that also runs fast.
This is an explainabrag which is also wrong: languages without these features can also have "clean, maintainable code" and nothing about this list implies "runs fast."
> Memory unsafe languages, such as C, lead to the worst sort of bugs and security vulnerabilities (buffer overflows and memory leaks).
Is a memory leak meant to be the "worst sort of bug" or a "security vulnerability?"
The implication is that memory-safe languages do not have memory leaks, which is completely false. Haskell is particularly prone to "space leaks" due to its laziness.
> Memory safe languages form two groups: the ones that rely on a garbage collector, and Rust.
What a profoundly dismissive attitude. Why bring up Cyclone and not, say, Swift? Or is Swift meant to be included in "garbage collected languages?"
> Dynamically typed (or, rather, unityped)
No these are not the same and this is an absurdly wrong conflation. Dart, Objective-C, TypeScript, and others are dynamically typed languages with static type checking. You can't "or rather" this distinction away.
The author rushes past real-world facts to get to the architecture-astronaut rocket ship, solving type-theoretical problems and pretending it's an engineering exercise. Blast off, I guess.
ну хоть пока они эти простыни с батхертом от очевидных утверждений строчат, они код не пишут, т.е. не вредят
Leonid 🦇
вот напишите для людей без фантазии (мне) статью как зависимые типы потогут писать опердени. а то всё у вас безопасное индексирование односвязных списков какое-то
Aleksei (astynax)
никак не помогут. Писатели оперденей должны страдать
Andrei
ну-ну, полегче
оперденей намного больше, чем кажется на первый взгляд
A64m
завтипы в хаскеле нужны для того чтоб все что сейчас написано со всякими тайплевелостраданиями было нормальным кодом
чего-то принципиально отличающегося от того, что уже в хаскеле накостылено и в языках с завтипами пока не написано/непонятно как написать
Alexander
Не знаю, насколько это относится к завтипам, но когда API к БД проектирую, очень хочу, чтобы было можно писать функции примерно такие. Достаем из колонки некий тип-тег, а потом на основе других колонок создаем соответствующий тип-результат.
get :: RowId -> m dependentType
get rowId = do
cols <- get' rowId
case tag cols of
Type1 -> mkType1 cols
Type2 -> mkType2 colsИ вот я не знаю, как эту штуку лучше выразить
Leonid 🦇
Left <$> mkType1
Alexander
ну это сегодня можно сделать
Alexander
https://ruhaskell.org/posts/theory/2016/01/06/serialization-with-deptypes.html
Alexander
типа того
Alexander
хотя по нормальному зависимыми типами это не назовёшь, но уж извините
Alexander
Ну то есть таки, это связанные вещи, понятно.
Alexander
Ryner Reinhardt
Почему ./TryReflex уже пол часа собирает проект?
Алексей
Всего
Ryner Reinhardt
Kirill
Сам try-reflex должен качать бинарники. Если что-то собирает - это не ок
Kirill
У меня так было, вылечилось удалением nix.conf
Ryner Reinhardt
Ryner Reinhardt
7 гигов за пол часа, отлично
Kirill
Это норма, он потом ещё столько же отожрёт минимум
Leonid 🦇
Ryner Reinhardt
У меня 120 SDD
Leonid 🦇
Слишком много
Это никс. Монтируй другой диск на /nix/store
Ryner Reinhardt
nix превзошел stack в прожорливости места
Kirill
Можно делать nix-collect-garbage, он всё потрёт, но потом опять загрузит при попытке собирать рефлекс-проект
Алексей
$ du -sh /nix/
41G /nix
Ryner Reinhardt
Ryner Reinhardt
Это ненормально
Ryner Reinhardt
У нас юнити проекты столько даже и близко не весят
Kirill
Воспроизводимые билды дорого обходятся
Leonid 🦇
Alexander
Ох, смерть SSD
Ryner Reinhardt
Ryner Reinhardt
Я вижу