Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute Haskell Online

main = putStrLn "hello world"

esCero :: Int -> Bool
esCero x | x/=0 = False

esPositivo :: Int -> Bool
esPositivo x | x>0 = True

paratodo :: [Bool] -> Bool
paratodo [] = False
paratodo (x:xs) | x == True = True && paratodo xs
   | x == False = False && paratodo xs


sumatoria :: [Int] -> Int
sumatoria [] = 0 
sumatoria (x:xs) = x + sumatoria xs

productoria :: [Int] -> Int
productoria [] = 0
productoria (x:xs) = x*productoria xs

factorial :: Int -> Int
factorial 0 = 1 
factorial x = x*factorial x-1

promedio :: [Int] -> Int
promedio [] = 0
promedio (x:xs) = x+promedio xs/

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.