I read the documentation and some articles that talk about the package, but I’m new to Haskell and did not understand much but I tried ….
Below is what I did:
module Main where
{-# LANGUAGE BangPatterns #-}
import Control.Parallel(par,pseq)
import Control.Exception
import Data.List
import IO
import Data.Char
import Criterion.Main (defaultMain, bench)
learquivo :: FilePath -> IO ([[Int]])
learquivo "mkList1.txt" = do
conteudo <- readFile "mkList1.txt"
return (read conteudo)
main = defaultMain [
bench "map sort learquivo" $ \n -> map sort learquivo
]
As it did the following error occurred:
Couldn't match expected type [[a]]
against inferred type FilePath -> IO [[Int]]
Just so you have how I usually run it, using the
nforwhnffunctions, I’ll give my code:EDIT: If you like this then also give plotting a try: