Skip to content

Instantly share code, notes, and snippets.

@cleichner
cleichner / wrapM.hs
Last active August 29, 2015 14:02
wrapM
wrapM :: Monad m => (a -> b) -> (a -> m b)
wrapM = (return .)
-- same as wrapM f = \x -> return (f x)

Keybase proof

I hereby claim:

  • I am cleichner on github.
  • I am chas (https://keybase.io/chas) on keybase.
  • I have a public key whose fingerprint is EB53 7E69 EAAC 25ED F926 9C92 4C07 A6D8 BE65 FBF6

To claim this, I am signing this object:

@cleichner
cleichner / HkdZip.hs
Last active May 7, 2021 22:50
Example code to explore the example from https://www.youtube.com/watch?v=sIqZEmnFer8 without the use of the 'barbies' library
-- Copyright 2021 Google LLC.
-- SPDX-License-Identifier: Apache-2.0
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
module Main where
import Data.Functor.Identity
import Data.Functor.Product