1 kyu

Lensmaker

389tel
Description
Loading description...
Fundamentals
Functional Programming
Puzzles
View
AllIssues3QuestionsSuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • Polymorbism Avatar

    I'm having the same trouble as the user below me. My solution is correct and I'm not using any Lens imports but I'm getting the following error: uncaught exception: IOException of type UserError user error (Could not parse solution correctly)

  • WinterShiver Avatar

    How to avoid the following error on the test case Cannot use Control.Lens? I did not import anything that relates to Control.Lens.

    uncaught exception: IOException of type UserError
    user error (Could not parse solution correctly)
    
  • Simon_ Avatar

    Very scary, but surprisingly pretty easy, just follow the types (some of them are singletons !)

    Really nice kata, thanks tel !

  • Abastro Avatar

    It is satisfctory, but I wish it could give more thorough explanation and type replacements. Especially, how each part of it works. (And what actually is a profunctor)

  • lambdaret Avatar

    what's mean a type? use not a

    newtype K b a = K { getK :: b } deriving Functor

  • Kacarott Avatar

    Very nice. Managed to follow almost all of it, but still don't quite get prisms. Follow the types!

  • mmcquaid Avatar

    This was fantastically satisfying! Took me several days of leaving and coming back to it, and some reading about lenses/profunctors/contravariant functors. I learned a lot from this.

  • phaul Avatar

    probably the hardest kata I ever solved :) I still don't get most of it. ghc typed holes can help a lot.

  • metalbot Avatar

    Thanks for putting this together. Working this kata did a lot to force me to understand how lenses work.

  • linxnp Avatar

    awesome kata, and to understand why those type signature work is more difficult than implement those function

  • soulomoon Avatar

    I like this kata, so many lenses, perfect

  • ice1000 Avatar

    I've completed this kata, but I still have no idea about wtf is Lens...

    I think I should read more books about Haskell. This kata is awesome. Thank you @tel.

  • ice1000 Avatar

    Description is improved, and test case is now completed. It's time to approve this new 1kyu Haskell Kata.

    Wow! The first Haskell-specific 1kyu kata approved! Cheers!

  • qnikst Avatar

    It seems that it's possible to pass this cata without implementing 'coerce' and 'over', is porttible to add tests for those?

  • user5463744 Avatar

    I don't quite understand 'coerce' and didn't try hard to implement it. Is it feasible to add at least primitive tests for it?

    Thanks!

  • muesli4 Avatar

    This is madness. I actually used the most time to figure out what the types are and how to put them together. I wish I learned a bit more, but not sure whether it is worth, seems pretty complicated.

  • AnkalagonBlack Avatar

    This comment has been hidden.

  • user578387 Avatar

    This looks like a really cool kata, but the lenses are explained really poorly - I can't make head or tail of a couple. Could you maybe add some online refrences or explain a bit further?

  • ddrone Avatar

    Last Iso thing is still untested (at least, in provided tests)

  • kazagistar Avatar

    Bleh. I didn't know lenses before I started, and I still dont know how most of the lensy things I just wrote work. This was frustrating; basically just blindly following types, with no intuition. What is a Protofunctor? What is a "witness"? Some crazy category theory stuff I guess?

    Towards the end of it, I was just motivated by sunk cost (and wanting to complain about how annoying it was).

    The last Iso problem is untested (so I could have left it blank), and I have no idea what "coerce" was about but it seemed to be happy with it as bottom, so I didn't touch it.

    Side note: Either is not traversable in this version of haskell, so I implemented it myself.

  • NicolasT Avatar

    Whilst useful, I think the _Left and _Right exercises are a bit too hard, especially since the types are pretty hard to read, and it's non-obvious what those Prisms are al about.

    Did you consider monomorphing the p to -> (assuming that's possible)? This might make types easier to grok. If not, maybe adding another example of a p instance could be useful.

  • bkaes Avatar

    The test cases don't cover _Right.

  • Yuval Avatar

    People who haven't encountered Van Larhoven lenses will be unable to succeed.

  • pcapriotti Avatar

    This comment has been hidden.

  • xcthulhu Avatar

    You'll want to hide Control.Lens...

  • tel Avatar

    There are many more lens concepts which could be included into this Kata to increase its challenge!