-
2023-09-26 Казань. Митап по функциональному программированию в Казани Регистрация
Темы:
— про software transactional memory (STM) и том, какие проблемы она решает;
— как работать с иммутабельными данными удобно и без боли.
foldRight' :: | |
(b -> z -> z) | |
-> (a -> b) | |
-> z | |
-> [a] | |
-> z | |
foldRight' _ _ z [] = | |
z | |
foldRight' k f z (x:xs) = | |
k (f x) (foldRight' k f z xs) |
2023-09-26 Казань. Митап по функциональному программированию в Казани Регистрация
Темы:
— про software transactional memory (STM) и том, какие проблемы она решает;
— как работать с иммутабельными данными удобно и без боли.
Set Implicit Arguments. | |
Set Contextual Implicit. | |
Record container : Type := { | |
shape : Type; | |
pos : shape -> Type; | |
}. | |
Inductive ext (c : container) (a : Type) : Type := { | |
this_shape : shape c; |
Section from_ssrfun. | |
Local Set Implicit Arguments. | |
Local Unset Strict Implicit. | |
Local Unset Printing Implicit Defensive. | |
Variables S T R : Type. | |
Definition left_inverse e inv (op : S -> T -> R) := forall x, op (inv x) x = e. |
{-| This @lens@ tutorial targets Haskell beginners and assumes only basic | |
familiarity with Haskell. By the end of this tutorial you should: | |
* understand what problems the @lens@ library solves, | |
* know when it is appropriate to use the @lens@ library, | |
* be proficient in the most common @lens@ idioms, | |
* understand the drawbacks of using lenses, and: |
I was recently asked to explain why I felt disappointed by Haskell, as a language. And, well. Crucified for crucified, I might as well criticise Haskell publicly.
First though, I need to make it explicit that I claim no particular skill with the language - I will in fact vehemently (and convincingly!) argue that I'm a terrible Haskell programmer. And what I'm about to explain is not meant as The Truth, but my current understanding, potentially flawed, incomplete, or flat out incorrect. I welcome any attempt at proving me wrong, because when I dislike something that so many clever people worship, it's usually because I missed an important detail.
Another important point is that this is not meant to convey the idea that Haskell is a bad language. I do feel, however, that the vocal, and sometimes aggressive, reverence in which it's held might lead people to have unreasonable expectations. It certainly was my case, and the reason I'm writing this.
I love the concept of type class
-module(bit_vector). | |
-export([new/1, get/2, set/2, clear/2, flip/2, print/1]). | |
new(Size) -> | |
Words = (Size + 63) div 64, | |
{?MODULE, Size, atomics:new(Words, [{signed, false}])}. | |
get({?MODULE, _Size, Aref}, Bix) -> |
{-# LANGUAGE | |
TypeFamilies | |
, KindSignatures | |
, ScopedTypeVariables | |
, ConstraintKinds | |
, FlexibleInstances | |
, FlexibleContexts | |
, DeriveGeneric | |
, DeriveAnyClass | |
, TypeApplications |