
Effects Without Monads: Non-Determinism – Back to the Meta Language - mpweiher
https://arxiv.org/abs/1905.06544
======
lalaithion
I thought it would be fun to write "perm" in Haskell using the List Monad,
which is sometimes referred to as expressing nondeterminism.

    
    
        import Data.Foldable (foldrM)
    
        insert x [] = return [x]
        insert x (y:ys) = do
          z <- insert x ys
          [x:y:ys, y:z]
    
        perm = foldrM insert []

