2 kyu
Finally tagless interpreter
297 of 309tel
Description:
Write a typed interpreter for the finally tagless style language given. The language will use de Bruijn style names and includes a fixed point and functions for manipulating integers and booleans.
An example expression would be
\a -> \b -> a + b
which, rendered as a Term
is
ex :: Term (Int -> Int -> Int)
ex = lambda (lambda (add (before here) here))
The use of de Bruijn indices means that instead of denoting variables by name they are denote by position instead. So, here
is the variable most recently bound, and before here
is the variable bound just prior to here
.
Hint: This technique is discussed in a lecture from Oleg Kiselyov.
Interpreters
Algorithms
Similar Kata:
Stats:
Created | Sep 26, 2014 |
Published | Sep 26, 2014 |
Warriors Trained | 1046 |
Total Skips | 273 |
Total Code Submissions | 1180 |
Total Times Completed | 309 |
Haskell Completions | 297 |
Agda Completions | 18 |
Scala Completions | 5 |
Total Stars | 125 |
% of votes with a positive feedback rating | 97% of 73 |
Total "Very Satisfied" Votes | 68 |
Total "Somewhat Satisfied" Votes | 5 |
Total "Not Satisfied" Votes | 0 |