I have an arrow which outputs a list of values (a b [c]) and another arrow which accepts a single value of that type (a c d). What I need basically is a way to chain them or uplift the second arrow to a [c] [d].
I have an arrow which outputs a list of values ( a b [c]
Share
You cannot do this with just
Arrowtype class. Liftinga b cintoa [b] [c]requires choice between[]and(:)case. Luckily for us,ArrowChoiceoffers exactly this operation.Your function is then simply:
Without
procnotation, we would need a function that translates list constructors intoEither: