13 lines
14 KiB
HTML
13 lines
14 KiB
HTML
<!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>System.IO.HVFS.InstanceHelpers</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_System-IO-HVFS-InstanceHelpers.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">MissingH-1.3.0.1: Large utility library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2004-2011 John Goerzen</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>John Goerzen <jgoerzen@complete.org></td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">System.IO.HVFS.InstanceHelpers</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">HVFSStat objects</a></li><li><a href="#g:2">HVFS objects & types</a><ul><li><a href="#g:3">MemoryVFS</a></li></ul></li><li><a href="#g:4">Utilities</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Utilities for creating instances of the items defined in
|
|
<a href="System-IO-HVFS.html">System.IO.HVFS</a>.</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"><span class="keyword">data</span> <a href="#t:SimpleStat">SimpleStat</a> = <a href="#v:SimpleStat">SimpleStat</a> {<ul class="subs"><li><a href="#v:isFile">isFile</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:fileSize">fileSize</a> :: <a href="System-IO-HVFS.html#t:FileOffset">FileOffset</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:MemoryVFS">MemoryVFS</a></li><li class="src short"><a href="#v:newMemoryVFS">newMemoryVFS</a> :: [<a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryNode">MemoryNode</a>] -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></li><li class="src short"><a href="#v:newMemoryVFSRef">newMemoryVFSRef</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-IORef.html#t:IORef">IORef</a> [<a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryNode">MemoryNode</a>] -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:MemoryNode">MemoryNode</a> = (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a>, <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryEntry">MemoryEntry</a>)</li><li class="src short"><span class="keyword">data</span> <a href="#t:MemoryEntry">MemoryEntry</a><ul class="subs"><li>= <a href="#v:MemoryDirectory">MemoryDirectory</a> [<a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryNode">MemoryNode</a>]</li><li>| <a href="#v:MemoryFile">MemoryFile</a> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></li></ul></li><li class="src short"><a href="#v:nice_slice">nice_slice</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> [<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:getFullPath">getFullPath</a> :: <a href="System-IO-HVFS.html#t:HVFS">HVFS</a> a => a -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:getFullSlice">getFullSlice</a> :: <a href="System-IO-HVFS.html#t:HVFS">HVFS</a> a => a -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a>]</li></ul></div><div id="interface"><h1 id="g:1">HVFSStat objects</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:SimpleStat" class="def">SimpleStat</a></p><div class="doc"><p>A simple <a href="System-IO-HVFS-HVFSStat.html">System.IO.HVFS.HVFSStat</a>
|
|
class that assumes that everything is either a file
|
|
or a directory. </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:SimpleStat" class="def">SimpleStat</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:isFile" class="def">isFile</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>True if file, False if directory</p></dd><dt class="src"><a name="v:fileSize" class="def">fileSize</a> :: <a href="System-IO-HVFS.html#t:FileOffset">FileOffset</a></dt><dd class="doc"><p>Set to 0 if unknown or a directory</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:SimpleStat" class="caption collapser" onclick="toggleSection('i:SimpleStat')">Instances</p><div id="section.i:SimpleStat" class="show"><table><tr><td class="src"><a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:SimpleStat">SimpleStat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:SimpleStat">SimpleStat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="System-IO-HVFS.html#t:HVFSStat">HVFSStat</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:SimpleStat">SimpleStat</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:2">HVFS objects & types</h1><h2 id="g:3">MemoryVFS</h2><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:MemoryVFS" class="def">MemoryVFS</a></p><div class="doc"><p>An in-memory read/write filesystem. Think of it as a dynamically
|
|
resizable ramdisk written in Haskell. </p></div><div class="subs instances"><p id="control.i:MemoryVFS" class="caption collapser" onclick="toggleSection('i:MemoryVFS')">Instances</p><div id="section.i:MemoryVFS" class="show"><table><tr><td class="src"><a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="System-IO-HVFS.html#t:HVFSOpenable">HVFSOpenable</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="System-IO-HVFS.html#t:HVFS">HVFS</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:newMemoryVFS" class="def">newMemoryVFS</a> :: [<a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryNode">MemoryNode</a>] -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></p><div class="doc"><p>Create a new <code><a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></code> object from an existing tree.
|
|
An empty filesystem may be created by using <code>[]</code> for the parameter.</p></div></div><div class="top"><p class="src"><a name="v:newMemoryVFSRef" class="def">newMemoryVFSRef</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-IORef.html#t:IORef">IORef</a> [<a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryNode">MemoryNode</a>] -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></p><div class="doc"><p>Create a new <code><a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></code> object using an IORef to an
|
|
existing tree.</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:MemoryNode" class="def">MemoryNode</a> = (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a>, <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryEntry">MemoryEntry</a>)</p><div class="doc"><p>The basic node of a <code><a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></code>. The String corresponds to the filename,
|
|
and the entry to the contents. </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:MemoryEntry" class="def">MemoryEntry</a></p><div class="doc"><p>The content of a file or directory in a <code><a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryVFS">MemoryVFS</a></code>. </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:MemoryDirectory" class="def">MemoryDirectory</a> [<a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryNode">MemoryNode</a>]</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:MemoryFile" class="def">MemoryFile</a> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:MemoryEntry" class="caption collapser" onclick="toggleSection('i:MemoryEntry')">Instances</p><div id="section.i:MemoryEntry" class="show"><table><tr><td class="src"><a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryEntry">MemoryEntry</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> <a href="System-IO-HVFS-InstanceHelpers.html#t:MemoryEntry">MemoryEntry</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:4">Utilities</h1><div class="top"><p class="src"><a name="v:nice_slice" class="def">nice_slice</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> [<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a>]</p><div class="doc"><p>Similar to <code><a href="System-Path.html#t:NameManip">NameManip</a></code> but the first element
|
|
won't be <code>/</code>.</p><pre>nice_slice "/" -> []
|
|
nice_slice "/foo/bar" -> ["foo", "bar"]</pre></div></div><div class="top"><p class="src"><a name="v:getFullPath" class="def">getFullPath</a> :: <a href="System-IO-HVFS.html#t:HVFS">HVFS</a> a => a -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Gets a full path, after investigating the cwd.</p></div></div><div class="top"><p class="src"><a name="v:getFullSlice" class="def">getFullSlice</a> :: <a href="System-IO-HVFS.html#t:HVFS">HVFS</a> a => a -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a>]</p><div class="doc"><p>Gets the full path via <code><a href="System-IO-HVFS-InstanceHelpers.html#v:getFullPath">getFullPath</a></code>, then splits it via <code><a href="System-IO-HVFS-InstanceHelpers.html#v:nice_slice">nice_slice</a></code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.0</p></div></body></html> |