Article topics:
{-# LANGUAGE AllowAmbiguousTypes #-} | |
module Test2 where | |
import Control.Monad.Free | |
import Control.Monad | |
data BreadType = Baguette | Toast | |
deriving (Show, Eq, Ord) |
# 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> |
# 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 |
-- 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) |
module StateLangSpec where | |
import Test.Hspec | |
import Data.IORef | |
import Control.Monad.Free.Church | |
data StateMethod s next | |
= Put s (() -> next) | |
| Get (s -> next) |
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?
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.
(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.
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 |