- 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
Found 185 Articles for Haskell
506 Views
In this tutorial, we discuss writing a program to compute the quotient and remainder in Haskell programming language. Quotient and remainder are the quantities obtained as a result of dividing two quantities. Example − quotient and remainder for the division of 31/5 are 6, 1 respectively. The number can be represented as 31 (dividend) = 5(divisor) * 6(quotient) + 1(remainder). In this tutorial, we see four different ways to write a program to compute quotient and remainder. Haskell program to compute the quotient and the remainder using built-in functions div and mod Haskell program to compute the quotient and ... Read More
223 Views
In this tutorial, we discuss writing a program to check if two of three Boolean variables are true in the Haskell programming language Boolean variables are the type of variable which hold the boolean value true and false. In this tutorial, we see two different ways to implement a program to check if two of the three boolean values are true Program to check if two of the three boolean values are true in an iterative method. Program to check if two of the three boolean values are true in a recursive method. Algorithm steps Declare or ... Read More
724 Views
In this tutorial, we discuss writing a program to calculate the sum of the natural numbers in the Haskell programming language. Natural numbers are positive integers starting from 1, 2, 3...N In this tutorial, we see different ways to implement a program to compute the sum of natural numbers. Program to compute the sum of the natural numbers using a mathematical formula. Program to compute the sum of the natural numbers using a recursive function. Program to compute the sum of the natural numbers using the list method/function sum. Algorithm steps Declare or take input the range ... Read More
276 Views
In this tutorial, we discuss writing a program to calculate simple and compound interest in the Haskell programming language In this tutorial, we see Program to compute Simple interest. Program to compute Compound interest. Simple interest is an Interest method for an investment, where interest is defined as I = p*t*r/100, where p is the invested amount, t is the quantity of time in years, and r is the interest rate. (per 100). Example − For an invested amount of 1000(p), t= 2 and r =3 the interest is 60. Compound interest is an Interest method for an ... Read More
1K+ Views
In this tutorial, we discuss writing a program to get input from the user in the Haskell programming language. Haskell is a Declarative, Strongly Typed, and Functional programming language. This tutorial discusses reading numbers from standard input in the Haskell Programming language. Haskell is a purely functional Language. Pure functions are the ones that return the same output for the same arguments. Taking user input changes the program’s nature to impure. Haskell introduced a type IO that differentiates impure functions from pure functions. A function declaration with type IO infers that it is an impure function that interacts with the outer ... Read More
3K+ Views
In this tutorial, we discuss writing a program to get input from the user in the Haskell programming language. Haskell is a Declarative, Strongly Typed, and Functional programming language. Computations in Haskell are mathematical functions. In this tutorial, we discuss two ways to get input from the user in Haskell. User input using the getLine method. User input using the getChar method. As Haskell is a purely functional Language. Pure functions are the functions that return the same output for the same arguments. Taking user input changes the program’s nature to impure. Haskell introduced a type IO that ... Read More
552 Views
This tutorial will discuss writing a program to add two complex numbers in the Haskell Programming Language. Haskell is a declarative, strongly typed, and functional programming language. The computations in Haskell are mathematical functions. Complex numbers are a combination of real and imaginary values. Example: 1 + 2i, where i is √-1 In this tutorial, we see four ways to Add two complex numbers. Computing the addition using the infix operator for addition “+”. Implementing addition computation in a separate function. Computing the addition using the infix operator “+” as a function. Computing the addition of complex numbers by ... Read More
451 Views
This tutorial will discuss writing a program to display characters from A-Z in Haskell programming Language. Haskell is a Functional, Declarative, and Strongly Typed Language. The computations in Haskell are mathematical functions. In this tutorial, We see two ways to display Alphabets in Haskell. An iterative Program to display Alphabets. A recursive Program to display Alphabets. Note − Haskell doesn’t support Loops, So we mimic the function of a loop with other iterative and recursive implementations. Algorithmic Steps Implement the logic for printing Alphabets. Print/display Alphabets. Displaying Alphabets In An Iterative Way Using List Comprehensions. Example Program ... Read More
1K+ Views
This tutorial will discuss writing a program to find the LCM of two numbers in the Haskell Programming Language. Haskell is a functional programming language. The GCD of two numbers is the Greatest Common Divisor/ Number that divides both numbers Can also be called as Highest Common Factor. In this tutorial, we discuss five ways to implement a program to find the GCD of two numbers. Using the inbuilt function gcd. Using the inbuilt function lcm. Computing GCD using list comprehension. Computing GCD using a recursive function with three arguments. Computing GCD using a recursive function with two arguments. ... Read More
345 Views
This tutorial will discuss writing a program to find the LCM of two numbers in the Haskell Programming Language. Haskell is a functional programming language. LCM of two numbers is the least common multiple for that two numbers i.e smallest number that is divided by both numbers. In this tutorial, we discuss five different ways to implement a program to find the LCM of two numbers. Using inbuilt function lcm. Computing LCM using list comprehension. Computing LCM using a recursive function. Computing LCM using the HCF (Highest Common Factor) function. Algorithm steps Take the two integers as ... Read More
To Continue Learning Please Login
Login with Google