I launched HLint in a small project and suggested that I use && &.
Example:
>>> cat st.hs f = (+) 10 g = (+) 1 main = print $ (\x -> (fx, gx)) 5 >>> hlint st.hs st.hs:4:17: Warning: Use &&& Found: \ x -> (fx, gx) Why not: f Control.Arrow.&&& g 1 suggestion
I understand that \x -> (fx, gx) is a model and evaluates a sentence. However, Control.Arrow.&&& does not accept normal functions, but an arrow, so I cannot just use &&& as suggested.
So what is the recommended way in this situation?
- to define own operator
&&& for function? - use the arrow and do something like
(arr f) &&& (arr g) , but I donβt even know how to evaluate it? - ignore hlint in this particular case.
haskell arrows hlint
mb14
source share