tryResolveAllImports :: [String] -> L1.L1NamespaceContents -> LookupModel (M.Map BS.ByteString L2.L2Model)
tryResolveAllImports incl nsc = do
  forM_ (nub . sort $ [v | L1.L1NSImport { L1.l1nsImportFrom = Just v} <- universeBi nsc]) $ \toImport -> do
    lm <- loadL2ModelFromURL' incl (BSC.unpack toImport)
    modify $ M.insert toImport lm
  get

-- | Attempts to translate a parsed L1 model into L2. This function depends
--   on all imports being loaded already.
tryResolveAllImports :: [String] -> L1.L1NamespaceContents -> LookupModel (M.Map BS.ByteString L2.L2Model)
tryResolveAllImports incl nsc = do
  forM_ (nub . sort $ [v | L1.L1NSImport { L1.l1nsImportFrom = Just v} <- universeBi nsc]) $ \toImport -> do
    lm <- loadL2ModelFromURL' incl (BSC.unpack toImport)
    modify $ M.insert toImport lm
  get

-- | Attempts to translate a parsed L1 model into L2. This function depends
--   on all imports being loaded already.
tryResolveAllImports incl nsc = do
  forM_ (nub . sort $ [v | L1.L1NSImport { L1.l1nsImportFrom = Just v} <- universeBi nsc]) $ \toImport -> do
    lm <- loadL2ModelFromURL' incl (BSC.unpack toImport)
    modify $ M.insert toImport lm
  get

-- | Attempts to translate a parsed L1 model into L2. This function depends
--   on all imports being loaded already.