From 922036187116dfd8c3f404fa209c5263c9f38892 Mon Sep 17 00:00:00 2001 From: sforman Date: Sat, 29 Jul 2023 12:09:08 -0700 Subject: [PATCH] Gotta keep a Dict around. --- implementations/Elm/src/Joy.elm | 4 +++- implementations/Elm/src/Main.elm | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/implementations/Elm/src/Joy.elm b/implementations/Elm/src/Joy.elm index 717bc3c..4338129 100644 --- a/implementations/Elm/src/Joy.elm +++ b/implementations/Elm/src/Joy.elm @@ -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 diff --git a/implementations/Elm/src/Main.elm b/implementations/Elm/src/Main.elm index 53a6baa..fd16447 100644 --- a/implementations/Elm/src/Main.elm +++ b/implementations/Elm/src/Main.elm @@ -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 }