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:
/// 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. | |
/// |
I hereby claim:
To claim this, I am signing this object:
{-# 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 |
interrupt_handler = lambda _: None | |
def foo(): | |
global interrupt_handler | |
# also could be something like write to a channel, opened only locally in foo | |
def h(x): | |
print(x) | |
interrupt_handler = h | |
for i in bar(): |
class Ref: | |
sentinel = object() | |
def __init__(self): | |
self._val = self.sentinel | |
def set(self, val): | |
self._val = val | |
def get(self): | |
t = self._val | |
self._val = self.sentinel | |
return t |
{-# LANGUAGE NoImplicitPrelude, GADTs, FlexibleContexts #-} | |
import Control.Arrow ((***)) | |
import qualified Data.Char as C | |
import qualified Data.HashMap.Strict as Map | |
import Data.List (partition) | |
import System.Directory | |
import System.FilePath | |
import Text.Printf | |
import Universum |
#!stack runhaskell | |
import Data.Monoid | |
import Text.Printf | |
data ExtsHelper | |
= Prefixed String | |
[ExtsHelper] | |
| Values [String] | |
exts :: [ExtsHelper] |
-- A one-file Haskell password generator file. | |
-- | |
-- has two generation methods | |
-- chars which works simply by generating random characters | |
-- dict which selects words from a dictionary. | |
-- | |
-- The `dict` generation method needs `aspell` to be installed on the system (as | |
-- it uses the `aspell` wordlists). The language argument to the `dicts` method | |
-- must be a valid `aspell` language identifierm with the default being 'en'. | |
-- |
-- Reads a plist file and converts it into Yaml | |
-- it might not support all plist elements | |
-- it supports 'dict', 'array', 'integer' and 'string' | |
-- dependencies: | |
-- - base | |
-- - aeson | |
-- - xml | |
-- - yaml | |
-- - unordered-containers |
{-# LANGUAGE BangPatterns #-} | |
import Control.Concurrent | |
import Control.Monad | |
import Data.Foldable | |
import qualified Data.HashSet as HS | |
import System.Directory | |
import System.Environment | |
import System.FilePath | |
import System.FSNotify |