CurryInfo: currypath-3.0.0 / System.CurryPath.getPackageVersionOfModule

definition: Info
 
getPackageVersionOfModule :: String -> IO (Maybe (String,String))
getPackageVersionOfModule mname = do
  mbsrc <- lookupModuleSourceInLoadPath mname
  case mbsrc of
    Nothing -> error $ "Module '" ++ mname ++ "' not found in load path!"
    Just (dirname,_) -> getPackageVersionOfDirectory dirname
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
Checks whether a module name is part of a package and
returns the package name and package version.
For instance, in a package containing a dependency to package
`process` with version `3.0.0`, the call

    getPackageVersionOfModule "System.Process"

returns

    Just "process" "3.0.0"

`Nothing` is returned if there is no package to which this module
belongs.

For this purpose, the source file of the module is looked up
(and an error is raised if this module cannot be found) and
it is checked whether there is a `package.json` file under the
directory of the source file and the directory name is a valid package id.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_) |-> _}
name: Info
 getPackageVersionOfModule
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> Prelude.IO (Prelude.Maybe (String, String))
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term