<commit_before>module OnEnter exposing (..)

import Html
import Html.Events exposing (on, keyCode)
import Json.Decode as Json


onEnter : msg -> Html.Attribute msg
onEnter message =
    on "keydown"
        (Json.customDecoder keyCode (is13 message))


is13 : msg -> Int -> Result String msg
is13 message code =
    if code == 13 then
        Ok message
    else
        Err "not the right key code"
<commit_msg>gui: Json.Decode.customDecoder was removed in elm-lang/core 5.0.0<commit_after>module OnEnter exposing (..)

import Html
import Html.Events exposing (on, keyCode)
import Json.Decode as Json


onEnter : msg -> Html.Attribute msg
onEnter message =
    on "keydown"
        (keyCode
            |> Json.andThen (is13 message)
        )


is13 : msg -> Int -> Json.Decoder msg
is13 message code =
    if code == 13 then
        Json.succeed message
    else
        Json.fail "not the right key code"

{'fraction_non_alphanumeric': 0.08800880088008801, 'fraction_numerical': 0.020902090209020903, 'mean_word_length': 2.6254980079681274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3905477', 'n_tokens_mistral': 297, 'n_tokens_neox': 275, 'n_words': 101}