Ad
  • Custom User Avatar

    If the type system will handle it, you can always write your let rec expressions in lambda syntax. If I can do it in LC, you can do it in Ocaml.

    See https://en.wikipedia.org/wiki/Let_expression for how to rewrite let rec, and ping me on Discord ( in #lambda-calculus ) for how to do mutual recursion and Y*.

    Note that I can't help you with the type system, and I know from Haskell recursive types can be a hassle. I might be able to do the type in Haskell, if that will help you do it in Ocaml ( it really helps here that LC is untyped ).

  • Custom User Avatar

    in c++ error test:
    Expected: equal to [unsupported type]
    Actual: [unsupported type]

  • Default User Avatar

    OK - figured out the problem.

    Although the show representation was identical, my internal representation of polynomials was ambiguous.
    To fix this I needed to implement Eq.

  • Default User Avatar

    In the field multiplication test I got the result:
    Expected x^6 + x^5 + x^4 + x^3 + x^1 + x^0 but got x^6 + x^5 + x^4 + x^3 + x^1 + x^0

    I can't see any difference here. What's the problem?

  • Custom User Avatar

    Done, thanks!

  • Custom User Avatar

    For the Java version it would be a nicer experience if the intitial code could at least compile such that all method stubs are filles with return null.

  • Default User Avatar

    Спасибо, очень доступное объяснение в ролике, все понятно даже не смотря на мой слабый английский

  • Custom User Avatar

    Okay this : Note: Frequency lists with just one or less elements should get rejected. (Because then there is no information we could encode, but the length.).
    is missleading, just return the frequency list no matter it's size. Retuning null if freqs.length<=1 cause error in the tests

  • Custom User Avatar

    I keep getting this error :

    TypeError: Cannot read property 'map' of null
        at Context.<anonymous> (test.js:122:35)
        at processImmediate (internal/timers.js:464:21)
        ```
    But my code ain't 122 line long (only 80) and I don't even use map property in my code.
    What am I doing wrong ?
    
  • Default User Avatar

    I get that input validations is necessary and all, but I spent more time wondering why would one pass an empty list to encode (I am fine with empty strings) than finding errors in my code. Great kata nevertheless. I would suggest imporoving the functions signatures to remove some redundency in the computations but maybe it is me who wasn't clever enough (though I could ignore some variables but that annoys me even more). Again, great kata.

  • Custom User Avatar

    The let rec construct has some limitations, for example it is not possible to define the list of naturals like so :

    let rec nats = 0 :: List.map ((+) 1) nats
    

    The precise explanation of what is or is not acceptable as a right hand side is available in the OCaml manual.

  • Default User Avatar

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

  • Custom User Avatar

    It is meant to be a puzzle. If I provide the algorithm, then what is the challenge? You have to figure out how to reconstruct the shifts by yourselfs. Obviously, you can also google it.

  • Default User Avatar

    Good kata but I found decoding instrution not intuitive, in my opinion it should be extended.
    Current simple explanation is not sufficient and if someone doesn't know the IBWT then it will be hard to proceed based only on description from excercise.

  • Custom User Avatar

    This solution was meant to expose the lazy testing of this kata. My actual solution is here: https://www.codewars.com/kata/reviews/54e4b5cfd5e01959820000b5/groups/55e36e2cda32c7934600006e

  • Loading more items...