Hacker News new | ask | show | jobs
by klibertp 4877 days ago
Not in Haskell, but there are languages where it's possible. It's called dependent typing and I don't really understand how it works, but I suppose gp was referring to this.
2 comments

It is possible in GHC, see parent comment.
Oh of course, and that also explains the use of GADTs since they are one route to dependent types in Haskell. I'm not sure what he's done there is fully legit, but maybe not as loony as at first thought.
It plays fast and loose on notation, but is perfectly kosher in GHC (not Haskell2010 or Haskell98).