OSDN Git Service

Gotta keep a Dict around.
authorsforman <sforman@hushmail.com>
Sat, 29 Jul 2023 19:09:08 +0000 (12:09 -0700)
committersforman <sforman@hushmail.com>
Sat, 29 Jul 2023 19:09:08 +0000 (12:09 -0700)
implementations/Elm/src/Joy.elm
implementations/Elm/src/Main.elm

index 717bc3c..4338129 100644 (file)
@@ -1,6 +1,7 @@
-module Joy exposing (doit)
+module Joy exposing (doit, JoyDict)
 
 import Bitwise
+import Dict exposing (Dict)
 import Result exposing (andThen)
 import String exposing (replace, words)
 
@@ -14,6 +15,7 @@ type JoyType
 
 type alias JList = List JoyType
 
+type alias JoyDict = Dict String JList
 
 
 joy : JList -> JList -> Result String JList
index 53a6baa..fd16447 100644 (file)
@@ -1,12 +1,13 @@
 module Main exposing (..)
 
+import Dict
 
 import Browser
 import Html exposing (Html, Attribute, div, input, text)
 import Html.Attributes exposing (..)
 import Html.Events exposing (onInput)
 
-import Joy exposing (doit)
+import Joy exposing (doit, JoyDict)
 
 -- MAIN
 
@@ -21,12 +22,13 @@ main =
 
 type alias Model =
   { content : String
+  , dictionary : JoyDict
   }
 
 
 init : Model
 init =
-  { content = "" }
+  { content = "", dictionary = Dict.empty }