The common types and combinators.
TODO: add some great docs.
model -> Html msg
An alias for the view function.
( a, b )
An alias for the pair of things (product of two types).
Wrapper type that adds an index.
initAll : List a -> Array a
Just an alias for Array.fromList (made for convinience).
viewBoth : View model1 msg1 -> View model2 msg2 -> Both model1 model2 -> Both (Html (Either msg1 msg2)) (Html (Either msg1 msg2))
Combines two sub-views into a pair (Both).
viewAll : List (View model msg) -> Array model -> List (Html (Ix msg))
Returns a list of Html produced by applying a List
of sub-views to the List
of sub-models (like List.zip does).
viewEach : (Basics.Int -> View model msg) -> Array model -> List (Html (Ix msg))
Returns a list of Html produced by applying an index-aware view to the each of sub-models.
viewSome : (Basics.Int -> Maybe (View model msg)) -> Array model -> List (Html (Ix msg))
Works as viewEach but returns only some of sub-views.
previewEvery : View model msg -> Array model -> List (Html (Ix msg))
Returns a list of Html produced by applying a
sub-view to the List
of sub-models (like List.map does).
joinViews : View model1 msg1 -> View model2 msg2 -> Both model1 model2 -> List (Html (Either msg1 msg2))
Works as viewBoth but returns a function that produces a
List
of sub-views.
This is a first step of "joinViews+[withView]" chain.
withView : View model2 msg2 -> (model1 -> List (Html msg1)) -> Both model1 model2 -> List (Html (Either msg1 msg2))
Adds an another step to the "joinViews+[withView]" chain.
bind : (a -> b) -> (model -> a) -> model -> b
Makes a function that applies a getter to the model and then modifies result.
This is a first step in the "bind+[thenBind]"-chain.
thenBind : (model2 -> a) -> (model1 -> a -> b) -> Both model1 model2 -> b
Adds an another step to the "bind+[thenBind]"-chain.
oneOfViews : View model1 msg1 -> View model2 msg2 -> Either () () -> Both model1 model2 -> Html (Either msg1 msg2)
Combines two views and lets to select (using path) which one should be applied to the PRODUCT of models.
This is a first step in a "oneOfViews+[orView]"-chain.
orView : View model2 msg2 -> (path -> View model1 msg1) -> Either path () -> Both model1 model2 -> Html (Either msg1 msg2)
Adds an another view to the "oneOfViews+[orView]"-chain.
oneOfPaths : a -> a -> List.Nonempty.Nonempty ( a, Either () () )
Combines two path labels.
This is a first step in the "oneOfPaths+[orPath]"-chain.
orPath : a -> List.Nonempty.Nonempty ( a, b ) -> List.Nonempty.Nonempty ( a, Either b () )
Adds an another path label to the "oneOfPaths+[orPath]"-chain.
eitherView : View model2 msg2 -> View model1 msg1 -> Either model1 model2 -> Html (Either msg1 msg2)
Combines two views into view for the SUM of models.
mapBoth : (a -> c) -> (b -> d) -> Both a b -> Both c d
Applies two functions to the "sides" of the Both
.