polysemy
ghc
Our great sponsors
polysemy  ghc  

6  55  
936  2,705  
0.9%  1.0%  
6.8  9.9  
6 days ago  2 days ago  
Haskell  Haskell  
BSD 3clause "New" or "Revised" License  GNU General Public License v3.0 or later 
Stars  the number of stars that a project has on GitHub. Growth  month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
polysemy

Introduction to Doctests in Haskell
Looking for a few projects that make use of it, I found accelerate, hawk, polysemy and prettysimple, so I'll be interested to poke around in their code and see how they have things set up.

ReaderT pattern is just extensible effects
Right, I think I'll just give it a shot to see. Polysemy is nice but I'm still having trouble getting what I want out of it (which may very well be entirely a fault of my own understanding)

Where's more discussion of the designs of effect systems?
Languages such as Koka only support algebraic effects, not scoping operations such as catch and listen. The Effect Handlers in Scope paper introduces scoping operations, which lead to the Haskell libraries fusedeffects and polysemy, but they turned out to have some weird semantics. eff is her effort to fix that.
 Monthly Hask Anything (June 2021)

Trouble Reinterpreting Higher Order Effects in PolySemy
Looking at the interpreter for Reader might give some clues if this doesn't work. https://github.com/polysemyresearch/polysemy/blob/master/src/Polysemy/Reader.hs#L38L45

Structuring Code with ZIO & ZLayers
*But I'm not terribly well versed in Scala's other DI offerings. I came from Haskell and didn't find anything in Scala that clicked with me until I found ZIO. It reminded me a lot of my favorite way of writing Haskell programs (https://github.com/polysemyresearch/polysemy)—albeit with a completely different implementation.
ghc

Roses are red, but unless you're in \{\infty\} \union C, division by zero does not equal infinity
Haskell has entered the chat. $ ghci GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Prelude> one = 1::Double Prelude> zero = 0::Double Prelude> :t one/zero one/zero :: Double Prelude> one/zero Infinity

Basic list construction
[email protected] % ghci XNoImplicitPrelude GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/bss/.ghc/ghci.conf GHCi> :{ GHCi data Nat = Z  S Nat GHCi GHCi listNat :: a > Nat > a > [a] GHCi listNat x y z = l y GHCi where GHCi l Z = [z] GHCi l (S p) = x : l p GHCi :} data Nat = ... listNat :: a > Nat > a > [a] GHCi> listNat 1 (S (S Z)) 3 [1,1,3] (0.00 secs, 71,512 bytes)
 Golang Diaries: Generics

Calculating number of possible outcomes
GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help Prelude> fact x = if x == 1 then 1 else x * (fact (x1)) Prelude> (fact 100)  (fact 50) 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976126104193051984542783611150085120442072486358431039488000000000000 Prelude> (fact 101)  (fact 51) 9425947759838359420851623124482936749562312794702543768327889353416977599316221476503087861590257228158336107723325356566900403091540004279983013888000000000000 Prelude> ((fact 101)  (fact 51)) / ((fact 100)  (fact 50)) 100.99999999999999

How to use Data.Map ! Operator?
[email protected] % ghci GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/bss/.ghc/ghci.conf GHCi> import Data.Map (0.01 secs, 0 bytes) GHCi> map = fromList [(1,1),(2,3),(5,8)] map :: (Ord k, Num k, Num a) => Map k a (0.04 secs, 24,872 bytes) GHCi> map ! 1 1 it :: Num a => a (0.01 secs, 58,424 bytes) GHCi> map ! 2 3 it :: Num a => a (0.01 secs, 58,424 bytes) GHCi> map ! 3 *** Exception: Map.!: given key is not an element in the map CallStack (from HasCallStack): error, called at libraries/containers/containers/src/Data/Map/Internal.hs:627:17 in containers0.6.2.1:Data.Map.Internal
 Does Idris Always Force Prelude?

Haskell Listing
% ghci GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/bss/.ghc/ghci.conf GHCi> data List a = Nil  Cons a (List a) deriving Show data List a = ... (0.02 secs, 0 bytes) GHCi> :{ GHCi lengthList :: List a > Int GHCi lengthList Nil = 0 GHCi lengthList (Cons _ xs) = 1 + lengthList xs GHCi :} lengthList :: List a > Int (0.00 secs, 0 bytes) GHCi> lengthList Nil 0 it :: Int (0.00 secs, 58,752 bytes) GHCi> lengthList (Cons 'a' Nil) 1 it :: Int (0.00 secs, 57,976 bytes) GHCi> lengthList (Cons 123 Nil) 1 it :: Int (0.00 secs, 57,840 bytes) GHCi> lengthList (Cons 1 (Cons 2 (Cons 3 (Cons 4 (Cons 5 (Cons 6 (Cons 7 (Cons 8 (Cons 9 (Cons 10 Nil)))))))))) 10 it :: Int (0.01 secs, 59,584 bytes)

Combinations in Haskell
sh sh> ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /your/home/.config/ghc/ghci.conf λ> :l 20220415CombinationsTailAfterTail'.lhs [1 of 1] Compiling TailAfterTail ( 20220415CombinationsTailAfterTail'.lhs, interpreted ) Ok, one module loaded. λ> unsafe_allCombinationsWithSingleStep [1..5] [[[[1]],[[2]],[[3]],[[4]],[[5]]],[[[1,2],[1,3],[1,4],[1,5]],[[2,3],[2,4],[2,5]],[[3,4],[3,5]],[[4,5]]],[[[1,2,3],[1,2,4],[1,2,5],[1,3,4],[1,3,5],[1,4,5]],[[2,3,4],[2,3,5],[2,4,5]],[[3,4,5]]],[[[1,2,3,4],[1,2,3,5],[1,2,4,5],[1,3,4,5]],[[2,3,4,5]]],[[[1,2,3,4,5]]],[[]*** Exception: 20220415CombinationsTailAfterTail'.lhs:(120,9)(122,52): Nonexhaustive patterns in function genStep

Why is Haskell considered good for writing a Compiler/Interpreter?
The GHC runtime system including its core interpreter loop and garbage collector are written in C.

Generic Applicative
The next release of base (4.17) will include the Generically1 newtype which can be used to derive Applicative and I really want to discuss challenges in pushing beyond that.
What are some alternatives?
fusedeffects  A fast, flexible, fused effect system for Haskell
purescript  A stronglytyped language that compiles to JavaScript
Exercism  Scala Exercises  Crowdsourced code mentorship. Practice having thoughtful conversations about code.
freersimple  A friendly effect system for Haskell
astmonad  A library for constructing AST by using donotation
vimmultiplecursors  True Sublime Text style multiple selections for Vim
seed7  Source code of Seed7
haskell.nix  Alternative Haskell Infrastructure for Nixpkgs
liquidhaskell  Liquid Types For Haskell
linear  Lowdimensional linear algebra primitives for Haskell.
inotherwords  A higherorder effect system where the sky's the limit
languagepython  A parser for Python 2.x and 3.x written in Haskell