| | |
WinHugs - using isDigit
![]() |
•
•
Join Date: Feb 2008
Posts: 2
Reputation:
Solved Threads: 0
I downloaded the most recent vesion of winHugs and I installed it.
I'm trying to follow a tutorial about the commands (hugs2List pg 3).
I try to use the Prelude function isDigit, but this gives an error.
-- File second.hs
getDigits :: [Char] -> [Char]
getDigits s = [C|c <-s, isDigit c]
Prelude> Undefined variable "isDigit"
I've noticed that in the tutorial Prelude> is named Main> Does it have something to do with the version/modules? How can I use this isDigit?
Thank you for your attention!
I'm trying to follow a tutorial about the commands (hugs2List pg 3).
I try to use the Prelude function isDigit, but this gives an error.
-- File second.hs
getDigits :: [Char] -> [Char]
getDigits s = [C|c <-s, isDigit c]
Prelude> Undefined variable "isDigit"
I've noticed that in the tutorial Prelude> is named Main> Does it have something to do with the version/modules? How can I use this isDigit?
Thank you for your attention!
At the top of your main program (the .hsx file) you should have something like:
In this example I named my .hsx file "MyProg.hsx" but you can name it whatever you like. Make sure to import every library you need. The isDigit function is in the Char module of the Prelude.
Hope this helps.
Haskell Syntax (Toggle Plain Text)
module MyProg where import Char
Hope this helps.
![]() |
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Create Table View In VC++ #1
- Next Thread: solution to my matlab code
| Thread Tools | Search this Thread |






