Skip to content

Introduces bangs on bangs #16

Description

@cronburg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions