Вопрос

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

Это было полезно?

Решение

You need to import Data.Char to get isUpper.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top