ghci special case for Applicative?
问题 In ghci: λ> :t (pure 1) (pure 1) :: (Applicative f, Num a) => f a λ> show (pure 1) <interactive>:1:1: No instance for (Show (f0 a0)) arising from a use of `show' Possible fix: add an instance declaration for (Show (f0 a0)) In the expression: show (pure 1) In an equation for `it': it = show (pure 1) λ> pure 1 1 Does this mean that ghci execute Applicative and displays the result, just like IO ? Note that pure () and pure (+1) don't print anything. 回答1: You get the same behaviour if you use