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

Introduces bangs on bangs #16

Open
cronburg opened this issue Oct 3, 2016 · 0 comments
Open

Introduces bangs on bangs #16

cronburg opened this issue Oct 3, 2016 · 0 comments
Labels

Comments

@cronburg
Copy link
Collaborator

cronburg commented Oct 3, 2016

We probably want to in some way discourage (if not outright disallow) the algorithm from introducing bangs on things that already have bangs, e.g. by detecting !(*! in the AST and reducing it to just !.

Example output:

{-# LANGUAGE BangPatterns #-}
module Main (main, fib) where
import System.Environment
fib (!(((!0)))) = 1
fib 1 = 1
fib (!n) = (+) (fib $ n - 1) (fib $ n - 2)
main
  = do (!(!as)) <- getArgs
       let ((!a)) = read $ head as :: Int
       putStrLn $ show a
       putStrLn $ show $ fib a
@cronburg cronburg added the bug label Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant