• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
intena Avatar
Name:Unknown
Clan:Unknown
Member Since:Nov 2017
Last Seen:Apr 2022
Profiles:
    Following:31
    Followers:4
    Allies:3
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (6)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • Alex616
      • commented on "Find the smallest integer in the array" haskell solution
      • 4 years ago

      This comment is hidden because it contains spoiler information about the solution

    • Custom User Avatar
      • GeorgeFlerovsky
      • commented on "Reverse or rotate?" haskell solution
      • 7 years ago

      Simple example: bimap (+ 10) (* 13) (7, 3) = (17, 39)

      So, (bimap f g (a,b)) applies f to a, and g to b, while maintaining the tuple structure.

      Another example, but with Either:

      bimap (+ 10) (* 13) (Left 9)  = Left  19
      bimap (+ 10) (* 13) (Right 2) = Right 26
      

      Now, a clever trick is to apply join to bimap. It happens to be the case that join bimap applies the same function to both parts of a tuple:

      join bimap (+2) (2,3) = (4,5)
      

      The reason this works is due to the definition of join and the monad instance for functions (i.e. (->) r):

      -- definitions
      join x  :=  x >>= id
      f >>= g :=  \r -> g (f r) r     -- (for functions only)
      
      -- therefore:
      join f  =  f >>= id
              =  \r -> id (f r) r
              =  \r -> f r r
      
      -- specific to bimap:
      join bimap = \r -> bimap r r
      
    • Custom User Avatar
      • intena
      • commented on "Reverse or rotate?" haskell solution
      • 7 years ago

      what is bimap?

    • Custom User Avatar
      • Unnamed
      • commented on "Thinkful - List Drills: Longest word" haskell solution
      • 7 years ago

      This comment is hidden because it contains spoiler information about the solution

    • Custom User Avatar
      • Unnamed
      • commented on "Thinkful - List Drills: Longest word" haskell solution
      • 7 years ago

      It's all about "$". When there's enough dollars, work gets done.

    • Custom User Avatar
      • intena
      • commented on "Thinkful - List Drills: Longest word" haskell solution
      • 7 years ago

      how does it work?

    • © 2025 Codewars
    • About
    • API
    • Blog
    • Privacy
    • Terms
    • Code of Conduct
    • Contact

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...