mbr/elm-extras/1.2.0

NOTE: the latest version is 3.1.0

Extras.Core

General convenience functions.

always : a -> b -> a

Regardless of input, always return a constant value.

Helpful adapter for function that only offer updates when one really just wants to replace a value:

List.updateAt index (always item) list
flip : (a -> b -> c) -> b -> a -> c

Change the order of the arguments of a two argument function.

unless : Bool -> a -> a -> a

Negated functional if-then-else

Checks a condition and returns the respective value.

Allows writing more natural conditional atttributes, elements, etc:

div [] [ unless isLoggedIn (text "not logged in") (a [] [ text "logout" ]) ]