WinHugs - using isDigit

Reply

Join Date: Feb 2008
Posts: 2
Reputation: sarko86 is an unknown quantity at this point 
Solved Threads: 0
sarko86 sarko86 is offline Offline
Newbie Poster

WinHugs - using isDigit

 
0
  #1
Feb 7th, 2008
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!
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: WinHugs - using isDigit

 
0
  #2
Feb 13th, 2008
At the top of your main program (the .hsx file) you should have something like:
  1. module MyProg where
  2.  
  3. import Char
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 2
Reputation: sarko86 is an unknown quantity at this point 
Solved Threads: 0
sarko86 sarko86 is offline Offline
Newbie Poster

Re: WinHugs - using isDigit

 
0
  #3
Feb 14th, 2008
Thanks a lot! It works now!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Legacy and Other Languages Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC