Skip to content

Commit

Permalink
unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Jul 4, 2024
1 parent f2ed27b commit f524a64
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/Juvix/Prelude/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,10 @@ _unsnoc1 afb la = uncurryF (|:) (afb (maybe [] toList minit, lasta))
_last1 :: Lens' (NonEmpty a) a
_last1 = _unsnoc1 . _2

_self :: Prism' a a
_self = prism' id Just

overM :: (Applicative m) => Lens' a b -> (b -> m b) -> a -> m a
overM l f a = do
a' <- f (a ^. l)
return $ set l a' a

setAndRemember :: LensLike ((,) a) s t a b -> b -> s -> (a, t)
setAndRemember = (<<.~)

-- | Extracts the getter from a prism
prismView :: Prism s t a b -> b -> t
prismView aprism = withPrism aprism const

matchingMaybe :: Prism s s a b -> s -> Maybe a
matchingMaybe pri = either (const Nothing) return . matching pri

0 comments on commit f524a64

Please sign in to comment.