TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Visualizing Types: Hussling Haskell types into Hasse diagrams

31 pointsby donsover 14 years ago

1 comment

lmkgover 14 years ago
This post makes some sense in the context of Common Lisp as well, because it also has the bottom value NIL, of type NULL, which is always a subtype of all types (type T is also a supertype of all types, making the type system a complete lattice). Lisp's type system isn't as rigid, or as flexible, but the construction of lists follows a similar pattern, and the AND and OR type constructors make the relation between types and partial orders pretty explicit.<p>But, the one thing that sticks out to me is that NIL is a full-fledged value in Lisp, and I've never seen an equivalent bottom type in any Haskell tutorial. In fact, it would seem to violate the strictness of the type system (given that I don't fully understand said type system). Does Haskell have a "real" (reifiable?) bottom type, i.e. can your functions actually return bottom in a valid program, or is the bottom value only something that appears when you're doing theoretical analysis of the type system? I know that Bottom sometimes represents uncaught exceptions or infinite loops in type theory, does Haskell use it in the same way?
评论 #1977076 未加载
评论 #1976759 未加载