Point-free pattern matching possible in Haskell?
-
29-10-2019 - |
Pergunta
Given:
data TwoInts = TwoInts Int Int
add'em :: TwoInts -> Int
add'em (TwoInts a b) = a+b
is it possible to write add'em
without having to name a
and b
. Something like:
add'em TwoInts = (+) -- (Note: Fails to type check)
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow