Convert String to Array in Haskell

Akhil Sharma
Updated on 28-Mar-2023 14:56:48

1K+ Views

In Haskell, we will convert String to an Array by using listArray and intersperse functions. In the first example, we are going to use (stringToArray s = listArray (0, length s - 1) s) function and in the second example, we are going to use (stringToArray s = s) function. In the third example, we are going to use (stringToArray s = intersperse ' ' s). Algorithm Step 1 − The stringToArray function is defined Step 2 − The program execution will be started from main function. The main() function has whole control of the program. It is written ... Read More

Convert Character to String in Haskell

Akhil Sharma
Updated on 28-Mar-2023 14:55:14

2K+ Views

In Haskell, we can convert Character to String by using user-defined function, show function, list comprehension and (:[]) notation. In the first example, we are going to use (charToString c = [c]) function and in the second example, we are going to use (charToString c = show c) function. Where as in third, we are going to use (charToString c = [x | x String charToString c = [c] main :: IO () main = do let myChar = 'a' let myString = charToString myChar putStrLn myString Output [1 of 1] ... Read More

Convert Data to Hexadecimal in Haskell

Akhil Sharma
Updated on 28-Mar-2023 14:51:47

747 Views

In Haskell, we will convert Data to Hexadecimal by using intToDigit, toHex and showHex functions. In the first example, we are going to use toHex function and (stringToHex = concatMap (\c -> toHex (fromEnum c))) function and in the second example, we are going to use convertToHex x = showHex x ""). And in the third example, we are going to use (toHex = concatMap toHexChar). Method 1: Converting Data to Hexadecimal using intToDigit and toHex function In this method, the toHex function converts an integer to its hexadecimal representation by repeatedly dividing by 16 and converting each remainder ... Read More

Chromatographic Techniques: Types and Applications

Anusha Karthik
Updated on 28-Mar-2023 14:51:34

2K+ Views

Introduction Chromatography is a separation technique that is used to separate and identify individual components of a mixture. The technique relies on the differential affinities of the components of the mixture for a stationary phase and a mobile phase The stationary phase is a material that is fixed in place and the mobile phase is a fluid that moves through the stationary phase. The components of the mixture interact differently with the stationary phase and the mobile phase, which results in their separation. Chromatography has a wide range of applications in various fields, including chemistry, biochemistry, pharmaceuticals, food science, ... Read More

Deep Belief Network (DBN) in Deep Learning

Sohail Tabrez
Updated on 28-Mar-2023 14:43:41

11K+ Views

Introduction Deep Belief Networks (DBNs) are a type of deep learning architecture combining unsupervised learning principles and neural networks. They are composed of layers of Restricted Boltzmann Machines (RBMs), which are trained one at a time in an unsupervised manner. The output of one RBM is used as the input to the next RBM, and the final output is used for supervised learning tasks such as classification or regression. Deep Belief Network DBNs have been used in various applications, including image recognition, speech recognition, and natural language processing. They have been shown to achieve state-ofthe-art results in many tasks ... Read More

Exploring Intelligent Agents in Artificial Intelligence

Sohail Tabrez
Updated on 28-Mar-2023 14:42:03

1K+ Views

Introduction Artificial intelligence, more commonly referred to as AI, is an exciting area of information technology that permeates many facets of contemporary life. We can become more accustomed to and at ease with AI by looking at each of its components separately, even though it may appear complex and is in fact complex. We can better comprehend and put the ideas into practice when we grasp how the components go together. Agent in AI An "agent" is a self-contained software or entity that interacts with its surroundings through sensor-based perception and actuator- or effector-based action in the context of ... Read More

Centrifugal Force: Principle, Formula and Applications

Anusha Karthik
Updated on 28-Mar-2023 14:40:41

4K+ Views

Introduction Centrifugal force is a term used to describe the apparent force that acts on an object moving in a circular path. It is often referred to as a "fictitious" force because it does not have a physical origin, but rather is a result of the object's motion. Despite its lack of a physical origin, the centrifugal force plays a crucial role in many aspects of our lives, from amusement park rides to the operation of centrifuges in laboratories. In this article, we will explore the principle behind centrifugal force, the formula used to calculate it, and its applications in ... Read More

Make Your Career in Machine Learning

Sohail Tabrez
Updated on 28-Mar-2023 14:36:54

318 Views

Introduction Machine learning is a rapidly growing field that has the potential to revolutionize many industries. As a result, a career in machine learning can be both challenging and rewarding. Today, machine learning is applied actively in many more areas than one might anticipate. As the name suggests, it gives the computer the learning capacity, enhancing its resemblance to a human. This article will explore the steps you can take to make a career in machine learning. Machine Learning Machine learning algorithms use a set of training data to teach computers how to do tasks for which they were ... Read More

Haskell Program to Print Inverted Star Pattern

Akhil Sharma
Updated on 28-Mar-2023 14:36:40

337 Views

In Haskell, to print Inverted star pattern we will be using mapM_, reverse, unlines and replicate functions. In the first example, we are going to use ( invertedStarPattern n = mapM_ putStrLn (reverse [replicate i '*' | i

Haskell Program to Print Diamond Star Pattern

Akhil Sharma
Updated on 28-Mar-2023 14:34:57

239 Views

In Haskell, to print Diamond star pattern we will be using mapM_, reverse, unlines and replicate functions. In the first example, we are going to use ( diamondStarPattern n = unlines $ topHalf ++ bottomHalf where topHalf = [replicate (n - i) ' ' ++ replicate ((2 * i) - 1) '*' | i

Advertisements