Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2021
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. ```haskell
  2. V<0∫mo`^_1c
  3. ```
  4. ```haskell
  5. -- implicit last parameter (⁰ variable)
  6. c -- get char code
  7. _1c -- literal -1
  8. ^_1c -- raise to the power of
  9. `^_1c -- invert the arguments for ^
  10. o`^_1c -- compose the functions together (map only takes one function)
  11. ∫mo`^_1c -- get the cumulative sum
  12. V<0∫mo`^_1c -- find the first index where the element is less than 0 (husk is 1 indexed)
  13. ```
  14. [Try it online!][TIO-kwsivkh5]
  15.  
  16. [TIO-kwsivkh5]: https://tio.run/##yygtzv6f@6ip8dC2/2E2Bo86VufmJ8TFGyb///9fQ1NDU1NDA0gAAYjk0uTSgABNTAAA "Husk – Try It Online"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement