A Type Driven Approach to Functional Design
来源:互联网 发布:淘宝5星好评 编辑:程序博客网 时间:2024/06/05 08:28
# :: [Event] -> [Month, Int]def avg_lines_per_commit_by_month events cls_by_month = lines_added_per_commit(events).group_by { |date,_| month_from_date$ cls_by_month.map { |_,cls| cls.map { |cl| cl[1] }.mean }.flattenend# :: [Event] -> Floatdef percent_reduction method_events non_deleted = method_events.select { |e| e.status != :deleted } return 0.0 if non_deleted.count == 0 num_reductions = non_deleted.each_cons(2) \ .map { |before,after| after.method_length < before.me$ .count(true) num_reductions / non_deleted.count.to_fend# :: [Event] -> [FixNum]def refactoring_reduction_profile events events.group_by(&:method_name) \ .map { |_,e| percent_reduction(e) } \ .freq_by { |e| (e * 100/10).to_i }end
It's about thinking about the shape of data first before thinking about the names in some TDD.
http://infoq.com/presentations/Type-Functional-Design
- A Type Driven Approach to Functional Design
- A Practical Approach to Computer Systems Design and Architecture
- Designing the Obvious: A Common Sense Approach to Web Application Design
- Game Design Workshop, Second Edition: A Playcentric Approach to Creating Innovative Games
- [译]An Approach to Game Design
- Week5-2Empirical/data driven approach to parsing
- Design Concepts with Code: A Developer Approach
- A new approach to China
- An Introduction To Domain-Driven Design
- Table-driven Approach
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- Ajax: A New Approach to Web Applications
- SSH框架总结(框架分析+环境搭建+实例源码下载)
- 触发器实现两台服务器数据同步
- 数组存文件
- OpenCV 1.0 在VS2005中编译为静态库所需的设置
- SAP简单报表
- A Type Driven Approach to Functional Design
- 有关虚拟机下的 linux连接网络的两种方式 (桥接)
- SecureCRT 设置标签栏显示名字
- 最大的子序列和的问题
- 62(p84)求已知串中最长空格序列的长度
- linux system返回值
- android strings.xml 中的特殊字符转义
- JAVA面试代码与编程题
- json中时间类型传到前台页面显示object类型 时间类型转换