AOA AOA AOA Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!

Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 17th February, 2002, 08:28 PM
Member
 
Join Date: September 2001
Location: Kent UK
Posts: 969
Send a message via ICQ to Rackne Send a message via AIM to Rackne Send a message via Yahoo to Rackne

Haskell

Just out of interest is there any one here who knows anything about the functional programming language Haskell?

If so i'm in need of a little help with implementing what is essentially a for loop using recursion and where clauses. I'm pretty sure there's something very simple wrong with the code i have but i really can't see what the problem is!

In essence the layout of what I have is:

mainfunction :: input type -> output type
mainfunction x y = secondfunction x y
where secondfunction x y
| something == True = this
| otherwise = secondfunction (change to x) (change to y)

This to me seems it should work but i keep getting unexpected keyword "where" errors when i try and run it.

Any thoughts?
__________________

Last edited by Rackne; 17th February, 2002 at 08:32 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 17th February, 2002, 10:24 PM
Dr_Romulus's Avatar
Member/OES
 
Join Date: January 2002
Location: St. Louis, MO
Posts: 134
Send a message via ICQ to Dr_Romulus

I've never even heard of Haskell. Is it a proprietory language for a specific industry or what? Time to do some diggin on the net...
__________________
I am Jack's desire to kill you all...

My Heatware

Email me here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 18th February, 2002, 03:49 PM
Member
 
Join Date: September 2001
Location: Kent UK
Posts: 969
Send a message via ICQ to Rackne Send a message via AIM to Rackne Send a message via Yahoo to Rackne

Doesn't matter now, problem solved and one finished project!!!
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 18th February, 2002, 03:56 PM
Dr_Romulus's Avatar
Member/OES
 
Join Date: January 2002
Location: St. Louis, MO
Posts: 134
Send a message via ICQ to Dr_Romulus

LOL

Fine... Don't enlighten the rest of us dullards.
__________________
I am Jack's desire to kill you all...

My Heatware

Email me here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 18th February, 2002, 04:23 PM
Member
 
Join Date: September 2001
Location: Kent UK
Posts: 969
Send a message via ICQ to Rackne Send a message via AIM to Rackne Send a message via Yahoo to Rackne

Sorry!

Haskell is a language I'm learning as part of my degree, more because of it's value in giving us more programming experience than because it's useful for "real world" applications. It's meant to help improve our problem solving skills and has the added bonus of making us appreciate Java more.

It also has fun things like polymorphic types that Java doesn't currently cope well with and it's one of the areas of research that the computing laboratory at my university (University of Kent) is currently persuing.

Go to http://www.haskell.org for more information if you're interested.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 18th February, 2002, 04:29 PM
Dr_Romulus's Avatar
Member/OES
 
Join Date: January 2002
Location: St. Louis, MO
Posts: 134
Send a message via ICQ to Dr_Romulus

Now thats what I'm talkin about. More stuff that I need to learn about to impress people in conversation.

Actually I'm glad that you posted the link since I was curious and haven't had time to research it at all.

It seems to be programmed similar to Visual Basic, is that true?
__________________
I am Jack's desire to kill you all...

My Heatware

Email me here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 18th February, 2002, 04:49 PM
Member
 
Join Date: September 2001
Location: Kent UK
Posts: 969
Send a message via ICQ to Rackne Send a message via AIM to Rackne Send a message via Yahoo to Rackne

Visual Basic was the first language I learnt and I hadn't even thought to compare them until you mentioned it. Thinking about it, on the surface at least I don't think they're any more similar than Haskell and say Java is but I may well be wrong. Haskell is in fact based on lambda calculus, ie maths that goes straight over my head! It's taught side by side with logic and set theory which gives you an idea what it's principles are like.

The thing about Haskell that I don't like is that there is little or no built in syntax for things like loops, which to be honest I miss and was what caused me a major problem last night! There's also as far as I can see little scope for casting between types which I also find irritating but then again it's very easy to define your own types specific to the problem being solved.

It does have the advantage of requiring far fewer lines of code to achieve the same task than other languages would and code can very easily be reused due to its polymorphic nature. ie You can write functions without ever specifying an input or output type.

I'm probably missing a lot of its subtleties but what I do like about it is that it seems less fluffy than other languages and it's easy to build up complex functions from lower level functions. But when it goes wrong it can be very difficult to find out why!

There, I think I've rambled on long enough
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 18th February, 2002, 05:10 PM
Daniel ~'s Avatar
Chief BBS Administrator
 
