ghci ‘Not in scope:’ message

This is not a function code, it’s function signature which can only be saved in a module along with function definition and the be loaded to GHCi.

This signature means that you’re going to define a function lucky which gets an Integer and returns a String.

However if you’re composing your functions using GHCi as interactive interpreter, you can let Haskell infer your function’s type, e. g.:

ghci> let lucky x = show (x + 1)
ghci> :t lucky
lucky :: (Num a) => a -> String

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)