Defining function signature in GHCi
问题 Defining a function signature in Haskell's interpreter GHCi doesn't work. Copying an example from this page: Prelude> square :: Int -> Int <interactive>:60:1: error: • No instance for (Show (Int -> Int)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) • In a stmt of an interactive GHCi command: print it Prelude> square x = x * x How can I declare a function signature and then give function definition in Haskell interactively? also: why can't I simply