小编Mos*_*him的帖子

Haskell类型签名

我是haskell的新手,我读了一些关于这个称为类型签名的东西,但有一些我不理解的东西.

这是我正在看的代码:

--mult applies product
mult :: Num a => [a] -> a
mult  = foldr (*) 1 

--posList filters positive numbers out
posList :: (Ord a, Num a) => [a] -> [a]
posList = filter (>0) 

--trueList determines whether all of the members of a list are T or not
trueList :: [Bool] -> Bool
trueList  =  foldr(&&) True 

--evenList determines where all of the members of a list are even or not
evenList :: (Integral a, Foldable t) …
Run Code Online (Sandbox Code Playgroud)

haskell types

3
推荐指数
1
解决办法
261
查看次数

标签 统计

haskell ×1

types ×1