[Haskell-cafe] data type familly and makeLenses
PICCA Frederic-Emmanuel
frederic-emmanuel.picca at synchrotron-soleil.fr
Fri Mar 4 10:58:31 UTC 2022
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
More information about the Haskell-Cafe
mailing list