<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HeaderInfo</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_HeaderInfo.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ghc-7.4.2: The GHC API</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">HeaderInfo</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Parsing the top of a Haskell source file to get its module name, imports and options. </p><p>(c) Simon Marlow 2005 (c) Lemmih 2006 </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:getImports">getImports</a> :: <a href="DynFlags.html#t:DynFlags">DynFlags</a> -> <a href="StringBuffer.html#t:StringBuffer">StringBuffer</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ([<a href="SrcLoc.html#t:Located">Located</a> (<a href="HsImpExp.html#t:ImportDecl">ImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>)], [<a href="SrcLoc.html#t:Located">Located</a> (<a href="HsImpExp.html#t:ImportDecl">ImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>)], <a href="SrcLoc.html#t:Located">Located</a> <a href="Module.html#t:ModuleName">ModuleName</a>)</li><li class="src short"><a href="#v:mkPrelImports">mkPrelImports</a> :: <a href="Module.html#t:ModuleName">ModuleName</a> -> <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a> -> [<a href="HsImpExp.html#t:LImportDecl">LImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>] -> [<a href="HsImpExp.html#t:LImportDecl">LImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>]</li><li class="src short"><a href="#v:getOptionsFromFile">getOptionsFromFile</a> :: <a href="DynFlags.html#t:DynFlags">DynFlags</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:getOptions">getOptions</a> :: <a href="DynFlags.html#t:DynFlags">DynFlags</a> -> <a href="StringBuffer.html#t:StringBuffer">StringBuffer</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:optionsErrorMsgs">optionsErrorMsgs</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="ErrUtils.html#t:Messages">Messages</a></li><li class="src short"><a href="#v:checkProcessArgsResult">checkProcessArgsResult</a> :: <a href="MonadUtils.html#t:MonadIO">MonadIO</a> m => [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> m ()</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:getImports" class="def">getImports</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="DynFlags.html#t:DynFlags">DynFlags</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="StringBuffer.html#t:StringBuffer">StringBuffer</a></td><td class="doc"><p>Parse this. </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>Filename the buffer came from. Used for reporting parse error locations. </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>The original source filename (used for locations in the function result) </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ([<a href="SrcLoc.html#t:Located">Located</a> (<a href="HsImpExp.html#t:ImportDecl">ImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>)], [<a href="SrcLoc.html#t:Located">Located</a> (<a href="HsImpExp.html#t:ImportDecl">ImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>)], <a href="SrcLoc.html#t:Located">Located</a> <a href="Module.html#t:ModuleName">ModuleName</a>)</td><td class="doc"><p>The source imports, normal imports, and the module name. </p></td></tr></table></div><div class="doc"><p>Parse the imports of a source file. </p><p>Throws a <code><a href="HscTypes.html#t:SourceError">SourceError</a></code> if parsing fails. </p></div></div><div class="top"><p class="src"><a name="v:mkPrelImports" class="def">mkPrelImports</a> :: <a href="Module.html#t:ModuleName">ModuleName</a> -> <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a> -> [<a href="HsImpExp.html#t:LImportDecl">LImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>] -> [<a href="HsImpExp.html#t:LImportDecl">LImportDecl</a> <a href="RdrName.html#t:RdrName">RdrName</a>]</p></div><div class="top"><p class="src"><a name="v:getOptionsFromFile" class="def">getOptionsFromFile</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="DynFlags.html#t:DynFlags">DynFlags</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>Input file </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>Parsed options, if any. </p></td></tr></table></div><div class="doc"><p>Parse OPTIONS and LANGUAGE pragmas of the source file. </p><p>Throws a <code><a href="HscTypes.html#t:SourceError">SourceError</a></code> if flag parsing fails (including unsupported flags.) </p></div></div><div class="top"><p class="src"><a name="v:getOptions" class="def">getOptions</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="DynFlags.html#t:DynFlags">DynFlags</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="StringBuffer.html#t:StringBuffer">StringBuffer</a></td><td class="doc"><p>Input Buffer </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>Source filename. Used for location info. </p></td></tr><tr><td class="src">-> [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>Parsed options. </p></td></tr></table></div><div class="doc"><p>Parse OPTIONS and LANGUAGE pragmas of the source file. </p><p>Throws a <code><a href="HscTypes.html#t:SourceError">SourceError</a></code> if flag parsing fails (including unsupported flags.) </p></div></div><div class="top"><p class="src"><a name="v:optionsErrorMsgs" class="def">optionsErrorMsgs</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="ErrUtils.html#t:Messages">Messages</a></p></div><div class="top"><p class="src"><a name="v:checkProcessArgsResult" class="def">checkProcessArgsResult</a> :: <a href="MonadUtils.html#t:MonadIO">MonadIO</a> m => [<a href="SrcLoc.html#t:Located">Located</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> m ()</p><div class="doc"><p>Complain about non-dynamic flags in OPTIONS pragmas. </p><p>Throws a <code><a href="HscTypes.html#t:SourceError">SourceError</a></code> if the input list is non-empty claiming that the input flags are unknown. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>