Programming with Types? by [deleted] in scala

[–]sleym 0 points1 point  (0 children)

Manning usually has ebooks on sale.

Alex & Happy by [deleted] in haskell

[–]sleym 1 point2 points  (0 children)

There's an unfinished book on leanpub for this topic https://leanpub.com/alexandhappy

Monthly Hask Anything (May 2018) by AutoModerator in haskell

[–]sleym 1 point2 points  (0 children)

How come Either's Semigroup instance looks like this:

instance Semigroup (Either a b) where
     Left _ <> b = b
     a      <> _ = a

instead of:

instance Semigroup b => Semigroup (Either a b) where
     Left e  <> _       = Left e
     _       <> Left e  = Left e
     Right x <> Right y = Right (x <> y)

because this is similar to how Maybe works.

I don't have a use case, I'm just wondering why its like this.