|
|
|
|
|
by Y_Y
630 days ago
|
|
Did you do that by hand? I guessed you used the classic `pointfree` program, bit that gave lift = fix ((`ap` tail) . (. head) . flip ((.) . liftM2 (:)))
As far as I know it's not possible to get this functionality in Haskell even with clever instance magic, but I'd love to be proved wrong. |
|
It is possible to fill in basic function bodies based on their type, using ghc-justdoit (https://hackage.haskell.org/package/ghc-justdoit). That's maybe not what you meant, if you are looking for integrating pointfree into Haskell it can be added to ghci or your development environment.
In this case I wrote it because I knew about the pattern. Your lift definition is just ($)