I know we can’t actually implement Monad in Swift yet, but swiftz’s bind instance for Optional’s still convenient: github.com/maxpow4h/swiftz
Conversation
Replying to
Monad is implementable. It just takes 12 seconds to compile and need a little typealias magic: gist.github.com/cobbal/7562875
2
4
Ah, interesting. Instances could break this by misdefining U, which scares me, but better than nothing! Thanks.
Replying to
You are saying “yet”. Will higher kinded type variables come?
1
Are rank 2 types needed for monads in general? I thought they are only used in ST's runST as a safety net.
1
Show replies



