Skip to content

Instantly share code, notes, and snippets.

View JustusAdam's full-sized avatar

Justus Adam JustusAdam

View GitHub Profile
@JustusAdam
JustusAdam / CopyAssets.hs
Created August 27, 2020 20:13
Copy data files from installed Haskell libraries
{-# LANGUAGE LambdaCase #-}
import System.Directory
import System.FilePath
import System.Process
import Data.List
import System.Environment
import GHC.Stack
import Control.Monad
import System.IO.Unsafe

Keybase proof

I hereby claim:

  • I am justusadam on github.
  • I am justusad (https://keybase.io/justusad) on keybase.
  • I have a public key ASDFvBohqMmxS4-GP7xXP3c7K2VSNY-TNjcKEDag4quf3wo

To claim this, I am signing this object:

@JustusAdam
JustusAdam / iterator_quantifiers.rs
Last active October 9, 2023 19:17
Monad-like quantifiers for Rust
/// Monadic quantifiers for Rust iterators.
///
/// Allows you to pseudo-monadically create a `bool` computation with iterators.
/// It exposes the iterator methods `any` and `all` as prefix bindings and also
/// enables pattern matching and guarding.
///
/// The macro expands a sequence of statements. All usual Rust statements are
/// supported and only the top-level statements are expanded with the special
/// syntax, not e.g. nested blocks.
///