Ad
  • Default User Avatar

    About Haskell, I'm a noob too. I was hinting at the documentation eg. zipWith.

    I don't even know where to put the initialization !

    That's the neat part : nowhere. (Well kinda, but no spoil).

    Finally about join : the order doesn't matter because it is not tested, but the tests still need to access some elements so they have to be at a reasonable position (something exponential would not be reasonable).

    Ps : does your version of join really go through all elements ? If that's not the case then the tests may take elements forever.

  • Default User Avatar
    • The order of the element doesn’t matter in join, you just need to have every element of the «  2D stream » in the output « 1D stream ». Trying to exhaust the first stream, then the second, etc … will not work because they are, well, infinite.
  • Default User Avatar
    • Modifying signatures in general will most likely stop anything from even compiling. (but refactoring modules is possible, as written in the solution setup).
  • Default User Avatar
    • tail and join, can (and should) be really lazy. After all it’s a ’a L.t (or a Stream of it), so no evaluation is needed right now.
  • Default User Avatar
    • For fib_aux, let’s say it’s a bit like building a list recursively, but adding stuff to the tail side lazily in the future :
    (* With list syntax : *)
    (* Instead of *)
    new_thing :: already_built
    (* You do *)
    currently_built :: will_do_in_the_future
    
  • Default User Avatar
    • About tie specificaly, it’s hard to wrap your head around how it works - at least that’s my experience. So sorry I can’t help.
  • Default User Avatar
    • This kata is quite under specified, yeah. In case you (or anyone) want to know what a function is supposed to do, it’s likely to be equivalent to the homonymous Haskell function.
  • Default User Avatar

    I’ll try to answer some of your points without revealing too much of the solution. (Just in case I’ll split the answer so a spoiler flag will not hide everything).