Join Date: September 2001
Location: Seattle Wa.
Posts: 41,181

Hey I can't even programm my Keyboard and I found this interesting!
__________________
"Though all men live in ignorance before mystery,
they need not live in darkness...
Justice is foundation and ETERNAL
."
DKE

"All that we do is touched by Ocean
Yet we remain on the shore of what we know."
Richard Wilbur


Subscribers! Ask Pitch about a Custom Sig Graphic

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 18th February, 2002, 10:33 PM
Phil's Avatar
Member
 
Join Date: September 2001
Location: Bolton, UK
Posts: 1,338
Send a message via ICQ to Phil

Well you were right, no one had heard of it, thats why I asked what it was derrived from.
Was it simple like I thought it would be?
__________________
"Let's Blow This Facist Popsicle Stand!"



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 18th February, 2002, 11:16 PM
Dr_Romulus's Avatar
Member/OES
 
Join Date: January 2002
Location: St. Louis, MO
Posts: 134
Send a message via ICQ to Dr_Romulus

Digging in deeper this looks like a very powerful language to write in. Since it is based around Lambda Calculus I would assume that is great for computational data, such as labratory programming.
I just read a very little bit but the small amout of code is awsome... and the polymorphic nature of the code that the site discusses is cool as hell. you could port entire reams of code from one program to another with monkeying with it very much... very interesting stuff.

I gotta know what degree you are working on that teaches this language...
__________________
I am Jack's desire to kill you all...

My Heatware

Email me here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 19th February, 2002, 02:16 AM
Member
 
Join Date: September 2001
Location: Kent UK
Posts: 969
Send a message via ICQ to Rackne Send a message via AIM to Rackne Send a message via Yahoo to Rackne

Yes it was simple, and i'm quite ashamed that I didn't see it sooner!

I'm on the first year of a BSc in Computer Science (with a year in industry that I really need to start thinking about soon.....)
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 19th February, 2002, 09:51 PM
Phil's Avatar
Member
 
Join Date: September 2001
Location: Bolton, UK
Posts: 1,338
Send a message via ICQ to Phil

I always used to get stupid little errors in my dephi programming, and it was always something so obvious and dumb I'd look right past it looking for a major error when it was usually something as simple as a spelling mistake, or colon missing or something.
A 2nd set of eyes usually helps a lot, bit like when you're playing solitaire and someone watching see's all the moves you miss
__________________
"Let's Blow This Facist Popsicle Stand!"



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 19th February, 2002, 11:24 PM
Superman's Avatar
Systems Administrator
 
Join Date: September 2001
Location: WI
Posts: 4,406
Send a message via ICQ to Superman

Quote:
Originally posted by Phil
I always used to get stupid little errors in my dephi programming, and it was always something so obvious and dumb I'd look right past it looking for a major error when it was usually something as simple as a spelling mistake, or colon missing or something.
A 2nd set of eyes usually helps a lot, bit like when you're playing solitaire and someone watching see's all the moves you miss
I always forget semi-colons!!! LOL. That's why I like coffeecup HTML editor, it gives you line numbers. And you used to count them, LOL, looking for the right line with the PHP or C++ syntax error
__________________
"And, most of all, remember this descendant of David who beat the hell out of death."
-from the book "Six Hours One Friday" by Max Lucado

"You have to go outside the sequence of engines, into the world of men, to find the real originator of the rocket. Is it not equally reasonable to look outside nature for the real Originator of the natural order?
-C.S. Lewis


Director of JavaScript section of the Allied Sites Support Team, web designer and programmer for DaOCPlace, and co-web designer and programmer for AOA Files

Avatar by Epox Tech



<>< I Believe-Do You?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 20th February, 2002, 07:41 PM
Phil's Avatar
Member
 
Join Date: September 2001
Location: Bolton, UK
Posts: 1,338
Send a message via ICQ to Phil

Quote:
Originally posted by Superman53142


I always forget semi-colons!!! LOL. That's why I like coffeecup HTML editor, it gives you line numbers. And you used to count them, LOL, looking for the right line with the PHP or C++ syntax error
And you'd spend ages going thorugh it wondering why it wasn't working and then someone would walk past and go 'you've missed out a semi-colon there mate' and I'd scream
__________________
"Let's Blow This Facist Popsicle Stand!"



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:38 AM.


Copyright ©2001 - 2009, AOA Forums

Search Engine Friendly URLs by vBSEO 3.3.0