<commit_before>module Main where

import Control.Monad.Eff
import Debug.Trace (trace)
import Data.Array (map)
import React
import React.DOM

todoHeader = mkUI spec do
  pure $ header [ idProp "header" ]
    [ h1' [ text "todos" ]
    , input
      [ idProp "new-todo"
      , placeholder "What needs to be done?"
      , autoFocus "true"
      ] []
    ]

exampleItems =<commit_msg>Start for submitNewTodo<commit_after>module Main where

import Control.Monad.Eff
import Debug.Trace (trace, Trace())
import Data.Array (map)
import React
import React.DOM

enterKeyCode :: Number
enterKeyCode = 13

todoHeader = mkUI spec do
  pure $ header [ idProp "header" ]
    [ h1' [ text "todos" ]
    , input
      [ idProp "new-todo"
      , ref "newField"
      , placeholder "What needs to be done?"
      , autoFocus "true"
      , onKeyDown submitNewTodo
      ] []
    ]
  where
    submitNewTodo :: forall a b. KeyboardEvent -> Eff (trace :: Trace, refs :: ReactRefs b | a) Unit
    submitNewTodo e = do
      refs <- getRefs
      -- TODO: UGLY!! guard? Control.Monad.when?
      if e.keyCode == enterKeyCode
         then trace "hi"
         else pure unit


exampleItems =
{'fraction_non_alphanumeric': 0.10427350427350428, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 2.625386996904025, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7269716', 'n_tokens_mistral': 391, 'n_tokens_neox': 385, 'n_words': 119}