Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Created July 16, 2021 13:01
Show Gist options
  • Save puffnfresh/9f97177f80dd2aa51a5e48f7e61bec41 to your computer and use it in GitHub Desktop.
Save puffnfresh/9f97177f80dd2aa51a5e48f7e61bec41 to your computer and use it in GitHub Desktop.
Get a Traversal from a Traversal1
{-# LANGUAGE RankNTypes #-}
import Control.Lens
import Data.Functor.Apply
traversal1
:: Traversal1 s t a b
-> Traversal s t a b
traversal1 t f =
unwrapApplicative . t (WrapApplicative . f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment