From 45d3bb73db3039e0f4a48a39273425a9e4b20f84 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 21 Aug 2001 14:44:42 +0000 Subject: [PATCH] [project @ 2001-08-21 14:44:42 by simonmar] Test various forms of :info --- ghc/tests/ghci/ghci008.script | 10 +++++++ ghc/tests/ghci/ghci008.stdout | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ghc/tests/ghci/ghci008.script create mode 100644 ghc/tests/ghci/ghci008.stdout diff --git a/ghc/tests/ghci/ghci008.script b/ghc/tests/ghci/ghci008.script new file mode 100644 index 0000000..1daf837 --- /dev/null +++ b/ghc/tests/ghci/ghci008.script @@ -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 index 0000000..3aab118 --- /dev/null +++ b/ghc/tests/ghci/ghci008.stdout @@ -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. -- 1.7.10.4