2013-04-01から1ヶ月間の記事一覧
すごいH本のp234で ghci> fmap (replicate 3) (Right "blah") Right ["blah","blah","blah"] ghic>fmap (replicate 3) (Left "foo") Left "foo" とあって、なぜRightとLeftの結果が違うのか疑問だったが、 instance Functor (Either a) where fmap _ (Left x…
すごいH本のp234で ghci> fmap (replicate 3) (Right "blah") Right ["blah","blah","blah"] ghic>fmap (replicate 3) (Left "foo") Left "foo" とあって、なぜRightとLeftの結果が違うのか疑問だったが、 instance Functor (Either a) where fmap _ (Left x…