Created
July 8, 2022 21:47
-
-
Save AndreasPK/448ac60e5caab642b5181a6ea21fce3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- -fno-worker-wrapper -dno-typeable-binds just makes the resulting dump easier to understand. | |
-- Try uncommenting the second OPTIONS pragma to see the difference float out makes. | |
{-# OPTIONS_GHC -O -fno-worker-wrapper -ddump-simpl -dsuppress-all -ddump-to-file -fforce-recomp #-} | |
-- {-# OPTIONS_GHC -fno-full-laziness #-} | |
module Main(main,g) where | |
import GHC.Exts | |
{-# NOINLINE f #-} | |
f x y = x + y :: Int | |
g = map (\x -> f (nfib 15) x) [1..1000] | |
nfib :: Int -> Int | |
nfib n = if n <= 1 then 1 else nfib (n-1) + nfib (n-2) + 1 | |
main = print $ sum g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment