diff options
author | Simon Hengel <sol@typeful.net> | 2012-10-07 17:05:45 +0200 |
---|---|---|
committer | Simon Hengel <sol@typeful.net> | 2012-10-07 17:05:45 +0200 |
commit | 5e746fa9e5dc4b210dab3b1fe1b120760b96f305 (patch) | |
tree | f59a766bf8725c80785af5ee36c9e22caf14d70d | |
parent | dd6209a0a1adf9f2817075173cca99ac2379db2e (diff) |
cross-package test: re-export IsString instead of Monad
There is a monad instance for Q, which is not available on platforms
that do not have GHCi support. This caused CrossPackageDocs to fail on
those platforms. Re-exporting IsString should test the same thing, but
it works on all platforms.
-rw-r--r-- | tests/html-tests/tests/CrossPackageDocs.hs | 3 | ||||
-rw-r--r-- | tests/html-tests/tests/CrossPackageDocs.html.ref | 204 | ||||
-rw-r--r-- | tests/html-tests/tests/mini_CrossPackageDocs.html.ref | 4 |
3 files changed, 24 insertions, 187 deletions
diff --git a/tests/html-tests/tests/CrossPackageDocs.hs b/tests/html-tests/tests/CrossPackageDocs.hs index de55060e..4d529f79 100644 --- a/tests/html-tests/tests/CrossPackageDocs.hs +++ b/tests/html-tests/tests/CrossPackageDocs.hs @@ -1,3 +1,4 @@ -module CrossPackageDocs (map, Monad(..), runInteractiveProcess) where +module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where import System.Process +import Data.String diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index 39353720..d0a306af 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -53,28 +53,16 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html" ><span class="keyword" >class</span > <a href="" - >Monad</a - > m <span class="keyword" + >IsString</a + > a <span class="keyword" >where</span ><ul class="subs" ><li ><a href="" - >(>>=)</a - > :: m a -> (a -> m b) -> m b</li - ><li - ><a href="" - >(>>)</a - > :: m a -> m b -> m b</li - ><li - ><a href="" - >return</a - > :: a -> m a</li - ><li - ><a href="" - >fail</a - > :: <a href="" + >fromString</a + > :: <a href="" >String</a - > -> m a</li + > -> a</li ></ul ></li ><li class="src short" @@ -140,191 +128,39 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html" ><p class="src" ><span class="keyword" >class</span - > <a name="t:Monad" class="def" - >Monad</a - > m <span class="keyword" + > <a name="t:IsString" class="def" + >IsString</a + > a <span class="keyword" >where</span ></p ><div class="doc" ><p - >The <code - ><a href="" - >Monad</a - ></code - > class defines the basic operations over a <em - >monad</em - >, -a concept from a branch of mathematics known as <em - >category theory</em - >. -From the perspective of a Haskell programmer, however, it is best to -think of a monad as an <em - >abstract datatype</em - > of actions. -Haskell's <code - >do</code - > expressions provide a convenient syntax for writing -monadic expressions. -</p - ><p - >Minimal complete definition: <code - ><a href="" - >>>=</a - ></code - > and <code - ><a href="" - >return</a - ></code - >. -</p - ><p - >Instances of <code - ><a href="" - >Monad</a - ></code - > should satisfy the following laws: -</p - ><pre - > return a >>= k == k a - m >>= return == m - m >>= (\x -> k x >>= h) == (m >>= k) >>= h -</pre - ><p - >Instances of both <code - ><a href="" - >Monad</a - ></code - > and <code - ><a href="" - >Functor</a - ></code - > should additionally satisfy the law: -</p - ><pre - > fmap f xs == xs >>= return . f -</pre - ><p - >The instances of <code - ><a href="" - >Monad</a - ></code - > for lists, <code - ><a href="" - >Maybe</a - ></code - > and <code - ><a href="" - >IO</a - ></code - > -defined in the <a href="" - >Prelude</a - > satisfy these laws. + >Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC). </p ></div ><div class="subs methods" ><p class="caption" >Methods</p ><p class="src" - ><a name="v:-62--62--61-" class="def" - >(>>=)</a - > :: m a -> (a -> m b) -> m b</p - ><div class="doc" - ><p - >Sequentially compose two actions, passing any value produced - by the first as an argument to the second. -</p - ></div - ><p class="src" - ><a name="v:-62--62-" class="def" - >(>>)</a - > :: m a -> m b -> m b</p - ><div class="doc" - ><p - >Sequentially compose two actions, discarding any value produced - by the first, like sequencing operators (such as the semicolon) - in imperative languages. -</p - ></div - ><p class="src" - ><a name="v:return" class="def" - >return</a - > :: a -> m a</p - ><div class="doc" - ><p - >Inject a value into the monadic type. -</p - ></div - ><p class="src" - ><a name="v:fail" class="def" - >fail</a - > :: <a href="" + ><a name="v:fromString" class="def" + >fromString</a + > :: <a href="" >String</a - > -> m a</p - ><div class="doc" - ><p - >Fail with a message. This operation is not part of the - mathematical definition of a monad, but is invoked on pattern-match - failure in a <code - >do</code - > expression. -</p - ></div + > -> a</p ></div ><div class="subs instances" - ><p id="control.i:Monad" class="caption collapser" onclick="toggleSection('i:Monad')" + ><p id="control.i:IsString" class="caption collapser" onclick="toggleSection('i:IsString')" >Instances</p - ><div id="section.i:Monad" class="show" + ><div id="section.i:IsString" class="show" ><table ><tr ><td class="src" ><a href="" - >Monad</a - > []</td - ><td class="doc empty" - > </td - ></tr - ><tr - ><td class="src" - ><a href="" - >Monad</a - > <a href="" - >IO</a - ></td - ><td class="doc empty" - > </td - ></tr - ><tr - ><td class="src" - ><a href="" - >Monad</a - > Q</td - ><td class="doc empty" - > </td - ></tr - ><tr - ><td class="src" - ><a href="" - >Monad</a - > <a href="" - >Maybe</a - ></td - ><td class="doc empty" - > </td - ></tr - ><tr - ><td class="src" - ><a href="" - >Monad</a - > PprM</td - ><td class="doc empty" - > </td - ></tr - ><tr - ><td class="src" - ><a href="" - >Monad</a - > ((->) r)</td + >IsString</a + > [<a href="" + >Char</a + >]</td ><td class="doc empty" > </td ></tr diff --git a/tests/html-tests/tests/mini_CrossPackageDocs.html.ref b/tests/html-tests/tests/mini_CrossPackageDocs.html.ref index 9d957c1e..4c0588ba 100644 --- a/tests/html-tests/tests/mini_CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/mini_CrossPackageDocs.html.ref @@ -30,8 +30,8 @@ window.onload = function () {pageLoad();}; ><span class="keyword" >class</span > <a href="" target="main" - >Monad</a - > m</p + >IsString</a + > a</p ></div ><div class="top" ><p class="src" |