From 5e746fa9e5dc4b210dab3b1fe1b120760b96f305 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 17:05:45 +0200 Subject: 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. --- tests/html-tests/tests/CrossPackageDocs.hs | 3 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 204 ++------------------- .../tests/mini_CrossPackageDocs.html.ref | 4 +- 3 files changed, 24 insertions(+), 187 deletions(-) (limited to 'tests/html-tests') 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" >class Monad m IsString a where
  • class Monad m IsString a where

    The Monad class defines the basic operations over a monad, -a concept from a branch of mathematics known as category theory. -From the perspective of a Haskell programmer, however, it is best to -think of a monad as an abstract datatype of actions. -Haskell's do expressions provide a convenient syntax for writing -monadic expressions. -

    Minimal complete definition: >>= and return. -

    Instances of Monad should satisfy the following laws: -

     return a >>= k  ==  k a
    - m >>= return  ==  m
    - m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h
    -

    Instances of both Monad and Functor should additionally satisfy the law: -

     fmap f xs  ==  xs >>= return . f
    -

    The instances of Monad for lists, Maybe and IO -defined in the Prelude satisfy these laws. + >Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC).

    Methods

    (>>=) :: m a -> (a -> m b) -> m b

    Sequentially compose two actions, passing any value produced - by the first as an argument to the second. -

    (>>) :: m a -> m b -> m b

    Sequentially compose two actions, discarding any value produced - by the first, like sequencing operators (such as the semicolon) - in imperative languages. -

    return :: a -> m a

    Inject a value into the monadic type. -

    fail :: fromString :: String -> m a

    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 do expression. -

    -> a

    Instances

    IsString [Char]classMonad m

    IsString a

    Monad [] 
    Monad IO 
    Monad Q 
    Monad Maybe 
    Monad PprM 
    Monad ((->) r)