loadIface :: ModName -> IfaceM ModIface
loadIface modName = do
    let filePath = haskellInterfacePath modName
    dynflags <- getSessionDynFlags
    liftIO $ readIface dynflags filePath
    where
        -- | Read binary interface (adapted from 'showIface' in GHC's
        --      iface/LoadIface.hs)
        readIface :: DynFlags -> FilePath -> IO ModIface
        readIface dynflags filename = do
            hscEnv <- newHscEnv dynflags
            initTcRnIf 's' hscEnv () () $
                readBinIface IgnoreHiWay TraceBinIFaceReading filename

-- | Determine the path to the .hi file for a given module name "Foo.Bar.Baz"
loadIface :: ModName -> IfaceM ModIface
loadIface modName = do
    let filePath = haskellInterfacePath modName
    dynflags <- getSessionDynFlags
    liftIO $ readIface dynflags filePath
    where
        -- | Read binary interface (adapted from 'showIface' in GHC's
        --      iface/LoadIface.hs)
        readIface :: DynFlags -> FilePath -> IO ModIface
        readIface dynflags filename = do
            hscEnv <- newHscEnv dynflags
            initTcRnIf 's' hscEnv () () $
                readBinIface IgnoreHiWay TraceBinIFaceReading filename

-- | Determine the path to the .hi file for a given module name "Foo.Bar.Baz"
loadIface modName = do
    let filePath = haskellInterfacePath modName
    dynflags <- getSessionDynFlags
    liftIO $ readIface dynflags filePath
    where
        -- | Read binary interface (adapted from 'showIface' in GHC's
        --      iface/LoadIface.hs)
        readIface :: DynFlags -> FilePath -> IO ModIface
        readIface dynflags filename = do
            hscEnv <- newHscEnv dynflags
            initTcRnIf 's' hscEnv () () $
                readBinIface IgnoreHiWay TraceBinIFaceReading filename

-- | Determine the path to the .hi file for a given module name "Foo.Bar.Baz"