Domanda

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

È stato utile?

Soluzione

You need to import Data.Char to get isUpper.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top