In Haskell we can section a binary operation ⊕ to obtain two functions
(x ⊕) and (⊕ y). As far as I know, we can mimic the first section by writing _⊕_ x but can we do so cleanly for the second section?
Example
Here I define an already sectioned version of Agda library's Function._$_ to perform the second section as mentioned above.
However, it does not work in my desired case below and I do not know why.
Any insight is welcome!
$ : ∀ {a b} {A : Set a} {B : A → Set b} → (x : A) → ((y : A) → B y) → B x
$ x = λ f → f x
success-usage : ∀{a b}{A : Set a}{B : Set b} → A → (A → B) → B
success-usage x = $ x
failed-usage : ∀{A : Set} → (∀{B : Set} → B) → (∀{B : Set} → B → A) → A
failed-usage {A} bs = $ (bs {A})
-- works : λ {A} bs f → $ (bs {A}) f
Thank-you :-)