How to convert int to string in Haskell

Overview

While developing, it’s useful to convert int to a string. In this shot, we’ll learn how to do just that in Haskell.

Haskell

Haskell is a statically typed, functional, and concurrent programming language with a dynamic range of packages.

The show method is used to convert an int value to string.

Syntax

show 79

Parameter

This method accepts one parameter, the int.

Example

main = do
let x = 6
print(show x)

Explanation

We print 6, which is an integer, as a string.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources