Skip to content

Template Haskell quotes drop strictness of bindings

Quoting a strict binding gives the same result as a lazy binding:

ghci> :set -XTemplateHaskell
ghci> [|let x = undefined in ()|]
LetE [ValD (VarP x_0) (NormalB (VarE GHC.Err.undefined)) []] (ConE GHC.Tuple.())
ghci> [|let !x = undefined in ()|]
LetE [ValD (VarP x_1) (NormalB (VarE GHC.Err.undefined)) []] (ConE GHC.Tuple.())
ghci> $([|let x = undefined in ()|])
()
ghci> $([|let !x = undefined in ()|])
()

The last line should throw an exception.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information