logo
首页技术栈工具库讨论
bit-stream

bit-stream

[Index] For package maintainers and hackage trustees Lazy, infinite, compact stream of Bool with O(1) indexing. Most useful for memoization of predicates. Consider following predicate: Its computation is expensive, so we'd like to memoize its values into BitStream using tabulate and access this stream via index instead of recalculation of isOdd: We can do even better by replacing part of recursive calls to isOdd by indexing memoized values. Write isOddF such that isOdd = fix isOddF: and use tabulateFix: Define a predicate, which checks whether its argument is a prime number by trial division. Convert it to unfixed form: Create its memoized version for faster evaluation:
由 
bruceshi2021-01-13 收录
--
推荐
不推荐
更多信息
GitHub iconBodigrim/chimera40
HACKAGE
carbal install bit-stream
查看
标签
根据用户添加的标签生成
暂无标签