You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: