sarashino
あまり経験がなかったので気になったのですが、newtypeで宣言できる型をdataで宣言するユースケースって何があるでしょうか?
data Box a = Box { unBox :: a } deriving (Functor)
instance Applicative Box where
pure = Box
Box f <*> Box a = Box (f a)
-- (t %~! const undefined) x === undefined
(%~!) :: ((a -> Box b) -> s -> Box t) -> (a -> b) -> s -> t
t %~! f = unBox . t ((Box $!) . f)