Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite rule をもっと簡単に書けるようにする #132

Closed
kmyk opened this issue Aug 2, 2021 · 0 comments · Fixed by #133
Closed

rewrite rule をもっと簡単に書けるようにする #132

kmyk opened this issue Aug 2, 2021 · 0 comments · Fixed by #133

Comments

@kmyk
Copy link
Collaborator

kmyk commented Aug 2, 2021

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 |]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant