Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (8 sloc) 234 Bytes
{-# LANGUAGE TemplateHaskell #-}
module Fibs where
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
fibs :: [Integer]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
fibQ :: Int -> Q Exp
fibQ n = [| $( lift $ fibs !! n) |]