From 223636d249fa2f3583ad7078a2354063b28c1047 Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Tue, 20 Jan 2026 12:14:11 +0100 Subject: [PATCH] Add Elm.Declare.withDeclarations --- src/Elm/Declare.elm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Elm/Declare.elm b/src/Elm/Declare.elm index eb00e8b..2f7d005 100644 --- a/src/Elm/Declare.elm +++ b/src/Elm/Declare.elm @@ -4,7 +4,7 @@ module Elm.Declare exposing , fnBuilder, fnArg, fnDone, fnBody, placeholder , Value, value , function - , Module, module_, with, withUnexposed + , Module, module_, with, withUnexposed, withDeclarations , Annotation, alias, customType, exposeConstructor , toFile, include, withSubmodule , customTypeAdvanced, CustomType @@ -108,7 +108,7 @@ Which will generate And handle the imports and everything. -@docs Module, module_, with, withUnexposed +@docs Module, module_, with, withUnexposed, withDeclarations @docs Annotation, alias, customType, exposeConstructor @@ -931,3 +931,10 @@ buildRecord (Record r) = , internal = inner.internal , make = \v -> Elm.record (List.reverse (r.make v)) |> Elm.withType annotation } + + +{-| Add multiple declarations to the module. +-} +withDeclarations : List Elm.Declaration -> Module val -> Module val +withDeclarations declarations mod = + { mod | declarations = List.reverse declarations ++ mod.declarations }