I would like to learn how to do the following in point-free:
withinBounds :: [Int] -> Bool withinBounds xs = (all (>= 0) xs) && (all (<= 8) xs)
I understand that it is better to write it like this for readability / common sense, but I would like to know more about how I can create functions. I scratch my head how I can do this. Full (extended?) Type signature
[Int] -> ([Int] -> Bool) -> ([Int] -> Bool) -> (Bool -> Bool -> Bool) -> Bool
The typical song signature I'm trying to jump to is
(a -> b) -> (a -> c) -> (b -> c -> d) -> (a -> d)
I wrote the following notes in the form of a bastard lambda. If there is a way to simplify the problem with lambda calculus a little, it would be great if this could also be explained:
\ L@ [] -> \ f1@ ([] -> Bool) -> \ f2@ ([] -> Bool) -> \ f3@ (Bool -> Bool -> Bool) -> f3.(f1.L).(f2.L)
In the above example . - application, @ capture is performed (so f3 is another name for (Bool β Bool β Bool)). Many thanks.
Edit: I know that this is not the most optimal or reusable code, and I know that turning this into contactless makes it worse in terms of readability, etc. To clarify, I ask how I can turn it into a pointless , because I want to know more about haskell and composition .
Edit2: Really good SO contactless contact
lambda haskell function-composition pointfree
MIJOTHY
source share