You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Lets say I have several procedures sharing same signature. I'd like Ivory to build a procedure which would act as a call gate - select the right call branch by analyzing a selector variable. Here is the illustration:
syscalls_1 :: [ Def ('[Inp1] :-> Out1) ]
syscalls_1 = [
proc "proc11" $ \a -> body ... ,
proc "proc12" $ \a -> body ...
]
syscalls_2 :: [ Def ('[Inp2, Inp2] :-> Out2) ]
syscalls_2 = [
proc "proc21" $ \a b -> body ... ,
proc "proc22" $ \a b -> body ...
]
gate :: [(Int, Def (a :-> b))] -> Def ( (Uint32 ': a) :-> b)
gate pset = proc "gate" $ \ ??? (selector:args) ->
??? switch (selector) {
case 0 : call (pset !! 0) args ; break;
case 1 : call (pset !! 1) args ; break ;
...
}
???
Now I want to use gate to build a wrapper for all my syscalls. The resulting function should take additional argument describing an implementation to call :
@grwlf let me know if this still an issue. Otherwise, as it's not really a bug or enhancement request for Ivory, I'm closing this for now. Please feel free to email me directly.
Hi. Lets say I have several procedures sharing same signature. I'd like Ivory to build a procedure which would act as a call gate - select the right call branch by analyzing a selector variable. Here is the illustration:
Now I want to use
gate
to build a wrapper for all my syscalls. The resulting function should take additional argument describing an implementation to call :Could you please help me to design the implementation of
gate
in Haskell ?Thanks in advance.
The text was updated successfully, but these errors were encountered: