我写了这样的东西:
instance Functor (Either e) where fmap _ (Left a) = Left a fmap f (Right b) = Right (f b)
如果我只想fmap更改值,我该如何做同样的事情Left呢?
fmap
Left
我的意思是,我使用什么语法来表示我使用的是type Either _ b而不是Either a _?
Either _ b
Either a _
haskell types typeclass
haskell ×1
typeclass ×1
types ×1