Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 12 lines (8 sloc) 0.234 kB
3784d5d @maloi TH fibs
maloi authored
1 {-# LANGUAGE TemplateHaskell #-}
2
3 module Fibs where
4 import Language.Haskell.TH
5 import Language.Haskell.TH.Syntax
6
7 fibs :: [Integer]
8 fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
9
10 fibQ :: Int -> Q Exp
11 fibQ n = [| $( lift $ fibs !! n) |]
Something went wrong with that request. Please try again.