Skip to content

Instantly share code, notes, and snippets.

View albohlabs's full-sized avatar

Daniel Pfefferkorn albohlabs

View GitHub Profile
@tecklund
tecklund / index.ts
Created February 19, 2021 05:19
first crack at lodash to fp-ts conversion
import * as A from 'fp-ts/Array'
import * as Ap from 'fp-ts/Apply'
import * as A1 from 'fp-ts-std/Array'
import * as ROA from 'fp-ts/ReadonlyArray'
import * as NEA from 'fp-ts/NonEmptyArray'
import * as O from 'fp-ts/Option'
import * as Eq from 'fp-ts/Eq'
import * as Ord from 'fp-ts/Ord'
import * as R from 'fp-ts/Record'
import * as _ from 'lodash'
@nicuveo
nicuveo / Main.hs
Last active November 3, 2022 09:23
Minimalistic JSON parser, using a Parsec-like approach
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE LambdaCase #-}
import Control.Applicative (liftA2)
import Data.Char
import Data.Foldable (for_)
import Data.Functor
import qualified Data.HashMap.Strict as M
import Data.List (intercalate)
import Prelude hiding (any)

Some thoughts on building software

Lately I have been busy reading some new books on Domain Driven Design (DDD) and software architecture -- including a short yet eye-opening one in Python and a great one in F#. At the same time, it seems that more people in the Functional Programming world are looking at more formal approaches to modelling -- some examples here. This has brought some thought from the background of my brain about how we should model, organize, and architect software using the lessons we've learnt from functional programming.

Before moving on, let me be clear about this being just a dump of some thoughts, not always well-defined, definite

@april
april / arena-macos-fixes.sh
Last active November 16, 2024 17:57
Fixes Magic Arena's broken full screen implementation on macOS
# this forces Arena into full screen mode on startup, set back to 3 to reset
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these
# and you will need to run these commands again
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0
# you can also replace the long complicated integer bit with any other scaled 16:9
# resolution your system supports.
# to find the scaled resolutions, go to System Preferences --> Display and then
# divide the width by 16 and multiple by 9. on my personal system this ends up
@snoyberg
snoyberg / check-status.hs
Created May 27, 2020 06:13
Check HTTP status codes
#!/usr/bin/env stack
-- stack --resolver lts-15.10 script
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
import RIO
import Network.HTTP.Simple
import qualified RIO.Text as T
main :: IO ()
main = runSimpleApp $ do
@stettix
stettix / things-i-believe.md
Last active November 17, 2024 14:53
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active April 12, 2024 14:24
Optics Cheatsheet
@graninas
graninas / haskell_design_showcase_projects.md
Last active June 2, 2024 22:51
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 / haskell_approaches_comparison_table.md
Last active November 6, 2024 13:47
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

@ruizb
ruizb / advanced-example.md
Last active September 26, 2023 20:21
Reader monad example using fp-ts

The following section is not part of monet.js documentation, but I think it's worth showing how we can compose readers using fp-ts.

Reader composition

Let's say we have the following piece of code:

interface Dependencies {
  logger: { log: (message: string) => void }
 env: 'development' | 'production'