Skip to content

Instantly share code, notes, and snippets.

@viercc
Forked from anonymous/Main.hs
Last active December 15, 2017 12:21
Show Gist options
  • Save viercc/f98e2b94aded6be138da3f9907955f5b to your computer and use it in GitHub Desktop.
Save viercc/f98e2b94aded6be138da3f9907955f5b to your computer and use it in GitHub Desktop.
GHC 8.2.2 allows bang patterns in let binding without -XBangPatterns
$ $HOME/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/runghc Main.hs
Main.hs:8:22: error:
Illegal bang-pattern (use BangPatterns):
! x
$ $HOME/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/runghc Main.hs
Compiles
$ $HOME/.stack/programs/x86_64-linux/ghc-nopie-8.2.1/bin/runghc Main.hs
Compiles
--{-# LANGUAGE BangPatterns #-}
module Main where
main :: IO ()
main = putStrLn "Compiles"
letBangPattern :: Int
letBangPattern = let !x = 1 + 2 in x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment