typelift / Swiftz

Functional programming in Swift
BSD 3-Clause "New" or "Revised" License
3.33k stars 233 forks source link

Monad Operations as a typeclass? #143

Closed CodaFi closed 9 years ago

CodaFi commented 9 years ago

I've been playing around with generalizing the Monad operators so we don't have to write them all out for a couple months and have come to the conclusion it's just too inelegant even if it were possible. In the spirit of choosing the lesser of two evils, and not furthering bloat in Monad, I think the best course of action is to factor out the operators and functions into some kind of MonadOps protocol and implement them all.

It's a one-time yak shaving, but a yak shaving all the same.

Related to #136

pthariensflame commented 9 years ago

Fine with me. Full higher kinds are needed for any sort of true type class or Swiftish protocol to accurately represent monads, so any kind of kludge is acceptable right now.

pthariensflame commented 9 years ago

In response to discussion on typelift/Aquifer#10, we should consider using >>->> for (forward) Kleisli composition.

CodaFi commented 9 years ago

Fixed by the merge of #249.