diff --git a/servant-ruby.cabal b/servant-ruby.cabal
--- a/servant-ruby.cabal
+++ b/servant-ruby.cabal
@@ -1,5 +1,5 @@
 name:                servant-ruby
-version:             0.7.0.0
+version:             0.8.0.1
 synopsis:            Generate a Ruby client from a Servant API with Net::HTTP.
 description:         Generate a Ruby client from a Servant API with Net::HTTP.
 homepage:            https://github.com/joneshf/servant-ruby#readme
@@ -12,21 +12,19 @@
 build-type:          Simple
 extra-source-files:  README.md
 cabal-version:       >=1.10
-tested-with:         GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2
+tested-with:         GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.2
 
 library
   hs-source-dirs:      src
   exposed-modules:     Servant.Ruby
   build-depends:       base >= 4.8 && < 5
                      , casing >= 0.1 && < 0.2
-                     , lens >= 4.15 && < 4.17
                      , servant-foreign >= 0.9 && < 0.12
                      , text >= 1.2 && < 1.3
   default-language:    Haskell2010
   ghc-options:         -Wall
 
 test-suite doc-test
-  default-language:    Haskell2010
   type:                exitcode-stdio-1.0
   main-is:             Main.hs
   hs-source-dirs:      test
diff --git a/src/Servant/Ruby.hs b/src/Servant/Ruby.hs
--- a/src/Servant/Ruby.hs
+++ b/src/Servant/Ruby.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE RecordWildCards #-}
 
 {-|
@@ -15,9 +16,10 @@
 
 module Servant.Ruby (NameSpace(..), ruby) where
 
-import Control.Lens (filtered, folded, to, view, (^.), (^..), (&))
-
-import Data.Monoid ((<>))
+import Control.Applicative (Const(Const, getConst))
+import Data.Foldable (toList)
+import Data.Function ((&))
+import Data.Monoid (Endo(Endo, appEndo), (<>))
 import Data.Proxy (Proxy(Proxy))
 import Data.Text (Text)
 import Data.Text.Encoding (decodeUtf8')
@@ -231,7 +233,9 @@
     ++ headerArgs
 
   segments :: [Segment NoContent]
-  segments = req ^. reqUrl.path^..folded.filtered isCapture
+  segments = filter isCapture paths
+    where
+    paths = toList (req ^. reqUrl.path)
 
   queryparams :: [QueryArg NoContent]
   queryparams = req ^.. reqUrl.queryStr.traverse
@@ -325,3 +329,27 @@
 -}
 snake :: Text -> Text
 snake = T.pack . quietSnake . T.unpack
+
+-- optics
+
+to :: (s -> a) -> Getting a s a
+to f a2fa s = s <$ (a2fa $ f s)
+{-# INLINE to #-}
+
+view :: Getting a s a -> s -> a
+view s2a s = getConst (s2a Const s)
+{-# INLINE view #-}
+
+infixl 8 ^.
+
+(^.) :: s -> Getting a s a -> a
+x ^. l = view l x
+{-# INLINE (^.) #-}
+
+infixl 8 ^..
+
+(^..) :: s -> Getting (Endo [a]) s a -> [a]
+x ^.. l = appEndo (getConst $ l (Const . Endo . (:)) x) []
+{-# INLINE (^..) #-}
+
+type Getting r s a = (a -> Const r a) -> s -> Const r s
