Skip to content

Instantly share code, notes, and snippets.

Created December 15, 2017 12:17
Show Gist options
  • Save anonymous/bd003ebbf867b67bab709137e821402a to your computer and use it in GitHub Desktop.
Save anonymous/bd003ebbf867b67bab709137e821402a 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
--{-# 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