Extending functions on heterogeneous lists

I have implemented my own type HList

using the Apocalisp Level Programming Guide . Now I am trying to implement a function with the following signature:

extend : (A => B) => (A ::: R) => (B ::: R)

where
A, B, R <: HList and ':::' is type-level concatenation.

      

Unfortunately I don't know how to highlight the components A

and the R

input list A ::: R

. What's the best way to do this?

I cannot rely on external libraries like shapeless and I will not use any of the HList features other than adding and extending.

+3
types scala functional-programming type-level-computation


source to share


No one has answered this question yet

Check out similar questions:

1149
What is (functional) reactive programming?
1021
Is Functional Programming Replacing GoF Design Patterns?
875
function to display objects (instead of arrays)
775
list versus lambda + filter
633
Functional programming versus object-oriented programming
550
How can a function of time exist in functional programming?
129
Are HLists nothing more than a tricky way to write tuples?
3
Generic transform / fold / map over tuple / hlist containing some F [_]
2
Type-level Shapeless: concatenation of elements of type HList
-2
Functional programming in Scala tutorials



All Articles
Loading...
X
Show
Funny
Dev
Pics