Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GHCi error - "Not in scope: `isUpper'"

Tags:

haskell

ghci

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

like image 794
user2151486 Avatar asked Mar 06 '14 21:03

user2151486


1 Answers

You need to import Data.Char to get isUpper.

like image 174
Mark Reed Avatar answered Sep 18 '22 12:09

Mark Reed