-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import strutils | |
type | |
Dispatch = enum | |
Reveal | |
IKind = enum | |
Human, NonHuman | |
ObIkind = ref object of RootObj | |
kind*: IKind | |
Person = object of ObIkind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IO: A Monad for side-effects. | |
import $ivy.`org.typelevel::cats-effect:1.3.1` | |
import cats.effect.IO | |
import scala.concurrent.ExecutionContext | |
implicit val IOTimer = IO.timer(ExecutionContext.global) | |
implicit val IOShift = IO.contextShift(ExecutionContext.global) | |
// ---------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # | |
# RayLib h2nim autoconverter v0.05 | |
# Developed in 2*20 by Guevara-chan | |
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # | |
[fs, rl, http] = [require('fs'), require('readline'), require('https')] if process? | |
#.{ [Procedures] | |
sanity = (name, undes = /\*/g) -> | |
name = name.replace(undes, '') | |
if name in ['type', 'end', 'from', 'div', 'ptr'] then name + 'x' else name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by pip2nix 0.8.0.dev1 | |
# See https://github.com/nix-community/pip2nix | |
{ pkgs, fetchurl, fetchgit, fetchhg }: | |
self: super: { | |
"Babel" = super.buildPythonPackage rec { | |
pname = "Babel"; | |
version = "2.9.0"; | |
src = fetchurl { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
The original applicative validation type is defined like this in FsToolkit.ErrorHandling: | |
*) | |
/// Validation<'a, 'err> is defined as Result<'a, 'err list> meaning you can use many of the functions found in the | |
/// Result module. | |
type Validation<'ok, 'error> = Result<'ok, List<'error>> | |
(* | |
We can abstract the `List` away by requiring any structure which supports concatenation, of which the list's (@) is an |
People trying to learn about FP will heard about the M word sooner than latter. Personally I believe that way sooner than what is required, and recommended; which is what makes folks to be confused about it.
This is my humble attempt to try to briefly explain the concept, while also arguing that you shouldn't really care too much about it. This all with the intention to make your FP journey more enjoyable 😄 — without further ado, let's start.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; djot.el -*- lexical-binding: t -*- | |
;; Copyright (C) 2024 John MacFarlane | |
;; Author: John MacFarlane <jgm@berkeley.edu> | |
;; Keywords: lisp djot | |
;; Version 0.0.1 | |
;;; Commentary: |