HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to HaskellVariables (let)Data TypesOperatorsStringsListsConditions (if / then / else)Iteration (map / sum)Functions
REFERENCE
📖 Overview
🖥️ Output
📦 Value & Type
🔢 Numbers & Math
✍️ String
++ / lengthmap toUpper (Data.Char)isInfixOf (Data.List)
📚 List
🔀 Condition
🧩 Function
Haskell›REFERENCE›String
✍️

String

String = list of characters.

CommandDescription
++ / lengthConcatenation and length.
map toUpper (Data.Char)Case conversion.
isInfixOf (Data.List)Substring search.

++ / length

Try it yourself →

Concatenation and length.

Syntax

a ++ b   //   length s

Description

A String is a list of characters. ++ concatenates two texts/lists. length returns the number of characters/elements.

Example

main = do
  putStrLn ("Hello " ++ "Alex")
  print (length "HexLibrary")

Expected output

Hello Alex
10

When to use?

Creating text, length check.

map toUpper (Data.Char)

Try it yourself →

Case conversion.

Syntax

map toUpper s   //   map toLower s

Description

toUpper/toLower converts a single character; applied to every letter of the text with map. Imported from Data.Char.

Example

import Data.Char (toUpper)
main = putStrLn (map toUpper "hexlibrary")

Expected output

HEXLIBRARY

When to use?

Uppercase/lowercase normalization.

Common mistakes

  • ⚠️ toUpper cannot be found without import Data.Char.

isInfixOf (Data.List)

Try it yourself →

Substring search.

Syntax

isInfixOf "x" text

Description

isInfixOf tells whether a substring exists within the text (True/False). Imported from Data.List.

Example

import Data.List (isInfixOf)
main = print (isInfixOf "Lib" "HexLibrary")

Expected output

True

When to use?

Search, content check.

HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code