This is an OpenPGP proof that connects my OpenPGP key to this Github account. For details check out https://docs.keyoxide.org/advanced/openpgp-proofs/
[Verifying my OpenPGP key: openpgp4fpr:d4d25b92bfcb8b1aac34178253a06f568795072a]
import System.Environment | |
quickIndex :: [a] -> Int -> a | |
quickIndex xs = \n -> if n < blockSize then xs !! n else (nextLevel (n `div` blockSize)) !! (n `mod` blockSize) | |
where | |
blockSize = 32 | |
skipList ys = ys : skipList (drop blockSize ys) | |
nextLevel = quickIndex $ skipList xs | |
example :: Integer -> Integer |
# Haskell-inspired functional skew heap in Python employing Scott-encoded sum types | |
# Inspired by <https://doisinkidney.com/posts/2019-10-02-what-is-good-about-haskell.html> | |
# data Maybe a = Nothing | Just a | |
nothing = lambda f_nothing, f_just: f_nothing() | |
just = lambda x: lambda f_nothing, f_just: f_just(x) | |
# data List a = Nil | Cons a (List a) | |
nil = lambda f_nil, f_cons: f_nil() | |
cons = lambda x, xs: lambda f_nil, f_cons: f_cons(x, xs) |
pub struct IntoIter<T> { | |
current: AVLTree<T>, | |
} | |
impl<T> IntoIter<T> { | |
pub fn new(tree: AVLTree<T>) -> Self { | |
let mut into_iter = IntoIter { current: Empty }; | |
into_iter.traverse_left(tree); | |
into_iter | |
} |
#![feature(unboxed_closures)] | |
#![feature(fn_traits)] | |
pub mod hlist { | |
mod private { | |
pub trait Sealed {} | |
} | |
pub trait HList: private::Sealed {} |
This is an OpenPGP proof that connects my OpenPGP key to this Github account. For details check out https://docs.keyoxide.org/advanced/openpgp-proofs/
[Verifying my OpenPGP key: openpgp4fpr:d4d25b92bfcb8b1aac34178253a06f568795072a]