logo
  • 教程列表
  • SO官方文檔
  • 向量
    • 過濾向量
    • 對映(對映)和減少(摺疊)向量
    • 研究多個向量
    • Data.Vector 模組
  1. StackOverflow 文件
  2. Haskell Language 教程
  3. 向量
  4. 對映(對映)和減少(摺疊)向量

對映(對映)和減少(摺疊)向量

Created: November-22, 2018

向量可以是 map’d 和 fold'd,filter'd andzip`‘d:

Prelude Data.Vector> Data.Vector.map (^2) y
fromList [0,1,4,9,16,25,36,49,64,81,100,121] :: Data.Vector.Vector

減少到單個值:

Prelude Data.Vector> Data.Vector.foldl (+) 0 y
66
  • 研究多個向量
  • 過濾向量

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明