5
votes

I'm learning haskell and I'm trying to write some simple functions. Everything worked well until I've used function isUpper. I'm unable to compile the project because of this error:

[1 of 1] Compiling Main             ( C:\Users\...\src\Main.hs, interpreted )
C:\Users\...\src\Main.hs:147:25:
    Not in scope: `isUpper'
Failed, modules loaded: none.
Prelude>

My code:

module Main where
main::IO()
main = undefined
stringIsUpper [] = True
stringIsUpper (x:ys) = (isUpper x) && (stringIsUpper(ys))  

The goal of this code should be just to check if the inserted string consists of the uppercase letters. I'm using EclipseFP for development Thank you for your help

1
isUpper is a function in Data.Char, you have to import it firstbheklilr
When in doubt, hoogle it.bheklilr
Thank You @bheklilr. It works. I just thought that I don't have to write imports and also I didn't know, where to place that imports. Problem is solveduser2151486

1 Answers

17
votes

You need to import Data.Char to get isUpper.