{{ message }}

Instantly share code, notes, and snippets.

🐺
Nothing is more permanent than a temporary solution

🐺
Nothing is more permanent than a temporary solution
Last active Jan 26, 2020
View ToBin.hs
 toBin8 :: Int8 -> Integer toBin8 x = y .&. 1 + (y `shiftR` 1 .&. 1) * 10 + (y `shiftR` 2 .&. 1) * 100 + (y `shiftR` 3 .&. 1) * 1000 + (y `shiftR` 4 .&. 1) * 10000 + (y `shiftR` 5 .&. 1) * 100000 + (y `shiftR` 6 .&. 1) * 1000000 + (y `shiftR` 7 .&. 1) * 10000000
Last active Jan 3, 2020
For Dylan Musk
View dylanmusk.rs
 // A depends on B-0.1 and C-0.1 // B depends on C-0.1 // in C struct Foo; struct Bar; // in A fn foo(_: Foo, _: Bar);
Created Mar 7, 2019
View Selective.hs
 -- Why not this implementation? selectM :: (Monad f) => f (Either a b) -> f (a -> b) -> f b selectM x y = do e <- x case e of Left a -> fmap (\$a) y Right b -> b <\$ y
Created Mar 7, 2019
View Selective.hs
 -- Why not this implementation? selectM :: (Monad f) => f (Either a b) -> f (a -> b) -> f b selectM x y = do e <- x case e of Left a -> fmap (\$a) y Right b -> fmap (const b) y
Created Jan 18, 2019
View a.cpp
 #include #include struct BordelLand { BordelLand(bool x): tag(Graffiti::A), a(x) {} BordelLand(char x): tag(Graffiti::B), b(x) {} BordelLand(float x): tag(Graffiti::C), c(x) {} template void pattern_a(F f) { if (tag == Graffiti::A) {
Last active Oct 24, 2018
View custom_deserialize_serde.rs
 use serde::de::{Deserialize, Deserializer, Error, Visitor}; use std::fmt; use serde_json::de::from_str; #[derive(Clone, Debug, Eq, PartialEq)] enum YourFancyEnum { Foo, Bar, Zoo,
Created May 24, 2018
View keybase.md

### Keybase proof

I hereby claim:

• I am phaazon on github.
• I am phaazon (https://keybase.io/phaazon) on keybase.
• I have a public key whose fingerprint is 3943 DF2A 2E41 24B4 5702 E6BC 4F28 29BB 996A 2EED

To claim this, I am signing this object:

Created May 19, 2018
View NT.hs
 {-# LANGUAGE RankNTypes #-} -- A natural transformation. data NT f g = NT { nt :: forall a. f a -> g a } -- Natural transformation from Maybe to []. maybeListNT :: NT Maybe [] maybeListNT = NT (maybe [] pure)
Created Feb 19, 2018
View a.rs
 fn correct(f: F) where F: for<'a> FnOnce(&'a u32) { f(&3) } fn dafuck(f: F) where for<'a> F: FnOnce(&'a u32) { f(&3) } fn main() { correct(|x| println!("{}", x));
Created Oct 14, 2017
View enkuler_de_rire.go
 package main import "fmt" func fibonacci() func() int { a := 0 b := 1 return func() int { c := a a, b = b, a + b
You can’t perform that action at this time.