From d9d5760928c9f02de4c5954f3d4b0936b083d99c Mon Sep 17 00:00:00 2001 From: Bram Date: Mon, 18 Dec 2023 17:20:43 +0100 Subject: [PATCH] Reorder Envelope functions alphabetically --- src/Internal/Values/Envelope.elm | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Internal/Values/Envelope.elm b/src/Internal/Values/Envelope.elm index 6d302d0..617973c 100644 --- a/src/Internal/Values/Envelope.elm +++ b/src/Internal/Values/Envelope.elm @@ -227,26 +227,6 @@ mapContext f (Envelope data) = } -{-| Update the settings in the Envelope. - - setDeviceName : String -> Envelope a -> Envelope a - setDeviceName name envelope = - mapSettings - (\settings -> - { settings | deviceName = name } - ) - envelope - --} -mapSettings : (Settings -> Settings) -> Envelope a -> Envelope a -mapSettings f (Envelope data) = - Envelope - { content = data.content - , context = data.context - , settings = f data.settings - } - - {-| Map the contents of a function, where the result is wrapped in a `List` type. This can be useful when you are mapping to a list of individual values that you would all like to see enveloped. @@ -287,6 +267,26 @@ mapMaybe f = map f >> toMaybe +{-| Update the settings in the Envelope. + + setDeviceName : String -> Envelope a -> Envelope a + setDeviceName name envelope = + mapSettings + (\settings -> + { settings | deviceName = name } + ) + envelope + +-} +mapSettings : (Settings -> Settings) -> Envelope a -> Envelope a +mapSettings f (Envelope data) = + Envelope + { content = data.content + , context = data.context + , settings = f data.settings + } + + toList : Envelope (List a) -> List (Envelope a) toList (Envelope data) = List.map