@@ -23,6 +23,7 @@ module Servant.Docs.Internal where
2323import Control.Applicative
2424import Control.Arrow (second)
2525import Control.Lens hiding (List, to, from)
26+import qualified Control.Monad.Omega as Omega
2627import Data.ByteString.Conversion (ToByteString, toByteString)
2728import Data.ByteString.Lazy.Char8 (ByteString)
2829import qualified Data.CaseInsensitive as CI
@@ -394,12 +395,12 @@ defaultSample :: forall a b. (Generic a, Generic b, GToSample (Rep a) (Rep b)) =
394395defaultSample _ = to <$> gtoSample (Proxy :: Proxy (Rep a))
395396
396397defaultSamples :: forall a b. (Generic a, Generic b, GToSample (Rep a) (Rep b)) => Proxy a -> [(Text, b)]
397−defaultSamples _ = second to <$> gtoSamples (Proxy :: Proxy (Rep a))
398+defaultSamples _ = Omega.runOmega $ second to <$> gtoSamples (Proxy :: Proxy (Rep a))
398399
399400class GToSample t s where
400401 gtoSample :: proxy t -> Maybe (s x)
401− gtoSample _ = snd <$> listToMaybe (gtoSamples (Proxy :: Proxy t))
402− gtoSamples :: proxy t -> [(Text, s x)]
402+ gtoSample _ = snd <$> listToMaybe (Omega.runOmega (gtoSamples (Proxy :: Proxy t)))
403+ gtoSamples :: proxy t -> Omega.Omega (Text, s x)
403404 gtoSamples _ = maybe empty (pure . ("",)) (gtoSample (Proxy :: Proxy t))
404405
405406instance GToSample U1 U1 where
@@ -426,7 +427,7 @@ instance (GToSample p p', GToSample q q') => GToSample (p :+: q) (p' :+: q') whe
426427
427428instance ToSample a b => GToSample (K1 i a) (K1 i b) where
428429 gtoSample _ = K1 <$> toSample (Proxy :: Proxy a)
429− gtoSamples _ = second K1 <$> toSamples (Proxy :: Proxy a)
430+ gtoSamples _ = second K1 <$> Omega.each (toSamples (Proxy :: Proxy a))
430431
431432instance (GToSample f g) => GToSample (M1 i a f) (M1 i a g) where
432433 gtoSample _ = M1 <$> gtoSample (Proxy :: Proxy f)