[project @ 2001-08-21 14:44:42 by simonmar]
authorsimonmar <unknown>
Tue, 21 Aug 2001 14:44:42 +0000 (14:44 +0000)
committersimonmar <unknown>
Tue, 21 Aug 2001 14:44:42 +0000 (14:44 +0000)
Test various forms of :info

ghc/tests/ghci/ghci008.script [new file with mode: 0644]
ghc/tests/ghci/ghci008.stdout [new file with mode: 0644]

diff --git a/ghc/tests/ghci/ghci008.script b/ghc/tests/ghci/ghci008.script
new file mode 100644 (file)
index 0000000..1daf837
--- /dev/null
@@ -0,0 +1,10 @@
+-- testing :info
+:info +
+:info (+)
+:info Complex.:+
+:info (Complex.:+)
+:info RealFloat
+:info []
+:info ()
+:info (,)
+:info `List.isPrefixOf`
diff --git a/ghc/tests/ghci/ghci008.stdout b/ghc/tests/ghci/ghci008.stdout
new file mode 100644 (file)
index 0000000..3aab118
--- /dev/null
@@ -0,0 +1,66 @@
+   ___         ___ _
+  / _ \ /\  /\/ __(_)
+ / /_\// /_/ / /  | |      GHC Interactive, version 5.01, for Haskell 98.
+/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
+\____/\/ /_/\____/|_|      Type :? for help.
+
+Loading package std ... linking ... done.
+Prelude> -- testing :info
+Prelude> :info +
+-- + is a method in class Num
+infixl 6 +
+(+) :: forall a. (Num a) => a -> a -> a
+Prelude> :info (+)
+-- + is a method in class Num
+infixl 6 +
+(+) :: forall a. (Num a) => a -> a -> a
+Prelude> :info Complex.:+
+-- Complex.:+ is a data constructor
+infix 6 Complex.:+
+(Complex.:+) :: forall a. (RealFloat a) =>
+               a -> a -> Complex.Complex a
+Prelude> :info (Complex.:+)
+-- Complex.:+ is a data constructor
+infix 6 Complex.:+
+(Complex.:+) :: forall a. (RealFloat a) =>
+               a -> a -> Complex.Complex a
+Prelude> :info RealFloat
+-- RealFloat is a class
+class (RealFrac a, Floating a) => RealFloat a where {
+    floatRadix :: a -> Integer;
+    floatDigits :: a -> Int;
+    floatRange :: a -> (Int, Int);
+    decodeFloat :: a -> (Integer, Int);
+    encodeFloat :: Integer -> Int -> a;
+    exponent :: a -> Int {- has default method -};
+    significand :: a -> a {- has default method -};
+    scaleFloat :: Int -> a -> a {- has default method -};
+    isInfinite :: a -> Bool;
+    isDenormalized :: a -> Bool;
+    isNegativeZero :: a -> Bool;
+    isIEEE :: a -> Bool;
+    isNaN :: a -> Bool;
+    atan2 :: a -> a -> a {- has default method -};
+    }
+Prelude> :info []
+-- [] is a data constructor
+[] :: forall t_12. [t_12]
+
+-- [] is a type constructor
+data [] t_12 = [] | : t_12 [t_12]
+Prelude> :info ()
+-- () is a data constructor
+() :: ()
+
+-- () is a type constructor
+data () = ()
+Prelude> :info (,)
+-- (,) is a data constructor
+(,) :: forall t_12 t_13. t_12 -> t_13 -> (t_12, t_13)
+
+-- (,) is a type constructor
+data (,) t_12 t_13 = (,) t_12 t_13
+Prelude> :info `List.isPrefixOf`
+-- List.isPrefixOf is a variable
+List.isPrefixOf :: forall a. (Eq a) => [a] -> [a] -> Bool
+Prelude> Leaving GHCi.