随笔分类 -  Haskell

Haskell: What is Weak Head Normal Form
摘要:Stack Overflow 阅读全文

posted @ 2015-08-29 18:40 Stomach_ache 阅读(154) 评论(0) 推荐(0) 编辑

取模运算和取余运算的区别
摘要:Haskell中有两个函数:mod, rem,前者是取模,后者为取余。当两个操作数都是同号时两者无差别。异号则体现出计算过程的差异。摘百度百科的说明:取模取余运算区别对于整型数a,b来说,取模运算或者求余运算的方法都是:1.求 整数商: c = a/b;2.计算模或者余数: r = a - c*b.... 阅读全文

posted @ 2015-08-28 20:05 Stomach_ache 阅读(1185) 评论(0) 推荐(1) 编辑

Functional Programming Contest - September'14
摘要:比赛链接A题1 -- Enter your code here. Read input from STDIN. Print output to STDOUT2 main = do3 x [y]++[x]++acc) [] $ zip x yB题1 -- Enter your code he... 阅读全文

posted @ 2014-09-17 18:52 Stomach_ache 阅读(178) 评论(0) 推荐(0) 编辑

hackerrank--- challenges/fp-update-list
摘要:纯属为了练习haskell, 竟然贴代码都没办法高亮。challenges/fp-update-listUpdate the values of a list with their absolute values. The input and output portions will be hand... 阅读全文

posted @ 2014-06-18 16:53 Stomach_ache 阅读(310) 评论(0) 推荐(0) 编辑

Hashkell 第一篇
摘要:心情极差。。。。。。。。。。。。。。。。。。无事可做,其实是没心情去做事情,只好又翻起了haskell入门记下几点,以备查询:1. 函数名首字符是不可以大写的, 而且名称中可以有单引号,这也是合法的2. if语句中else部分是不可以省略的3. 函数声明无先后顺序4. 数字5既可以是整形也可... 阅读全文

posted @ 2014-06-03 08:39 Stomach_ache 阅读(773) 评论(0) 推荐(0) 编辑

Haskell 学习
摘要:truncate pi-- 表示截断, 此处结果为 3haskell中的touple是可变的,而python中是不可变的lines函数:lines :: String -> [String]以‘\n'为分隔符,建立列表interact 函数:interact :: (String -> String... 阅读全文

posted @ 2014-03-07 12:47 Stomach_ache 阅读(142) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示