Retired

Optional Functor (retired)

Description
Loading description...
Functional Programming
  • Please sign in or sign up to leave a comment.
  • JohanWiltink Avatar

    Multiple issues should be addressed before this collects unnecessarily many downvotes.

  • mauro-1 Avatar
    • No random tests
    • There should be tests with falsy values (0, '', [], ...)
    • map and id are builtin functions, hiding builtins is bad practice
    • JohanWiltink Avatar

      You could rename map to lift1, and lift in the other kata to liftN, with the option to have lift2, lift3, ..

      In my head, mapping happens over lists, not over arguments, that would be ( one instance of ) fmapping. But I understand lifting. ( I have some experience with Haskell. )

    • samsmucny Avatar

      Python and Haskell are similar in this way. They both specializized map to lists, but it should be generic. Because of the similar history, I think using fmap would be fine here. I do want to keep map in this kata instead of using lift since seeing the connection to list's map is part of the point. I also thought about lift2, liftN, etc, but given Python's *args feature I thought it would be appropiate to just have liftN.

    • samsmucny Avatar
      • Random tests added
      • Edge case tests
      • map -> fmap & id -> identity
      Issue marked resolved by samsmucny 9 months ago