我阅读了有关该软件包的文档和一些文章,但是我是 Haskell 的新手并且不太了解,但我尝试了....
以下是我所做的:
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
]
因为它发生了以下错误:
Couldn't match expected type [[a]]
against inferred type FilePath -> IO [[Int]]