Hacker News new | past | comments | ask | show | jobs | submit login

I agree, but that's not too practical. I mean, give me a system that will show [] to satisfy monad laws. You won't, because the definition of >>= for [] involves concat and map... both functions are recursive, and you know your system is going to reject that because it's not part of your strongly normalizing language, consequently rejecting [] as a monad.

Yes, it will work if you redefine the list constructors as functions...

  (:) x xs = \f z -> f x (xs f z)
  []       = \f z -> z
... and then we can define fold in a non-recursive way... but can this work in Haskell?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: