Cum se extrage un substring

From HaskellWiki

Ori cautati o functie din biblioteca ori scrieti dvs una:

substring :: Int -> Int -> String -> String
substring start end text = take (end - start) (drop start text)

Main Data.Text> substring 2 6 "alfaville"
"favi"
Main Data.Text>