- 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
163 Views
In Haskell, we can use fromIntegral function along with toInteger and truncate function, div and mod functions to convert long type variable into int. In the first example, we are going to use ( let intVar = fromIntegral longVar :: Int) and in the second example, we are going ... Read More
Akhil Sharma
972 Views
In Haskell, we will convert int type variables to char by using user-defined function using chr function, toEnum function and list indexing. In the first example, we are going to use (intToChar I | i >= 0 && i = 0 && i = 0 && i = 0 && ... Read More
Akhil Sharma
536 Views
In Haskell, we can use pattern matching, digitToInt, reads and a user-defined functions to convert char-type variables to int. In the first example, we are going to use cases for matching the pattern and in the second example, we are going to use (charToInt c = if isDigit c then ... Read More
Akhil Sharma
213 Views
In Haskell, we can use the user-defined function, Folder, reverse and helper function to convert binary to octal number. In the first example, we are going to use (binaryToOctal binary = showOct decimalValue "" where decimalValue = foldl (\acc x -> acc * 2 + digitToInt x) 0 binary) function. ... Read More
Akhil Sharma
361 Views
In Haskell, we can convert Boolean to String by using user-defined function along with guards and if-else statements. In the first example, we are going to use (boolToString True = "True" and boolToString False = "False") function and in the second example, we are going to use (boolToString b | ... Read More
Akhil Sharma
588 Views
In Haskell, we can use functions like foldl, recursion, and list comprehension to convert a binary number to decimal. In the first example, we are going to use (binToDec = foldl (\acc x -> 2*acc + digitToInt x) 0) and in the second example, we are going to use base ... Read More
Akhil Sharma
595 Views
In Haskell, we will convert Decimal to Binary by using reverse function , tail recursion, and divMod function. In the first example, we are going to use (decToBin n | n < 0 = error "Input must be non-negative" | n == 0 ... Read More
Akhil Sharma
422 Views
In Haskell, we can use intToDigits, showIntAtBase and format functions to convert a decimal to Hexadecimal number. In the first example, we are going to use (decToHex n = reverse (hexChars n) where hexChars 0 = "" and hexChars x = intToDigit (x `mod` 16) : hexChars (x `div` 16)) ... Read More
Akhil Sharma
271 Views
In Haskell, we can get the the successor of an integer number using library function like succ, addition and fromMaybe function. In the first example, we are going to use (succ number) function and in the second example, we are going to use addition while in third example, we are ... Read More
Akhil Sharma
128 Views
In Haskell, we can use library function like pred, subtraction and fromMaybe to get the predecessor of an integer number. In the first example, we are going to use (pred number) function and in the second example, we are going to use subtraction while in third example, we are going ... Read More