From 95b1565c8accbf7c89c8d5f1005e3685da6d7215 Mon Sep 17 00:00:00 2001 From: linsy king Date: Fri, 12 May 2023 11:10:01 +0800 Subject: [PATCH] fix: change sig --- src/Messenger/GeneralModel.elm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Messenger/GeneralModel.elm b/src/Messenger/GeneralModel.elm index 4339893..1b772b5 100644 --- a/src/Messenger/GeneralModel.elm +++ b/src/Messenger/GeneralModel.elm @@ -12,9 +12,10 @@ General model is designed to be an abstract interface of scenes, layers, compone - a: data type - b: environment type - - c: message type - - d: target type - - e: render type + - c: init type + - d: message type + - e: target type + - f: render type @docs GeneralModel @docs viewModelList, viewModelArray @@ -29,24 +30,24 @@ import Array exposing (Array) This has a name field. -} -type alias GeneralModel a b c d e = +type alias GeneralModel a b d e f = { name : String , data : a - , update : b -> c -> a -> ( a, List ( d, c ), b ) - , view : b -> a -> e + , update : b -> d -> a -> ( a, List ( e, d ), b ) + , view : b -> a -> f } {-| View model list. -} -viewModelList : b -> List (GeneralModel a b c d e) -> List e +viewModelList : b -> List (GeneralModel a b d e f) -> List f viewModelList env models = List.map (\model -> model.view env model.data) models {-| View model array. -} -viewModelArray : b -> Array (GeneralModel a b c d e) -> List e +viewModelArray : b -> Array (GeneralModel a b d e f) -> List f viewModelArray env models = Array.toList models |> List.map (\model -> model.view env model.data)