Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by ihb (Deacon)
on Jun 24, 2004 at 02:44 UTC ( #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
Node Status?
node history
Node Type: note [id://369232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2019-11-20 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (96 votes). Check out past polls.

    Notices?