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

8 lines
129 B
Haskell
Raw Permalink Normal View History

2015-11-18 06:14:39 +00:00
module Factorial where
import Language.Haskell.TH.Syntax
fact n = product [1..n]
factQ :: Integer -> Q Exp
factQ = lift . fact