rewrite rule をもっと簡単に書けるようにする
kmyk opened this issue · 0 comments
kmyk commented
GHC の RULES pragma みたいに手軽に書きたい
{-# RULES
"map/map" forall f g xs. map f (map g xs) = map (f.g) xs
#-}
Template Haskell を使って準クオートで書けるようにするのがよい気がする
mapMapReduce :: Monad m => RewriteRule m
mapMapReduce = [rule| "map/map" forall f g xs. map f (map g xs) = map (f.g) xs |]