
Could you derive Generic and then use generic lenses?
On Mar 4, 2022, at 06:04, PICCA Frederic-Emmanuel
wrote: Hello, I defined a typeclass like this with a data familly
class HasConfig a where data BinocularsConfig a :: *
new :: (MonadIO m, MonadLogger m, MonadThrow m) => Maybe FilePath -> m (BinocularsConfig a) getConfig :: Maybe FilePath -> IO (Either String (BinocularsConfig a)) combineWithCmdLineArgs :: BinocularsConfig a -> Maybe ConfigRange -> Maybe (Path Abs Dir) -> BinocularsConfig a update :: (MonadIO m, MonadLogger m, MonadThrow m) => FilePath -> m (BinocularsConfig a)
the instance is for now
instance HasConfig PreConfig where data BinocularsConfig PreConfig = BinocularsPreConfig { _binocularsPreConfigProjectionType :: ProjectionType } deriving (Eq, Show)
[...]
Since I use Ini to serialize/un-serialize the configuration, I need lens for this type
My question is how can I generate the like easily
makeLenses ''(BinocularsConfig PreConfig) does not work
thanks for considering
Frederic _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.