RosettaCodeData/Task/Compile-time-calculation/Haskell/compile-time-calculation-1.hs

8 lines
129 B
Haskell
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
module Factorial where
import Language.Haskell.TH.Syntax
fact n = product [1..n]
factQ :: Integer -> Q Exp
factQ = lift . fact