List Functors Lambda Laziness
Posted on March 1, 2020
Tags: typetheory
1 List Projection is same as Lazy Lambda
= [5]
x 0] #list projection
x[
= lambda (): 5
x #lazy lambda x()
select0 :: list int -> int
= x[0]
select0 x #select0 x will output x[0]
lazylambda :: (() -> int) -> int
= x()
lazylambda x #lazylambda x will output x()
#GENERALIZATION
selectF :: F int -> int
F X = list X
F X = () -> X
We can treat a list projection in the same way as a lazy lambda