On Wed, Oct 26, 2016 at 2:36 PM, Did <didier.cau...@gmail.com> wrote:

> But It seems that, in the update function, currentBox always return
> something because it doesn't update my model... I'm obviously doing
> something wrong. But, for me, as all cells are unoccupied, this test should
> return Nothing. What's wrong ?
>

sorry, my bad. currentBox should have been:

currentBox =
    List.map (filterRow boxId) model.cells
    |> List.head
    |> Maybe.withDefault (Box -1 Nothing) -- this value should never happen
in your context

you need to unpack the Maybe received from head.



> I'm sorry, but I don't know how to debug elm code in general, and in
> particular with the elm lang try editor (I'm at work and I don't have elm
> working on my machine...)
>

You can add Debug.log
<http://package.elm-lang.org/packages/elm-lang/core/4.0.5/Debug#log> in
your code and check the JS console in your browser.




-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to