Skip to content

Instantly share code, notes, and snippets.

View leshow's full-sized avatar
🌹

Evan Cameron leshow

🌹
View GitHub Profile
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
import Data.Monoid ((<>))
data Nat = Zero | Succ Nat
import Control.Monad
import Control.Monad.ST
import Data.STRef
import qualified Data.Vector as V
-- typical recursive linked list partition
partition :: Ord a => a -> [a] -> ([a], [a])
partition _ [] = ([], [])
partition val xs = (left val xs, right val xs)
use std::ops::Shl;
#[derive(Debug)]
struct V<T>(Vec<T>);
impl<T> Shl<usize> for V<T> {
type Output = Self;
fn shl(mut self, rhs: usize) -> V<T> {
let l = self.0.len();
rotate_by(&mut self.0, 0, rhs-1);

Keybase proof

I hereby claim:

  • I am leshow on github.
  • I am leshow (https://keybase.io/leshow) on keybase.
  • I have a public key whose fingerprint is BC60 5DE6 F939 E0D6 74CA 9189 6878 FBDA B459 783C

To claim this, I am signing this object: