Skip to content

Instantly share code, notes, and snippets.

@wizzup
wizzup / LilLambda.ipynb
Created September 11, 2017 10:24 — forked from vakila/LilLambda.ipynb
Anjana Vakil, "Mary had a little lambda", EuroPython 2017: https://ep2017.europython.eu/conference/talks/mary-had-a-little-lambda
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wizzup
wizzup / GenericPath.hs
Last active June 17, 2017 10:08 — forked from flickyfrans/Generic path
The shortest path in a graph
import Control.Monad
import Control.Monad.Trans.State
import Data.Maybe
(<.>) :: Monad m => (a -> b) -> (c -> m a) -> c -> m b
f <.> g = fmap f . g
whenJust :: Monad m => Maybe t -> (t -> m ()) -> m ()
whenJust Nothing _ = return ()
whenJust (Just x) f = f x