Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: RFC: A Perlesque Introduction to Haskell, Part One (draft)

by ihb (Deacon)
on Jun 24, 2004 at 02:44 UTC ( [id://369232]=note: print w/replies, xml ) Need Help??


in reply to Re^4: RFC: A Perlesque Introduction to Haskell, Part One (draft)
in thread RFC: A Perlesque Introduction to Haskell, Part One (DRAFT)

How do the Haskell examples handle those cases?

It doesn't. You can use "boolean guards" though to handle different cases:

fac 0 = 1; fac n | n > 0 = n * fac (n-1) | otherwise = ...
otherwise is just a standard alias for True to make it read well.

ihb

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://369232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found