Commit f9b1bfe1 authored by claus.reinke@talk21.com's avatar claus.reinke@talk21.com
Browse files

augment ghci025 to cover #1847

- need to test :browse! in different contexts
- -s has disappeared, see #1799 for sorting
- 'imported from' clarified to 'imported via'
parent 86e50eb6
:l ghci025
System.IO.putStrLn "test :browse! functionality"
System.IO.putStrLn ":browse! -s *T -- sort output to get deterministic result (#1799)"
System.IO.putStrLn "-- test :browse! functionality"
System.IO.putStrLn ":browse! *T"
:browse! *T
System.IO.putStrLn ":browse! T"
:browse! T
......@@ -8,3 +8,17 @@ System.IO.putStrLn ":browse! T"
System.IO.putStrLn ":browse! T -- with -fglasgow-exts"
:browse! T
System.IO.putStrLn "-- test :browse! <target> relative to different contexts"
:l ../prog001/D.hs
:add ../prog001/C.hs
System.IO.putStrLn ":browse! C -- from *C>"
:browse! C
:add ../prog001/B.hs
System.IO.putStrLn ":browse! C -- from *B>, after :add B"
:browse! C
:m *C
System.IO.putStrLn ":browse! C -- from *C>, after :m *C"
:browse! C
:m *D
System.IO.putStrLn ":browse! C -- from *D>, after :m *D"
:browse! C
test :browse! functionality
:browse! -s *T -- sort output to get deterministic result (#1799)
-- test :browse! functionality
:browse! *T
-- defined locally
T.length :: GHC.Num.Integer
class N a
......@@ -13,24 +13,24 @@ c1 :: (C a b, N b) => a -> b
c2 :: (C a b, N b, S b) => a -> b
c3 :: (C a b) => a1 -> b
c4 :: (C a b) => a1 -> b
-- imported from Control.Monad
-- imported via Control.Monad
class (Monad m) => MonadPlus m where
mzero :: m a
mplus :: m a -> m a -> m a
mplus :: (MonadPlus m) => m a -> m a -> m a
mzero :: (MonadPlus m) => m a
-- imported from Control.Monad, Prelude
-- imported via Control.Monad, Prelude
(>>) :: (Monad m) => m a -> m b -> m b
(>>=) :: (Monad m) => m a -> (a -> m b) -> m b
fail :: (Monad m) => GHC.Base.String -> m a
return :: (Monad m) => a -> m a
-- imported from Control.Monad, Prelude, T
-- imported via Control.Monad, Prelude, T
class Monad m where
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
return :: a -> m a
fail :: GHC.Base.String -> m a
-- imported from Data.Maybe
-- imported via Data.Maybe
catMaybes :: [Maybe a] -> [a]
fromJust :: Maybe a -> a
fromMaybe :: a -> Maybe a -> a
......@@ -40,23 +40,23 @@ listToMaybe :: [a] -> Maybe a
mapMaybe :: (a -> Maybe b) -> [a] -> [b]
maybe :: b -> (a -> b) -> Maybe a -> b
maybeToList :: Maybe a -> [a]
-- imported from Data.Maybe, Prelude
-- imported via Data.Maybe, Prelude
Just :: a -> Maybe a
data Maybe a = Nothing | Just a
Nothing :: Maybe a
-- imported from Prelude
-- imported via Prelude
(+) :: (GHC.Num.Num a) => a -> a -> a
(=<<) :: (Monad m) => (a -> m b) -> m a -> m b
class Eq a where
(GHC.Base.==) :: a -> a -> GHC.Base.Bool
(GHC.Base./=) :: a -> a -> GHC.Base.Bool
-- imported from Prelude, T
-- imported via Prelude, T
Prelude.length :: [a] -> GHC.Base.Int
-- imported from T
-- imported via T
T.length :: Data.ByteString.Internal.ByteString -> GHC.Base.Int
:browse! T
-- defined locally
T.length :: Integer
T.length :: GHC.Num.Integer
class N a
class S a
class C a b where
......@@ -70,7 +70,7 @@ c3 :: (C a b) => a1 -> b
c4 :: (C a b) => a1 -> b
:browse! T -- with -fglasgow-exts
-- defined locally
T.length :: Integer
T.length :: GHC.Num.Integer
class N a
class S a
class C a b where
......@@ -82,3 +82,27 @@ c1 :: forall a b. (C a b, N b) => a -> b
c2 :: forall a b. (C a b, N b, S b) => a -> b
c3 :: forall a b. (C a b) => forall a1. a1 -> b
c4 :: forall a b. (C a b) => forall a1. a1 -> b
-- test :browse! <target> relative to different contexts
:browse! C -- from *C>
-- defined locally
g :: forall a. (Num a) => a -> a
h :: forall a. (Integral a) => a -> a
-- imported via D
f :: forall a. (Num a) => a -> a
:browse! C -- from *B>, after :add B
-- imported via C
g :: forall a. (Num a) => a -> a
h :: forall a. (Integral a) => a -> a
f :: forall a. (Num a) => a -> a
:browse! C -- from *C>, after :m *C
-- defined locally
g :: forall a. (Num a) => a -> a
h :: forall a. (Integral a) => a -> a
-- imported via D
f :: forall a. (Num a) => a -> a
:browse! C -- from *D>, after :m *D
-- not currently imported
C.g :: forall a. (Num a) => a -> a
C.h :: forall a. (Integral a) => a -> a
-- defined locally
f :: forall a. (Num a) => a -> a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment