- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Akhil Sharma has Published 671 Articles
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
113 Views
In Haskell, to print the downward traingle star pattern we will be using mapM_, replicate and unlines functions. In the first example, we are going to use ( mapM_ putStrLn $ map (concat . flip replicate "*") rows) function defined under main function and in the second ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
203 Views
In Haskell, to print the Left Triangle Star Pattern we will be using mapM_ function, replicate function and recursion. In the first example, we are going to use ( mapM_ putStrLn [replicate i '*' | i > putStrLn (replicate n '*') else return ()) function. Method 1: Printing Left ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
275 Views
We can use elem function in Haskell to check whether the given alphabet is vowel or consonant. In the first example, we are going to use (isVowel c = c `elem` "aeiouAEIOU") function. And in other examples, we’re going to use elem function along with certain if-else statements, nested conditions ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
155 Views
In Haskell, we will call one constructor from another by using user-defined function. In the first example, we are going to use (newPerson name = Person name 10) constructor and in the second example, we are going to use (newPerson n a = Person { name = n, age = ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
51 Views
Haskell has internal function like finiteBitSize, ceiling, logBase, length and showIntAtBase that can be used to get total bits required from the given number. In the first example, we are going to use (bits = finiteBitSize (fromIntegral x :: Int)) function and in the second example, we are going to ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
91 Views
In Haskell, we will calculate the logarithm gamma of the given number by using Stirling’s approximation and Lanczos appromixation formula. In the first example, we are going to use Stirling’s approximation with (s = foldr (\(c, q) acc -> c + (q / (x + acc))) 0 (zip (tail ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
755 Views
In Haskell, we can use round, printf and truncate functions to round a number to n decimal places. In the first example, we are going to use (roundTo n x = (fromInteger $ round $ x * (10^n)) / (10.0^^n)) function and in the second example, we are going to ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
355 Views
In golang, we can use hashmap to perform various operations like deleting, updating, and storing the values in the hash collection. In this article, we are going to understand get key based on a value from the hash collection using two different examples. In the first example, we will use ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
Akhil Sharma
528 Views
In Haskell, we can find Sum of N Numbers by using recursion, tail-recursion and fold-recursion. In the first example we are going to use base case, (sum_n [] = 0) and recursive case, (sum_n (x:xs) = x + sum_n xs)) and in second example, we are going to use, tail-recursion. ... Read More