Skip to content

Instantly share code, notes, and snippets.

@gregberns
Created July 19, 2021 06:05
Show Gist options
  • Save gregberns/efeb508f7dbad3a30ffab16a0acc3783 to your computer and use it in GitHub Desktop.
Save gregberns/efeb508f7dbad3a30ffab16a0acc3783 to your computer and use it in GitHub Desktop.
Store Compose
compose ::
Lens b c ->
Lens a b ->
Lens a c
compose (Lens g) (Lens f) =
Lens
( \a ->
let Store s2 g2 = f a
Store s3 g3 = g g2
in Store (s2 . s3) g3
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment