惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
P
Palo Alto Networks Blog
大猫的无限游戏
大猫的无限游戏
量子位
S
Secure Thoughts
博客园 - 【当耐特】
V
Visual Studio Blog
腾讯CDC
爱范儿
爱范儿
Webroot Blog
Webroot Blog
The Register - Security
The Register - Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Latest news
Latest news
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Cloudbric
Cloudbric
T
Troy Hunt's Blog
S
Security @ Cisco Blogs
B
Blog RSS Feed
I
Intezer
S
SegmentFault 最新的问题
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
TaoSecurity Blog
TaoSecurity Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recorded Future
Recorded Future
Google DeepMind News
Google DeepMind News
Forbes - Security
Forbes - Security
雷峰网
雷峰网
博客园 - 司徒正美
C
Cisco Blogs
S
Securelist
L
LINUX DO - 最新话题
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
N
News | PayPal Newsroom
N
News and Events Feed by Topic

Haskell

哪个函数返回参数本身? - V2EX GHC 9.2 发布了 - V2EX 那本书可以称为编程界的《葵花宝典》? - V2EX 国内有什么好的 Haskell 社群( qq/wechat/论坛)吗? - V2EX 如何修复错误“Variable not in scope: md5 :: C8.ByteString -> a0”? - V2EX Haskell 这门语言怎么样? - V2EX 写了篇 Applicative 的小总结~ - V2EX 有没有小伙伴一起来团购 Haskell Programming 这本书 - V2EX 为什么学了 Haskell,果然印证了 V2EX 上的 智者(忘记网名)的断论,“学了 Haskell,回不去了“, 回不去了耶。 - V2EX 贴 Haskell 代码,解一道小题。给任意字符串,找出长度最长的数字串。请随意扔砖头。 http://www.v2ex.com/t/259360#reply18 - V2EX 一个很酷的 Hakyll 静态博客例子 - V2EX 学习 Haskell 过程中,写了一篇对 Functor 的总结 - V2EX 发现一本好书《Haskell Data Analysis Cookbook》 - V2EX How to Write a Spelling Corrector - Haskell - V2EX Haskell 入门学习资料整理 - V2EX Haskell for Mac - V2EX Yesod - Haskell 的 Web 开发框架 - V2EX 一段 Haskell 代码求助! - V2EX Haskell 很适合做编译器前端 - V2EX Introduction to Haskell - V2EX 在 Github 上弄了一个 blog, 写写 Haskell - V2EX 关于一些名词翻译的确定 - V2EX 有没有人有兴趣补完 《趣学指南》 的汉语翻译? - V2EX 贺 haskell 开区,这是交流处。 - V2EX
Haskell 怎么在只有一个元素的列表上定义函数 - V2EX
arbipher · 2014-11-27 · via Haskell

arbipher

V2EX  ›  Haskell

 

arbipher · 2014 年 11 月 27 日 · 6874 次点击

这是一个创建于 4217 天前的主题,其中的信息可能已经有所发展或是发生改变。

我想针对函数参数为空列表、一个元素、更多元素分别定义

foo (x:[]) = 0
foo (x:xs) | null xs = 0
这两次能通过编译,但是不能一运行就报错。

发现只有
foo xs | length xs == 1 = 0
这么定义才work,感觉很丑。。。