Skip to content

Instantly share code, notes, and snippets.

View graninas's full-sized avatar
😊
My Twitter: graninas

Alexander Granin graninas

😊
My Twitter: graninas
View GitHub Profile
@graninas
graninas / haskeller_competency_matrix.md
Last active April 11, 2024 23:23
Haskeller competency matrix

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Engineering in Haskell](https://github.com/graninas/software-design-in-haskell#B
@graninas
graninas / haskell_design_showcase_projects.md
Last active March 29, 2024 14:43
Software Design Showcase Projects in Haskell

Software Design Showcase Projects in Haskell

(WIP)

  • Automatic White-Box Testing with Free Monads | Alexander Granin
    • Description: Article and showcase project about an approach to whitebox testing. Describes the idea of recordable and replayable business scenarios based on the Free Monad approach.
    • Design Approach: [Free Monads]
    • Technologies: [free, aeson]
    • Teaches for: How to make a Free monad based business logic recordable and replayable. How to use the recordings for automatic whitebox testing. How to configure this system to do integration testing.
@graninas
graninas / cpp_stm_free_tutorial.md
Last active March 21, 2024 10:51
Software Transactional Memory in C++: Pure Functional Approach (tutorial)

Software Transactional Memory in C++: pure functional approach (Tutorial)

In this article I’ll tell you about my pure functional library for Software Transactional Memory (STM) that I’ve built in C++. I adopted some advanced functional programming concepts that make it composable and convenient to use. Its implementation is rather small and robust, which differentiates the library from competitors. Let’s discuss what STM is and how to use it.

@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active March 18, 2024 14:57
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@graninas
graninas / haskell_approaches_comparison_table.md
Last active February 1, 2024 11:02
Haskell Approaches Comparison Table

An Opinionated Comparison of Software Design Approaches in Haskell

| | Raw IO | Free Monads; Church Encoded Free Monads | Final Tagless / mtl | Effect Systems | ReaderT

@graninas
graninas / enq-node-framework.md
Last active November 7, 2023 17:20
Building network actors with Node Framework
@graninas
graninas / StateLangSpec.hs
Created September 14, 2023 15:24
Church Free monad based State
module StateLangSpec where
import Test.Hspec
import Data.IORef
import Control.Monad.Free.Church
data StateMethod s next
= Put s (() -> next)
| Get (s -> next)
@graninas
graninas / ChurchState.hs
Created September 13, 2023 18:53
Some thoughts on merging Church Free and State monad
-- Option 1: State as an eDSL
data StateMethod s next
= Put s (() -> next)
| Get (s -> next)
instance Functor (StateMethod s) where
fmap f (Put st next) = Put st (f . next)
fmap f (Get next) = Get (f . next)
@graninas
graninas / gist:32a2cd52c062c42bccbad9e8b69b6360
Last active September 13, 2023 18:51
Path 2 to implement the State monad in C++ using Church Free
# This is an idea of how to merge the State monad and the Church Free monad
# without interferring with the inner eDSL.
# This code is incomplete and requires a further development.
# The idea is that we pass the state around with the Church Free functions
# as we would do it with a regular State monad.
# The overal concept is based on my Free monadic STM implementation:
# https://github.com/graninas/cpp_stm_free
@graninas
graninas / state_church_free.h
Last active September 12, 2023 17:18
Path 1 to implement the State monad in C++ using Church Free
# This is a sample of how to implement the State monad with Church Free monad.
# This sample is incomplete, but its concept is taken from my Free-monad based STM library.
# Consider the library to implement the rest of the code. The idea is the same.
# https://github.com/graninas/cpp_stm_free
#include <functional>
#include <variant>
#include <any>