From ddd500a02c72c9e7180f969a049958a56908b7de Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Wed, 2 Jul 2025 23:47:21 +0200 Subject: [PATCH 1/2] Remove unused bindings --- codegen/Gen/ApiRoute.elm | 1366 ------- codegen/Gen/Array.elm | 1185 ------ codegen/Gen/BackendTask/Custom.elm | 401 -- codegen/Gen/BackendTask/Do.elm | 1198 ------ codegen/Gen/BackendTask/Env.elm | 252 -- codegen/Gen/BackendTask/File.elm | 981 ----- codegen/Gen/BackendTask/Glob.elm | 2137 ----------- codegen/Gen/BackendTask/Random.elm | 166 - codegen/Gen/BackendTask/Stream.elm | 3163 ---------------- codegen/Gen/BackendTask/Time.elm | 73 - codegen/Gen/Bitwise.elm | 302 -- codegen/Gen/Bytes/Encode.elm | 863 ----- codegen/Gen/Char.elm | 560 --- codegen/Gen/CodeGen/Generate.elm | 240 -- codegen/Gen/Head.elm | 1046 ------ codegen/Gen/Head/Seo.elm | 1278 ------- codegen/Gen/Json/Decode/Extra.elm | 1679 --------- codegen/Gen/Json/Encode/Extra.elm | 104 - codegen/Gen/OpenApi/Common.elm | 1999 ---------- codegen/Gen/Pages/ConcurrentSubmission.elm | 283 -- codegen/Gen/Pages/Fetcher.elm | 375 -- codegen/Gen/Pages/Flags.elm | 80 - codegen/Gen/Pages/Form.elm | 1036 ------ codegen/Gen/Pages/FormData.elm | 71 - codegen/Gen/Pages/Internal/NotFoundReason.elm | 410 --- codegen/Gen/Pages/Internal/Platform.elm | 2340 ------------ codegen/Gen/Pages/Internal/Platform/Cli.elm | 690 ---- .../Platform/GeneratorApplication.elm | 701 ---- codegen/Gen/Pages/Internal/ResponseSketch.elm | 250 -- codegen/Gen/Pages/Internal/RoutePattern.elm | 1196 ------ codegen/Gen/Pages/Internal/Router.elm | 340 -- codegen/Gen/Pages/Manifest.elm | 1391 ------- codegen/Gen/Pages/Manifest/Category.elm | 1068 ------ codegen/Gen/Pages/Navigation.elm | 194 - codegen/Gen/Pages/PageUrl.elm | 212 -- codegen/Gen/Pages/Script.elm | 1063 ------ codegen/Gen/Pages/Script/Spinner.elm | 1230 ------- codegen/Gen/Pages/Url.elm | 228 -- codegen/Gen/PagesMsg.elm | 250 -- codegen/Gen/Parser.elm | 3210 ----------------- codegen/Gen/Platform.elm | 427 --- codegen/Gen/Platform/Cmd.elm | 183 - codegen/Gen/Platform/Sub.elm | 181 - codegen/Gen/Process.elm | 259 -- codegen/Gen/Scaffold/Form.elm | 678 ---- codegen/Gen/Scaffold/Route.elm | 1962 ---------- codegen/Gen/Server/Request.elm | 1502 -------- codegen/Gen/Server/Response.elm | 1275 ------- codegen/Gen/Server/Session.elm | 974 ----- codegen/Gen/Server/SetCookie.elm | 985 ----- codegen/Gen/Set.elm | 1250 ------- codegen/Gen/Time/Extra.elm | 976 ----- codegen/Gen/Tuple.elm | 391 -- codegen/Gen/Url/Parser.elm | 849 ----- codegen/Gen/Url/Parser/Query.elm | 1922 ---------- codegen/Gen/UrlPath.elm | 276 -- 56 files changed, 49701 deletions(-) delete mode 100644 codegen/Gen/ApiRoute.elm delete mode 100644 codegen/Gen/Array.elm delete mode 100644 codegen/Gen/BackendTask/Custom.elm delete mode 100644 codegen/Gen/BackendTask/Do.elm delete mode 100644 codegen/Gen/BackendTask/Env.elm delete mode 100644 codegen/Gen/BackendTask/File.elm delete mode 100644 codegen/Gen/BackendTask/Glob.elm delete mode 100644 codegen/Gen/BackendTask/Random.elm delete mode 100644 codegen/Gen/BackendTask/Stream.elm delete mode 100644 codegen/Gen/BackendTask/Time.elm delete mode 100644 codegen/Gen/Bitwise.elm delete mode 100644 codegen/Gen/Bytes/Encode.elm delete mode 100644 codegen/Gen/Char.elm delete mode 100644 codegen/Gen/CodeGen/Generate.elm delete mode 100644 codegen/Gen/Head.elm delete mode 100644 codegen/Gen/Head/Seo.elm delete mode 100644 codegen/Gen/Json/Decode/Extra.elm delete mode 100644 codegen/Gen/Json/Encode/Extra.elm delete mode 100644 codegen/Gen/OpenApi/Common.elm delete mode 100644 codegen/Gen/Pages/ConcurrentSubmission.elm delete mode 100644 codegen/Gen/Pages/Fetcher.elm delete mode 100644 codegen/Gen/Pages/Flags.elm delete mode 100644 codegen/Gen/Pages/Form.elm delete mode 100644 codegen/Gen/Pages/FormData.elm delete mode 100644 codegen/Gen/Pages/Internal/NotFoundReason.elm delete mode 100644 codegen/Gen/Pages/Internal/Platform.elm delete mode 100644 codegen/Gen/Pages/Internal/Platform/Cli.elm delete mode 100644 codegen/Gen/Pages/Internal/Platform/GeneratorApplication.elm delete mode 100644 codegen/Gen/Pages/Internal/ResponseSketch.elm delete mode 100644 codegen/Gen/Pages/Internal/RoutePattern.elm delete mode 100644 codegen/Gen/Pages/Internal/Router.elm delete mode 100644 codegen/Gen/Pages/Manifest.elm delete mode 100644 codegen/Gen/Pages/Manifest/Category.elm delete mode 100644 codegen/Gen/Pages/Navigation.elm delete mode 100644 codegen/Gen/Pages/PageUrl.elm delete mode 100644 codegen/Gen/Pages/Script.elm delete mode 100644 codegen/Gen/Pages/Script/Spinner.elm delete mode 100644 codegen/Gen/Pages/Url.elm delete mode 100644 codegen/Gen/PagesMsg.elm delete mode 100644 codegen/Gen/Parser.elm delete mode 100644 codegen/Gen/Platform.elm delete mode 100644 codegen/Gen/Platform/Cmd.elm delete mode 100644 codegen/Gen/Platform/Sub.elm delete mode 100644 codegen/Gen/Process.elm delete mode 100644 codegen/Gen/Scaffold/Form.elm delete mode 100644 codegen/Gen/Scaffold/Route.elm delete mode 100644 codegen/Gen/Server/Request.elm delete mode 100644 codegen/Gen/Server/Response.elm delete mode 100644 codegen/Gen/Server/Session.elm delete mode 100644 codegen/Gen/Server/SetCookie.elm delete mode 100644 codegen/Gen/Set.elm delete mode 100644 codegen/Gen/Time/Extra.elm delete mode 100644 codegen/Gen/Tuple.elm delete mode 100644 codegen/Gen/Url/Parser.elm delete mode 100644 codegen/Gen/Url/Parser/Query.elm delete mode 100644 codegen/Gen/UrlPath.elm diff --git a/codegen/Gen/ApiRoute.elm b/codegen/Gen/ApiRoute.elm deleted file mode 100644 index 1d2e658b..00000000 --- a/codegen/Gen/ApiRoute.elm +++ /dev/null @@ -1,1366 +0,0 @@ -module Gen.ApiRoute exposing - ( moduleName_, single, preRender, serverRender, preRenderWithFallback, capture - , literal, slash, succeed, withGlobalHeadTags, toJson, getBuildTimeRoutes, getGlobalHeadTagsBackendTask - , annotation_, call_, values_ - ) - -{-| -# Generated bindings for ApiRoute - -@docs moduleName_, single, preRender, serverRender, preRenderWithFallback, capture -@docs literal, slash, succeed, withGlobalHeadTags, toJson, getBuildTimeRoutes -@docs getGlobalHeadTagsBackendTask, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "ApiRoute" ] - - -{-| Same as [`preRender`](#preRender), but for an ApiRoute that has no dynamic segments. This is just a bit simpler because -since there are no dynamic segments, you don't need to provide a BackendTask with the list of dynamic segments to pre-render because there is only a single possible route. - -single: - ApiRoute.ApiRouteBuilder (BackendTask.BackendTask FatalError.FatalError String) (List String) - -> ApiRoute.ApiRoute ApiRoute.Response --} -single : Elm.Expression -> Elm.Expression -single singleArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - , Type.list Type.string - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - ) - [ singleArg_ ] - - -{-| Pre-render files for a given route pattern statically at build-time. If you only need to serve a single file, you can use [`single`](#single) instead. - - import ApiRoute - import BackendTask - import BackendTask.Http - import Json.Decode as Decode - import Json.Encode as Encode - - starsApi : ApiRoute ApiRoute.Response - starsApi = - ApiRoute.succeed - (\user repoName -> - BackendTask.Http.getJson - ("https://api.github.com/repos/" ++ user ++ "/" ++ repoName) - (Decode.field "stargazers_count" Decode.int) - |> BackendTask.allowFatal - |> BackendTask.map - (\stars -> - Encode.object - [ ( "repo", Encode.string repoName ) - , ( "stars", Encode.int stars ) - ] - |> Encode.encode 2 - ) - ) - |> ApiRoute.literal "repo" - |> ApiRoute.slash - |> ApiRoute.capture - |> ApiRoute.slash - |> ApiRoute.capture - |> ApiRoute.slash - |> ApiRoute.literal ".json" - |> ApiRoute.preRender - (\route -> - BackendTask.succeed - [ route "dillonkearns" "elm-graphql" - , route "dillonkearns" "elm-pages" - ] - ) - -You can view these files in the dev server at , and when you run `elm-pages build` this will result in the following files being generated: - - - `dist/repo/dillonkearns/elm-graphql.json` - - `dist/repo/dillonkearns/elm-pages.json` - -Note: `dist` is the output folder for `elm-pages build`, so this will be accessible in your hosted site at `/repo/dillonkearns/elm-graphql.json` and `/repo/dillonkearns/elm-pages.json`. - -preRender: - (constructor - -> BackendTask.BackendTask FatalError.FatalError (List (List String))) - -> ApiRoute.ApiRouteBuilder (BackendTask.BackendTask FatalError.FatalError String) constructor - -> ApiRoute.ApiRoute ApiRoute.Response --} -preRender : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -preRender preRenderArg_ preRenderArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list (Type.list Type.string) - ] - ) - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - ) - [ Elm.functionReduced "preRenderUnpack" preRenderArg_, preRenderArg_0 ] - - -{-| serverRender: - ApiRoute.ApiRouteBuilder (Server.Request.Request - -> BackendTask.BackendTask FatalError.FatalError (Server.Response.Response Basics.Never Basics.Never)) constructor - -> ApiRoute.ApiRoute ApiRoute.Response --} -serverRender : Elm.Expression -> Elm.Expression -serverRender serverRenderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith - [ "Basics" ] - "Never" - [] - , Type.namedWith - [ "Basics" ] - "Never" - [] - ] - ] - ) - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - ) - [ serverRenderArg_ ] - - -{-| preRenderWithFallback: - (constructor - -> BackendTask.BackendTask FatalError.FatalError (List (List String))) - -> ApiRoute.ApiRouteBuilder (BackendTask.BackendTask FatalError.FatalError (Server.Response.Response Basics.Never Basics.Never)) constructor - -> ApiRoute.ApiRoute ApiRoute.Response --} -preRenderWithFallback : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -preRenderWithFallback preRenderWithFallbackArg_ preRenderWithFallbackArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "preRenderWithFallback" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list (Type.list Type.string) - ] - ) - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - ) - [ Elm.functionReduced - "preRenderWithFallbackUnpack" - preRenderWithFallbackArg_ - , preRenderWithFallbackArg_0 - ] - - -{-| Captures a dynamic segment from the route. - -capture: - ApiRoute.ApiRouteBuilder (String -> a) constructor - -> ApiRoute.ApiRouteBuilder a (String -> constructor) --} -capture : Elm.Expression -> Elm.Expression -capture captureArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "capture" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.function [ Type.string ] (Type.var "a") - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a" - , Type.function - [ Type.string ] - (Type.var "constructor") - ] - ) - ) - } - ) - [ captureArg_ ] - - -{-| A literal String segment of a route. - -literal: - String - -> ApiRoute.ApiRouteBuilder a constructor - -> ApiRoute.ApiRouteBuilder a constructor --} -literal : String -> Elm.Expression -> Elm.Expression -literal literalArg_ literalArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "literal" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - ) - } - ) - [ Elm.string literalArg_, literalArg_0 ] - - -{-| A path separator within the route. - -slash: ApiRoute.ApiRouteBuilder a constructor -> ApiRoute.ApiRouteBuilder a constructor --} -slash : Elm.Expression -> Elm.Expression -slash slashArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "slash" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - ) - } - ) - [ slashArg_ ] - - -{-| Starts the definition of a route with any captured segments. - -succeed: a -> ApiRoute.ApiRouteBuilder a (List String) --} -succeed : Elm.Expression -> Elm.Expression -succeed succeedArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.list Type.string ] - ) - ) - } - ) - [ succeedArg_ ] - - -{-| Include head tags on every page's HTML. - -withGlobalHeadTags: - BackendTask.BackendTask FatalError.FatalError (List Head.Tag) - -> ApiRoute.ApiRoute response - -> ApiRoute.ApiRoute response --} -withGlobalHeadTags : Elm.Expression -> Elm.Expression -> Elm.Expression -withGlobalHeadTags withGlobalHeadTagsArg_ withGlobalHeadTagsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "withGlobalHeadTags" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.list (Type.namedWith [ "Head" ] "Tag" []) - ] - , Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ) - ) - } - ) - [ withGlobalHeadTagsArg_, withGlobalHeadTagsArg_0 ] - - -{-| Turn the route into a pattern in JSON format. For internal uses. - -toJson: ApiRoute.ApiRoute response -> Json.Encode.Value --} -toJson : Elm.Expression -> Elm.Expression -toJson toJsonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ toJsonArg_ ] - - -{-| For internal use by generated code. Not so useful in user-land. - -getBuildTimeRoutes: - ApiRoute.ApiRoute response - -> BackendTask.BackendTask FatalError.FatalError (List String) --} -getBuildTimeRoutes : Elm.Expression -> Elm.Expression -getBuildTimeRoutes getBuildTimeRoutesArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "getBuildTimeRoutes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.list Type.string - ] - ) - ) - } - ) - [ getBuildTimeRoutesArg_ ] - - -{-| For internal use. - -getGlobalHeadTagsBackendTask: - ApiRoute.ApiRoute response - -> Maybe (BackendTask.BackendTask FatalError.FatalError (List Head.Tag)) --} -getGlobalHeadTagsBackendTask : Elm.Expression -> Elm.Expression -getGlobalHeadTagsBackendTask getGlobalHeadTagsBackendTaskArg_ = - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "getGlobalHeadTagsBackendTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ] - ) - ) - ) - } - ) - [ getGlobalHeadTagsBackendTaskArg_ ] - - -annotation_ : - { apiRoute : Type.Annotation -> Type.Annotation - , apiRouteBuilder : Type.Annotation -> Type.Annotation -> Type.Annotation - , response : Type.Annotation - } -annotation_ = - { apiRoute = - \apiRouteArg0 -> - Type.alias - moduleName_ - "ApiRoute" - [ apiRouteArg0 ] - (Type.namedWith - [ "Internal", "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ) - , apiRouteBuilder = - \apiRouteBuilderArg0 apiRouteBuilderArg1 -> - Type.alias - moduleName_ - "ApiRouteBuilder" - [ apiRouteBuilderArg0, apiRouteBuilderArg1 ] - (Type.namedWith - [ "Internal", "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - , response = - Type.alias - moduleName_ - "Response" - [] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - } - - -call_ : - { single : Elm.Expression -> Elm.Expression - , preRender : Elm.Expression -> Elm.Expression -> Elm.Expression - , serverRender : Elm.Expression -> Elm.Expression - , preRenderWithFallback : Elm.Expression -> Elm.Expression -> Elm.Expression - , capture : Elm.Expression -> Elm.Expression - , literal : Elm.Expression -> Elm.Expression -> Elm.Expression - , slash : Elm.Expression -> Elm.Expression - , succeed : Elm.Expression -> Elm.Expression - , withGlobalHeadTags : Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : Elm.Expression -> Elm.Expression - , getBuildTimeRoutes : Elm.Expression -> Elm.Expression - , getGlobalHeadTagsBackendTask : Elm.Expression -> Elm.Expression - } -call_ = - { single = - \singleArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - , Type.list Type.string - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith - [ "ApiRoute" ] - "Response" - [] - ] - ) - ) - } - ) - [ singleArg_ ] - , preRender = - \preRenderArg_ preRenderArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list (Type.list Type.string) - ] - ) - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith - [ "ApiRoute" ] - "Response" - [] - ] - ) - ) - } - ) - [ preRenderArg_, preRenderArg_0 ] - , serverRender = - \serverRenderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith - [ "Basics" ] - "Never" - [] - , Type.namedWith - [ "Basics" ] - "Never" - [] - ] - ] - ) - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith - [ "ApiRoute" ] - "Response" - [] - ] - ) - ) - } - ) - [ serverRenderArg_ ] - , preRenderWithFallback = - \preRenderWithFallbackArg_ preRenderWithFallbackArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "preRenderWithFallback" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list (Type.list Type.string) - ] - ) - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith - [ "Basics" ] - "Never" - [] - , Type.namedWith - [ "Basics" ] - "Never" - [] - ] - ] - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith - [ "ApiRoute" ] - "Response" - [] - ] - ) - ) - } - ) - [ preRenderWithFallbackArg_, preRenderWithFallbackArg_0 ] - , capture = - \captureArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "capture" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.function - [ Type.string ] - (Type.var "a") - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a" - , Type.function - [ Type.string ] - (Type.var "constructor") - ] - ) - ) - } - ) - [ captureArg_ ] - , literal = - \literalArg_ literalArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "literal" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - ) - } - ) - [ literalArg_, literalArg_0 ] - , slash = - \slashArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "slash" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - ) - } - ) - [ slashArg_ ] - , succeed = - \succeedArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.list Type.string ] - ) - ) - } - ) - [ succeedArg_ ] - , withGlobalHeadTags = - \withGlobalHeadTagsArg_ withGlobalHeadTagsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "withGlobalHeadTags" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ] - , Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ) - ) - } - ) - [ withGlobalHeadTagsArg_, withGlobalHeadTagsArg_0 ] - , toJson = - \toJsonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_ ] - , getBuildTimeRoutes = - \getBuildTimeRoutesArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "getBuildTimeRoutes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list Type.string - ] - ) - ) - } - ) - [ getBuildTimeRoutesArg_ ] - , getGlobalHeadTagsBackendTask = - \getGlobalHeadTagsBackendTaskArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "ApiRoute" ] - , name = "getGlobalHeadTagsBackendTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list - (Type.namedWith - [ "Head" ] - "Tag" - [] - ) - ] - ) - ) - ) - } - ) - [ getGlobalHeadTagsBackendTaskArg_ ] - } - - -values_ : - { single : Elm.Expression - , preRender : Elm.Expression - , serverRender : Elm.Expression - , preRenderWithFallback : Elm.Expression - , capture : Elm.Expression - , literal : Elm.Expression - , slash : Elm.Expression - , succeed : Elm.Expression - , withGlobalHeadTags : Elm.Expression - , toJson : Elm.Expression - , getBuildTimeRoutes : Elm.Expression - , getGlobalHeadTagsBackendTask : Elm.Expression - } -values_ = - { single = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - , Type.list Type.string - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - , preRender = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list (Type.list Type.string) - ] - ) - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - , serverRender = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith - [ "Basics" ] - "Never" - [] - , Type.namedWith - [ "Basics" ] - "Never" - [] - ] - ] - ) - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - , preRenderWithFallback = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "preRenderWithFallback" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list (Type.list Type.string) - ] - ) - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - , capture = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "capture" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.function [ Type.string ] (Type.var "a") - , Type.var "constructor" - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a" - , Type.function - [ Type.string ] - (Type.var "constructor") - ] - ) - ) - } - , literal = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "literal" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - ) - } - , slash = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "slash" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.var "constructor" ] - ) - ) - } - , succeed = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRouteBuilder" - [ Type.var "a", Type.list Type.string ] - ) - ) - } - , withGlobalHeadTags = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "withGlobalHeadTags" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.list (Type.namedWith [ "Head" ] "Tag" []) - ] - , Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ) - ) - } - , toJson = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - , getBuildTimeRoutes = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "getBuildTimeRoutes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.list Type.string - ] - ) - ) - } - , getGlobalHeadTagsBackendTask = - Elm.value - { importFrom = [ "ApiRoute" ] - , name = "getGlobalHeadTagsBackendTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.var "response" ] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ] - ) - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Array.elm b/codegen/Gen/Array.elm deleted file mode 100644 index 6003e08c..00000000 --- a/codegen/Gen/Array.elm +++ /dev/null @@ -1,1185 +0,0 @@ -module Gen.Array exposing - ( moduleName_, empty, initialize, repeat, fromList, isEmpty - , length, get, set, push, append, slice, toList - , toIndexedList, map, indexedMap, foldl, foldr, filter, annotation_ - , call_, values_ - ) - -{-| -# Generated bindings for Array - -@docs moduleName_, empty, initialize, repeat, fromList, isEmpty -@docs length, get, set, push, append, slice -@docs toList, toIndexedList, map, indexedMap, foldl, foldr -@docs filter, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Array" ] - - -{-| Return an empty array. - - length empty == 0 - -empty: Array.Array a --} -empty : Elm.Expression -empty = - Elm.value - { importFrom = [ "Array" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - } - - -{-| Initialize an array. `initialize n f` creates an array of length `n` with -the element at index `i` initialized to the result of `(f i)`. - - initialize 4 identity == fromList [0,1,2,3] - initialize 4 (\n -> n*n) == fromList [0,1,4,9] - initialize 4 (always 0) == fromList [0,0,0,0] - -initialize: Int -> (Int -> a) -> Array.Array a --} -initialize : Int -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -initialize initializeArg_ initializeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "initialize" - , annotation = - Just - (Type.function - [ Type.int - , Type.function [ Type.int ] (Type.var "a") - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ Elm.int initializeArg_ - , Elm.functionReduced "initializeUnpack" initializeArg_0 - ] - - -{-| Creates an array with a given length, filled with a default element. - - repeat 5 0 == fromList [0,0,0,0,0] - repeat 3 "cat" == fromList ["cat","cat","cat"] - -Notice that `repeat 3 x` is the same as `initialize 3 (always x)`. - -repeat: Int -> a -> Array.Array a --} -repeat : Int -> Elm.Expression -> Elm.Expression -repeat repeatArg_ repeatArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "repeat" - , annotation = - Just - (Type.function - [ Type.int, Type.var "a" ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ Elm.int repeatArg_, repeatArg_0 ] - - -{-| Create an array from a `List`. - -fromList: List a -> Array.Array a --} -fromList : List Elm.Expression -> Elm.Expression -fromList fromListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "a") ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ Elm.list fromListArg_ ] - - -{-| Determine if an array is empty. - - isEmpty empty == True - -isEmpty: Array.Array a -> Bool --} -isEmpty : Elm.Expression -> Elm.Expression -isEmpty isEmptyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - Type.bool - ) - } - ) - [ isEmptyArg_ ] - - -{-| Return the length of an array. - - length (fromList [1,2,3]) == 3 - -length: Array.Array a -> Int --} -length : Elm.Expression -> Elm.Expression -length lengthArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "length" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - Type.int - ) - } - ) - [ lengthArg_ ] - - -{-| Return `Just` the element at the index or `Nothing` if the index is out of -range. - - get 0 (fromList [0,1,2]) == Just 0 - get 2 (fromList [0,1,2]) == Just 2 - get 5 (fromList [0,1,2]) == Nothing - get -1 (fromList [0,1,2]) == Nothing - -get: Int -> Array.Array a -> Maybe a --} -get : Int -> Elm.Expression -> Elm.Expression -get getArg_ getArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.maybe (Type.var "a")) - ) - } - ) - [ Elm.int getArg_, getArg_0 ] - - -{-| Set the element at a particular index. Returns an updated array. -If the index is out of range, the array is unaltered. - - set 1 7 (fromList [1,2,3]) == fromList [1,7,3] - -set: Int -> a -> Array.Array a -> Array.Array a --} -set : Int -> Elm.Expression -> Elm.Expression -> Elm.Expression -set setArg_ setArg_0 setArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "set" - , annotation = - Just - (Type.function - [ Type.int - , Type.var "a" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ Elm.int setArg_, setArg_0, setArg_1 ] - - -{-| Push an element onto the end of an array. - - push 3 (fromList [1,2]) == fromList [1,2,3] - -push: a -> Array.Array a -> Array.Array a --} -push : Elm.Expression -> Elm.Expression -> Elm.Expression -push pushArg_ pushArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "push" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ pushArg_, pushArg_0 ] - - -{-| Append two arrays to a new one. - - append (repeat 2 42) (repeat 3 81) == fromList [42,42,81,81,81] - -append: Array.Array a -> Array.Array a -> Array.Array a --} -append : Elm.Expression -> Elm.Expression -> Elm.Expression -append appendArg_ appendArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "append" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ appendArg_, appendArg_0 ] - - -{-| Get a sub-section of an array: `(slice start end array)`. The `start` is a -zero-based index where we will start our slice. The `end` is a zero-based index -that indicates the end of the slice. The slice extracts up to but not including -`end`. - - slice 0 3 (fromList [0,1,2,3,4]) == fromList [0,1,2] - slice 1 4 (fromList [0,1,2,3,4]) == fromList [1,2,3] - -Both the `start` and `end` indexes can be negative, indicating an offset from -the end of the array. - - slice 1 -1 (fromList [0,1,2,3,4]) == fromList [1,2,3] - slice -2 5 (fromList [0,1,2,3,4]) == fromList [3,4] - -This makes it pretty easy to `pop` the last element off of an array: -`slice 0 -1 array` - -slice: Int -> Int -> Array.Array a -> Array.Array a --} -slice : Int -> Int -> Elm.Expression -> Elm.Expression -slice sliceArg_ sliceArg_0 sliceArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "slice" - , annotation = - Just - (Type.function - [ Type.int - , Type.int - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ Elm.int sliceArg_, Elm.int sliceArg_0, sliceArg_1 ] - - -{-| Create a list of elements from an array. - - toList (fromList [3,5,8]) == [3,5,8] - -toList: Array.Array a -> List a --} -toList : Elm.Expression -> Elm.Expression -toList toListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.list (Type.var "a")) - ) - } - ) - [ toListArg_ ] - - -{-| Create an indexed list from an array. Each element of the array will be -paired with its index. - - toIndexedList (fromList ["cat","dog"]) == [(0,"cat"), (1,"dog")] - -toIndexedList: Array.Array a -> List ( Int, a ) --} -toIndexedList : Elm.Expression -> Elm.Expression -toIndexedList toIndexedListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "toIndexedList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.list (Type.tuple Type.int (Type.var "a"))) - ) - } - ) - [ toIndexedListArg_ ] - - -{-| Apply a function on every element in an array. - - map sqrt (fromList [1,4,9]) == fromList [1,2,3] - -map: (a -> b) -> Array.Array a -> Array.Array b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Apply a function on every element with its index as first argument. - - indexedMap (*) (fromList [5,5,5]) == fromList [0,5,10] - -indexedMap: (Int -> a -> b) -> Array.Array a -> Array.Array b --} -indexedMap : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -indexedMap indexedMapArg_ indexedMapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "indexedMap" - , annotation = - Just - (Type.function - [ Type.function - [ Type.int, Type.var "a" ] - (Type.var "b") - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) - ) - } - ) - [ Elm.functionReduced - "indexedMapUnpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (indexedMapArg_ functionReducedUnpack) - ) - , indexedMapArg_0 - ] - - -{-| Reduce an array from the left. Read `foldl` as fold from the left. - - foldl (::) [] (fromList [1,2,3]) == [3,2,1] - -foldl: (a -> b -> b) -> b -> Array.Array a -> b --} -foldl : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -foldl foldlArg_ foldlArg_0 foldlArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ Elm.functionReduced - "foldlUnpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (foldlArg_ functionReducedUnpack) - ) - , foldlArg_0 - , foldlArg_1 - ] - - -{-| Reduce an array from the right. Read `foldr` as fold from the right. - - foldr (+) 0 (repeat 3 5) == 15 - -foldr: (a -> b -> b) -> b -> Array.Array a -> b --} -foldr : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -foldr foldrArg_ foldrArg_0 foldrArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ Elm.functionReduced - "foldrUnpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (foldrArg_ functionReducedUnpack) - ) - , foldrArg_0 - , foldrArg_1 - ] - - -{-| Keep elements that pass the test. - - filter isEven (fromList [1,2,3,4,5,6]) == (fromList [2,4,6]) - -filter: (a -> Bool) -> Array.Array a -> Array.Array a --} -filter : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -filter filterArg_ filterArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] Type.bool - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - ) - [ Elm.functionReduced "filterUnpack" filterArg_, filterArg_0 ] - - -annotation_ : { array : Type.Annotation -> Type.Annotation } -annotation_ = - { array = \arrayArg0 -> Type.namedWith [ "Array" ] "Array" [ arrayArg0 ] } - - -call_ : - { initialize : Elm.Expression -> Elm.Expression -> Elm.Expression - , repeat : Elm.Expression -> Elm.Expression -> Elm.Expression - , fromList : Elm.Expression -> Elm.Expression - , isEmpty : Elm.Expression -> Elm.Expression - , length : Elm.Expression -> Elm.Expression - , get : Elm.Expression -> Elm.Expression -> Elm.Expression - , set : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , push : Elm.Expression -> Elm.Expression -> Elm.Expression - , append : Elm.Expression -> Elm.Expression -> Elm.Expression - , slice : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , toList : Elm.Expression -> Elm.Expression - , toIndexedList : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , indexedMap : Elm.Expression -> Elm.Expression -> Elm.Expression - , foldl : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , foldr : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , filter : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { initialize = - \initializeArg_ initializeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "initialize" - , annotation = - Just - (Type.function - [ Type.int - , Type.function [ Type.int ] (Type.var "a") - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ initializeArg_, initializeArg_0 ] - , repeat = - \repeatArg_ repeatArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "repeat" - , annotation = - Just - (Type.function - [ Type.int, Type.var "a" ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ repeatArg_, repeatArg_0 ] - , fromList = - \fromListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "a") ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ fromListArg_ ] - , isEmpty = - \isEmptyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - Type.bool - ) - } - ) - [ isEmptyArg_ ] - , length = - \lengthArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "length" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - Type.int - ) - } - ) - [ lengthArg_ ] - , get = - \getArg_ getArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.maybe (Type.var "a")) - ) - } - ) - [ getArg_, getArg_0 ] - , set = - \setArg_ setArg_0 setArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "set" - , annotation = - Just - (Type.function - [ Type.int - , Type.var "a" - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ setArg_, setArg_0, setArg_1 ] - , push = - \pushArg_ pushArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "push" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ pushArg_, pushArg_0 ] - , append = - \appendArg_ appendArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "append" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ appendArg_, appendArg_0 ] - , slice = - \sliceArg_ sliceArg_0 sliceArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "slice" - , annotation = - Just - (Type.function - [ Type.int - , Type.int - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ sliceArg_, sliceArg_0, sliceArg_1 ] - , toList = - \toListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.list (Type.var "a")) - ) - } - ) - [ toListArg_ ] - , toIndexedList = - \toIndexedListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "toIndexedList" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.list - (Type.tuple Type.int (Type.var "a")) - ) - ) - } - ) - [ toIndexedListArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , indexedMap = - \indexedMapArg_ indexedMapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "indexedMap" - , annotation = - Just - (Type.function - [ Type.function - [ Type.int, Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "b" ] - ) - ) - } - ) - [ indexedMapArg_, indexedMapArg_0 ] - , foldl = - \foldlArg_ foldlArg_0 foldlArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ foldlArg_, foldlArg_0, foldlArg_1 ] - , foldr = - \foldrArg_ foldrArg_0 foldrArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ foldrArg_, foldrArg_0, foldrArg_1 ] - , filter = - \filterArg_ filterArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Array" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] Type.bool - , Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Array" ] - "Array" - [ Type.var "a" ] - ) - ) - } - ) - [ filterArg_, filterArg_0 ] - } - - -values_ : - { empty : Elm.Expression - , initialize : Elm.Expression - , repeat : Elm.Expression - , fromList : Elm.Expression - , isEmpty : Elm.Expression - , length : Elm.Expression - , get : Elm.Expression - , set : Elm.Expression - , push : Elm.Expression - , append : Elm.Expression - , slice : Elm.Expression - , toList : Elm.Expression - , toIndexedList : Elm.Expression - , map : Elm.Expression - , indexedMap : Elm.Expression - , foldl : Elm.Expression - , foldr : Elm.Expression - , filter : Elm.Expression - } -values_ = - { empty = - Elm.value - { importFrom = [ "Array" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - } - , initialize = - Elm.value - { importFrom = [ "Array" ] - , name = "initialize" - , annotation = - Just - (Type.function - [ Type.int, Type.function [ Type.int ] (Type.var "a") ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , repeat = - Elm.value - { importFrom = [ "Array" ] - , name = "repeat" - , annotation = - Just - (Type.function - [ Type.int, Type.var "a" ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , fromList = - Elm.value - { importFrom = [ "Array" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "a") ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , isEmpty = - Elm.value - { importFrom = [ "Array" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] - Type.bool - ) - } - , length = - Elm.value - { importFrom = [ "Array" ] - , name = "length" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] - Type.int - ) - } - , get = - Elm.value - { importFrom = [ "Array" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.maybe (Type.var "a")) - ) - } - , set = - Elm.value - { importFrom = [ "Array" ] - , name = "set" - , annotation = - Just - (Type.function - [ Type.int - , Type.var "a" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , push = - Elm.value - { importFrom = [ "Array" ] - , name = "push" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , append = - Elm.value - { importFrom = [ "Array" ] - , name = "append" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , slice = - Elm.value - { importFrom = [ "Array" ] - , name = "slice" - , annotation = - Just - (Type.function - [ Type.int - , Type.int - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - , toList = - Elm.value - { importFrom = [ "Array" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] - (Type.list (Type.var "a")) - ) - } - , toIndexedList = - Elm.value - { importFrom = [ "Array" ] - , name = "toIndexedList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] - (Type.list (Type.tuple Type.int (Type.var "a"))) - ) - } - , map = - Elm.value - { importFrom = [ "Array" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) - ) - } - , indexedMap = - Elm.value - { importFrom = [ "Array" ] - , name = "indexedMap" - , annotation = - Just - (Type.function - [ Type.function - [ Type.int, Type.var "a" ] - (Type.var "b") - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) - ) - } - , foldl = - Elm.value - { importFrom = [ "Array" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - , foldr = - Elm.value - { importFrom = [ "Array" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - , filter = - Elm.value - { importFrom = [ "Array" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] Type.bool - , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] - ] - (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Custom.elm b/codegen/Gen/BackendTask/Custom.elm deleted file mode 100644 index 5df4db8f..00000000 --- a/codegen/Gen/BackendTask/Custom.elm +++ /dev/null @@ -1,401 +0,0 @@ -module Gen.BackendTask.Custom exposing - ( moduleName_, run, timeDecoder, dateDecoder, annotation_, make_ - , caseOf_, call_, values_ - ) - -{-| -# Generated bindings for BackendTask.Custom - -@docs moduleName_, run, timeDecoder, dateDecoder, annotation_, make_ -@docs caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Custom" ] - - -{-| run: - String - -> Json.Encode.Value - -> Json.Decode.Decoder b - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.Custom.Error - } b --} -run : String -> Elm.Expression -> Elm.Expression -> Elm.Expression -run runArg_ runArg_0 runArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Custom" ] - "Error" - [] - ) - ] - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.string runArg_, runArg_0, runArg_1 ] - - -{-| timeDecoder: Json.Decode.Decoder Time.Posix -} -timeDecoder : Elm.Expression -timeDecoder = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "timeDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Time" ] "Posix" [] ] - ) - } - - -{-| The same as `timeDecoder`, but it converts the decoded `Time.Posix` value into a `Date` with `Date.fromPosix Time.utc`. - -JavaScript `Date` objects don't distinguish between values with only a date vs. values with both a date and a time. So be sure -to use this decoder when you know the semantics represent a date with no associated time (or you're sure you don't care about the time). - -dateDecoder: Json.Decode.Decoder Date.Date --} -dateDecoder : Elm.Expression -dateDecoder = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "dateDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Date" ] "Date" [] ] - ) - } - - -annotation_ : { error : Type.Annotation } -annotation_ = - { error = Type.namedWith [ "BackendTask", "Custom" ] "Error" [] } - - -make_ : - { error : Elm.Expression - , errorInCustomBackendTaskFile : Elm.Expression - , missingCustomBackendTaskFile : Elm.Expression - , customBackendTaskNotDefined : Elm.Expression -> Elm.Expression - , customBackendTaskException : Elm.Expression -> Elm.Expression - , nonJsonException : Elm.Expression -> Elm.Expression - , exportIsNotFunction : Elm.Expression - , decodeError : Elm.Expression -> Elm.Expression - } -make_ = - { error = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "Error" - , annotation = Just (Type.namedWith [] "Error" []) - } - , errorInCustomBackendTaskFile = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "ErrorInCustomBackendTaskFile" - , annotation = Just (Type.namedWith [] "Error" []) - } - , missingCustomBackendTaskFile = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "MissingCustomBackendTaskFile" - , annotation = Just (Type.namedWith [] "Error" []) - } - , customBackendTaskNotDefined = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "CustomBackendTaskNotDefined" - , annotation = Just (Type.namedWith [] "Error" []) - } - ) - [ ar0 ] - , customBackendTaskException = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "CustomBackendTaskException" - , annotation = Just (Type.namedWith [] "Error" []) - } - ) - [ ar0 ] - , nonJsonException = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "NonJsonException" - , annotation = Just (Type.namedWith [] "Error" []) - } - ) - [ ar0 ] - , exportIsNotFunction = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "ExportIsNotFunction" - , annotation = Just (Type.namedWith [] "Error" []) - } - , decodeError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "DecodeError" - , annotation = Just (Type.namedWith [] "Error" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { error = - \errorExpression errorTags -> - Elm.Case.custom - errorExpression - (Type.namedWith [ "BackendTask", "Custom" ] "Error" []) - [ Elm.Case.branch - (Elm.Arg.customType "Error" errorTags.error) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ErrorInCustomBackendTaskFile" - errorTags.errorInCustomBackendTaskFile - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "MissingCustomBackendTaskFile" - errorTags.missingCustomBackendTaskFile - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "CustomBackendTaskNotDefined" - errorTags.customBackendTaskNotDefined |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.record - [ ( "name" - , Type.string - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "CustomBackendTaskException" - errorTags.customBackendTaskException |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NonJsonException" - errorTags.nonJsonException |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExportIsNotFunction" - errorTags.exportIsNotFunction - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "DecodeError" - errorTags.decodeError |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeError" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Error" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { run : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { run = - \runArg_ runArg_0 runArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Custom" ] - "Error" - [] - ) - ] - , Type.var "b" - ] - ) - ) - } - ) - [ runArg_, runArg_0, runArg_1 ] - } - - -values_ : - { run : Elm.Expression - , timeDecoder : Elm.Expression - , dateDecoder : Elm.Expression - } -values_ = - { run = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Custom" ] - "Error" - [] - ) - ] - , Type.var "b" - ] - ) - ) - } - , timeDecoder = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "timeDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Time" ] "Posix" [] ] - ) - } - , dateDecoder = - Elm.value - { importFrom = [ "BackendTask", "Custom" ] - , name = "dateDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Date" ] "Date" [] ] - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Do.elm b/codegen/Gen/BackendTask/Do.elm deleted file mode 100644 index 8c7a6f0c..00000000 --- a/codegen/Gen/BackendTask/Do.elm +++ /dev/null @@ -1,1198 +0,0 @@ -module Gen.BackendTask.Do exposing - ( moduleName_, do, allowFatal, noop, exec, command - , glob, log, env, each, failIf, call_, values_ - ) - -{-| -# Generated bindings for BackendTask.Do - -@docs moduleName_, do, allowFatal, noop, exec, command -@docs glob, log, env, each, failIf, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Do" ] - - -{-| Use any `BackendTask` into a continuation-style task. - - example : BackendTask FatalError () - example = - do - (Script.question "What is your name? ") - <| - \name -> - \() -> - Script.log ("Hello " ++ name ++ "!") - -do: - BackendTask.BackendTask error a - -> (a -> BackendTask.BackendTask error b) - -> BackendTask.BackendTask error b --} -do : Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -do doArg_ doArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "do" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "a" ] - , Type.function - [ Type.var "a" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ) - } - ) - [ doArg_, Elm.functionReduced "doUnpack" doArg_0 ] - - -{-| Same as [`do`](#do), but with a shorthand to call `BackendTask.allowFatal` on it. - - import BackendTask exposing (BackendTask) - import FatalError exposing (FatalError) - import BackendTask.File as BackendTask.File - import BackendTask.Do exposing (allowFatal, do) - - example : BackendTask FatalError () - example = - do (BackendTask.File.rawFile "post-1.md" |> BackendTask.allowFatal) <| - \post1 -> - allowFatal (BackendTask.File.rawFile "post-2.md") <| - \post2 -> - Script.log (post1 ++ "\n\n" ++ post2) - -allowFatal: - BackendTask.BackendTask { error | fatal : FatalError.FatalError } data - -> (data -> BackendTask.BackendTask FatalError.FatalError b) - -> BackendTask.BackendTask FatalError.FatalError b --} -allowFatal : - Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -allowFatal allowFatalArg_ allowFatalArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "allowFatal" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.extensible - "error" - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - ] - , Type.var "data" - ] - , Type.function - [ Type.var "data" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - ) - [ allowFatalArg_ - , Elm.functionReduced "allowFatalUnpack" allowFatalArg_0 - ] - - -{-| A `BackendTask` that does nothing. Defined as `BackendTask.succeed ()`. - -It's a useful shorthand for when you want to end a continuation chain. - - example : BackendTask FatalError () - example = - exec "ls" [ "-l" ] <| - \() -> - log "Hello, world!" <| - \() -> - noop - -noop: BackendTask.BackendTask error () --} -noop : Elm.Expression -noop = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "noop" - , annotation = - Just - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - } - - -{-| A do-style helper for [`Script.exec`](Pages-Script#exec). - -exec: - String - -> List String - -> (() -> BackendTask.BackendTask FatalError.FatalError b) - -> BackendTask.BackendTask FatalError.FatalError b --} -exec : - String - -> List String - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression -exec execArg_ execArg_0 execArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string - , Type.list Type.string - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.string execArg_ - , Elm.list (List.map Elm.string execArg_0) - , Elm.functionReduced "execUnpack" execArg_1 - ] - - -{-| A do-style helper for [`Script.command`](Pages-Script#command). - -command: - String - -> List String - -> (String -> BackendTask.BackendTask FatalError.FatalError b) - -> BackendTask.BackendTask FatalError.FatalError b --} -command : - String - -> List String - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression -command commandArg_ commandArg_0 commandArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string - , Type.list Type.string - , Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.string commandArg_ - , Elm.list (List.map Elm.string commandArg_0) - , Elm.functionReduced "commandUnpack" commandArg_1 - ] - - -{-| A continuation-style helper for [`Glob.fromString`](BackendTask-Glob#fromString). - -In a shell script, you can think of this as a stand-in for globbing files directly within a command. The [`BackendTask.Stream.command`](BackendTask-Stream#command) -which lets you run shell commands sanitizes and escapes all arguments passed, and does not do glob expansion, so this is helpful for translating -a shell script to Elm. - -This example passes a list of matching file paths along to an `rm -f` command. - - example : BackendTask FatalError () - example = - glob "src/**/*.elm" <| - \elmFiles -> - log ("Going to delete " ++ String.fromInt (List.length elmFiles) ++ " Elm files") <| - \() -> - exec "rm" ("-f" :: elmFiles) <| - \() -> - noop - -glob: - String - -> (List String -> BackendTask.BackendTask FatalError.FatalError a) - -> BackendTask.BackendTask FatalError.FatalError a --} -glob : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -glob globArg_ globArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "glob" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "a" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "a" - ] - ) - ) - } - ) - [ Elm.string globArg_, Elm.functionReduced "globUnpack" globArg_0 ] - - -{-| A do-style helper for [`Script.log`](Pages-Script#log). - - example : BackendTask FatalError () - example = - log "Starting script..." <| - \() -> - -- ... - log "Done!" <| - \() -> - noop - -log: - String - -> (() -> BackendTask.BackendTask error b) - -> BackendTask.BackendTask error b --} -log : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -log logArg_ logArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ) - } - ) - [ Elm.string logArg_, Elm.functionReduced "logUnpack" logArg_0 ] - - -{-| A do-style helper for [`Env.expect`](BackendTask-Env#expect). - - example : BackendTask FatalError () - example = - env "API_KEY" <| - \apiKey -> - allowFatal (apiRequest apiKey) <| - \() -> - noop - -env: - String - -> (String -> BackendTask.BackendTask FatalError.FatalError b) - -> BackendTask.BackendTask FatalError.FatalError b --} -env : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -env envArg_ envArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "env" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.string envArg_, Elm.functionReduced "envUnpack" envArg_0 ] - - -{-| checkCompilationInDir : String -> BackendTask FatalError () - checkCompilationInDir dir = - glob (dir ++ "/**/*.elm") <| - \elmFiles -> - each elmFiles - (\elmFile -> - Shell.sh "elm" [ "make", elmFile, "--output", "/dev/null" ] - |> BackendTask.quiet - ) - <| - \_ -> - noop - -each: - List a - -> (a -> BackendTask.BackendTask error b) - -> (List b -> BackendTask.BackendTask error c) - -> BackendTask.BackendTask error c --} -each : - List Elm.Expression - -> (Elm.Expression -> Elm.Expression) - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression -each eachArg_ eachArg_0 eachArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "each" - , annotation = - Just - (Type.function - [ Type.list (Type.var "a") - , Type.function - [ Type.var "a" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - , Type.function - [ Type.list (Type.var "b") ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "c" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "c" ] - ) - ) - } - ) - [ Elm.list eachArg_ - , Elm.functionReduced "eachUnpack" eachArg_0 - , Elm.functionReduced "eachUnpack" eachArg_1 - ] - - -{-| A do-style helper for [`BackendTask.failIf`](BackendTask#failIf). - -failIf: - Bool - -> FatalError.FatalError - -> (() -> BackendTask.BackendTask FatalError.FatalError b) - -> BackendTask.BackendTask FatalError.FatalError b --} -failIf : - Bool - -> Elm.Expression - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression -failIf failIfArg_ failIfArg_0 failIfArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "failIf" - , annotation = - Just - (Type.function - [ Type.bool - , Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.bool failIfArg_ - , failIfArg_0 - , Elm.functionReduced "failIfUnpack" failIfArg_1 - ] - - -call_ : - { do : Elm.Expression -> Elm.Expression -> Elm.Expression - , allowFatal : Elm.Expression -> Elm.Expression -> Elm.Expression - , exec : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , command : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , glob : Elm.Expression -> Elm.Expression -> Elm.Expression - , log : Elm.Expression -> Elm.Expression -> Elm.Expression - , env : Elm.Expression -> Elm.Expression -> Elm.Expression - , each : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , failIf : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { do = - \doArg_ doArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "do" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "a" ] - , Type.function - [ Type.var "a" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ) - } - ) - [ doArg_, doArg_0 ] - , allowFatal = - \allowFatalArg_ allowFatalArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "allowFatal" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.extensible - "error" - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - ] - , Type.var "data" - ] - , Type.function - [ Type.var "data" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ) - } - ) - [ allowFatalArg_, allowFatalArg_0 ] - , exec = - \execArg_ execArg_0 execArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string - , Type.list Type.string - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ) - } - ) - [ execArg_, execArg_0, execArg_1 ] - , command = - \commandArg_ commandArg_0 commandArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string - , Type.list Type.string - , Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ) - } - ) - [ commandArg_, commandArg_0, commandArg_1 ] - , glob = - \globArg_ globArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "glob" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "a" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "a" - ] - ) - ) - } - ) - [ globArg_, globArg_0 ] - , log = - \logArg_ logArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ) - } - ) - [ logArg_, logArg_0 ] - , env = - \envArg_ envArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "env" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ) - } - ) - [ envArg_, envArg_0 ] - , each = - \eachArg_ eachArg_0 eachArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "each" - , annotation = - Just - (Type.function - [ Type.list (Type.var "a") - , Type.function - [ Type.var "a" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - , Type.function - [ Type.list (Type.var "b") ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "c" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "c" ] - ) - ) - } - ) - [ eachArg_, eachArg_0, eachArg_1 ] - , failIf = - \failIfArg_ failIfArg_0 failIfArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "failIf" - , annotation = - Just - (Type.function - [ Type.bool - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ) - } - ) - [ failIfArg_, failIfArg_0, failIfArg_1 ] - } - - -values_ : - { do : Elm.Expression - , allowFatal : Elm.Expression - , noop : Elm.Expression - , exec : Elm.Expression - , command : Elm.Expression - , glob : Elm.Expression - , log : Elm.Expression - , env : Elm.Expression - , each : Elm.Expression - , failIf : Elm.Expression - } -values_ = - { do = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "do" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "a" ] - , Type.function - [ Type.var "a" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ) - } - , allowFatal = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "allowFatal" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.extensible - "error" - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - ] - , Type.var "data" - ] - , Type.function - [ Type.var "data" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - , noop = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "noop" - , annotation = - Just - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - } - , exec = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string - , Type.list Type.string - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - , command = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string - , Type.list Type.string - , Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - , glob = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "glob" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "a" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "a" - ] - ) - ) - } - , log = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - ) - } - , env = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "env" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - , each = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "each" - , annotation = - Just - (Type.function - [ Type.list (Type.var "a") - , Type.function - [ Type.var "a" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "b" ] - ) - , Type.function - [ Type.list (Type.var "b") ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "c" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "c" ] - ) - ) - } - , failIf = - Elm.value - { importFrom = [ "BackendTask", "Do" ] - , name = "failIf" - , annotation = - Just - (Type.function - [ Type.bool - , Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.function - [ Type.unit ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "b" - ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "b" - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Env.elm b/codegen/Gen/BackendTask/Env.elm deleted file mode 100644 index 1ada4874..00000000 --- a/codegen/Gen/BackendTask/Env.elm +++ /dev/null @@ -1,252 +0,0 @@ -module Gen.BackendTask.Env exposing - ( moduleName_, get, expect, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for BackendTask.Env - -@docs moduleName_, get, expect, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Env" ] - - -{-| Get an environment variable, or Nothing if there is no environment variable matching that name. This `BackendTask` -will never fail, but instead will return `Nothing` if the environment variable is missing. - -get: String -> BackendTask.BackendTask error (Maybe String) --} -get : String -> Elm.Expression -get getArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.maybe Type.string ] - ) - ) - } - ) - [ Elm.string getArg_ ] - - -{-| Get an environment variable, or a BackendTask FatalError if there is no environment variable matching that name. - -expect: - String - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.Env.Error - } String --} -expect : String -> Elm.Expression -expect expectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "expect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Env" ] - "Error" - [] - ) - ] - , Type.string - ] - ) - ) - } - ) - [ Elm.string expectArg_ ] - - -annotation_ : { error : Type.Annotation } -annotation_ = - { error = Type.namedWith [ "BackendTask", "Env" ] "Error" [] } - - -make_ : { missingEnvVariable : Elm.Expression -> Elm.Expression } -make_ = - { missingEnvVariable = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "MissingEnvVariable" - , annotation = Just (Type.namedWith [] "Error" []) - } - ) - [ ar0 ] - } - - -caseOf_ : - { error : - Elm.Expression - -> { missingEnvVariable : Elm.Expression -> Elm.Expression } - -> Elm.Expression - } -caseOf_ = - { error = - \errorExpression errorTags -> - Elm.Case.custom - errorExpression - (Type.namedWith [ "BackendTask", "Env" ] "Error" []) - [ Elm.Case.branch - (Elm.Arg.customType - "MissingEnvVariable" - errorTags.missingEnvVariable |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - ] - } - - -call_ : - { get : Elm.Expression -> Elm.Expression - , expect : Elm.Expression -> Elm.Expression - } -call_ = - { get = - \getArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.maybe Type.string - ] - ) - ) - } - ) - [ getArg_ ] - , expect = - \expectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "expect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Env" ] - "Error" - [] - ) - ] - , Type.string - ] - ) - ) - } - ) - [ expectArg_ ] - } - - -values_ : { get : Elm.Expression, expect : Elm.Expression } -values_ = - { get = - Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.maybe Type.string ] - ) - ) - } - , expect = - Elm.value - { importFrom = [ "BackendTask", "Env" ] - , name = "expect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Env" ] - "Error" - [] - ) - ] - , Type.string - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/File.elm b/codegen/Gen/BackendTask/File.elm deleted file mode 100644 index 7d35b195..00000000 --- a/codegen/Gen/BackendTask/File.elm +++ /dev/null @@ -1,981 +0,0 @@ -module Gen.BackendTask.File exposing - ( moduleName_, bodyWithFrontmatter, bodyWithoutFrontmatter, onlyFrontmatter, jsonFile, rawFile - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for BackendTask.File - -@docs moduleName_, bodyWithFrontmatter, bodyWithoutFrontmatter, onlyFrontmatter, jsonFile, rawFile -@docs annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "File" ] - - -{-| import BackendTask exposing (BackendTask) - import BackendTask.File as File - import FatalError exposing (FatalError) - import Json.Decode as Decode exposing (Decoder) - - blogPost : BackendTask FatalError BlogPostMetadata - blogPost = - File.bodyWithFrontmatter blogPostDecoder - "blog/hello-world.md" - |> BackendTask.allowFatal - - type alias BlogPostMetadata = - { body : String - , title : String - , tags : List String - } - - blogPostDecoder : String -> Decoder BlogPostMetadata - blogPostDecoder body = - Decode.map2 (BlogPostMetadata body) - (Decode.field "title" Decode.string) - (Decode.field "tags" tagsDecoder) - - tagsDecoder : Decoder (List String) - tagsDecoder = - Decode.map (String.split " ") - Decode.string - -This will give us a BackendTask that results in the following value: - - value = - { body = "Hey there! This is my first post :)" - , title = "Hello, World!" - , tags = [ "elm" ] - } - -It's common to parse the body with a markdown parser or other format. - - import BackendTask exposing (BackendTask) - import BackendTask.File as File - import FatalError exposing (FatalError) - import Html exposing (Html) - import Json.Decode as Decode - - example : - BackendTask - FatalError - { title : String - , body : List (Html msg) - } - example = - File.bodyWithFrontmatter - (\markdownString -> - Decode.map2 - (\title renderedMarkdown -> - { title = title - , body = renderedMarkdown - } - ) - (Decode.field "title" Decode.string) - (markdownString - |> markdownToView - |> Decode.fromResult - ) - ) - "foo.md" - |> BackendTask.allowFatal - - markdownToView : - String - -> Result String (List (Html msg)) - markdownToView markdownString = - markdownString - |> Markdown.Parser.parse - |> Result.mapError (\_ -> "Markdown error.") - |> Result.andThen - (\blocks -> - Markdown.Renderer.render - Markdown.Renderer.defaultHtmlRenderer - blocks - ) - -bodyWithFrontmatter: - (String -> Json.Decode.Decoder frontmatter) - -> String - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.File.FileReadError Json.Decode.Error - } frontmatter --} -bodyWithFrontmatter : - (Elm.Expression -> Elm.Expression) -> String -> Elm.Expression -bodyWithFrontmatter bodyWithFrontmatterArg_ bodyWithFrontmatterArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "bodyWithFrontmatter" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "frontmatter" ] - ) - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "frontmatter" - ] - ) - ) - } - ) - [ Elm.functionReduced - "bodyWithFrontmatterUnpack" - bodyWithFrontmatterArg_ - , Elm.string bodyWithFrontmatterArg_0 - ] - - -{-| Same as `bodyWithFrontmatter` except it doesn't include the frontmatter. - -For example, if you have a file called `blog/hello-world.md` with - -```markdown ---- -title: Hello, World! -tags: elm ---- -Hey there! This is my first post :) -``` - - import BackendTask exposing (BackendTask) - import BackendTask.File as File - import FatalError exposing (FatalError) - - data : BackendTask FatalError String - data = - File.bodyWithoutFrontmatter "blog/hello-world.md" - |> BackendTask.allowFatal - -Then data will yield the value `"Hey there! This is my first post :)"`. - -bodyWithoutFrontmatter: - String - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.File.FileReadError decoderError - } String --} -bodyWithoutFrontmatter : String -> Elm.Expression -bodyWithoutFrontmatter bodyWithoutFrontmatterArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "bodyWithoutFrontmatter" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoderError" ] - ) - ] - , Type.string - ] - ) - ) - } - ) - [ Elm.string bodyWithoutFrontmatterArg_ ] - - -{-| Same as `bodyWithFrontmatter` except it doesn't include the body. - -This is often useful when you're aggregating data, for example getting a listing of blog posts and need to extract -just the metadata. - - import BackendTask exposing (BackendTask) - import BackendTask.File as File - import FatalError exposing (FatalError) - import Json.Decode as Decode exposing (Decoder) - - blogPost : BackendTask FatalError BlogPostMetadata - blogPost = - File.onlyFrontmatter - blogPostDecoder - "blog/hello-world.md" - |> BackendTask.allowFatal - - type alias BlogPostMetadata = - { title : String - , tags : List String - } - - blogPostDecoder : Decoder BlogPostMetadata - blogPostDecoder = - Decode.map2 BlogPostMetadata - (Decode.field "title" Decode.string) - (Decode.field "tags" (Decode.list Decode.string)) - -If you wanted to use this to get this metadata for all blog posts in a folder, you could use -the [`BackendTask`](BackendTask) API along with [`BackendTask.Glob`](BackendTask-Glob). - - import BackendTask exposing (BackendTask) - import BackendTask.File as File - import Decode exposing (Decoder) - - blogPostFiles : BackendTask (List String) - blogPostFiles = - Glob.succeed identity - |> Glob.captureFilePath - |> Glob.match (Glob.literal "content/blog/") - |> Glob.match Glob.wildcard - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - - allMetadata : BackendTask (List BlogPostMetadata) - allMetadata = - blogPostFiles - |> BackendTask.map - (List.map - (File.onlyFrontmatter - blogPostDecoder - ) - ) - |> BackendTask.resolve - -onlyFrontmatter: - Json.Decode.Decoder frontmatter - -> String - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.File.FileReadError Json.Decode.Error - } frontmatter --} -onlyFrontmatter : Elm.Expression -> String -> Elm.Expression -onlyFrontmatter onlyFrontmatterArg_ onlyFrontmatterArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "onlyFrontmatter" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "frontmatter" ] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "frontmatter" - ] - ) - ) - } - ) - [ onlyFrontmatterArg_, Elm.string onlyFrontmatterArg_0 ] - - -{-| Read a file as JSON. - -The Decode will strip off any unused JSON data. - - import BackendTask exposing (BackendTask) - import BackendTask.File as File - import FatalError exposing (FatalError) - import Json.Decode as Decode - - sourceDirectories : BackendTask FatalError (List String) - sourceDirectories = - File.jsonFile - (Decode.field - "source-directories" - (Decode.list Decode.string) - ) - "elm.json" - |> BackendTask.allowFatal - -jsonFile: - Json.Decode.Decoder a - -> String - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.File.FileReadError Json.Decode.Error - } a --} -jsonFile : Elm.Expression -> String -> Elm.Expression -jsonFile jsonFileArg_ jsonFileArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "jsonFile" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "a" - ] - ) - ) - } - ) - [ jsonFileArg_, Elm.string jsonFileArg_0 ] - - -{-| Get the raw file content. Unlike the frontmatter helpers in this module, this function will not strip off frontmatter if there is any. - -This is the function you want if you are reading in a file directly. For example, if you read in a CSV file, a raw text file, or any other file that doesn't -have frontmatter. - -There's a special function for reading in JSON files, [`jsonFile`](#jsonFile). If you're reading a JSON file then be sure to -use `jsonFile` to get the benefits of the `Decode` here. - -You could read a file called `hello.txt` in your root project directory like this: - - import BackendTask exposing (BackendTask) - import BackendTask.File as File - import FatalError exposing (FatalError) - - elmJsonFile : BackendTask FatalError String - elmJsonFile = - File.rawFile "hello.txt" - |> BackendTask.allowFatal - -rawFile: - String - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.File.FileReadError decoderError - } String --} -rawFile : String -> Elm.Expression -rawFile rawFileArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "rawFile" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoderError" ] - ) - ] - , Type.string - ] - ) - ) - } - ) - [ Elm.string rawFileArg_ ] - - -annotation_ : { fileReadError : Type.Annotation -> Type.Annotation } -annotation_ = - { fileReadError = - \fileReadErrorArg0 -> - Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ fileReadErrorArg0 ] - } - - -make_ : - { fileDoesntExist : Elm.Expression - , fileReadError : Elm.Expression -> Elm.Expression - , decodingError : Elm.Expression -> Elm.Expression - } -make_ = - { fileDoesntExist = - Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "FileDoesntExist" - , annotation = - Just (Type.namedWith [] "FileReadError" [ Type.var "decoding" ]) - } - , fileReadError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "FileReadError" - , annotation = - Just - (Type.namedWith - [] - "FileReadError" - [ Type.var "decoding" ] - ) - } - ) - [ ar0 ] - , decodingError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "DecodingError" - , annotation = - Just - (Type.namedWith - [] - "FileReadError" - [ Type.var "decoding" ] - ) - } - ) - [ ar0 ] - } - - -caseOf_ : - { fileReadError : - Elm.Expression - -> { fileDoesntExist : Elm.Expression - , fileReadError : Elm.Expression -> Elm.Expression - , decodingError : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { fileReadError = - \fileReadErrorExpression fileReadErrorTags -> - Elm.Case.custom - fileReadErrorExpression - (Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoding" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "FileDoesntExist" - fileReadErrorTags.fileDoesntExist - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FileReadError" - fileReadErrorTags.fileReadError |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "DecodingError" - fileReadErrorTags.decodingError |> Elm.Arg.item - (Elm.Arg.varWith - "decoding" - (Type.var - "decoding" - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { bodyWithFrontmatter : Elm.Expression -> Elm.Expression -> Elm.Expression - , bodyWithoutFrontmatter : Elm.Expression -> Elm.Expression - , onlyFrontmatter : Elm.Expression -> Elm.Expression -> Elm.Expression - , jsonFile : Elm.Expression -> Elm.Expression -> Elm.Expression - , rawFile : Elm.Expression -> Elm.Expression - } -call_ = - { bodyWithFrontmatter = - \bodyWithFrontmatterArg_ bodyWithFrontmatterArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "bodyWithFrontmatter" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "frontmatter" ] - ) - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "frontmatter" - ] - ) - ) - } - ) - [ bodyWithFrontmatterArg_, bodyWithFrontmatterArg_0 ] - , bodyWithoutFrontmatter = - \bodyWithoutFrontmatterArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "bodyWithoutFrontmatter" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoderError" ] - ) - ] - , Type.string - ] - ) - ) - } - ) - [ bodyWithoutFrontmatterArg_ ] - , onlyFrontmatter = - \onlyFrontmatterArg_ onlyFrontmatterArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "onlyFrontmatter" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "frontmatter" ] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "frontmatter" - ] - ) - ) - } - ) - [ onlyFrontmatterArg_, onlyFrontmatterArg_0 ] - , jsonFile = - \jsonFileArg_ jsonFileArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "jsonFile" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "a" - ] - ) - ) - } - ) - [ jsonFileArg_, jsonFileArg_0 ] - , rawFile = - \rawFileArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "rawFile" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoderError" ] - ) - ] - , Type.string - ] - ) - ) - } - ) - [ rawFileArg_ ] - } - - -values_ : - { bodyWithFrontmatter : Elm.Expression - , bodyWithoutFrontmatter : Elm.Expression - , onlyFrontmatter : Elm.Expression - , jsonFile : Elm.Expression - , rawFile : Elm.Expression - } -values_ = - { bodyWithFrontmatter = - Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "bodyWithFrontmatter" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "frontmatter" ] - ) - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "frontmatter" - ] - ) - ) - } - , bodyWithoutFrontmatter = - Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "bodyWithoutFrontmatter" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoderError" ] - ) - ] - , Type.string - ] - ) - ) - } - , onlyFrontmatter = - Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "onlyFrontmatter" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "frontmatter" ] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "frontmatter" - ] - ) - ) - } - , jsonFile = - Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "jsonFile" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - ] - ) - ] - , Type.var "a" - ] - ) - ) - } - , rawFile = - Elm.value - { importFrom = [ "BackendTask", "File" ] - , name = "rawFile" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "File" ] - "FileReadError" - [ Type.var "decoderError" ] - ) - ] - , Type.string - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Glob.elm b/codegen/Gen/BackendTask/Glob.elm deleted file mode 100644 index 3e71274b..00000000 --- a/codegen/Gen/BackendTask/Glob.elm +++ /dev/null @@ -1,2137 +0,0 @@ -module Gen.BackendTask.Glob exposing - ( moduleName_, capture, match, fromString, fromStringWithOptions, captureFilePath - , wildcard, recursiveWildcard, int, digits, captureStats, expectUniqueMatch, expectUniqueMatchFromList - , literal, map, succeed, oneOf, zeroOrMore, atLeastOne, toBackendTask - , toBackendTaskWithOptions, defaultOptions, annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for BackendTask.Glob - -@docs moduleName_, capture, match, fromString, fromStringWithOptions, captureFilePath -@docs wildcard, recursiveWildcard, int, digits, captureStats, expectUniqueMatch -@docs expectUniqueMatchFromList, literal, map, succeed, oneOf, zeroOrMore -@docs atLeastOne, toBackendTask, toBackendTaskWithOptions, defaultOptions, annotation_, make_ -@docs caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Glob" ] - - -{-| Adds on to the glob pattern, and captures it in the resulting Elm match value. That means this both changes which -files will match, and gives you the sub-match as Elm data for each matching file. - -Exactly the same as `match` except it also captures the matched sub-pattern. - - type alias ArchivesArticle = - { year : String - , month : String - , day : String - , slug : String - } - - archives : BackendTask error ArchivesArticle - archives = - Glob.succeed ArchivesArticle - |> Glob.match (Glob.literal "archive/") - |> Glob.capture Glob.int - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.int - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.int - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - -The file `archive/1977/06/10/apple-2-released.md` will give us this match: - - matches : List error ArchivesArticle - matches = - BackendTask.succeed - [ { year = 1977 - , month = 6 - , day = 10 - , slug = "apple-2-released" - } - ] - -When possible, it's best to grab data and turn it into structured Elm data when you have it. That way, -you don't end up with duplicate validation logic and data normalization, and your code will be more robust. - -If you only care about getting the full matched file paths, you can use `match`. `capture` is very useful because -you can pick apart structured data as you build up your glob pattern. This follows the principle of -[Parse, Don't Validate](https://elm-radio.com/episode/parse-dont-validate/). - -capture: - BackendTask.Glob.Glob a - -> BackendTask.Glob.Glob (a -> value) - -> BackendTask.Glob.Glob value --} -capture : Elm.Expression -> Elm.Expression -> Elm.Expression -capture captureArg_ captureArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "capture" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function - [ Type.var "a" ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ captureArg_, captureArg_0 ] - - -{-| Adds on to the glob pattern, but does not capture it in the resulting Elm match value. That means this changes which -files will match, but does not change the Elm data type you get for each matching file. - -Exactly the same as `capture` except it doesn't capture the matched sub-pattern. - -match: - BackendTask.Glob.Glob a - -> BackendTask.Glob.Glob value - -> BackendTask.Glob.Glob value --} -match : Elm.Expression -> Elm.Expression -> Elm.Expression -match matchArg_ matchArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "match" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ matchArg_, matchArg_0 ] - - -{-| Runs a glob string directly, with `include = FilesAndFolders`. Behavior is similar to using glob patterns in a shell. - -If you need to capture specific parts of the path, you can use `capture` and `match` functions instead. `fromString` -only allows you to capture a list of matching file paths. - -The following glob syntax is supported: - - - `*` matches any number of characters except for `/` - - `**` matches any number of characters including `/` - -For example, if we have the following files: - -```shell -- src/ - - Main.elm - - Ui/ - - Icon.elm -- content/ - - blog/ - - first-post.md - - second-post.md -``` - - import BackendTask.Glob as Glob - - blogPosts : BackendTask error (List String) - blogPosts = - Glob.fromString "content/blog/*.md" - - --> BackendTask.succeed [ "content/blog/first-post.md", "content/blog/second-post.md" ] - elmFiles : BackendTask error (List String) - elmFiles = - Glob.fromString "src/**/*.elm" - - --> BackendTask.succeed [ "src/Main.elm", "src/Ui", "src/Ui/Icon.elm" ] - -fromString: String -> BackendTask.BackendTask error (List String) --} -fromString : String -> Elm.Expression -fromString fromStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - ) - } - ) - [ Elm.string fromStringArg_ ] - - -{-| Same as [`fromString`](#fromString), but with custom [`Options`](#Options). - -fromStringWithOptions: - BackendTask.Glob.Options - -> String - -> BackendTask.BackendTask error (List String) --} -fromStringWithOptions : Elm.Expression -> String -> Elm.Expression -fromStringWithOptions fromStringWithOptionsArg_ fromStringWithOptionsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "fromStringWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Options" - [] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - ) - } - ) - [ fromStringWithOptionsArg_, Elm.string fromStringWithOptionsArg_0 ] - - -{-| import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - blogPosts : - BackendTask - error - (List - { filePath : String - , slug : String - } - ) - blogPosts = - Glob.succeed - (\filePath slug -> - { filePath = filePath - , slug = slug - } - ) - |> Glob.captureFilePath - |> Glob.match (Glob.literal "content/blog/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - -This function does not change which files will or will not match. It just gives you the full matching -file path in your `Glob` pipeline. - -Whenever possible, it's a good idea to use function to make sure you have an accurate file path when you need to read a file. - -captureFilePath: BackendTask.Glob.Glob (String -> value) -> BackendTask.Glob.Glob value --} -captureFilePath : Elm.Expression -> Elm.Expression -captureFilePath captureFilePathArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "captureFilePath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function [ Type.string ] (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ captureFilePathArg_ ] - - -{-| Matches anything except for a `/` in a file path. You may be familiar with this syntax from shells like bash -where you can run commands like `rm client/*.js` to remove all `.js` files in the `client` directory. - -Just like a `*` glob pattern in bash, this `Glob.wildcard` function will only match within a path part. If you need to -match 0 or more path parts like, see `recursiveWildcard`. - - import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - type alias BlogPost = - { year : String - , month : String - , day : String - , slug : String - } - - example : BackendTask error (List BlogPost) - example = - Glob.succeed BlogPost - |> Glob.match (Glob.literal "blog/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal "-") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal "-") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - -```shell - -- blog/ - - 2021-05-27/ - - first-post.md -``` - -That will match to: - - results : BackendTask error (List BlogPost) - results = - BackendTask.succeed - [ { year = "2021" - , month = "05" - , day = "27" - , slug = "first-post" - } - ] - -Note that we can "destructure" the date part of this file path in the format `yyyy-mm-dd`. The `wildcard` matches -will match _within_ a path part (think between the slashes of a file path). `recursiveWildcard` can match across path parts. - -wildcard: BackendTask.Glob.Glob String --} -wildcard : Elm.Expression -wildcard = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "wildcard" - , annotation = - Just - (Type.namedWith [ "BackendTask", "Glob" ] "Glob" [ Type.string ] - ) - } - - -{-| Matches any number of characters, including `/`, as long as it's the only thing in a path part. - -In contrast, `wildcard` will never match `/`, so it only matches within a single path part. - -This is the elm-pages equivalent of `**/*.txt` in standard shell syntax: - - import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - example : BackendTask error (List ( List String, String )) - example = - Glob.succeed Tuple.pair - |> Glob.match (Glob.literal "articles/") - |> Glob.capture Glob.recursiveWildcard - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".txt") - |> Glob.toBackendTask - -With these files: - -```shell -- articles/ - - google-io-2021-recap.txt - - archive/ - - 1977/ - - 06/ - - 10/ - - apple-2-announced.txt -``` - -We would get the following matches: - - matches : BackendTask error (List ( List String, String )) - matches = - BackendTask.succeed - [ ( [ "archive", "1977", "06", "10" ], "apple-2-announced" ) - , ( [], "google-io-2021-recap" ) - ] - -Note that the recursive wildcard conveniently gives us a `List String`, where -each String is a path part with no slashes (like `archive`). - -And also note that it matches 0 path parts into an empty list. - -If we didn't include the `wildcard` after the `recursiveWildcard`, then we would only get -a single level of matches because it is followed by a file extension. - - example : BackendTask error (List String) - example = - Glob.succeed identity - |> Glob.match (Glob.literal "articles/") - |> Glob.capture Glob.recursiveWildcard - |> Glob.match (Glob.literal ".txt") - - matches : BackendTask error (List String) - matches = - BackendTask.succeed - [ "google-io-2021-recap" - ] - -This is usually not what is intended. Using `recursiveWildcard` is usually followed by a `wildcard` for this reason. - -recursiveWildcard: BackendTask.Glob.Glob (List String) --} -recursiveWildcard : Elm.Expression -recursiveWildcard = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "recursiveWildcard" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.list Type.string ] - ) - } - - -{-| Same as [`digits`](#digits), but it safely turns the digits String into an `Int`. - -Leading 0's are ignored. - - import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - slides : BackendTask error (List Int) - slides = - Glob.succeed identity - |> Glob.match (Glob.literal "slide-") - |> Glob.capture Glob.int - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - -With files - -```shell -- slide-no-match.md -- slide-.md -- slide-1.md -- slide-01.md -- slide-2.md -- slide-03.md -- slide-4.md -- slide-05.md -- slide-06.md -- slide-007.md -- slide-08.md -- slide-09.md -- slide-10.md -- slide-11.md -``` - -Yields - - matches : BackendTask error (List Int) - matches = - BackendTask.succeed - [ 1 - , 1 - , 2 - , 3 - , 4 - , 5 - , 6 - , 7 - , 8 - , 9 - , 10 - , 11 - ] - -Note that neither `slide-no-match.md` nor `slide-.md` match. -And both `slide-1.md` and `slide-01.md` match and turn into `1`. - -int: BackendTask.Glob.Glob Int --} -int : Elm.Expression -int = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "int" - , annotation = - Just (Type.namedWith [ "BackendTask", "Glob" ] "Glob" [ Type.int ]) - } - - -{-| This is similar to [`wildcard`](#wildcard), but it will only match 1 or more digits (i.e. `[0-9]+`). - -See [`int`](#int) for a convenience function to get an Int value instead of a String of digits. - -digits: BackendTask.Glob.Glob String --} -digits : Elm.Expression -digits = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "digits" - , annotation = - Just - (Type.namedWith [ "BackendTask", "Glob" ] "Glob" [ Type.string ] - ) - } - - -{-| import BackendTask.Glob as Glob - - recentlyChangedRouteModules : BackendTask error (List ( Time.Posix, List String )) - recentlyChangedRouteModules = - Glob.succeed - (\fileStats directoryName fileName -> - ( fileStats.lastContentChange - , directoryName ++ [ fileName ] - ) - ) - |> Glob.captureStats - |> Glob.match (Glob.literal "app/Route/") - |> Glob.capture Glob.recursiveWildcard - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".elm") - |> Glob.toBackendTask - |> BackendTask.map - (\entries -> - entries - |> List.sortBy (\( lastChanged, _ ) -> Time.posixToMillis lastChanged) - |> List.reverse - ) - -captureStats: - BackendTask.Glob.Glob (BackendTask.Glob.FileStats -> value) - -> BackendTask.Glob.Glob value --} -captureStats : Elm.Expression -> Elm.Expression -captureStats captureStatsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "captureStats" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "FileStats" - [] - ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ captureStatsArg_ ] - - -{-| Sometimes you want to make sure there is a unique file matching a particular pattern. -This is a simple helper that will give you a `BackendTask` error if there isn't exactly 1 matching file. -If there is exactly 1, then you successfully get back that single match. - -For example, maybe you can have - - import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - findBlogBySlug : String -> BackendTask FatalError String - findBlogBySlug slug = - Glob.succeed identity - |> Glob.captureFilePath - |> Glob.match (Glob.literal "blog/") - |> Glob.match (Glob.literal slug) - |> Glob.match - (Glob.oneOf - ( ( "", () ) - , [ ( "/index", () ) ] - ) - ) - |> Glob.match (Glob.literal ".md") - |> Glob.expectUniqueMatch - |> BackendTask.allowFatal - -If we used `findBlogBySlug "first-post"` with these files: - -```markdown -- blog/ - - first-post/ - - index.md -``` - -This would give us: - - results : BackendTask FatalError String - results = - BackendTask.succeed "blog/first-post/index.md" - -If we used `findBlogBySlug "first-post"` with these files: - -```markdown -- blog/ - - first-post.md - - first-post/ - - index.md -``` - -Then we will get a `BackendTask` error saying `More than one file matched.` Keep in mind that `BackendTask` failures -in build-time routes will cause a build failure, giving you the opportunity to fix the problem before users see the issue, -so it's ideal to make this kind of assertion rather than having fallback behavior that could silently cover up -issues (like if we had instead ignored the case where there are two or more matching blog post files). - -expectUniqueMatch: - BackendTask.Glob.Glob a - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : String - } a --} -expectUniqueMatch : Elm.Expression -> Elm.Expression -expectUniqueMatch expectUniqueMatchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "expectUniqueMatch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.string ) - ] - , Type.var "a" - ] - ) - ) - } - ) - [ expectUniqueMatchArg_ ] - - -{-| expectUniqueMatchFromList: List (BackendTask.Glob.Glob a) -> BackendTask.BackendTask String a -} -expectUniqueMatchFromList : List Elm.Expression -> Elm.Expression -expectUniqueMatchFromList expectUniqueMatchFromListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "expectUniqueMatchFromList" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.string, Type.var "a" ] - ) - ) - } - ) - [ Elm.list expectUniqueMatchFromListArg_ ] - - -{-| Match a literal part of a path. Can include `/`s. - -Some common uses include - - - The leading part of a pattern, to say "starts with `content/blog/`" - - The ending part of a pattern, to say "ends with `.md`" - - In-between wildcards, to say "these dynamic parts are separated by `/`" - -```elm -import BackendTask exposing (BackendTask) -import BackendTask.Glob as Glob - -blogPosts = - Glob.succeed - (\section slug -> - { section = section, slug = slug } - ) - |> Glob.match (Glob.literal "content/blog/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".md") -``` - -literal: String -> BackendTask.Glob.Glob String --} -literal : String -> Elm.Expression -literal literalArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "literal" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.string ] - ) - ) - } - ) - [ Elm.string literalArg_ ] - - -{-| A `Glob` can be mapped. This can be useful for transforming a sub-match in-place. - -For example, if you wanted to take the slugs for a blog post and make sure they are normalized to be all lowercase, you -could use - - import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - blogPostsGlob : BackendTask error (List String) - blogPostsGlob = - Glob.succeed (\slug -> slug) - |> Glob.match (Glob.literal "content/blog/") - |> Glob.capture (Glob.wildcard |> Glob.map String.toLower) - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - -If you want to validate file formats, you can combine that with some `BackendTask` helpers to turn a `Glob (Result String value)` into -a `BackendTask FatalError (List value)`. - -For example, you could take a date and parse it. - - import BackendTask exposing (BackendTask) - import BackendTask.Glob as Glob - - example : BackendTask FatalError (List ( String, String )) - example = - Glob.succeed - (\dateResult slug -> - dateResult - |> Result.map (\okDate -> ( okDate, slug )) - ) - |> Glob.match (Glob.literal "blog/") - |> Glob.capture (Glob.recursiveWildcard |> Glob.map expectDateFormat) - |> Glob.match (Glob.literal "/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - |> BackendTask.map (List.map BackendTask.fromResult) - |> BackendTask.resolve - - expectDateFormat : List String -> Result FatalError String - expectDateFormat dateParts = - case dateParts of - [ year, month, date ] -> - Ok (String.join "-" [ year, month, date ]) - - _ -> - Err <| FatalError.fromString "Unexpected date format, expected yyyy/mm/dd folder structure." - -map: (a -> b) -> BackendTask.Glob.Glob a -> BackendTask.Glob.Glob b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| `succeed` is how you start a pipeline for a `Glob`. You will need one argument for each `capture` in your `Glob`. - -succeed: constructor -> BackendTask.Glob.Glob constructor --} -succeed : Elm.Expression -> Elm.Expression -succeed succeedArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "constructor" ] - ) - ) - } - ) - [ succeedArg_ ] - - -{-| import BackendTask.Glob as Glob - - type Extension - = Json - | Yml - - type alias DataFile = - { name : String - , extension : String - } - - dataFiles : BackendTask error (List DataFile) - dataFiles = - Glob.succeed DataFile - |> Glob.match (Glob.literal "my-data/") - |> Glob.capture Glob.wildcard - |> Glob.match (Glob.literal ".") - |> Glob.capture - (Glob.oneOf - ( ( "yml", Yml ) - , [ ( "json", Json ) - ] - ) - ) - -If we have the following files - -```shell -- my-data/ - - authors.yml - - events.json -``` - -That gives us - - results : BackendTask error (List DataFile) - results = - BackendTask.succeed - [ { name = "authors" - , extension = Yml - } - , { name = "events" - , extension = Json - } - ] - -You could also match an optional file path segment using `oneOf`. - - rootFilesMd : BackendTask error (List String) - rootFilesMd = - Glob.succeed (\slug -> slug) - |> Glob.match (Glob.literal "blog/") - |> Glob.capture Glob.wildcard - |> Glob.match - (Glob.oneOf - ( ( "", () ) - , [ ( "/index", () ) ] - ) - ) - |> Glob.match (Glob.literal ".md") - |> Glob.toBackendTask - -With these files: - -```markdown -- blog/ - - first-post.md - - second-post/ - - index.md -``` - -This would give us: - - results : BackendTask error (List String) - results = - BackendTask.succeed - [ "first-post" - , "second-post" - ] - -oneOf: ( ( String, a ), List ( String, a ) ) -> BackendTask.Glob.Glob a --} -oneOf : Elm.Expression -> Elm.Expression -oneOf oneOfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.tuple - (Type.tuple Type.string (Type.var "a")) - (Type.list (Type.tuple Type.string (Type.var "a")) - ) - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - ) - } - ) - [ oneOfArg_ ] - - -{-| zeroOrMore: List String -> BackendTask.Glob.Glob (Maybe String) -} -zeroOrMore : List String -> Elm.Expression -zeroOrMore zeroOrMoreArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "zeroOrMore" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.maybe Type.string ] - ) - ) - } - ) - [ Elm.list (List.map Elm.string zeroOrMoreArg_) ] - - -{-| atLeastOne: ( ( String, a ), List ( String, a ) ) -> BackendTask.Glob.Glob ( a, List a ) -} -atLeastOne : Elm.Expression -> Elm.Expression -atLeastOne atLeastOneArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "atLeastOne" - , annotation = - Just - (Type.function - [ Type.tuple - (Type.tuple Type.string (Type.var "a")) - (Type.list (Type.tuple Type.string (Type.var "a")) - ) - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.tuple - (Type.var "a") - (Type.list (Type.var "a")) - ] - ) - ) - } - ) - [ atLeastOneArg_ ] - - -{-| In order to get match data from your glob, turn it into a `BackendTask` with this function. - -toBackendTask: BackendTask.Glob.Glob a -> BackendTask.BackendTask error (List a) --} -toBackendTask : Elm.Expression -> Elm.Expression -toBackendTask toBackendTaskArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "toBackendTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list (Type.var "a") ] - ) - ) - } - ) - [ toBackendTaskArg_ ] - - -{-| Same as toBackendTask, but lets you set custom glob options. For example, to list folders instead of files, - - import BackendTask.Glob as Glob exposing (OnlyFolders, defaultOptions) - - matchingFiles : Glob a -> BackendTask error (List a) - matchingFiles glob = - glob - |> Glob.toBackendTaskWithOptions { defaultOptions | include = OnlyFolders } - -toBackendTaskWithOptions: - BackendTask.Glob.Options - -> BackendTask.Glob.Glob a - -> BackendTask.BackendTask error (List a) --} -toBackendTaskWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression -toBackendTaskWithOptions toBackendTaskWithOptionsArg_ toBackendTaskWithOptionsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "toBackendTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Options" - [] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list (Type.var "a") ] - ) - ) - } - ) - [ toBackendTaskWithOptionsArg_, toBackendTaskWithOptionsArg_0 ] - - -{-| The default options used in [`toBackendTask`](#toBackendTask). To use a custom set of options, use [`toBackendTaskWithOptions`](#toBackendTaskWithOptions). - -defaultOptions: BackendTask.Glob.Options --} -defaultOptions : Elm.Expression -defaultOptions = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "defaultOptions" - , annotation = - Just (Type.namedWith [ "BackendTask", "Glob" ] "Options" []) - } - - -annotation_ : - { glob : Type.Annotation -> Type.Annotation - , fileStats : Type.Annotation - , options : Type.Annotation - , include : Type.Annotation - } -annotation_ = - { glob = - \globArg0 -> - Type.alias - moduleName_ - "Glob" - [ globArg0 ] - (Type.namedWith - [ "BackendTask", "Internal", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - , fileStats = - Type.alias - moduleName_ - "FileStats" - [] - (Type.record - [ ( "fullPath", Type.string ) - , ( "sizeInBytes", Type.int ) - , ( "lastContentChange", Type.namedWith [ "Time" ] "Posix" [] ) - , ( "lastAccess", Type.namedWith [ "Time" ] "Posix" [] ) - , ( "lastFileChange", Type.namedWith [ "Time" ] "Posix" [] ) - , ( "createdAt", Type.namedWith [ "Time" ] "Posix" [] ) - , ( "isDirectory", Type.bool ) - ] - ) - , options = - Type.alias - moduleName_ - "Options" - [] - (Type.record - [ ( "includeDotFiles", Type.bool ) - , ( "include" - , Type.namedWith [ "BackendTask", "Glob" ] "Include" [] - ) - , ( "followSymbolicLinks", Type.bool ) - , ( "caseSensitiveMatch", Type.bool ) - , ( "gitignore", Type.bool ) - , ( "maxDepth", Type.maybe Type.int ) - ] - ) - , include = Type.namedWith [ "BackendTask", "Glob" ] "Include" [] - } - - -make_ : - { fileStats : - { fullPath : Elm.Expression - , sizeInBytes : Elm.Expression - , lastContentChange : Elm.Expression - , lastAccess : Elm.Expression - , lastFileChange : Elm.Expression - , createdAt : Elm.Expression - , isDirectory : Elm.Expression - } - -> Elm.Expression - , options : - { includeDotFiles : Elm.Expression - , include : Elm.Expression - , followSymbolicLinks : Elm.Expression - , caseSensitiveMatch : Elm.Expression - , gitignore : Elm.Expression - , maxDepth : Elm.Expression - } - -> Elm.Expression - , onlyFiles : Elm.Expression - , onlyFolders : Elm.Expression - , filesAndFolders : Elm.Expression - } -make_ = - { fileStats = - \fileStats_args -> - Elm.withType - (Type.alias - [ "BackendTask", "Glob" ] - "FileStats" - [] - (Type.record - [ ( "fullPath", Type.string ) - , ( "sizeInBytes", Type.int ) - , ( "lastContentChange" - , Type.namedWith [ "Time" ] "Posix" [] - ) - , ( "lastAccess" - , Type.namedWith [ "Time" ] "Posix" [] - ) - , ( "lastFileChange" - , Type.namedWith [ "Time" ] "Posix" [] - ) - , ( "createdAt" - , Type.namedWith [ "Time" ] "Posix" [] - ) - , ( "isDirectory", Type.bool ) - ] - ) - ) - (Elm.record - [ Tuple.pair "fullPath" fileStats_args.fullPath - , Tuple.pair "sizeInBytes" fileStats_args.sizeInBytes - , Tuple.pair - "lastContentChange" - fileStats_args.lastContentChange - , Tuple.pair "lastAccess" fileStats_args.lastAccess - , Tuple.pair "lastFileChange" fileStats_args.lastFileChange - , Tuple.pair "createdAt" fileStats_args.createdAt - , Tuple.pair "isDirectory" fileStats_args.isDirectory - ] - ) - , options = - \options_args -> - Elm.withType - (Type.alias - [ "BackendTask", "Glob" ] - "Options" - [] - (Type.record - [ ( "includeDotFiles", Type.bool ) - , ( "include" - , Type.namedWith - [ "BackendTask", "Glob" ] - "Include" - [] - ) - , ( "followSymbolicLinks", Type.bool ) - , ( "caseSensitiveMatch", Type.bool ) - , ( "gitignore", Type.bool ) - , ( "maxDepth", Type.maybe Type.int ) - ] - ) - ) - (Elm.record - [ Tuple.pair "includeDotFiles" options_args.includeDotFiles - , Tuple.pair "include" options_args.include - , Tuple.pair - "followSymbolicLinks" - options_args.followSymbolicLinks - , Tuple.pair - "caseSensitiveMatch" - options_args.caseSensitiveMatch - , Tuple.pair "gitignore" options_args.gitignore - , Tuple.pair "maxDepth" options_args.maxDepth - ] - ) - , onlyFiles = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "OnlyFiles" - , annotation = Just (Type.namedWith [] "Include" []) - } - , onlyFolders = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "OnlyFolders" - , annotation = Just (Type.namedWith [] "Include" []) - } - , filesAndFolders = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "FilesAndFolders" - , annotation = Just (Type.namedWith [] "Include" []) - } - } - - -caseOf_ : - { include : - Elm.Expression - -> { onlyFiles : Elm.Expression - , onlyFolders : Elm.Expression - , filesAndFolders : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { include = - \includeExpression includeTags -> - Elm.Case.custom - includeExpression - (Type.namedWith [ "BackendTask", "Glob" ] "Include" []) - [ Elm.Case.branch - (Elm.Arg.customType "OnlyFiles" includeTags.onlyFiles) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "OnlyFolders" includeTags.onlyFolders) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FilesAndFolders" - includeTags.filesAndFolders - ) - Basics.identity - ] - } - - -call_ : - { capture : Elm.Expression -> Elm.Expression -> Elm.Expression - , match : Elm.Expression -> Elm.Expression -> Elm.Expression - , fromString : Elm.Expression -> Elm.Expression - , fromStringWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression - , captureFilePath : Elm.Expression -> Elm.Expression - , captureStats : Elm.Expression -> Elm.Expression - , expectUniqueMatch : Elm.Expression -> Elm.Expression - , expectUniqueMatchFromList : Elm.Expression -> Elm.Expression - , literal : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , succeed : Elm.Expression -> Elm.Expression - , oneOf : Elm.Expression -> Elm.Expression - , zeroOrMore : Elm.Expression -> Elm.Expression - , atLeastOne : Elm.Expression -> Elm.Expression - , toBackendTask : Elm.Expression -> Elm.Expression - , toBackendTaskWithOptions : - Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { capture = - \captureArg_ captureArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "capture" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function - [ Type.var "a" ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ captureArg_, captureArg_0 ] - , match = - \matchArg_ matchArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "match" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ matchArg_, matchArg_0 ] - , fromString = - \fromStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list Type.string - ] - ) - ) - } - ) - [ fromStringArg_ ] - , fromStringWithOptions = - \fromStringWithOptionsArg_ fromStringWithOptionsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "fromStringWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Options" - [] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list Type.string - ] - ) - ) - } - ) - [ fromStringWithOptionsArg_, fromStringWithOptionsArg_0 ] - , captureFilePath = - \captureFilePathArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "captureFilePath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function - [ Type.string ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ captureFilePathArg_ ] - , captureStats = - \captureStatsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "captureStats" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "FileStats" - [] - ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - ) - [ captureStatsArg_ ] - , expectUniqueMatch = - \expectUniqueMatchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "expectUniqueMatch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.string ) - ] - , Type.var "a" - ] - ) - ) - } - ) - [ expectUniqueMatchArg_ ] - , expectUniqueMatchFromList = - \expectUniqueMatchFromListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "expectUniqueMatchFromList" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.string, Type.var "a" ] - ) - ) - } - ) - [ expectUniqueMatchFromListArg_ ] - , literal = - \literalArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "literal" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.string ] - ) - ) - } - ) - [ literalArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , succeed = - \succeedArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "constructor" ] - ) - ) - } - ) - [ succeedArg_ ] - , oneOf = - \oneOfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.tuple - (Type.tuple Type.string (Type.var "a")) - (Type.list - (Type.tuple Type.string (Type.var "a")) - ) - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - ) - } - ) - [ oneOfArg_ ] - , zeroOrMore = - \zeroOrMoreArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "zeroOrMore" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.maybe Type.string ] - ) - ) - } - ) - [ zeroOrMoreArg_ ] - , atLeastOne = - \atLeastOneArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "atLeastOne" - , annotation = - Just - (Type.function - [ Type.tuple - (Type.tuple Type.string (Type.var "a")) - (Type.list - (Type.tuple Type.string (Type.var "a")) - ) - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.tuple - (Type.var "a") - (Type.list (Type.var "a")) - ] - ) - ) - } - ) - [ atLeastOneArg_ ] - , toBackendTask = - \toBackendTaskArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "toBackendTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list (Type.var "a") - ] - ) - ) - } - ) - [ toBackendTaskArg_ ] - , toBackendTaskWithOptions = - \toBackendTaskWithOptionsArg_ toBackendTaskWithOptionsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "toBackendTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Options" - [] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list (Type.var "a") - ] - ) - ) - } - ) - [ toBackendTaskWithOptionsArg_, toBackendTaskWithOptionsArg_0 ] - } - - -values_ : - { capture : Elm.Expression - , match : Elm.Expression - , fromString : Elm.Expression - , fromStringWithOptions : Elm.Expression - , captureFilePath : Elm.Expression - , wildcard : Elm.Expression - , recursiveWildcard : Elm.Expression - , int : Elm.Expression - , digits : Elm.Expression - , captureStats : Elm.Expression - , expectUniqueMatch : Elm.Expression - , expectUniqueMatchFromList : Elm.Expression - , literal : Elm.Expression - , map : Elm.Expression - , succeed : Elm.Expression - , oneOf : Elm.Expression - , zeroOrMore : Elm.Expression - , atLeastOne : Elm.Expression - , toBackendTask : Elm.Expression - , toBackendTaskWithOptions : Elm.Expression - , defaultOptions : Elm.Expression - } -values_ = - { capture = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "capture" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function [ Type.var "a" ] (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - , match = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "match" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - , fromString = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - ) - } - , fromStringWithOptions = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "fromStringWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith [ "BackendTask", "Glob" ] "Options" [] - , Type.string - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - ) - } - , captureFilePath = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "captureFilePath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function [ Type.string ] (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - , wildcard = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "wildcard" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.string ] - ) - } - , recursiveWildcard = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "recursiveWildcard" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.list Type.string ] - ) - } - , int = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "int" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.int ] - ) - } - , digits = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "digits" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.string ] - ) - } - , captureStats = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "captureStats" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "FileStats" - [] - ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "value" ] - ) - ) - } - , expectUniqueMatch = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "expectUniqueMatch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.string ) - ] - , Type.var "a" - ] - ) - ) - } - , expectUniqueMatchFromList = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "expectUniqueMatchFromList" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.string, Type.var "a" ] - ) - ) - } - , literal = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "literal" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.string ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "b" ] - ) - ) - } - , succeed = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "constructor" ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "constructor" ] - ) - ) - } - , oneOf = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.tuple - (Type.tuple Type.string (Type.var "a")) - (Type.list (Type.tuple Type.string (Type.var "a"))) - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ) - ) - } - , zeroOrMore = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "zeroOrMore" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.maybe Type.string ] - ) - ) - } - , atLeastOne = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "atLeastOne" - , annotation = - Just - (Type.function - [ Type.tuple - (Type.tuple Type.string (Type.var "a")) - (Type.list (Type.tuple Type.string (Type.var "a"))) - ] - (Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.tuple - (Type.var "a") - (Type.list (Type.var "a")) - ] - ) - ) - } - , toBackendTask = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "toBackendTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list (Type.var "a") ] - ) - ) - } - , toBackendTaskWithOptions = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "toBackendTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith [ "BackendTask", "Glob" ] "Options" [] - , Type.namedWith - [ "BackendTask", "Glob" ] - "Glob" - [ Type.var "a" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list (Type.var "a") ] - ) - ) - } - , defaultOptions = - Elm.value - { importFrom = [ "BackendTask", "Glob" ] - , name = "defaultOptions" - , annotation = - Just (Type.namedWith [ "BackendTask", "Glob" ] "Options" []) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Random.elm b/codegen/Gen/BackendTask/Random.elm deleted file mode 100644 index c2a93ed8..00000000 --- a/codegen/Gen/BackendTask/Random.elm +++ /dev/null @@ -1,166 +0,0 @@ -module Gen.BackendTask.Random exposing - ( moduleName_, generate, int32, call_, values_ - ) - -{-| -# Generated bindings for BackendTask.Random - -@docs moduleName_, generate, int32, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Random" ] - - -{-| Takes an `elm/random` `Random.Generator` and runs it using a randomly generated initial seed. - - type alias Data = - { randomData : ( Int, Float ) - } - - data : BackendTask FatalError Data - data = - BackendTask.map Data - (BackendTask.Random.generate generator) - - generator : Random.Generator ( Int, Float ) - generator = - Random.map2 Tuple.pair (Random.int 0 100) (Random.float 0 100) - -The random initial seed is generated using -to generate a single 32-bit Integer. That 32-bit Integer is then used with `Random.initialSeed` to create an Elm Random.Seed value. -Then that `Seed` used to run the `Generator`. - -Note that this is different than `elm/random`'s `Random.generate`. This difference shouldn't be problematic, and in fact the `BackendTask` -random seed generation is more cryptographically independent because you can't determine the -random seed based solely on the time at which it is run. Each time you call `BackendTask.generate` it uses a newly -generated random seed to run the `Random.Generator` that is passed in. In contrast, `elm/random`'s `Random.generate` -generates an initial seed using `Time.now`, and then continues with that same seed using using [`Random.step`](https://package.elm-lang.org/packages/elm/random/latest/Random#step) -to get new random values after that. You can [see the implementation here](https://github.com/elm/random/blob/c1c9da4d861363cee1c93382d2687880279ed0dd/src/Random.elm#L865-L896). -However, `elm/random` is still not suitable in general for cryptographic uses of random because it uses 32-bits for when it -steps through new seeds while running a single `Random.Generator`. - -generate: Random.Generator value -> BackendTask.BackendTask error value --} -generate : Elm.Expression -> Elm.Expression -generate generateArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Random" ] - , name = "generate" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Random" ] - "Generator" - [ Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ generateArg_ ] - - -{-| Gives a random 32-bit Int. This can be useful if you want to do low-level things with a cryptographically sound -random 32-bit integer. - -The value comes from running this code in Node using : - -```js -import * as crypto from "node:crypto"; - -crypto.getRandomValues(new Uint32Array(1))[0] -``` - -int32: BackendTask.BackendTask error Int --} -int32 : Elm.Expression -int32 = - Elm.value - { importFrom = [ "BackendTask", "Random" ] - , name = "int32" - , annotation = - Just - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.int ] - ) - } - - -call_ : { generate : Elm.Expression -> Elm.Expression } -call_ = - { generate = - \generateArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Random" ] - , name = "generate" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Random" ] - "Generator" - [ Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ generateArg_ ] - } - - -values_ : { generate : Elm.Expression, int32 : Elm.Expression } -values_ = - { generate = - Elm.value - { importFrom = [ "BackendTask", "Random" ] - , name = "generate" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Random" ] - "Generator" - [ Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , int32 = - Elm.value - { importFrom = [ "BackendTask", "Random" ] - , name = "int32" - , annotation = - Just - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.int ] - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Stream.elm b/codegen/Gen/BackendTask/Stream.elm deleted file mode 100644 index 934f0f3d..00000000 --- a/codegen/Gen/BackendTask/Stream.elm +++ /dev/null @@ -1,3163 +0,0 @@ -module Gen.BackendTask.Stream exposing - ( moduleName_, pipe, fileRead, fileWrite, fromString, http - , httpWithInput, stdin, stdout, stderr, read, readJson, readMetadata - , run, command, commandWithOptions, defaultCommandOptions, allowNon0Status, withOutput, withTimeout - , gzip, unzip, customRead, customWrite, customDuplex, customReadWithMeta, customTransformWithMeta - , customWriteWithMeta, annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for BackendTask.Stream - -@docs moduleName_, pipe, fileRead, fileWrite, fromString, http -@docs httpWithInput, stdin, stdout, stderr, read, readJson -@docs readMetadata, run, command, commandWithOptions, defaultCommandOptions, allowNon0Status -@docs withOutput, withTimeout, gzip, unzip, customRead, customWrite -@docs customDuplex, customReadWithMeta, customTransformWithMeta, customWriteWithMeta, annotation_, make_ -@docs caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Stream" ] - - -{-| You can build up a pipeline of streams by using the `pipe` function. - -The stream you are piping to must be writable (`{ write : () }`), -and the stream you are piping from must be readable (`{ read : () }`). - - module HelloWorld exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fromString "Hello, World!" - |> Stream.stdout - |> Stream.run - ) - -pipe: - BackendTask.Stream.Stream errorTo metaTo { read : toReadable, write : () } - -> BackendTask.Stream.Stream errorFrom metaFrom { read : () - , write : fromWriteable - } - -> BackendTask.Stream.Stream errorTo metaTo { read : toReadable - , write : fromWriteable - } --} -pipe : Elm.Expression -> Elm.Expression -> Elm.Expression -pipe pipeArg_ pipeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "pipe" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorTo" - , Type.var "metaTo" - , Type.record - [ ( "read", Type.var "toReadable" ) - , ( "write", Type.unit ) - ] - ] - , Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorFrom" - , Type.var "metaFrom" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "fromWriteable" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorTo" - , Type.var "metaTo" - , Type.record - [ ( "read", Type.var "toReadable" ) - , ( "write", Type.var "fromWriteable" ) - ] - ] - ) - ) - } - ) - [ pipeArg_, pipeArg_0 ] - - -{-| Open a file's contents as a Stream. - - module ReadFile exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fileRead "elm.json" - |> Stream.readJson (Decode.field "source-directories" (Decode.list Decode.string)) - |> BackendTask.allowFatal - |> BackendTask.andThen - (\{ body } -> - Script.log - ("The source directories are: " - ++ String.join ", " body - ) - ) - ) - -If you want to read a file but don't need to use any of the other Stream functions, you can use [`BackendTask.File.read`](BackendTask-File#rawFile) instead. - -fileRead: String -> BackendTask.Stream.Stream () () { read : (), write : Basics.Never } --} -fileRead : String -> Elm.Expression -fileRead fileReadArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fileRead" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - ) - [ Elm.string fileReadArg_ ] - - -{-| Write a Stream to a file. - - module WriteFile exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fileRead "logs.txt" - |> Stream.pipe (Stream.command "grep" [ "error" ]) - |> Stream.pipe (Stream.fileWrite "errors.txt") - ) - -fileWrite: String -> BackendTask.Stream.Stream () () { read : Basics.Never, write : () } --} -fileWrite : String -> Elm.Expression -fileWrite fileWriteArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fileWrite" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ Elm.string fileWriteArg_ ] - - -{-| A handy way to turn either a hardcoded String, or any other value from Elm into a Stream. - - module HelloWorld exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fromString "Hello, World!" - |> Stream.stdout - |> Stream.run - |> BackendTask.allowFatal - ) - -A more programmatic use of `fromString` to use the result of a previous `BackendTask` to a `Stream`: - - module HelloWorld exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Glob.fromString "src/**/*.elm" - |> BackendTask.andThen - (\elmFiles -> - elmFiles - |> String.join ", " - |> Stream.fromString - |> Stream.pipe Stream.stdout - |> Stream.run - ) - ) - -fromString: String -> BackendTask.Stream.Stream () () { read : (), write : Basics.Never } --} -fromString : String -> Elm.Expression -fromString fromStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - ) - [ Elm.string fromStringArg_ ] - - -{-| Uses a regular HTTP request body (not a `Stream`). Streams the HTTP response body. - -If you want to pass a stream as the request body, use [`httpWithInput`](#httpWithInput) instead. - -If you don't need to stream the response body, you can use the functions from [`BackendTask.Http`](BackendTask-Http) instead. - -http: - { url : String - , method : String - , headers : List ( String, String ) - , body : BackendTask.Http.Body - , retries : Maybe Int - , timeoutInMs : Maybe Int - } - -> BackendTask.Stream.Stream BackendTask.Http.Error BackendTask.Http.Metadata { read : - () - , write : Basics.Never - } --} -http : - { url : String - , method : String - , headers : List Elm.Expression - , body : Elm.Expression - , retries : Elm.Expression - , timeoutInMs : Elm.Expression - } - -> Elm.Expression -http httpArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "http" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "method", Type.string ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "body" - , Type.namedWith - [ "BackendTask", "Http" ] - "Body" - [] - ) - , ( "retries", Type.maybe Type.int ) - , ( "timeoutInMs", Type.maybe Type.int ) - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.namedWith - [ "BackendTask", "Http" ] - "Error" - [] - , Type.namedWith - [ "BackendTask", "Http" ] - "Metadata" - [] - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "url" (Elm.string httpArg_.url) - , Tuple.pair "method" (Elm.string httpArg_.method) - , Tuple.pair "headers" (Elm.list httpArg_.headers) - , Tuple.pair "body" httpArg_.body - , Tuple.pair "retries" httpArg_.retries - , Tuple.pair "timeoutInMs" httpArg_.timeoutInMs - ] - ] - - -{-| Streams the data from the input stream as the body of the HTTP request. The HTTP response body becomes the output stream. - -httpWithInput: - { url : String - , method : String - , headers : List ( String, String ) - , retries : Maybe Int - , timeoutInMs : Maybe Int - } - -> BackendTask.Stream.Stream BackendTask.Http.Error BackendTask.Http.Metadata { read : - () - , write : () - } --} -httpWithInput : - { url : String - , method : String - , headers : List Elm.Expression - , retries : Elm.Expression - , timeoutInMs : Elm.Expression - } - -> Elm.Expression -httpWithInput httpWithInputArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "httpWithInput" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "method", Type.string ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "retries", Type.maybe Type.int ) - , ( "timeoutInMs", Type.maybe Type.int ) - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.namedWith - [ "BackendTask", "Http" ] - "Error" - [] - , Type.namedWith - [ "BackendTask", "Http" ] - "Metadata" - [] - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "url" (Elm.string httpWithInputArg_.url) - , Tuple.pair "method" (Elm.string httpWithInputArg_.method) - , Tuple.pair "headers" (Elm.list httpWithInputArg_.headers) - , Tuple.pair "retries" httpWithInputArg_.retries - , Tuple.pair "timeoutInMs" httpWithInputArg_.timeoutInMs - ] - ] - - -{-| The `stdin` from the process. When you execute an `elm-pages` script, this will be the value that is piped in to it. For example, given this script module: - - module CountLines exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.stdin - |> Stream.read - |> BackendTask.allowFatal - |> BackendTask.andThen - (\{ body } -> - body - |> String.lines - |> List.length - |> String.fromInt - |> Script.log - ) - ) - -If you run the script without any stdin, it will wait until stdin is closed. - -```shell -elm-pages run script/src/CountLines.elm -# pressing ctrl-d (or your platform-specific way of closing stdin) will print the number of lines in the input -``` - -Or you can pipe to it and it will read that input: - -```shell -ls | elm-pages run script/src/CountLines.elm -# prints the number of files in the current directory -``` - -stdin: BackendTask.Stream.Stream () () { read : (), write : Basics.Never } --} -stdin : Elm.Expression -stdin = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "stdin" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.namedWith [ "Basics" ] "Never" [] ) - ] - ] - ) - } - - -{-| Streaming through to stdout can be a convenient way to print a pipeline directly without going through to Elm. - - module UnzipFile exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fileRead "data.gzip.txt" - |> Stream.pipe Stream.unzip - |> Stream.pipe Stream.stdout - |> Stream.run - |> BackendTask.allowFatal - ) - -stdout: BackendTask.Stream.Stream () () { read : Basics.Never, write : () } --} -stdout : Elm.Expression -stdout = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "stdout" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.namedWith [ "Basics" ] "Never" [] ) - , ( "write", Type.unit ) - ] - ] - ) - } - - -{-| Similar to [`stdout`](#stdout), but writes to `stderr` instead. - -stderr: BackendTask.Stream.Stream () () { read : Basics.Never, write : () } --} -stderr : Elm.Expression -stderr = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "stderr" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.namedWith [ "Basics" ] "Never" [] ) - , ( "write", Type.unit ) - ] - ] - ) - } - - -{-| Read the body of the `Stream` as text. - -read: - BackendTask.Stream.Stream error metadata { read : (), write : write } - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.Stream.Error error String - } { metadata : metadata, body : String } --} -read : Elm.Expression -> Elm.Expression -read readArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "read" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.string ] - ) - ] - , Type.record - [ ( "metadata", Type.var "metadata" ) - , ( "body", Type.string ) - ] - ] - ) - ) - } - ) - [ readArg_ ] - - -{-| Read the body of the `Stream` as JSON. - - module ReadJson exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Json.Decode as Decode - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fileRead "data.json" - |> Stream.readJson (Decode.field "name" Decode.string) - |> BackendTask.allowFatal - |> BackendTask.andThen - (\{ body } -> - Script.log ("The name is: " ++ body) - ) - ) - -readJson: - Json.Decode.Decoder value - -> BackendTask.Stream.Stream error metadata { read : (), write : write } - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.Stream.Error error value - } { metadata : metadata, body : value } --} -readJson : Elm.Expression -> Elm.Expression -> Elm.Expression -readJson readJsonArg_ readJsonArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "readJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.var "value" ] - ) - ] - , Type.record - [ ( "metadata", Type.var "metadata" ) - , ( "body", Type.var "value" ) - ] - ] - ) - ) - } - ) - [ readJsonArg_, readJsonArg_0 ] - - -{-| Ignore the body of the `Stream`, while capturing the metadata from the final part of the Stream. - -readMetadata: - BackendTask.Stream.Stream error metadata { read : read, write : write } - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : BackendTask.Stream.Error error String - } metadata --} -readMetadata : Elm.Expression -> Elm.Expression -readMetadata readMetadataArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "readMetadata" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.string ] - ) - ] - , Type.var "metadata" - ] - ) - ) - } - ) - [ readMetadataArg_ ] - - -{-| Gives a `BackendTask` to execute the `Stream`, ignoring its body and metadata. - -This is useful if you only want the side-effect from the `Stream` and don't need to programmatically use its -output. For example, if the end result you want is: - - - Printing to the console - - Writing to a file - - Making an HTTP request - -If you need to read the output of the `Stream`, use [`read`](#read), [`readJson`](#readJson), or [`readMetadata`](#readMetadata) instead. - -run: - BackendTask.Stream.Stream error metadata kind - -> BackendTask.BackendTask FatalError.FatalError () --} -run : Elm.Expression -> Elm.Expression -run runArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.var "kind" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - ) - } - ) - [ runArg_ ] - - -{-| Run a command (or `child_process`). The command's output becomes the body of the `Stream`. - -command: - String - -> List String - -> BackendTask.Stream.Stream Int () { read : read, write : write } --} -command : String -> List String -> Elm.Expression -command commandArg_ commandArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.int - , Type.unit - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ) - ) - } - ) - [ Elm.string commandArg_, Elm.list (List.map Elm.string commandArg_0) ] - - -{-| Pass in custom [`CommandOptions`](#CommandOptions) to configure the behavior of the command. - -For example, `grep` will return a non-zero status code if it doesn't find any matches. To ignore the non-zero status code and proceed with -empty output, you can use `allowNon0Status`. - - module GrepErrors exposing (run) - - import BackendTask - import BackendTask.Stream as Stream - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Stream.fileRead "log.txt" - |> Stream.pipe - (Stream.commandWithOptions - (Stream.defaultCommandOptions |> Stream.allowNon0Status) - "grep" - [ "error" ] - ) - |> Stream.pipe Stream.stdout - |> Stream.run - ) - -commandWithOptions: - BackendTask.Stream.CommandOptions - -> String - -> List String - -> BackendTask.Stream.Stream Int () { read : read, write : write } --} -commandWithOptions : Elm.Expression -> String -> List String -> Elm.Expression -commandWithOptions commandWithOptionsArg_ commandWithOptionsArg_0 commandWithOptionsArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "commandWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - , Type.string - , Type.list Type.string - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.int - , Type.unit - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ) - ) - } - ) - [ commandWithOptionsArg_ - , Elm.string commandWithOptionsArg_0 - , Elm.list (List.map Elm.string commandWithOptionsArg_1) - ] - - -{-| The default options that are used for [`command`](#command). Used to build up `CommandOptions` -to pass in to [`commandWithOptions`](#commandWithOptions). - -defaultCommandOptions: BackendTask.Stream.CommandOptions --} -defaultCommandOptions : Elm.Expression -defaultCommandOptions = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "defaultCommandOptions" - , annotation = - Just - (Type.namedWith [ "BackendTask", "Stream" ] "CommandOptions" []) - } - - -{-| By default, the `Stream` will halt with an error if a command returns a non-zero status code. - -With `allowNon0Status`, the stream will continue without an error if the command returns a non-zero status code. - -allowNon0Status: BackendTask.Stream.CommandOptions -> BackendTask.Stream.CommandOptions --} -allowNon0Status : Elm.Expression -> Elm.Expression -allowNon0Status allowNon0StatusArg_ = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "allowNon0Status" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - ) - [ allowNon0StatusArg_ ] - - -{-| Configure the [`StderrOutput`](#StderrOutput) behavior. - -withOutput: - BackendTask.Stream.StderrOutput - -> BackendTask.Stream.CommandOptions - -> BackendTask.Stream.CommandOptions --} -withOutput : Elm.Expression -> Elm.Expression -> Elm.Expression -withOutput withOutputArg_ withOutputArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "withOutput" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "StderrOutput" - [] - , Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - ) - [ withOutputArg_, withOutputArg_0 ] - - -{-| By default, commands do not have a timeout. This will set the timeout, in milliseconds, for the given command. If that duration is exceeded, -the `Stream` will fail with an error. - -withTimeout: Int -> BackendTask.Stream.CommandOptions -> BackendTask.Stream.CommandOptions --} -withTimeout : Int -> Elm.Expression -> Elm.Expression -withTimeout withTimeoutArg_ withTimeoutArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "withTimeout" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - ) - [ Elm.int withTimeoutArg_, withTimeoutArg_0 ] - - -{-| Transforms the input with gzip compression. - -Under the hood this builds a Stream using Node's [`zlib.createGzip`](https://nodejs.org/api/zlib.html#zlibcreategzipoptions). - -gzip: BackendTask.Stream.Stream () () { read : (), write : () } --} -gzip : Elm.Expression -gzip = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "gzip" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ), ( "write", Type.unit ) ] - ] - ) - } - - -{-| Transforms the input by auto-detecting the header and decompressing either a Gzip- or Deflate-compressed stream. - -Under the hood, this builds a Stream using Node's [`zlib.createUnzip`](https://nodejs.org/api/zlib.html#zlibcreateunzip). - -unzip: BackendTask.Stream.Stream () () { read : (), write : () } --} -unzip : Elm.Expression -unzip = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "unzip" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ), ( "write", Type.unit ) ] - ] - ) - } - - -{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `ReadableStream` it returns. - -customRead: - String - -> Json.Encode.Value - -> BackendTask.Stream.Stream () () { read : (), write : Basics.Never } --} -customRead : String -> Elm.Expression -> Elm.Expression -customRead customReadArg_ customReadArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customRead" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - ) - [ Elm.string customReadArg_, customReadArg_0 ] - - -{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `WritableStream` it returns. - -customWrite: - String - -> Json.Encode.Value - -> BackendTask.Stream.Stream () () { read : Basics.Never, write : () } --} -customWrite : String -> Elm.Expression -> Elm.Expression -customWrite customWriteArg_ customWriteArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customWrite" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ Elm.string customWriteArg_, customWriteArg_0 ] - - -{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `DuplexStream` it returns. - -customDuplex: - String - -> Json.Encode.Value - -> BackendTask.Stream.Stream () () { read : (), write : () } --} -customDuplex : String -> Elm.Expression -> Elm.Expression -customDuplex customDuplexArg_ customDuplexArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customDuplex" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ Elm.string customDuplexArg_, customDuplexArg_0 ] - - -{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `DuplexStream` it returns. - -customReadWithMeta: - String - -> Json.Encode.Value - -> Json.Decode.Decoder (Result.Result { fatal : FatalError.FatalError - , recoverable : error - } metadata) - -> BackendTask.Stream.Stream error metadata { read : (), write : Basics.Never } --} -customReadWithMeta : - String -> Elm.Expression -> Elm.Expression -> Elm.Expression -customReadWithMeta customReadWithMetaArg_ customReadWithMetaArg_0 customReadWithMetaArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customReadWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.var "error" ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - ) - [ Elm.string customReadWithMetaArg_ - , customReadWithMetaArg_0 - , customReadWithMetaArg_1 - ] - - -{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `DuplexStream` and metadata function it returns. - -customTransformWithMeta: - String - -> Json.Encode.Value - -> Json.Decode.Decoder (Result.Result { fatal : FatalError.FatalError - , recoverable : error - } metadata) - -> BackendTask.Stream.Stream error metadata { read : (), write : () } --} -customTransformWithMeta : - String -> Elm.Expression -> Elm.Expression -> Elm.Expression -customTransformWithMeta customTransformWithMetaArg_ customTransformWithMetaArg_0 customTransformWithMetaArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customTransformWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.var "error" ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ Elm.string customTransformWithMetaArg_ - , customTransformWithMetaArg_0 - , customTransformWithMetaArg_1 - ] - - -{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `WritableStream` and metadata function it returns. - -customWriteWithMeta: - String - -> Json.Encode.Value - -> Json.Decode.Decoder (Result.Result { fatal : FatalError.FatalError - , recoverable : error - } metadata) - -> BackendTask.Stream.Stream error metadata { read : Basics.Never, write : () } --} -customWriteWithMeta : - String -> Elm.Expression -> Elm.Expression -> Elm.Expression -customWriteWithMeta customWriteWithMetaArg_ customWriteWithMetaArg_0 customWriteWithMetaArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customWriteWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.var "error" ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ Elm.string customWriteWithMetaArg_ - , customWriteWithMetaArg_0 - , customWriteWithMetaArg_1 - ] - - -annotation_ : - { stream : - Type.Annotation -> Type.Annotation -> Type.Annotation -> Type.Annotation - , error : Type.Annotation -> Type.Annotation -> Type.Annotation - , stderrOutput : Type.Annotation - , commandOptions : Type.Annotation - } -annotation_ = - { stream = - \streamArg0 streamArg1 streamArg2 -> - Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ streamArg0, streamArg1, streamArg2 ] - , error = - \errorArg0 errorArg1 -> - Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ errorArg0, errorArg1 ] - , stderrOutput = - Type.namedWith [ "BackendTask", "Stream" ] "StderrOutput" [] - , commandOptions = - Type.namedWith [ "BackendTask", "Stream" ] "CommandOptions" [] - } - - -make_ : - { streamError : Elm.Expression -> Elm.Expression - , customError : Elm.Expression -> Elm.Expression -> Elm.Expression - , printStderr : Elm.Expression - , ignoreStderr : Elm.Expression - , mergeStderrAndStdout : Elm.Expression - , stderrInsteadOfStdout : Elm.Expression - } -make_ = - { streamError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "StreamError" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "error", Type.var "body" ] - ) - } - ) - [ ar0 ] - , customError = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "CustomError" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "error", Type.var "body" ] - ) - } - ) - [ ar0, ar1 ] - , printStderr = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "PrintStderr" - , annotation = Just (Type.namedWith [] "StderrOutput" []) - } - , ignoreStderr = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "IgnoreStderr" - , annotation = Just (Type.namedWith [] "StderrOutput" []) - } - , mergeStderrAndStdout = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "MergeStderrAndStdout" - , annotation = Just (Type.namedWith [] "StderrOutput" []) - } - , stderrInsteadOfStdout = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "StderrInsteadOfStdout" - , annotation = Just (Type.namedWith [] "StderrOutput" []) - } - } - - -caseOf_ = - { error = - \errorExpression errorTags -> - Elm.Case.custom - errorExpression - (Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.var "body" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "StreamError" - errorTags.streamError |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "CustomError" - errorTags.customError |> Elm.Arg.item - (Elm.Arg.varWith - "error" - (Type.var "error") - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "body" - ) - ) - ) - ) - Basics.identity - ] - , stderrOutput = - \stderrOutputExpression stderrOutputTags -> - Elm.Case.custom - stderrOutputExpression - (Type.namedWith [ "BackendTask", "Stream" ] "StderrOutput" []) - [ Elm.Case.branch - (Elm.Arg.customType - "PrintStderr" - stderrOutputTags.printStderr - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "IgnoreStderr" - stderrOutputTags.ignoreStderr - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "MergeStderrAndStdout" - stderrOutputTags.mergeStderrAndStdout - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "StderrInsteadOfStdout" - stderrOutputTags.stderrInsteadOfStdout - ) - Basics.identity - ] - } - - -call_ : - { pipe : Elm.Expression -> Elm.Expression -> Elm.Expression - , fileRead : Elm.Expression -> Elm.Expression - , fileWrite : Elm.Expression -> Elm.Expression - , fromString : Elm.Expression -> Elm.Expression - , http : Elm.Expression -> Elm.Expression - , httpWithInput : Elm.Expression -> Elm.Expression - , read : Elm.Expression -> Elm.Expression - , readJson : Elm.Expression -> Elm.Expression -> Elm.Expression - , readMetadata : Elm.Expression -> Elm.Expression - , run : Elm.Expression -> Elm.Expression - , command : Elm.Expression -> Elm.Expression -> Elm.Expression - , commandWithOptions : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , allowNon0Status : Elm.Expression -> Elm.Expression - , withOutput : Elm.Expression -> Elm.Expression -> Elm.Expression - , withTimeout : Elm.Expression -> Elm.Expression -> Elm.Expression - , customRead : Elm.Expression -> Elm.Expression -> Elm.Expression - , customWrite : Elm.Expression -> Elm.Expression -> Elm.Expression - , customDuplex : Elm.Expression -> Elm.Expression -> Elm.Expression - , customReadWithMeta : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , customTransformWithMeta : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , customWriteWithMeta : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { pipe = - \pipeArg_ pipeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "pipe" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorTo" - , Type.var "metaTo" - , Type.record - [ ( "read", Type.var "toReadable" ) - , ( "write", Type.unit ) - ] - ] - , Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorFrom" - , Type.var "metaFrom" - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.var "fromWriteable" - ) - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorTo" - , Type.var "metaTo" - , Type.record - [ ( "read", Type.var "toReadable" ) - , ( "write" - , Type.var "fromWriteable" - ) - ] - ] - ) - ) - } - ) - [ pipeArg_, pipeArg_0 ] - , fileRead = - \fileReadArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fileRead" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - ] - ] - ) - ) - } - ) - [ fileReadArg_ ] - , fileWrite = - \fileWriteArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fileWrite" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ fileWriteArg_ ] - , fromString = - \fromStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - ] - ] - ) - ) - } - ) - [ fromStringArg_ ] - , http = - \httpArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "http" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "method", Type.string ) - , ( "headers" - , Type.list - (Type.tuple Type.string Type.string) - ) - , ( "body" - , Type.namedWith - [ "BackendTask", "Http" ] - "Body" - [] - ) - , ( "retries", Type.maybe Type.int ) - , ( "timeoutInMs", Type.maybe Type.int ) - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.namedWith - [ "BackendTask", "Http" ] - "Error" - [] - , Type.namedWith - [ "BackendTask", "Http" ] - "Metadata" - [] - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - ] - ] - ) - ) - } - ) - [ httpArg_ ] - , httpWithInput = - \httpWithInputArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "httpWithInput" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "method", Type.string ) - , ( "headers" - , Type.list - (Type.tuple Type.string Type.string) - ) - , ( "retries", Type.maybe Type.int ) - , ( "timeoutInMs", Type.maybe Type.int ) - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.namedWith - [ "BackendTask", "Http" ] - "Error" - [] - , Type.namedWith - [ "BackendTask", "Http" ] - "Metadata" - [] - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ httpWithInputArg_ ] - , read = - \readArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "read" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error" - , Type.string - ] - ) - ] - , Type.record - [ ( "metadata", Type.var "metadata" ) - , ( "body", Type.string ) - ] - ] - ) - ) - } - ) - [ readArg_ ] - , readJson = - \readJsonArg_ readJsonArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "readJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error" - , Type.var "value" - ] - ) - ] - , Type.record - [ ( "metadata", Type.var "metadata" ) - , ( "body", Type.var "value" ) - ] - ] - ) - ) - } - ) - [ readJsonArg_, readJsonArg_0 ] - , readMetadata = - \readMetadataArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "readMetadata" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error" - , Type.string - ] - ) - ] - , Type.var "metadata" - ] - ) - ) - } - ) - [ readMetadataArg_ ] - , run = - \runArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.var "kind" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ) - } - ) - [ runArg_ ] - , command = - \commandArg_ commandArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.int - , Type.unit - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ) - ) - } - ) - [ commandArg_, commandArg_0 ] - , commandWithOptions = - \commandWithOptionsArg_ commandWithOptionsArg_0 commandWithOptionsArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "commandWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - , Type.string - , Type.list Type.string - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.int - , Type.unit - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ) - ) - } - ) - [ commandWithOptionsArg_ - , commandWithOptionsArg_0 - , commandWithOptionsArg_1 - ] - , allowNon0Status = - \allowNon0StatusArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "allowNon0Status" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - ) - [ allowNon0StatusArg_ ] - , withOutput = - \withOutputArg_ withOutputArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "withOutput" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "StderrOutput" - [] - , Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - ) - [ withOutputArg_, withOutputArg_0 ] - , withTimeout = - \withTimeoutArg_ withTimeoutArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "withTimeout" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - ) - [ withTimeoutArg_, withTimeoutArg_0 ] - , customRead = - \customReadArg_ customReadArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customRead" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - ] - ] - ) - ) - } - ) - [ customReadArg_, customReadArg_0 ] - , customWrite = - \customWriteArg_ customWriteArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customWrite" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ customWriteArg_, customWriteArg_0 ] - , customDuplex = - \customDuplexArg_ customDuplexArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customDuplex" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ customDuplexArg_, customDuplexArg_0 ] - , customReadWithMeta = - \customReadWithMetaArg_ customReadWithMetaArg_0 customReadWithMetaArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customReadWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.var "error" - ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - ] - ] - ) - ) - } - ) - [ customReadWithMetaArg_ - , customReadWithMetaArg_0 - , customReadWithMetaArg_1 - ] - , customTransformWithMeta = - \customTransformWithMetaArg_ customTransformWithMetaArg_0 customTransformWithMetaArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customTransformWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.var "error" - ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ customTransformWithMetaArg_ - , customTransformWithMetaArg_0 - , customTransformWithMetaArg_1 - ] - , customWriteWithMeta = - \customWriteWithMetaArg_ customWriteWithMetaArg_0 customWriteWithMetaArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customWriteWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.var "error" - ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read" - , Type.namedWith - [ "Basics" ] - "Never" - [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - ) - [ customWriteWithMetaArg_ - , customWriteWithMetaArg_0 - , customWriteWithMetaArg_1 - ] - } - - -values_ : - { pipe : Elm.Expression - , fileRead : Elm.Expression - , fileWrite : Elm.Expression - , fromString : Elm.Expression - , http : Elm.Expression - , httpWithInput : Elm.Expression - , stdin : Elm.Expression - , stdout : Elm.Expression - , stderr : Elm.Expression - , read : Elm.Expression - , readJson : Elm.Expression - , readMetadata : Elm.Expression - , run : Elm.Expression - , command : Elm.Expression - , commandWithOptions : Elm.Expression - , defaultCommandOptions : Elm.Expression - , allowNon0Status : Elm.Expression - , withOutput : Elm.Expression - , withTimeout : Elm.Expression - , gzip : Elm.Expression - , unzip : Elm.Expression - , customRead : Elm.Expression - , customWrite : Elm.Expression - , customDuplex : Elm.Expression - , customReadWithMeta : Elm.Expression - , customTransformWithMeta : Elm.Expression - , customWriteWithMeta : Elm.Expression - } -values_ = - { pipe = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "pipe" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorTo" - , Type.var "metaTo" - , Type.record - [ ( "read", Type.var "toReadable" ) - , ( "write", Type.unit ) - ] - ] - , Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorFrom" - , Type.var "metaFrom" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "fromWriteable" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "errorTo" - , Type.var "metaTo" - , Type.record - [ ( "read", Type.var "toReadable" ) - , ( "write", Type.var "fromWriteable" ) - ] - ] - ) - ) - } - , fileRead = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fileRead" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - , fileWrite = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fileWrite" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - , fromString = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - , http = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "http" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "method", Type.string ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "body" - , Type.namedWith - [ "BackendTask", "Http" ] - "Body" - [] - ) - , ( "retries", Type.maybe Type.int ) - , ( "timeoutInMs", Type.maybe Type.int ) - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.namedWith - [ "BackendTask", "Http" ] - "Error" - [] - , Type.namedWith - [ "BackendTask", "Http" ] - "Metadata" - [] - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - , httpWithInput = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "httpWithInput" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "method", Type.string ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "retries", Type.maybe Type.int ) - , ( "timeoutInMs", Type.maybe Type.int ) - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.namedWith - [ "BackendTask", "Http" ] - "Error" - [] - , Type.namedWith - [ "BackendTask", "Http" ] - "Metadata" - [] - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - , stdin = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "stdin" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - } - , stdout = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "stdout" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - } - , stderr = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "stderr" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - } - , read = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "read" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.string ] - ) - ] - , Type.record - [ ( "metadata", Type.var "metadata" ) - , ( "body", Type.string ) - ] - ] - ) - ) - } - , readJson = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "readJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.var "value" ] - ) - ] - , Type.record - [ ( "metadata", Type.var "metadata" ) - , ( "body", Type.var "value" ) - ] - ] - ) - ) - } - , readMetadata = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "readMetadata" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "BackendTask", "Stream" ] - "Error" - [ Type.var "error", Type.string ] - ) - ] - , Type.var "metadata" - ] - ) - ) - } - , run = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.var "kind" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - ) - } - , command = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.int - , Type.unit - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ) - ) - } - , commandWithOptions = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "commandWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - , Type.string - , Type.list Type.string - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.int - , Type.unit - , Type.record - [ ( "read", Type.var "read" ) - , ( "write", Type.var "write" ) - ] - ] - ) - ) - } - , defaultCommandOptions = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "defaultCommandOptions" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - } - , allowNon0Status = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "allowNon0Status" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - , withOutput = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "withOutput" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask", "Stream" ] - "StderrOutput" - [] - , Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - , withTimeout = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "withTimeout" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "CommandOptions" - [] - ) - ) - } - , gzip = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "gzip" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ), ( "write", Type.unit ) ] - ] - ) - } - , unzip = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "unzip" - , annotation = - Just - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ), ( "write", Type.unit ) ] - ] - ) - } - , customRead = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customRead" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - , customWrite = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customWrite" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - , customDuplex = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customDuplex" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.unit - , Type.unit - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - , customReadWithMeta = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customReadWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.var "error" ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write" - , Type.namedWith [ "Basics" ] "Never" [] - ) - ] - ] - ) - ) - } - , customTransformWithMeta = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customTransformWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.var "error" ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read", Type.unit ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - , customWriteWithMeta = - Elm.value - { importFrom = [ "BackendTask", "Stream" ] - , name = "customWriteWithMeta" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable", Type.var "error" ) - ] - , Type.var "metadata" - ] - ] - ] - (Type.namedWith - [ "BackendTask", "Stream" ] - "Stream" - [ Type.var "error" - , Type.var "metadata" - , Type.record - [ ( "read" - , Type.namedWith [ "Basics" ] "Never" [] - ) - , ( "write", Type.unit ) - ] - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/BackendTask/Time.elm b/codegen/Gen/BackendTask/Time.elm deleted file mode 100644 index ec89104a..00000000 --- a/codegen/Gen/BackendTask/Time.elm +++ /dev/null @@ -1,73 +0,0 @@ -module Gen.BackendTask.Time exposing ( moduleName_, now, values_ ) - -{-| -# Generated bindings for BackendTask.Time - -@docs moduleName_, now, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "BackendTask", "Time" ] - - -{-| Gives a `Time.Posix` of when the `BackendTask` executes. - - type alias Data = - { time : Time.Posix - } - - data : BackendTask FatalError Data - data = - BackendTask.map Data - BackendTask.Time.now - -It's better to use [`Server.Request.requestTime`](Server-Request#requestTime) or `Pages.builtAt` when those are the semantics -you are looking for. `requestTime` gives you a single reliable and consistent time for when the incoming HTTP request was received in -a server-rendered Route or server-rendered API Route. `Pages.builtAt` gives a single reliable and consistent time when the -site was built. - -`BackendTask.Time.now` gives you the time that it happened to execute, which might give you what you need, but be -aware that the time you get is dependent on how BackendTask's are scheduled and executed internally in elm-pages, and -its best to avoid depending on that variation when possible. - -now: BackendTask.BackendTask error Time.Posix --} -now : Elm.Expression -now = - Elm.value - { importFrom = [ "BackendTask", "Time" ] - , name = "now" - , annotation = - Just - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.namedWith [ "Time" ] "Posix" [] ] - ) - } - - -values_ : { now : Elm.Expression } -values_ = - { now = - Elm.value - { importFrom = [ "BackendTask", "Time" ] - , name = "now" - , annotation = - Just - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith [ "Time" ] "Posix" [] - ] - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Bitwise.elm b/codegen/Gen/Bitwise.elm deleted file mode 100644 index d3fadc02..00000000 --- a/codegen/Gen/Bitwise.elm +++ /dev/null @@ -1,302 +0,0 @@ -module Gen.Bitwise exposing - ( moduleName_, and, or, xor, complement, shiftLeftBy - , shiftRightBy, shiftRightZfBy, call_, values_ - ) - -{-| -# Generated bindings for Bitwise - -@docs moduleName_, and, or, xor, complement, shiftLeftBy -@docs shiftRightBy, shiftRightZfBy, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Bitwise" ] - - -{-| Bitwise AND - -and: Int -> Int -> Int --} -and : Int -> Int -> Elm.Expression -and andArg_ andArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "and" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ Elm.int andArg_, Elm.int andArg_0 ] - - -{-| Bitwise OR - -or: Int -> Int -> Int --} -or : Int -> Int -> Elm.Expression -or orArg_ orArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "or" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ Elm.int orArg_, Elm.int orArg_0 ] - - -{-| Bitwise XOR - -xor: Int -> Int -> Int --} -xor : Int -> Int -> Elm.Expression -xor xorArg_ xorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "xor" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ Elm.int xorArg_, Elm.int xorArg_0 ] - - -{-| Flip each bit individually, often called bitwise NOT - -complement: Int -> Int --} -complement : Int -> Elm.Expression -complement complementArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "complement" - , annotation = Just (Type.function [ Type.int ] Type.int) - } - ) - [ Elm.int complementArg_ ] - - -{-| Shift bits to the left by a given offset, filling new bits with zeros. -This can be used to multiply numbers by powers of two. - - shiftLeftBy 1 5 == 10 - shiftLeftBy 5 1 == 32 - -shiftLeftBy: Int -> Int -> Int --} -shiftLeftBy : Int -> Int -> Elm.Expression -shiftLeftBy shiftLeftByArg_ shiftLeftByArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftLeftBy" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ Elm.int shiftLeftByArg_, Elm.int shiftLeftByArg_0 ] - - -{-| Shift bits to the right by a given offset, filling new bits with -whatever is the topmost bit. This can be used to divide numbers by powers of two. - - shiftRightBy 1 32 == 16 - shiftRightBy 2 32 == 8 - shiftRightBy 1 -32 == -16 - -This is called an [arithmetic right shift][ars], often written `>>`, and -sometimes called a sign-propagating right shift because it fills empty spots -with copies of the highest bit. - -[ars]: https://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift - -shiftRightBy: Int -> Int -> Int --} -shiftRightBy : Int -> Int -> Elm.Expression -shiftRightBy shiftRightByArg_ shiftRightByArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftRightBy" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ Elm.int shiftRightByArg_, Elm.int shiftRightByArg_0 ] - - -{-| Shift bits to the right by a given offset, filling new bits with zeros. - - shiftRightZfBy 1 32 == 16 - shiftRightZfBy 2 32 == 8 - shiftRightZfBy 1 -32 == 2147483632 - -This is called an [logical right shift][lrs], often written `>>>`, and -sometimes called a zero-fill right shift because it fills empty spots with -zeros. - -[lrs]: https://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift - -shiftRightZfBy: Int -> Int -> Int --} -shiftRightZfBy : Int -> Int -> Elm.Expression -shiftRightZfBy shiftRightZfByArg_ shiftRightZfByArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftRightZfBy" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ Elm.int shiftRightZfByArg_, Elm.int shiftRightZfByArg_0 ] - - -call_ : - { and : Elm.Expression -> Elm.Expression -> Elm.Expression - , or : Elm.Expression -> Elm.Expression -> Elm.Expression - , xor : Elm.Expression -> Elm.Expression -> Elm.Expression - , complement : Elm.Expression -> Elm.Expression - , shiftLeftBy : Elm.Expression -> Elm.Expression -> Elm.Expression - , shiftRightBy : Elm.Expression -> Elm.Expression -> Elm.Expression - , shiftRightZfBy : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { and = - \andArg_ andArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "and" - , annotation = - Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ andArg_, andArg_0 ] - , or = - \orArg_ orArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "or" - , annotation = - Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ orArg_, orArg_0 ] - , xor = - \xorArg_ xorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "xor" - , annotation = - Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ xorArg_, xorArg_0 ] - , complement = - \complementArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "complement" - , annotation = Just (Type.function [ Type.int ] Type.int) - } - ) - [ complementArg_ ] - , shiftLeftBy = - \shiftLeftByArg_ shiftLeftByArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftLeftBy" - , annotation = - Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ shiftLeftByArg_, shiftLeftByArg_0 ] - , shiftRightBy = - \shiftRightByArg_ shiftRightByArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftRightBy" - , annotation = - Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ shiftRightByArg_, shiftRightByArg_0 ] - , shiftRightZfBy = - \shiftRightZfByArg_ shiftRightZfByArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftRightZfBy" - , annotation = - Just (Type.function [ Type.int, Type.int ] Type.int) - } - ) - [ shiftRightZfByArg_, shiftRightZfByArg_0 ] - } - - -values_ : - { and : Elm.Expression - , or : Elm.Expression - , xor : Elm.Expression - , complement : Elm.Expression - , shiftLeftBy : Elm.Expression - , shiftRightBy : Elm.Expression - , shiftRightZfBy : Elm.Expression - } -values_ = - { and = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "and" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - , or = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "or" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - , xor = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "xor" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - , complement = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "complement" - , annotation = Just (Type.function [ Type.int ] Type.int) - } - , shiftLeftBy = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftLeftBy" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - , shiftRightBy = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftRightBy" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - , shiftRightZfBy = - Elm.value - { importFrom = [ "Bitwise" ] - , name = "shiftRightZfBy" - , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) - } - } \ No newline at end of file diff --git a/codegen/Gen/Bytes/Encode.elm b/codegen/Gen/Bytes/Encode.elm deleted file mode 100644 index 66e6513b..00000000 --- a/codegen/Gen/Bytes/Encode.elm +++ /dev/null @@ -1,863 +0,0 @@ -module Gen.Bytes.Encode exposing - ( moduleName_, encode, sequence, signedInt8, signedInt16, signedInt32 - , unsignedInt8, unsignedInt16, unsignedInt32, float32, float64, bytes, string - , getStringWidth, annotation_, call_, values_ - ) - -{-| -# Generated bindings for Bytes.Encode - -@docs moduleName_, encode, sequence, signedInt8, signedInt16, signedInt32 -@docs unsignedInt8, unsignedInt16, unsignedInt32, float32, float64, bytes -@docs string, getStringWidth, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Bytes", "Encode" ] - - -{-| Turn an `Encoder` into `Bytes`. - - encode (unsignedInt8 7) -- <07> - encode (unsignedInt16 BE 7) -- <0007> - encode (unsignedInt16 LE 7) -- <0700> - -The `encode` function is designed to minimize allocation. It figures out the -exact width necessary to fit everything in `Bytes` and then generate that -value directly. This is valuable when you are encoding more elaborate data: - - import Bytes exposing (Endianness(..)) - import Bytes.Encode as Encode - - type alias Person = - { age : Int - , name : String - } - - toEncoder : Person -> Encode.Encoder - toEncoder person = - Encode.sequence - [ Encode.unsignedInt16 BE person.age - , Encode.unsignedInt16 BE (Encode.getStringWidth person.name) - , Encode.string person.name - ] - - -- encode (toEncoder (Person 33 "Tom")) == <00210003546F6D> - -Did you know it was going to be seven bytes? How about when you have a hundred -people to serialize? And when some have Japanese and Norwegian names? Having -this intermediate `Encoder` can help reduce allocation quite a lot! - -encode: Bytes.Encode.Encoder -> Bytes.Bytes --} -encode : Elm.Expression -> Elm.Expression -encode encodeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "encode" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] ] - (Type.namedWith [ "Bytes" ] "Bytes" []) - ) - } - ) - [ encodeArg_ ] - - -{-| Put together a bunch of builders. So if you wanted to encode three `Float` -values for the position of a ball in 3D space, you could say: - - import Bytes exposing (Endianness(..)) - import Bytes.Encode as Encode - - type alias Ball = { x : Float, y : Float, z : Float } - - ball : Ball -> Encode.Encoder - ball {x,y,z} = - Encode.sequence - [ Encode.float32 BE x - , Encode.float32 BE y - , Encode.float32 BE z - ] - -sequence: List Bytes.Encode.Encoder -> Bytes.Encode.Encoder --} -sequence : List Elm.Expression -> Elm.Expression -sequence sequenceArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] - ) - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ Elm.list sequenceArg_ ] - - -{-| Encode integers from `-128` to `127` in one byte. - -signedInt8: Int -> Bytes.Encode.Encoder --} -signedInt8 : Int -> Elm.Expression -signedInt8 signedInt8Arg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt8" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ Elm.int signedInt8Arg_ ] - - -{-| Encode integers from `-32768` to `32767` in two bytes. - -signedInt16: Bytes.Endianness -> Int -> Bytes.Encode.Encoder --} -signedInt16 : Elm.Expression -> Int -> Elm.Expression -signedInt16 signedInt16Arg_ signedInt16Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt16" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ signedInt16Arg_, Elm.int signedInt16Arg_0 ] - - -{-| Encode integers from `-2147483648` to `2147483647` in four bytes. - -signedInt32: Bytes.Endianness -> Int -> Bytes.Encode.Encoder --} -signedInt32 : Elm.Expression -> Int -> Elm.Expression -signedInt32 signedInt32Arg_ signedInt32Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ signedInt32Arg_, Elm.int signedInt32Arg_0 ] - - -{-| Encode integers from `0` to `255` in one byte. - -unsignedInt8: Int -> Bytes.Encode.Encoder --} -unsignedInt8 : Int -> Elm.Expression -unsignedInt8 unsignedInt8Arg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt8" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ Elm.int unsignedInt8Arg_ ] - - -{-| Encode integers from `0` to `65535` in two bytes. - -unsignedInt16: Bytes.Endianness -> Int -> Bytes.Encode.Encoder --} -unsignedInt16 : Elm.Expression -> Int -> Elm.Expression -unsignedInt16 unsignedInt16Arg_ unsignedInt16Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt16" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ unsignedInt16Arg_, Elm.int unsignedInt16Arg_0 ] - - -{-| Encode integers from `0` to `4294967295` in four bytes. - -unsignedInt32: Bytes.Endianness -> Int -> Bytes.Encode.Encoder --} -unsignedInt32 : Elm.Expression -> Int -> Elm.Expression -unsignedInt32 unsignedInt32Arg_ unsignedInt32Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ unsignedInt32Arg_, Elm.int unsignedInt32Arg_0 ] - - -{-| Encode 32-bit floating point numbers in four bytes. - -float32: Bytes.Endianness -> Float -> Bytes.Encode.Encoder --} -float32 : Elm.Expression -> Float -> Elm.Expression -float32 float32Arg_ float32Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "float32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.float - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ float32Arg_, Elm.float float32Arg_0 ] - - -{-| Encode 64-bit floating point numbers in eight bytes. - -float64: Bytes.Endianness -> Float -> Bytes.Encode.Encoder --} -float64 : Elm.Expression -> Float -> Elm.Expression -float64 float64Arg_ float64Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "float64" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.float - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ float64Arg_, Elm.float float64Arg_0 ] - - -{-| Copy bytes directly into the new `Bytes` sequence. This does not record the -width though! You usually want to say something like this: - - import Bytes exposing (Bytes, Endianness(..)) - import Bytes.Encode as Encode - - png : Bytes -> Encode.Encoder - png imageData = - Encode.sequence - [ Encode.unsignedInt32 BE (Bytes.width imageData) - , Encode.bytes imageData - ] - -This allows you to represent the width however is necessary for your protocol. -For example, you can use [Base 128 Varints][pb] for ProtoBuf, -[Variable-Length Integers][sql] for SQLite, or whatever else they dream up. - -[pb]: https://developers.google.com/protocol-buffers/docs/encoding#varints -[sql]: https://www.sqlite.org/src4/doc/trunk/www/varint.wiki - -bytes: Bytes.Bytes -> Bytes.Encode.Encoder --} -bytes : Elm.Expression -> Elm.Expression -bytes bytesArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "bytes" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ bytesArg_ ] - - -{-| Encode a `String` as a bunch of UTF-8 bytes. - - encode (string "$20") -- <24 32 30> - encode (string "£20") -- - encode (string "€20") -- - encode (string "bread") -- <62 72 65 61 64> - encode (string "brød") -- <62 72 C3B8 64> - -Some characters take one byte, while others can take up to four. Read more -about [UTF-8](https://en.wikipedia.org/wiki/UTF-8) to learn the details! - -But if you just encode UTF-8 directly, how can you know when you get to the end -of the string when you are decoding? So most protocols have an integer saying -how many bytes follow, like this: - - sizedString : String -> Encoder - sizedString str = - sequence - [ unsignedInt32 BE (getStringWidth str) - , string str - ] - -You can choose whatever representation you want for the width, which is helpful -because many protocols use different integer representations to save space. For -example: - -- ProtoBuf uses [Base 128 Varints](https://developers.google.com/protocol-buffers/docs/encoding#varints) -- SQLite uses [Variable-Length Integers](https://www.sqlite.org/src4/doc/trunk/www/varint.wiki) - -In both cases, small numbers can fit just one byte, saving some space. (The -SQLite encoding has the benefit that the first byte tells you how long the -number is, making it faster to decode.) In both cases, it is sort of tricky -to make negative numbers small. - -string: String -> Bytes.Encode.Encoder --} -string : String -> Elm.Expression -string stringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - ) - [ Elm.string stringArg_ ] - - -{-| Get the width of a `String` in UTF-8 bytes. - - getStringWidth "$20" == 3 - getStringWidth "£20" == 4 - getStringWidth "€20" == 5 - getStringWidth "bread" == 5 - getStringWidth "brød" == 5 - -Most protocols need this number to come directly before a chunk of UTF-8 bytes -as a way to know where the string ends! - -Read more about how UTF-8 works [here](https://en.wikipedia.org/wiki/UTF-8). - -getStringWidth: String -> Int --} -getStringWidth : String -> Elm.Expression -getStringWidth getStringWidthArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "getStringWidth" - , annotation = Just (Type.function [ Type.string ] Type.int) - } - ) - [ Elm.string getStringWidthArg_ ] - - -annotation_ : { encoder : Type.Annotation } -annotation_ = - { encoder = Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] } - - -call_ : - { encode : Elm.Expression -> Elm.Expression - , sequence : Elm.Expression -> Elm.Expression - , signedInt8 : Elm.Expression -> Elm.Expression - , signedInt16 : Elm.Expression -> Elm.Expression -> Elm.Expression - , signedInt32 : Elm.Expression -> Elm.Expression -> Elm.Expression - , unsignedInt8 : Elm.Expression -> Elm.Expression - , unsignedInt16 : Elm.Expression -> Elm.Expression -> Elm.Expression - , unsignedInt32 : Elm.Expression -> Elm.Expression -> Elm.Expression - , float32 : Elm.Expression -> Elm.Expression -> Elm.Expression - , float64 : Elm.Expression -> Elm.Expression -> Elm.Expression - , bytes : Elm.Expression -> Elm.Expression - , string : Elm.Expression -> Elm.Expression - , getStringWidth : Elm.Expression -> Elm.Expression - } -call_ = - { encode = - \encodeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "encode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ] - (Type.namedWith [ "Bytes" ] "Bytes" []) - ) - } - ) - [ encodeArg_ ] - , sequence = - \sequenceArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ sequenceArg_ ] - , signedInt8 = - \signedInt8Arg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt8" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ signedInt8Arg_ ] - , signedInt16 = - \signedInt16Arg_ signedInt16Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt16" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ signedInt16Arg_, signedInt16Arg_0 ] - , signedInt32 = - \signedInt32Arg_ signedInt32Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ signedInt32Arg_, signedInt32Arg_0 ] - , unsignedInt8 = - \unsignedInt8Arg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt8" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ unsignedInt8Arg_ ] - , unsignedInt16 = - \unsignedInt16Arg_ unsignedInt16Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt16" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ unsignedInt16Arg_, unsignedInt16Arg_0 ] - , unsignedInt32 = - \unsignedInt32Arg_ unsignedInt32Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ unsignedInt32Arg_, unsignedInt32Arg_0 ] - , float32 = - \float32Arg_ float32Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "float32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.float - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ float32Arg_, float32Arg_0 ] - , float64 = - \float64Arg_ float64Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "float64" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.float - ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ float64Arg_, float64Arg_0 ] - , bytes = - \bytesArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "bytes" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ bytesArg_ ] - , string = - \stringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Bytes", "Encode" ] - "Encoder" - [] - ) - ) - } - ) - [ stringArg_ ] - , getStringWidth = - \getStringWidthArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "getStringWidth" - , annotation = - Just (Type.function [ Type.string ] Type.int) - } - ) - [ getStringWidthArg_ ] - } - - -values_ : - { encode : Elm.Expression - , sequence : Elm.Expression - , signedInt8 : Elm.Expression - , signedInt16 : Elm.Expression - , signedInt32 : Elm.Expression - , unsignedInt8 : Elm.Expression - , unsignedInt16 : Elm.Expression - , unsignedInt32 : Elm.Expression - , float32 : Elm.Expression - , float64 : Elm.Expression - , bytes : Elm.Expression - , string : Elm.Expression - , getStringWidth : Elm.Expression - } -values_ = - { encode = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "encode" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] ] - (Type.namedWith [ "Bytes" ] "Bytes" []) - ) - } - , sequence = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , signedInt8 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt8" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , signedInt16 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt16" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , signedInt32 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "signedInt32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , unsignedInt8 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt8" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , unsignedInt16 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt16" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , unsignedInt32 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "unsignedInt32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.int - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , float32 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "float32" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.float - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , float64 = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "float64" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Endianness" [] - , Type.float - ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , bytes = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "bytes" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , string = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) - ) - } - , getStringWidth = - Elm.value - { importFrom = [ "Bytes", "Encode" ] - , name = "getStringWidth" - , annotation = Just (Type.function [ Type.string ] Type.int) - } - } \ No newline at end of file diff --git a/codegen/Gen/Char.elm b/codegen/Gen/Char.elm deleted file mode 100644 index 06af506e..00000000 --- a/codegen/Gen/Char.elm +++ /dev/null @@ -1,560 +0,0 @@ -module Gen.Char exposing - ( moduleName_, isUpper, isLower, isAlpha, isAlphaNum, isDigit - , isOctDigit, isHexDigit, toUpper, toLower, toLocaleUpper, toLocaleLower, toCode - , fromCode, annotation_, call_, values_ - ) - -{-| -# Generated bindings for Char - -@docs moduleName_, isUpper, isLower, isAlpha, isAlphaNum, isDigit -@docs isOctDigit, isHexDigit, toUpper, toLower, toLocaleUpper, toLocaleLower -@docs toCode, fromCode, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Char" ] - - -{-| Detect upper case ASCII characters. - - isUpper 'A' == True - isUpper 'B' == True - ... - isUpper 'Z' == True - - isUpper '0' == False - isUpper 'a' == False - isUpper '-' == False - isUpper 'Σ' == False - -isUpper: Char.Char -> Bool --} -isUpper : Char.Char -> Elm.Expression -isUpper isUpperArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isUpper" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isUpperArg_ ] - - -{-| Detect lower case ASCII characters. - - isLower 'a' == True - isLower 'b' == True - ... - isLower 'z' == True - - isLower '0' == False - isLower 'A' == False - isLower '-' == False - isLower 'π' == False - -isLower: Char.Char -> Bool --} -isLower : Char.Char -> Elm.Expression -isLower isLowerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isLower" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isLowerArg_ ] - - -{-| Detect upper case and lower case ASCII characters. - - isAlpha 'a' == True - isAlpha 'b' == True - isAlpha 'E' == True - isAlpha 'Y' == True - - isAlpha '0' == False - isAlpha '-' == False - isAlpha 'π' == False - -isAlpha: Char.Char -> Bool --} -isAlpha : Char.Char -> Elm.Expression -isAlpha isAlphaArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isAlpha" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isAlphaArg_ ] - - -{-| Detect upper case and lower case ASCII characters. - - isAlphaNum 'a' == True - isAlphaNum 'b' == True - isAlphaNum 'E' == True - isAlphaNum 'Y' == True - isAlphaNum '0' == True - isAlphaNum '7' == True - - isAlphaNum '-' == False - isAlphaNum 'π' == False - -isAlphaNum: Char.Char -> Bool --} -isAlphaNum : Char.Char -> Elm.Expression -isAlphaNum isAlphaNumArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isAlphaNum" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isAlphaNumArg_ ] - - -{-| Detect digits `0123456789` - - isDigit '0' == True - isDigit '1' == True - ... - isDigit '9' == True - - isDigit 'a' == False - isDigit 'b' == False - isDigit 'A' == False - -isDigit: Char.Char -> Bool --} -isDigit : Char.Char -> Elm.Expression -isDigit isDigitArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isDigitArg_ ] - - -{-| Detect octal digits `01234567` - - isOctDigit '0' == True - isOctDigit '1' == True - ... - isOctDigit '7' == True - - isOctDigit '8' == False - isOctDigit 'a' == False - isOctDigit 'A' == False - -isOctDigit: Char.Char -> Bool --} -isOctDigit : Char.Char -> Elm.Expression -isOctDigit isOctDigitArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isOctDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isOctDigitArg_ ] - - -{-| Detect hexadecimal digits `0123456789abcdefABCDEF` - -isHexDigit: Char.Char -> Bool --} -isHexDigit : Char.Char -> Elm.Expression -isHexDigit isHexDigitArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isHexDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ Elm.char isHexDigitArg_ ] - - -{-| Convert to upper case. - -toUpper: Char.Char -> Char.Char --} -toUpper : Char.Char -> Elm.Expression -toUpper toUpperArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toUpper" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ Elm.char toUpperArg_ ] - - -{-| Convert to lower case. - -toLower: Char.Char -> Char.Char --} -toLower : Char.Char -> Elm.Expression -toLower toLowerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toLower" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ Elm.char toLowerArg_ ] - - -{-| Convert to upper case, according to any locale-specific case mappings. - -toLocaleUpper: Char.Char -> Char.Char --} -toLocaleUpper : Char.Char -> Elm.Expression -toLocaleUpper toLocaleUpperArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toLocaleUpper" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ Elm.char toLocaleUpperArg_ ] - - -{-| Convert to lower case, according to any locale-specific case mappings. - -toLocaleLower: Char.Char -> Char.Char --} -toLocaleLower : Char.Char -> Elm.Expression -toLocaleLower toLocaleLowerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toLocaleLower" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ Elm.char toLocaleLowerArg_ ] - - -{-| Convert to the corresponding Unicode [code point][cp]. - -[cp]: https://en.wikipedia.org/wiki/Code_point - - toCode 'A' == 65 - toCode 'B' == 66 - toCode '木' == 0x6728 - toCode '𝌆' == 0x1D306 - toCode '😃' == 0x1F603 - -toCode: Char.Char -> Int --} -toCode : Char.Char -> Elm.Expression -toCode toCodeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toCode" - , annotation = Just (Type.function [ Type.char ] Type.int) - } - ) - [ Elm.char toCodeArg_ ] - - -{-| Convert a Unicode [code point][cp] to a character. - - fromCode 65 == 'A' - fromCode 66 == 'B' - fromCode 0x6728 == '木' - fromCode 0x1D306 == '𝌆' - fromCode 0x1F603 == '😃' - fromCode -1 == '�' - -The full range of unicode is from `0` to `0x10FFFF`. With numbers outside that -range, you get [the replacement character][fffd]. - -[cp]: https://en.wikipedia.org/wiki/Code_point -[fffd]: https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character - -fromCode: Int -> Char.Char --} -fromCode : Int -> Elm.Expression -fromCode fromCodeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "fromCode" - , annotation = Just (Type.function [ Type.int ] Type.char) - } - ) - [ Elm.int fromCodeArg_ ] - - -annotation_ : { char : Type.Annotation } -annotation_ = - { char = Type.namedWith [] "Char" [] } - - -call_ : - { isUpper : Elm.Expression -> Elm.Expression - , isLower : Elm.Expression -> Elm.Expression - , isAlpha : Elm.Expression -> Elm.Expression - , isAlphaNum : Elm.Expression -> Elm.Expression - , isDigit : Elm.Expression -> Elm.Expression - , isOctDigit : Elm.Expression -> Elm.Expression - , isHexDigit : Elm.Expression -> Elm.Expression - , toUpper : Elm.Expression -> Elm.Expression - , toLower : Elm.Expression -> Elm.Expression - , toLocaleUpper : Elm.Expression -> Elm.Expression - , toLocaleLower : Elm.Expression -> Elm.Expression - , toCode : Elm.Expression -> Elm.Expression - , fromCode : Elm.Expression -> Elm.Expression - } -call_ = - { isUpper = - \isUpperArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isUpper" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isUpperArg_ ] - , isLower = - \isLowerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isLower" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isLowerArg_ ] - , isAlpha = - \isAlphaArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isAlpha" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isAlphaArg_ ] - , isAlphaNum = - \isAlphaNumArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isAlphaNum" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isAlphaNumArg_ ] - , isDigit = - \isDigitArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isDigitArg_ ] - , isOctDigit = - \isOctDigitArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isOctDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isOctDigitArg_ ] - , isHexDigit = - \isHexDigitArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "isHexDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - ) - [ isHexDigitArg_ ] - , toUpper = - \toUpperArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toUpper" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ toUpperArg_ ] - , toLower = - \toLowerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toLower" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ toLowerArg_ ] - , toLocaleUpper = - \toLocaleUpperArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toLocaleUpper" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ toLocaleUpperArg_ ] - , toLocaleLower = - \toLocaleLowerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toLocaleLower" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - ) - [ toLocaleLowerArg_ ] - , toCode = - \toCodeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "toCode" - , annotation = Just (Type.function [ Type.char ] Type.int) - } - ) - [ toCodeArg_ ] - , fromCode = - \fromCodeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Char" ] - , name = "fromCode" - , annotation = Just (Type.function [ Type.int ] Type.char) - } - ) - [ fromCodeArg_ ] - } - - -values_ : - { isUpper : Elm.Expression - , isLower : Elm.Expression - , isAlpha : Elm.Expression - , isAlphaNum : Elm.Expression - , isDigit : Elm.Expression - , isOctDigit : Elm.Expression - , isHexDigit : Elm.Expression - , toUpper : Elm.Expression - , toLower : Elm.Expression - , toLocaleUpper : Elm.Expression - , toLocaleLower : Elm.Expression - , toCode : Elm.Expression - , fromCode : Elm.Expression - } -values_ = - { isUpper = - Elm.value - { importFrom = [ "Char" ] - , name = "isUpper" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , isLower = - Elm.value - { importFrom = [ "Char" ] - , name = "isLower" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , isAlpha = - Elm.value - { importFrom = [ "Char" ] - , name = "isAlpha" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , isAlphaNum = - Elm.value - { importFrom = [ "Char" ] - , name = "isAlphaNum" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , isDigit = - Elm.value - { importFrom = [ "Char" ] - , name = "isDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , isOctDigit = - Elm.value - { importFrom = [ "Char" ] - , name = "isOctDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , isHexDigit = - Elm.value - { importFrom = [ "Char" ] - , name = "isHexDigit" - , annotation = Just (Type.function [ Type.char ] Type.bool) - } - , toUpper = - Elm.value - { importFrom = [ "Char" ] - , name = "toUpper" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - , toLower = - Elm.value - { importFrom = [ "Char" ] - , name = "toLower" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - , toLocaleUpper = - Elm.value - { importFrom = [ "Char" ] - , name = "toLocaleUpper" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - , toLocaleLower = - Elm.value - { importFrom = [ "Char" ] - , name = "toLocaleLower" - , annotation = Just (Type.function [ Type.char ] Type.char) - } - , toCode = - Elm.value - { importFrom = [ "Char" ] - , name = "toCode" - , annotation = Just (Type.function [ Type.char ] Type.int) - } - , fromCode = - Elm.value - { importFrom = [ "Char" ] - , name = "fromCode" - , annotation = Just (Type.function [ Type.int ] Type.char) - } - } \ No newline at end of file diff --git a/codegen/Gen/CodeGen/Generate.elm b/codegen/Gen/CodeGen/Generate.elm deleted file mode 100644 index dd4b5a8c..00000000 --- a/codegen/Gen/CodeGen/Generate.elm +++ /dev/null @@ -1,240 +0,0 @@ -port module Gen.CodeGen.Generate exposing - ( run, fromJson, fromText, fromDirectory, directoryDecoder - , withFeedback, Error - , File, Directory(..) - , error, files, info - ) - -{-| - - -# Simple API - -@docs run, fromJson, fromText, fromDirectory, directoryDecoder - - -# With errors - -@docs withFeedback, Error - - -# Types - -@docs File, Directory - - -# Flexible API - -This is the low level API if you need more control over the generation process proceeds. - -@docs error, files, info - --} - -import Dict exposing (Dict) -import Json.Decode exposing (Decoder) -import Json.Encode as Json - - -{-| Produce a list of files without taking input. --} -run : List File -> Program flags () () -run f = - Platform.worker - { init = - \_ -> - ( () - , files f - ) - , update = - \_ model -> - ( model, Cmd.none ) - , subscriptions = \_ -> Sub.none - } - - -{-| Given the flags, decoded from JSON, produce a list of files as output. --} -fromJson : Decoder flags -> (flags -> List File) -> Program Json.Value () () -fromJson decoder f = - Platform.worker - { init = - \flags -> - case Json.Decode.decodeValue decoder flags of - Ok input -> - ( () - , files (f input) - ) - - Err e -> - ( () - , error - [ { title = "Error decoding flags" - , description = Json.Decode.errorToString e - } - ] - ) - , update = - \_ model -> - ( model, Cmd.none ) - , subscriptions = \_ -> Sub.none - } - - -{-| Given the file passed in with `--flags-from` as String, produce a list of files as output. --} -fromText : (String -> List File) -> Program String () () -fromText f = - Platform.worker - { init = - \flags -> - ( () - , files (f flags) - ) - , update = - \_ model -> - ( model, Cmd.none ) - , subscriptions = \_ -> Sub.none - } - - -{-| Given the directory passed in with `--flags-from` as a file tree, produce a list of files as output. --} -fromDirectory : (Directory -> List File) -> Program Json.Value () () -fromDirectory f = - Platform.worker - { init = - \flags -> - case Json.Decode.decodeValue directoryDecoder flags of - Ok input -> - ( () - , files (f input) - ) - - Err e -> - ( () - , error - [ { title = "Error decoding flags" - , description = Json.Decode.errorToString e - } - ] - ) - , update = - \_ model -> - ( model, Cmd.none ) - , subscriptions = \_ -> Sub.none - } - - -directoryDecoder : Decoder Directory -directoryDecoder = - Json.Decode.lazy - (\_ -> - Json.Decode.oneOf - [ Json.Decode.map Ok Json.Decode.string - , Json.Decode.map Err directoryDecoder - ] - |> Json.Decode.dict - |> Json.Decode.map - (\entries -> - entries - |> Dict.toList - |> List.foldl - (\( name, entry ) ( dirAcc, fileAcc ) -> - case entry of - Ok file -> - ( dirAcc, ( name, file ) :: fileAcc ) - - Err directory -> - ( ( name, directory ) :: dirAcc, fileAcc ) - ) - ( [], [] ) - |> (\( dirAcc, fileAcc ) -> - Directory - { directories = Dict.fromList dirAcc - , files = Dict.fromList fileAcc - } - ) - ) - ) - - -type Directory - = Directory - { files : Dict String String - , directories : Dict String Directory - } - - -type alias File = - { path : String - , contents : String - , warnings : - List - { declaration : String - , warning : String - } - } - - -type alias Error = - { title : String - , description : String - } - - -withFeedback : - (flags - -> Result (List Error) { info : List String, files : List File } - ) - -> Program flags () () -withFeedback f = - Platform.worker - { init = - \flags -> - ( () - , case f flags of - Ok result -> - Cmd.batch <| - List.map info result.info - ++ [ files result.files ] - - Err errors -> - error errors - ) - , update = - \_ model -> - ( model, Cmd.none ) - , subscriptions = \_ -> Sub.none - } - - -{-| Provide the list of files to be generated. -These files will be generated and the script will end. --} -files : List File -> Cmd msg -files list = - onSuccessSend list - - -{-| Report an error. The script will end. --} -error : List Error -> Cmd msg -error errs = - onFailureSend errs - - -{-| Report some info. The script will continue to run. --} -info : String -> Cmd msg -info err = - onInfoSend err - - -port onSuccessSend : List File -> Cmd msg - - -port onFailureSend : List Error -> Cmd msg - - -port onInfoSend : String -> Cmd msg diff --git a/codegen/Gen/Head.elm b/codegen/Gen/Head.elm deleted file mode 100644 index 21f51c49..00000000 --- a/codegen/Gen/Head.elm +++ /dev/null @@ -1,1046 +0,0 @@ -module Gen.Head exposing - ( moduleName_, metaName, metaProperty, metaRedirect, rssLink, sitemapLink - , rootLanguage, manifestLink, nonLoadingNode, structuredData, currentPageFullUrl, urlAttribute, raw - , appleTouchIcon, icon, toJson, canonicalLink, annotation_, call_, values_ - ) - -{-| -# Generated bindings for Head - -@docs moduleName_, metaName, metaProperty, metaRedirect, rssLink, sitemapLink -@docs rootLanguage, manifestLink, nonLoadingNode, structuredData, currentPageFullUrl, urlAttribute -@docs raw, appleTouchIcon, icon, toJson, canonicalLink, annotation_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Head" ] - - -{-| Example: - - Head.metaName "twitter:card" (Head.raw "summary_large_image") - -Results in `` - -metaName: String -> Head.AttributeValue -> Head.Tag --} -metaName : String -> Elm.Expression -> Elm.Expression -metaName metaNameArg_ metaNameArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.string metaNameArg_, metaNameArg_0 ] - - -{-| Example: - - Head.metaProperty "fb:app_id" (Head.raw "123456789") - -Results in `` - -metaProperty: String -> Head.AttributeValue -> Head.Tag --} -metaProperty : String -> Elm.Expression -> Elm.Expression -metaProperty metaPropertyArg_ metaPropertyArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.string metaPropertyArg_, metaPropertyArg_0 ] - - -{-| Example: - - metaRedirect (Raw "0; url=https://google.com") - -Results in `` - -metaRedirect: Head.AttributeValue -> Head.Tag --} -metaRedirect : Elm.Expression -> Elm.Expression -metaRedirect metaRedirectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head" ] "AttributeValue" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaRedirectArg_ ] - - -{-| Add a link to the site's RSS feed. - -Example: - - rssLink "/feed.xml" - -```html - -``` - -rssLink: String -> Head.Tag --} -rssLink : String -> Elm.Expression -rssLink rssLinkArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.string rssLinkArg_ ] - - -{-| Add a link to the site's RSS feed. - -Example: - - sitemapLink "/feed.xml" - -```html - -``` - -sitemapLink: String -> Head.Tag --} -sitemapLink : String -> Elm.Expression -sitemapLink sitemapLinkArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.string sitemapLinkArg_ ] - - -{-| Set the language for a page. - - - - import Head - import LanguageTag - import LanguageTag.Language - - LanguageTag.Language.de -- sets the page's language to German - |> LanguageTag.build LanguageTag.emptySubtags - |> Head.rootLanguage - -This results pre-rendered HTML with a global lang tag set. - -```html - -... - -``` - -rootLanguage: LanguageTag.LanguageTag -> Head.Tag --} -rootLanguage : Elm.Expression -> Elm.Expression -rootLanguage rootLanguageArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rootLanguageArg_ ] - - -{-| Let's you link to your manifest.json file, see . - -manifestLink: String -> Head.Tag --} -manifestLink : String -> Elm.Expression -manifestLink manifestLinkArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.string manifestLinkArg_ ] - - -{-| Escape hatch for any head tags that don't have high-level helpers. This lets you build arbitrary head nodes as long as they -are not loading or preloading directives. - -Tags that do loading/pre-loading will not work from this function. `elm-pages` uses ViteJS for loading assets like -script tags, stylesheets, fonts, etc., and allows you to customize which assets to preload and how through the elm-pages.config.mjs file. -See the full discussion of the design in [#339](https://github.com/dillonkearns/elm-pages/discussions/339). - -So for example the following tags would _not_ load if defined through `nonLoadingNode`, and would instead need to be registered through Vite: - - - ` -``` - -To get that data, you would write this in your `elm-pages` head tags: - - import Json.Encode as Encode - - {-| - -} - encodeArticle : - { title : String - , description : String - , author : StructuredDataHelper { authorMemberOf | personOrOrganization : () } authorPossibleFields - , publisher : StructuredDataHelper { publisherMemberOf | personOrOrganization : () } publisherPossibleFields - , url : String - , imageUrl : String - , datePublished : String - , mainEntityOfPage : Encode.Value - } - -> Head.Tag - encodeArticle info = - Encode.object - [ ( "@context", Encode.string "http://schema.org/" ) - , ( "@type", Encode.string "Article" ) - , ( "headline", Encode.string info.title ) - , ( "description", Encode.string info.description ) - , ( "image", Encode.string info.imageUrl ) - , ( "author", encode info.author ) - , ( "publisher", encode info.publisher ) - , ( "url", Encode.string info.url ) - , ( "datePublished", Encode.string info.datePublished ) - , ( "mainEntityOfPage", info.mainEntityOfPage ) - ] - |> Head.structuredData - -Take a look at this [Google Search Gallery](https://developers.google.com/search/docs/guides/search-gallery) -to see some examples of how structured data can be used by search engines to give rich search results. It can help boost -your rankings, get better engagement for your content, and also make your content more accessible. For example, -voice assistant devices can make use of structured data. If you're hosting a conference and want to make the event -date and location easy for attendees to find, this can make that information more accessible. - -For the current version of API, you'll need to make sure that the format is correct and contains the required and recommended -structure. - -Check out for a comprehensive listing of possible data types and fields. And take a look at -Google's [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool) -too make sure that your structured data is valid and includes the recommended values. - -In the future, `elm-pages` will likely support a typed API, but schema.org is a massive spec, and changes frequently. -And there are multiple sources of information on the possible and recommended structure. So it will take some time -for the right API design to evolve. In the meantime, this allows you to make use of this for SEO purposes. - -structuredData: Json.Encode.Value -> Head.Tag --} -structuredData : Elm.Expression -> Elm.Expression -structuredData structuredDataArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ structuredDataArg_ ] - - -{-| Create an `AttributeValue` representing the current page's full url. - -currentPageFullUrl: Head.AttributeValue --} -currentPageFullUrl : Elm.Expression -currentPageFullUrl = - Elm.value - { importFrom = [ "Head" ] - , name = "currentPageFullUrl" - , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) - } - - -{-| Create an `AttributeValue` from an `ImagePath`. - -urlAttribute: Pages.Url.Url -> Head.AttributeValue --} -urlAttribute : Elm.Expression -> Elm.Expression -urlAttribute urlAttributeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - ) - [ urlAttributeArg_ ] - - -{-| Create a raw `AttributeValue` (as opposed to some kind of absolute URL). - -raw: String -> Head.AttributeValue --} -raw : String -> Elm.Expression -raw rawArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - ) - [ Elm.string rawArg_ ] - - -{-| Note: the type must be png. -See . - -If a size is provided, it will be turned into square dimensions as per the recommendations here: - -Images must be png's, and non-transparent images are recommended. Current recommended dimensions are 180px and 192px. - -appleTouchIcon: Maybe Int -> Pages.Url.Url -> Head.Tag --} -appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression -appleTouchIcon appleTouchIconArg_ appleTouchIconArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ appleTouchIconArg_, appleTouchIconArg_0 ] - - -{-| icon: List ( Int, Int ) -> MimeType.MimeImage -> Pages.Url.Url -> Head.Tag -} -icon : List Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -icon iconArg_ iconArg_0 iconArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.list iconArg_, iconArg_0, iconArg_1 ] - - -{-| Feel free to use this, but in 99% of cases you won't need it. The generated -code will run this for you to generate your `manifest.json` file automatically! - -toJson: String -> String -> Head.Tag -> Json.Encode.Value --} -toJson : String -> String -> Elm.Expression -> Elm.Expression -toJson toJsonArg_ toJsonArg_0 toJsonArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ Elm.string toJsonArg_, Elm.string toJsonArg_0, toJsonArg_1 ] - - -{-| It's recommended that you use the `Seo` module helpers, which will provide this -for you, rather than directly using this. - -Example: - - Head.canonicalLink "https://elm-pages.com" - -canonicalLink: Maybe String -> Head.Tag --} -canonicalLink : Elm.Expression -> Elm.Expression -canonicalLink canonicalLinkArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ canonicalLinkArg_ ] - - -annotation_ : { tag : Type.Annotation, attributeValue : Type.Annotation } -annotation_ = - { tag = Type.namedWith [ "Head" ] "Tag" [] - , attributeValue = Type.namedWith [ "Head" ] "AttributeValue" [] - } - - -call_ : - { metaName : Elm.Expression -> Elm.Expression -> Elm.Expression - , metaProperty : Elm.Expression -> Elm.Expression -> Elm.Expression - , metaRedirect : Elm.Expression -> Elm.Expression - , rssLink : Elm.Expression -> Elm.Expression - , sitemapLink : Elm.Expression -> Elm.Expression - , rootLanguage : Elm.Expression -> Elm.Expression - , manifestLink : Elm.Expression -> Elm.Expression - , nonLoadingNode : Elm.Expression -> Elm.Expression -> Elm.Expression - , structuredData : Elm.Expression -> Elm.Expression - , urlAttribute : Elm.Expression -> Elm.Expression - , raw : Elm.Expression -> Elm.Expression - , appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression - , icon : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , canonicalLink : Elm.Expression -> Elm.Expression - } -call_ = - { metaName = - \metaNameArg_ metaNameArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaNameArg_, metaNameArg_0 ] - , metaProperty = - \metaPropertyArg_ metaPropertyArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaPropertyArg_, metaPropertyArg_0 ] - , metaRedirect = - \metaRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaRedirectArg_ ] - , rssLink = - \rssLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rssLinkArg_ ] - , sitemapLink = - \sitemapLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ sitemapLinkArg_ ] - , rootLanguage = - \rootLanguageArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "LanguageTag" ] - "LanguageTag" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rootLanguageArg_ ] - , manifestLink = - \manifestLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ manifestLinkArg_ ] - , nonLoadingNode = - \nonLoadingNodeArg_ nonLoadingNodeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "nonLoadingNode" - , annotation = - Just - (Type.function - [ Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ) - ) - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ nonLoadingNodeArg_, nonLoadingNodeArg_0 ] - , structuredData = - \structuredDataArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ structuredDataArg_ ] - , urlAttribute = - \urlAttributeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" [] - ) - ) - } - ) - [ urlAttributeArg_ ] - , raw = - \rawArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" [] - ) - ) - } - ) - [ rawArg_ ] - , appleTouchIcon = - \appleTouchIconArg_ appleTouchIconArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ appleTouchIconArg_, appleTouchIconArg_0 ] - , icon = - \iconArg_ iconArg_0 iconArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ iconArg_, iconArg_0, iconArg_1 ] - , toJson = - \toJsonArg_ toJsonArg_0 toJsonArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_, toJsonArg_0, toJsonArg_1 ] - , canonicalLink = - \canonicalLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ canonicalLinkArg_ ] - } - - -values_ : - { metaName : Elm.Expression - , metaProperty : Elm.Expression - , metaRedirect : Elm.Expression - , rssLink : Elm.Expression - , sitemapLink : Elm.Expression - , rootLanguage : Elm.Expression - , manifestLink : Elm.Expression - , nonLoadingNode : Elm.Expression - , structuredData : Elm.Expression - , currentPageFullUrl : Elm.Expression - , urlAttribute : Elm.Expression - , raw : Elm.Expression - , appleTouchIcon : Elm.Expression - , icon : Elm.Expression - , toJson : Elm.Expression - , canonicalLink : Elm.Expression - } -values_ = - { metaName = - Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , metaProperty = - Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , metaRedirect = - Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head" ] "AttributeValue" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , rssLink = - Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , sitemapLink = - Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , rootLanguage = - Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , manifestLink = - Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , nonLoadingNode = - Elm.value - { importFrom = [ "Head" ] - , name = "nonLoadingNode" - , annotation = - Just - (Type.function - [ Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , structuredData = - Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , currentPageFullUrl = - Elm.value - { importFrom = [ "Head" ] - , name = "currentPageFullUrl" - , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) - } - , urlAttribute = - Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - , raw = - Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - , appleTouchIcon = - Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , icon = - Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , toJson = - Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - , canonicalLink = - Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Head/Seo.elm b/codegen/Gen/Head/Seo.elm deleted file mode 100644 index cbe3e71a..00000000 --- a/codegen/Gen/Head/Seo.elm +++ /dev/null @@ -1,1278 +0,0 @@ -module Gen.Head.Seo exposing - ( moduleName_, article, audioPlayer, book, profile, song - , summary, summaryLarge, videoPlayer, website, annotation_, make_, call_ - , values_ - ) - -{-| -# Generated bindings for Head.Seo - -@docs moduleName_, article, audioPlayer, book, profile, song -@docs summary, summaryLarge, videoPlayer, website, annotation_, make_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Head", "Seo" ] - - -{-| See - -article: - { tags : List String - , section : Maybe String - , publishedTime : Maybe DateOrDateTime.DateOrDateTime - , modifiedTime : Maybe DateOrDateTime.DateOrDateTime - , expirationTime : Maybe DateOrDateTime.DateOrDateTime - } - -> Head.Seo.Common - -> List Head.Tag --} -article : - { tags : List String - , section : Elm.Expression - , publishedTime : Elm.Expression - , modifiedTime : Elm.Expression - , expirationTime : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -article articleArg_ articleArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ Elm.record - [ Tuple.pair - "tags" - (Elm.list (List.map Elm.string articleArg_.tags)) - , Tuple.pair "section" articleArg_.section - , Tuple.pair "publishedTime" articleArg_.publishedTime - , Tuple.pair "modifiedTime" articleArg_.modifiedTime - , Tuple.pair "expirationTime" articleArg_.expirationTime - ] - , articleArg_0 - ] - - -{-| Will be displayed as a Player card in twitter -See: - -OpenGraph audio will also be included. -The options will also be used to build up the appropriate OpenGraph `` tags. - -audioPlayer: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , audio : Head.Seo.Audio - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -audioPlayer : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , audio : Elm.Expression - , locale : Elm.Expression - } - -> Elm.Expression -audioPlayer audioPlayerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith [ "Head", "Seo" ] "Audio" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - audioPlayerArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string audioPlayerArg_.siteName) - , Tuple.pair "image" audioPlayerArg_.image - , Tuple.pair "description" (Elm.string audioPlayerArg_.description) - , Tuple.pair "title" (Elm.string audioPlayerArg_.title) - , Tuple.pair "audio" audioPlayerArg_.audio - , Tuple.pair "locale" audioPlayerArg_.locale - ] - ] - - -{-| See - -book: - Head.Seo.Common - -> { tags : List String - , isbn : Maybe String - , releaseDate : Maybe DateOrDateTime.DateOrDateTime - } - -> List Head.Tag --} -book : - Elm.Expression - -> { tags : List String - , isbn : Elm.Expression - , releaseDate : Elm.Expression - } - -> Elm.Expression -book bookArg_ bookArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ bookArg_ - , Elm.record - [ Tuple.pair "tags" (Elm.list (List.map Elm.string bookArg_0.tags)) - , Tuple.pair "isbn" bookArg_0.isbn - , Tuple.pair "releaseDate" bookArg_0.releaseDate - ] - ] - - -{-| See - -profile: - { firstName : String, lastName : String, username : Maybe String } - -> Head.Seo.Common - -> List Head.Tag --} -profile : - { firstName : String, lastName : String, username : Elm.Expression } - -> Elm.Expression - -> Elm.Expression -profile profileArg_ profileArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ Elm.record - [ Tuple.pair "firstName" (Elm.string profileArg_.firstName) - , Tuple.pair "lastName" (Elm.string profileArg_.lastName) - , Tuple.pair "username" profileArg_.username - ] - , profileArg_0 - ] - - -{-| See - -song: - Head.Seo.Common - -> { duration : Maybe Int - , album : Maybe Int - , disc : Maybe Int - , track : Maybe Int - } - -> List Head.Tag --} -song : - Elm.Expression - -> { duration : Elm.Expression - , album : Elm.Expression - , disc : Elm.Expression - , track : Elm.Expression - } - -> Elm.Expression -song songArg_ songArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ songArg_ - , Elm.record - [ Tuple.pair "duration" songArg_0.duration - , Tuple.pair "album" songArg_0.album - , Tuple.pair "disc" songArg_0.disc - , Tuple.pair "track" songArg_0.track - ] - ] - - -{-| Will be displayed as a large card in twitter -See: - -The options will also be used to build up the appropriate OpenGraph `` tags. - -Note: You cannot include audio or video tags with summaries. -If you want one of those, use `audioPlayer` or `videoPlayer` - -summary: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -summary : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , locale : Elm.Expression - } - -> Elm.Expression -summary summaryArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "canonicalUrlOverride" summaryArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string summaryArg_.siteName) - , Tuple.pair "image" summaryArg_.image - , Tuple.pair "description" (Elm.string summaryArg_.description) - , Tuple.pair "title" (Elm.string summaryArg_.title) - , Tuple.pair "locale" summaryArg_.locale - ] - ] - - -{-| Will be displayed as a large card in twitter -See: - -The options will also be used to build up the appropriate OpenGraph `` tags. - -Note: You cannot include audio or video tags with summaries. -If you want one of those, use `audioPlayer` or `videoPlayer` - -summaryLarge: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -summaryLarge : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , locale : Elm.Expression - } - -> Elm.Expression -summaryLarge summaryLargeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - summaryLargeArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string summaryLargeArg_.siteName) - , Tuple.pair "image" summaryLargeArg_.image - , Tuple.pair "description" (Elm.string summaryLargeArg_.description) - , Tuple.pair "title" (Elm.string summaryLargeArg_.title) - , Tuple.pair "locale" summaryLargeArg_.locale - ] - ] - - -{-| Will be displayed as a Player card in twitter -See: - -OpenGraph video will also be included. -The options will also be used to build up the appropriate OpenGraph `` tags. - -videoPlayer: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , video : Head.Seo.Video - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -videoPlayer : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , video : Elm.Expression - , locale : Elm.Expression - } - -> Elm.Expression -videoPlayer videoPlayerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith [ "Head", "Seo" ] "Video" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - videoPlayerArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string videoPlayerArg_.siteName) - , Tuple.pair "image" videoPlayerArg_.image - , Tuple.pair "description" (Elm.string videoPlayerArg_.description) - , Tuple.pair "title" (Elm.string videoPlayerArg_.title) - , Tuple.pair "video" videoPlayerArg_.video - , Tuple.pair "locale" videoPlayerArg_.locale - ] - ] - - -{-| - -website: Head.Seo.Common -> List Head.Tag --} -website : Elm.Expression -> Elm.Expression -website websiteArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ websiteArg_ ] - - -annotation_ : { common : Type.Annotation, image : Type.Annotation } -annotation_ = - { common = - Type.alias - moduleName_ - "Common" - [] - (Type.record - [ ( "title", Type.string ) - , ( "image", Type.namedWith [ "Head", "Seo" ] "Image" [] ) - , ( "canonicalUrlOverride", Type.maybe Type.string ) - , ( "description", Type.string ) - , ( "siteName", Type.string ) - , ( "audio" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Audio" []) - ) - , ( "video" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Video" []) - ) - , ( "locale" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "alternateLocales" - , Type.list (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "twitterCard" - , Type.namedWith [ "Head", "Twitter" ] "TwitterCard" [] - ) - ] - ) - , image = - Type.alias - moduleName_ - "Image" - [] - (Type.record - [ ( "url", Type.namedWith [ "Pages", "Url" ] "Url" [] ) - , ( "alt", Type.string ) - , ( "dimensions" - , Type.maybe - (Type.record - [ ( "width", Type.int ), ( "height", Type.int ) ] - ) - ) - , ( "mimeType" - , Type.maybe (Type.namedWith [ "MimeType" ] "MimeType" []) - ) - ] - ) - } - - -make_ : - { common : - { title : Elm.Expression - , image : Elm.Expression - , canonicalUrlOverride : Elm.Expression - , description : Elm.Expression - , siteName : Elm.Expression - , audio : Elm.Expression - , video : Elm.Expression - , locale : Elm.Expression - , alternateLocales : Elm.Expression - , twitterCard : Elm.Expression - } - -> Elm.Expression - , image : - { url : Elm.Expression - , alt : Elm.Expression - , dimensions : Elm.Expression - , mimeType : Elm.Expression - } - -> Elm.Expression - } -make_ = - { common = - \common_args -> - Elm.withType - (Type.alias - [ "Head", "Seo" ] - "Common" - [] - (Type.record - [ ( "title", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "canonicalUrlOverride", Type.maybe Type.string ) - , ( "description", Type.string ) - , ( "siteName", Type.string ) - , ( "audio" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Audio" []) - ) - , ( "video" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Video" []) - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "alternateLocales" - , Type.list - (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "twitterCard" - , Type.namedWith - [ "Head", "Twitter" ] - "TwitterCard" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "title" common_args.title - , Tuple.pair "image" common_args.image - , Tuple.pair - "canonicalUrlOverride" - common_args.canonicalUrlOverride - , Tuple.pair "description" common_args.description - , Tuple.pair "siteName" common_args.siteName - , Tuple.pair "audio" common_args.audio - , Tuple.pair "video" common_args.video - , Tuple.pair "locale" common_args.locale - , Tuple.pair - "alternateLocales" - common_args.alternateLocales - , Tuple.pair "twitterCard" common_args.twitterCard - ] - ) - , image = - \image_args -> - Elm.withType - (Type.alias - [ "Head", "Seo" ] - "Image" - [] - (Type.record - [ ( "url" - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ) - , ( "alt", Type.string ) - , ( "dimensions" - , Type.maybe - (Type.record - [ ( "width", Type.int ) - , ( "height", Type.int ) - ] - ) - ) - , ( "mimeType" - , Type.maybe - (Type.namedWith [ "MimeType" ] "MimeType" []) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "url" image_args.url - , Tuple.pair "alt" image_args.alt - , Tuple.pair "dimensions" image_args.dimensions - , Tuple.pair "mimeType" image_args.mimeType - ] - ) - } - - -call_ : - { article : Elm.Expression -> Elm.Expression -> Elm.Expression - , audioPlayer : Elm.Expression -> Elm.Expression - , book : Elm.Expression -> Elm.Expression -> Elm.Expression - , profile : Elm.Expression -> Elm.Expression -> Elm.Expression - , song : Elm.Expression -> Elm.Expression -> Elm.Expression - , summary : Elm.Expression -> Elm.Expression - , summaryLarge : Elm.Expression -> Elm.Expression - , videoPlayer : Elm.Expression -> Elm.Expression - , website : Elm.Expression -> Elm.Expression - } -call_ = - { article = - \articleArg_ articleArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ articleArg_, articleArg_0 ] - , audioPlayer = - \audioPlayerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith - [ "Head", "Seo" ] - "Audio" - [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ audioPlayerArg_ ] - , book = - \bookArg_ bookArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ bookArg_, bookArg_0 ] - , profile = - \profileArg_ profileArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ profileArg_, profileArg_0 ] - , song = - \songArg_ songArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ songArg_, songArg_0 ] - , summary = - \summaryArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ summaryArg_ ] - , summaryLarge = - \summaryLargeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ summaryLargeArg_ ] - , videoPlayer = - \videoPlayerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith - [ "Head", "Seo" ] - "Video" - [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ videoPlayerArg_ ] - , website = - \websiteArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ websiteArg_ ] - } - - -values_ : - { article : Elm.Expression - , audioPlayer : Elm.Expression - , book : Elm.Expression - , profile : Elm.Expression - , song : Elm.Expression - , summary : Elm.Expression - , summaryLarge : Elm.Expression - , videoPlayer : Elm.Expression - , website : Elm.Expression - } -values_ = - { article = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , audioPlayer = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith [ "Head", "Seo" ] "Audio" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , book = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , profile = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , song = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , summary = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , summaryLarge = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , videoPlayer = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith [ "Head", "Seo" ] "Video" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , website = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Json/Decode/Extra.elm b/codegen/Gen/Json/Decode/Extra.elm deleted file mode 100644 index 026ab4d4..00000000 --- a/codegen/Gen/Json/Decode/Extra.elm +++ /dev/null @@ -1,1679 +0,0 @@ -module Gen.Json.Decode.Extra exposing - ( moduleName_, datetime, url, andMap, when, collection - , sequence, combine, indexedList, keys, set, dict2, withDefault - , optionalField, optionalNullableField, fromMaybe, fromResult, parseInt, parseFloat, doubleEncoded - , call_, values_ - ) - -{-| -# Generated bindings for Json.Decode.Extra - -@docs moduleName_, datetime, url, andMap, when, collection -@docs sequence, combine, indexedList, keys, set, dict2 -@docs withDefault, optionalField, optionalNullableField, fromMaybe, fromResult, parseInt -@docs parseFloat, doubleEncoded, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Json", "Decode", "Extra" ] - - -{-| Decode an ISO-8601 formatted date-time string. - -This always returns a `Time.Posix` value, which is naturally always expressed in -UTC. - - import Json.Decode exposing (..) - import Json.Encode - import Time - - """ "2018-08-26T09:46:00+02:00" """ - |> decodeString datetime - --> Ok (Time.millisToPosix 1535269560000) - - """ "" """ - |> decodeString datetime - --> Err - --> (Failure - --> "Expecting an ISO-8601 formatted date+time string" - --> (Json.Encode.string "") - --> ) - -datetime: Json.Decode.Decoder Time.Posix --} -datetime : Elm.Expression -datetime = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "datetime" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Time" ] "Posix" [] ] - ) - } - - -{-| Decode a URL - -This always returns a `Url.Url` value. - - import Json.Decode exposing (..) - import Url - - """ "http://foo.bar/quux" """ - |> decodeString url - --> Ok <| Url.Url Url.Http "foo.bar" Nothing "/quux" Nothing Nothing - -url: Json.Decode.Decoder Url.Url --} -url : Elm.Expression -url = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "url" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Url" ] "Url" [] ] - ) - } - - -{-| Can be helpful when decoding large objects incrementally. - -See [the `andMap` docs](https://github.com/elm-community/json-extra/blob/2.0.0/docs/andMap.md) -for an explanation of how `andMap` works and how to use it. - -andMap: Json.Decode.Decoder a -> Json.Decode.Decoder (a -> b) -> Json.Decode.Decoder b --} -andMap : Elm.Expression -> Elm.Expression -> Elm.Expression -andMap andMapArg_ andMapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "andMap" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.function [ Type.var "a" ] (Type.var "b") ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ) - ) - } - ) - [ andMapArg_, andMapArg_0 ] - - -{-| Helper for conditionally decoding values based on some discriminator -that needs to pass a certain check. - - import Json.Decode exposing (..) - import Json.Encode - - - is : a -> a -> Bool - is a b = - a == b - - - enabledValue : Decoder Int - enabledValue = - (field "value" int) - |> when (field "enabled" bool) (is True) - - - """ { "enabled": true, "value": 123 } """ - |> decodeString enabledValue - --> Ok 123 - - - input : Json.Decode.Value - input = - Json.Encode.object - [ ( "enabled", Json.Encode.bool False ) - , ( "value", Json.Encode.int 321 ) - ] - - expectedError : Error - expectedError = - Failure "Check failed with input" input - - """ { "enabled": false, "value": 321 } """ - |> decodeString enabledValue - --> Err expectedError - -This can also be used to decode union types that are encoded with a discriminator field: - - type Animal = Cat String | Dog String - - - dog : Decoder Animal - dog = - map Dog (field "name" string) - - - cat : Decoder Animal - cat = - map Cat (field "name" string) - - - animalType : Decoder String - animalType = - field "type" string - - - animal : Decoder Animal - animal = - oneOf - [ when animalType (is "dog") dog - , when animalType (is "cat") cat - ] - - - """ - [ - { "type": "dog", "name": "Dawg" }, - { "type": "cat", "name": "Roxy" } - ] - """ - |> decodeString (list animal) - --> Ok [ Dog "Dawg", Cat "Roxy" ] - -when: - Json.Decode.Decoder a - -> (a -> Bool) - -> Json.Decode.Decoder b - -> Json.Decode.Decoder b --} -when : - Elm.Expression - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -when whenArg_ whenArg_0 whenArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "when" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.function [ Type.var "a" ] Type.bool - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ) - ) - } - ) - [ whenArg_, Elm.functionReduced "whenUnpack" whenArg_0, whenArg_1 ] - - -{-| Some JavaScript structures look like arrays, but aren't really. Examples -include `HTMLCollection`, `NodeList` and everything else that has a `length` -property, has values indexed by an integer key between 0 and `length`, but yet -_is not_ a JavaScript Array. - -This decoder can come to the rescue. - - import Json.Decode exposing (..) - - - """ { "length": 3, "0": "foo", "1": "bar", "2": "baz" } """ - |> decodeString (collection string) - --> Ok [ "foo", "bar", "baz" ] - -collection: Json.Decode.Decoder a -> Json.Decode.Decoder (List a) --} -collection : Elm.Expression -> Elm.Expression -collection collectionArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "collection" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ collectionArg_ ] - - -{-| This function turns a list of decoders into a decoder that returns a list. - -The returned decoder will zip the list of decoders with a list of values, -matching each decoder with exactly one value at the same position. This is most -often useful in cases when you find yourself needing to dynamically generate a -list of decoders based on some data, and decode some other data with this list -of decoders. - -Note that this function, unlike `List.map2`'s behaviour, expects the list of -decoders to have the same length as the list of values in the JSON. - - import Json.Decode exposing (..) - - - decoder : Decoder (List (Maybe String)) - decoder = - sequence - [ map Just string - , succeed Nothing - , map Just string - ] - - - decodeString decoder """ [ "pick me", "ignore me", "and pick me" ] """ - --> Ok [ Just "pick me", Nothing, Just "and pick me" ] - -sequence: List (Json.Decode.Decoder a) -> Json.Decode.Decoder (List a) --} -sequence : List Elm.Expression -> Elm.Expression -sequence sequenceArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ Elm.list sequenceArg_ ] - - -{-| Helps converting a list of decoders into a decoder for a list of that type. - - import Json.Decode exposing (..) - - - decoders : List (Decoder String) - decoders = - [ field "foo" string - , field "bar" string - , field "another" string - ] - - - """ { "foo": "hello", "another": "!", "bar": "world" } """ - |> decodeString (combine decoders) - --> Ok [ "hello", "world", "!" ] - -combine: List (Json.Decode.Decoder a) -> Json.Decode.Decoder (List a) --} -combine : List Elm.Expression -> Elm.Expression -combine combineArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "combine" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ Elm.list combineArg_ ] - - -{-| Get access to the current index while decoding a list element. - - import Json.Decode exposing (..) - - - repeatedStringDecoder : Int -> Decoder String - repeatedStringDecoder times = - string |> map (String.repeat times) - - - """ [ "a", "b", "c", "d" ] """ - |> decodeString (indexedList repeatedStringDecoder) - --> Ok [ "", "b", "cc", "ddd" ] - -indexedList: (Int -> Json.Decode.Decoder a) -> Json.Decode.Decoder (List a) --} -indexedList : (Elm.Expression -> Elm.Expression) -> Elm.Expression -indexedList indexedListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "indexedList" - , annotation = - Just - (Type.function - [ Type.function - [ Type.int ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ Elm.functionReduced "indexedListUnpack" indexedListArg_ ] - - -{-| Get a list of the keys of a JSON object - - import Json.Decode exposing (..) - - - """ { "alice": 42, "bob": 99 } """ - |> decodeString keys - --> Ok [ "alice", "bob" ] - -keys: Json.Decode.Decoder (List String) --} -keys : Elm.Expression -keys = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "keys" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list Type.string ] - ) - } - - -{-| Extract a set. - - import Json.Decode exposing (..) - import Set - - - "[ 1, 1, 5, 2 ]" - |> decodeString (set int) - --> Ok <| Set.fromList [ 1, 2, 5 ] - -set: Json.Decode.Decoder comparable -> Json.Decode.Decoder (Set.Set comparable) --} -set : Elm.Expression -> Elm.Expression -set setArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "set" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - ) - ) - } - ) - [ setArg_ ] - - -{-| Extract a dict using separate decoders for keys and values. - - import Json.Decode exposing (..) - import Dict - - - """ { "1": "foo", "2": "bar" } """ - |> decodeString (dict2 int string) - --> Ok <| Dict.fromList [ ( 1, "foo" ), ( 2, "bar" ) ] - -dict2: - Json.Decode.Decoder comparable - -> Json.Decode.Decoder v - -> Json.Decode.Decoder (Dict.Dict comparable v) --} -dict2 : Elm.Expression -> Elm.Expression -> Elm.Expression -dict2 dict2Arg_ dict2Arg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "dict2" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "comparable" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "v" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.var "comparable", Type.var "v" ] - ] - ) - ) - } - ) - [ dict2Arg_, dict2Arg_0 ] - - -{-| Try running the given decoder; if that fails, then succeed with the given -fallback value. - - import Json.Decode exposing (..) - - - """ { "children": "oops" } """ - |> decodeString (field "children" (list string) |> withDefault []) - --> Ok [] - - - """ null """ - |> decodeString (field "children" (list string) |> withDefault []) - --> Ok [] - - - """ 30 """ - |> decodeString (int |> withDefault 42) - --> Ok 30 - -withDefault: a -> Json.Decode.Decoder a -> Json.Decode.Decoder a --} -withDefault : Elm.Expression -> Elm.Expression -> Elm.Expression -withDefault withDefaultArg_ withDefaultArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "withDefault" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ withDefaultArg_, withDefaultArg_0 ] - - -{-| If a field is missing, succeed with `Nothing`. If it is present, decode it -as normal and wrap successes in a `Just`. - -When decoding with -[`maybe`](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode#maybe), -if a field is present but malformed, you get a success and Nothing. -`optionalField` gives you a failed decoding in that case, so you know -you received malformed data. - -Examples: - - import Json.Decode exposing (..) - import Json.Encode - -Let's define a `stuffDecoder` that extracts the `"stuff"` field, if it exists. - - stuffDecoder : Decoder (Maybe String) - stuffDecoder = - optionalField "stuff" string - -If the "stuff" field is missing, decode to Nothing. - - """ { } """ - |> decodeString stuffDecoder - --> Ok Nothing - -If the "stuff" field is present but not a String, fail decoding. - - expectedError : Error - expectedError = - Failure "Expecting a STRING" (Json.Encode.list identity []) - |> Field "stuff" - - """ { "stuff": [] } """ - |> decodeString stuffDecoder - --> Err expectedError - -If the "stuff" field is present and valid, decode to Just String. - - """ { "stuff": "yay!" } """ - |> decodeString stuffDecoder - --> Ok <| Just "yay!" - -optionalField: String -> Json.Decode.Decoder a -> Json.Decode.Decoder (Maybe a) --} -optionalField : String -> Elm.Expression -> Elm.Expression -optionalField optionalFieldArg_ optionalFieldArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "optionalField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ Elm.string optionalFieldArg_, optionalFieldArg_0 ] - - -{-| A neat combination of `optionalField` and `nullable`. - -What this means is that a decoder like `optionalNullableField "foo" string` will -return `Just "hello"` for `{"foo": "hello"}`, `Nothing` for both `{"foo": null}` -and `{}`, and an error for malformed input like `{"foo": 123}`. - - import Json.Decode exposing (Decoder, Error(..), decodeString, field, string) - import Json.Decode.Extra exposing (optionalNullableField) - import Json.Encode - - myDecoder : Decoder (Maybe String) - myDecoder = - optionalNullableField "foo" string - - - """ {"foo": "hello"} """ - |> decodeString myDecoder - --> Ok (Just "hello") - - - """ {"foo": null} """ - |> decodeString myDecoder - --> Ok Nothing - - - """ {} """ - |> decodeString myDecoder - --> Ok Nothing - - - """ {"foo": 123} """ - |> decodeString myDecoder - |> Result.mapError (\_ -> "expected error") - --> Err "expected error" - -optionalNullableField: String -> Json.Decode.Decoder a -> Json.Decode.Decoder (Maybe a) --} -optionalNullableField : String -> Elm.Expression -> Elm.Expression -optionalNullableField optionalNullableFieldArg_ optionalNullableFieldArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "optionalNullableField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ Elm.string optionalNullableFieldArg_, optionalNullableFieldArg_0 ] - - -{-| Transform a `Maybe a` into a `Decoder a` - -Sometimes, you'll have a function that produces a `Maybe a` value, that you may -want to use in a decoder. - -Let's say, for example, that we have a function to extract the first letter of a -string, and we want to use that in a decoder so we can extract only the first -letter of that string. - - import Json.Decode exposing (..) - import Json.Encode - - - firstLetter : String -> Maybe Char - firstLetter input = - Maybe.map Tuple.first (String.uncons input) - - - firstLetterDecoder : Decoder Char - firstLetterDecoder = - andThen - (fromMaybe "Empty string not allowed" << firstLetter) - string - - """ "something" """ - |> decodeString firstLetterDecoder - --> Ok 's' - - - """ "" """ - |> decodeString firstLetterDecoder - --> Err (Failure "Empty string not allowed" (Json.Encode.string "")) - -fromMaybe: String -> Maybe a -> Json.Decode.Decoder a --} -fromMaybe : String -> Elm.Expression -> Elm.Expression -fromMaybe fromMaybeArg_ fromMaybeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "fromMaybe" - , annotation = - Just - (Type.function - [ Type.string, Type.maybe (Type.var "a") ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ Elm.string fromMaybeArg_, fromMaybeArg_0 ] - - -{-| Transform a result into a decoder - -Sometimes it can be useful to use functions that primarily operate on -`Result` in decoders. - - import Json.Decode exposing (..) - import Json.Encode - - - validateString : String -> Result String String - validateString input = - case input of - "" -> - Err "Empty string is not allowed" - _ -> - Ok input - - - """ "something" """ - |> decodeString (string |> andThen (fromResult << validateString)) - --> Ok "something" - - - """ "" """ - |> decodeString (string |> andThen (fromResult << validateString)) - --> Err (Failure "Empty string is not allowed" (Json.Encode.string "")) - -fromResult: Result.Result String a -> Json.Decode.Decoder a --} -fromResult : Elm.Expression -> Elm.Expression -fromResult fromResultArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "fromResult" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ fromResultArg_ ] - - -{-| Extract an int using [`String.toInt`](http://package.elm-lang.org/packages/elm-lang/core/latest/String#toInt) - - import Json.Decode exposing (..) - - - """ { "field": "123" } """ - |> decodeString (field "field" parseInt) - --> Ok 123 - -parseInt: Json.Decode.Decoder Int --} -parseInt : Elm.Expression -parseInt = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "parseInt" - , annotation = - Just (Type.namedWith [ "Json", "Decode" ] "Decoder" [ Type.int ]) - } - - -{-| Extract a float using [`String.toFloat`](http://package.elm-lang.org/packages/elm-lang/core/latest/String#toFloat) - - import Json.Decode exposing (..) - - - """ { "field": "50.5" } """ - |> decodeString (field "field" parseFloat) - --> Ok 50.5 - -parseFloat: Json.Decode.Decoder Float --} -parseFloat : Elm.Expression -parseFloat = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "parseFloat" - , annotation = - Just (Type.namedWith [ "Json", "Decode" ] "Decoder" [ Type.float ]) - } - - -{-| Extract a JSON-encoded string field - -"Yo dawg, I heard you like JSON..." - -If someone has put JSON in your JSON (perhaps a JSON log entry, encoded -as a string) this is the function you're looking for. Give it a decoder -and it will return a new decoder that applies your decoder to a string -field and yields the result (or fails if your decoder fails). - - import Json.Decode exposing (..) - - - logEntriesDecoder : Decoder (List String) - logEntriesDecoder = - doubleEncoded (list string) - - - logsDecoder : Decoder (List String) - logsDecoder = - field "logs" logEntriesDecoder - - - """ { "logs": "[\\"log1\\", \\"log2\\"]"} """ - |> decodeString logsDecoder - --> Ok [ "log1", "log2" ] - -doubleEncoded: Json.Decode.Decoder a -> Json.Decode.Decoder a --} -doubleEncoded : Elm.Expression -> Elm.Expression -doubleEncoded doubleEncodedArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "doubleEncoded" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ doubleEncodedArg_ ] - - -call_ : - { andMap : Elm.Expression -> Elm.Expression -> Elm.Expression - , when : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , collection : Elm.Expression -> Elm.Expression - , sequence : Elm.Expression -> Elm.Expression - , combine : Elm.Expression -> Elm.Expression - , indexedList : Elm.Expression -> Elm.Expression - , set : Elm.Expression -> Elm.Expression - , dict2 : Elm.Expression -> Elm.Expression -> Elm.Expression - , withDefault : Elm.Expression -> Elm.Expression -> Elm.Expression - , optionalField : Elm.Expression -> Elm.Expression -> Elm.Expression - , optionalNullableField : Elm.Expression -> Elm.Expression -> Elm.Expression - , fromMaybe : Elm.Expression -> Elm.Expression -> Elm.Expression - , fromResult : Elm.Expression -> Elm.Expression - , doubleEncoded : Elm.Expression -> Elm.Expression - } -call_ = - { andMap = - \andMapArg_ andMapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "andMap" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.function - [ Type.var "a" ] - (Type.var "b") - ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ) - ) - } - ) - [ andMapArg_, andMapArg_0 ] - , when = - \whenArg_ whenArg_0 whenArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "when" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.function [ Type.var "a" ] Type.bool - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ) - ) - } - ) - [ whenArg_, whenArg_0, whenArg_1 ] - , collection = - \collectionArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "collection" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ collectionArg_ ] - , sequence = - \sequenceArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ sequenceArg_ ] - , combine = - \combineArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "combine" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ combineArg_ ] - , indexedList = - \indexedListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "indexedList" - , annotation = - Just - (Type.function - [ Type.function - [ Type.int ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ indexedListArg_ ] - , set = - \setArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "set" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - ) - ) - } - ) - [ setArg_ ] - , dict2 = - \dict2Arg_ dict2Arg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "dict2" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "comparable" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "v" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.var "comparable" - , Type.var "v" - ] - ] - ) - ) - } - ) - [ dict2Arg_, dict2Arg_0 ] - , withDefault = - \withDefaultArg_ withDefaultArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "withDefault" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ withDefaultArg_, withDefaultArg_0 ] - , optionalField = - \optionalFieldArg_ optionalFieldArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "optionalField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ optionalFieldArg_, optionalFieldArg_0 ] - , optionalNullableField = - \optionalNullableFieldArg_ optionalNullableFieldArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "optionalNullableField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ optionalNullableFieldArg_, optionalNullableFieldArg_0 ] - , fromMaybe = - \fromMaybeArg_ fromMaybeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "fromMaybe" - , annotation = - Just - (Type.function - [ Type.string, Type.maybe (Type.var "a") ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ fromMaybeArg_, fromMaybeArg_0 ] - , fromResult = - \fromResultArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "fromResult" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ fromResultArg_ ] - , doubleEncoded = - \doubleEncodedArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "doubleEncoded" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - ) - [ doubleEncodedArg_ ] - } - - -values_ : - { datetime : Elm.Expression - , url : Elm.Expression - , andMap : Elm.Expression - , when : Elm.Expression - , collection : Elm.Expression - , sequence : Elm.Expression - , combine : Elm.Expression - , indexedList : Elm.Expression - , keys : Elm.Expression - , set : Elm.Expression - , dict2 : Elm.Expression - , withDefault : Elm.Expression - , optionalField : Elm.Expression - , optionalNullableField : Elm.Expression - , fromMaybe : Elm.Expression - , fromResult : Elm.Expression - , parseInt : Elm.Expression - , parseFloat : Elm.Expression - , doubleEncoded : Elm.Expression - } -values_ = - { datetime = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "datetime" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Time" ] "Posix" [] ] - ) - } - , url = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "url" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Url" ] "Url" [] ] - ) - } - , andMap = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "andMap" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.function [ Type.var "a" ] (Type.var "b") ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ) - ) - } - , when = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "when" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.function [ Type.var "a" ] Type.bool - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "b" ] - ) - ) - } - , collection = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "collection" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - , sequence = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - , combine = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "combine" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - , indexedList = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "indexedList" - , annotation = - Just - (Type.function - [ Type.function - [ Type.int ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list (Type.var "a") ] - ) - ) - } - , keys = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "keys" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.list Type.string ] - ) - } - , set = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "set" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - ) - ) - } - , dict2 = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "dict2" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "comparable" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "v" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.var "comparable", Type.var "v" ] - ] - ) - ) - } - , withDefault = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "withDefault" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - , optionalField = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "optionalField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "a") ] - ) - ) - } - , optionalNullableField = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "optionalNullableField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "a") ] - ) - ) - } - , fromMaybe = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "fromMaybe" - , annotation = - Just - (Type.function - [ Type.string, Type.maybe (Type.var "a") ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - , fromResult = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "fromResult" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - , parseInt = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "parseInt" - , annotation = - Just - (Type.namedWith [ "Json", "Decode" ] "Decoder" [ Type.int ]) - } - , parseFloat = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "parseFloat" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.float ] - ) - } - , doubleEncoded = - Elm.value - { importFrom = [ "Json", "Decode", "Extra" ] - , name = "doubleEncoded" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Json/Encode/Extra.elm b/codegen/Gen/Json/Encode/Extra.elm deleted file mode 100644 index 73a343e3..00000000 --- a/codegen/Gen/Json/Encode/Extra.elm +++ /dev/null @@ -1,104 +0,0 @@ -module Gen.Json.Encode.Extra exposing ( moduleName_, maybe, call_, values_ ) - -{-| -# Generated bindings for Json.Encode.Extra - -@docs moduleName_, maybe, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Json", "Encode", "Extra" ] - - -{-| Encode a Maybe value. If the value is `Nothing` it will be encoded as `null` - - import Json.Encode exposing (..) - - - maybe int (Just 50) - --> int 50 - - - maybe int Nothing - --> null - -maybe: (a -> Json.Encode.Value) -> Maybe a -> Json.Encode.Value --} -maybe : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -maybe maybeArg_ maybeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Json", "Encode", "Extra" ] - , name = "maybe" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - , Type.maybe (Type.var "a") - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ Elm.functionReduced "maybeUnpack" maybeArg_, maybeArg_0 ] - - -call_ : { maybe : Elm.Expression -> Elm.Expression -> Elm.Expression } -call_ = - { maybe = - \maybeArg_ maybeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Json", "Encode", "Extra" ] - , name = "maybe" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - , Type.maybe (Type.var "a") - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ maybeArg_, maybeArg_0 ] - } - - -values_ : { maybe : Elm.Expression } -values_ = - { maybe = - Elm.value - { importFrom = [ "Json", "Encode", "Extra" ] - , name = "maybe" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - , Type.maybe (Type.var "a") - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/OpenApi/Common.elm b/codegen/Gen/OpenApi/Common.elm deleted file mode 100644 index e5ab9792..00000000 --- a/codegen/Gen/OpenApi/Common.elm +++ /dev/null @@ -1,1999 +0,0 @@ -module Gen.OpenApi.Common exposing - ( moduleName_, jsonDecodeAndMap, decodeOptionalField, bytesResolverCustomEffect, expectBytesCustomEffect, stringResolverCustomEffect - , expectStringCustomEffect, jsonResolverCustomEffect, expectJsonCustomEffect, bytesResolverCustom, expectBytesCustom, stringResolverCustom, expectStringCustom - , jsonResolverCustom, expectJsonCustom, annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for OpenApi.Common - -@docs moduleName_, jsonDecodeAndMap, decodeOptionalField, bytesResolverCustomEffect, expectBytesCustomEffect, stringResolverCustomEffect -@docs expectStringCustomEffect, jsonResolverCustomEffect, expectJsonCustomEffect, bytesResolverCustom, expectBytesCustom, stringResolverCustom -@docs expectStringCustom, jsonResolverCustom, expectJsonCustom, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "OpenApi", "Common" ] - - -{-| {-| Chain JSON decoders, when `Json.Decode.map8` isn't enough. --} - -jsonDecodeAndMap: - Json.Decode.Decoder a - -> Json.Decode.Decoder (a -> value) - -> Json.Decode.Decoder value --} -jsonDecodeAndMap : Elm.Expression -> Elm.Expression -> Elm.Expression -jsonDecodeAndMap jsonDecodeAndMapArg_ jsonDecodeAndMapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonDecodeAndMap" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.function - [ Type.var "a" ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - ) - ) - } - ) - [ jsonDecodeAndMapArg_, jsonDecodeAndMapArg_0 ] - - -{-| {-| Decode an optional field - - decodeString (decodeOptionalField "x" int) "{ "x": 3 }" - --> Ok (Just 3) - - decodeString (decodeOptionalField "x" int) "{ "x": true }" - --> Err ... - - decodeString (decodeOptionalField "x" int) "{ "y": 4 }" - --> Ok Nothing - --} - -decodeOptionalField: String -> Json.Decode.Decoder t -> Json.Decode.Decoder (Maybe t) --} -decodeOptionalField : String -> Elm.Expression -> Elm.Expression -decodeOptionalField decodeOptionalFieldArg_ decodeOptionalFieldArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "decodeOptionalField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "t" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "t") ] - ) - ) - } - ) - [ Elm.string decodeOptionalFieldArg_, decodeOptionalFieldArg_0 ] - - -{-| bytesResolverCustomEffect: - Dict.Dict String (Json.Decode.Decoder err) - -> Effect.Http.Resolver restrictions (OpenApi.Common.Error err Bytes.Bytes) Bytes.Bytes --} -bytesResolverCustomEffect : Elm.Expression -> Elm.Expression -bytesResolverCustomEffect bytesResolverCustomEffectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "bytesResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ) - ) - } - ) - [ bytesResolverCustomEffectArg_ ] - - -{-| expectBytesCustomEffect: - (Result.Result (OpenApi.Common.Error err Bytes.Bytes) Bytes.Bytes -> msg) - -> Dict.Dict String (Json.Decode.Decoder err) - -> Effect.Http.Expect msg --} -expectBytesCustomEffect : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -expectBytesCustomEffect expectBytesCustomEffectArg_ expectBytesCustomEffectArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectBytesCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced - "expectBytesCustomEffectUnpack" - expectBytesCustomEffectArg_ - , expectBytesCustomEffectArg_0 - ] - - -{-| stringResolverCustomEffect: - Dict.Dict String (Json.Decode.Decoder err) - -> Effect.Http.Resolver restrictions (OpenApi.Common.Error err String) String --} -stringResolverCustomEffect : Elm.Expression -> Elm.Expression -stringResolverCustomEffect stringResolverCustomEffectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "stringResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ) - ) - } - ) - [ stringResolverCustomEffectArg_ ] - - -{-| expectStringCustomEffect: - (Result.Result (OpenApi.Common.Error err String) String -> msg) - -> Dict.Dict String (Json.Decode.Decoder err) - -> Effect.Http.Expect msg --} -expectStringCustomEffect : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -expectStringCustomEffect expectStringCustomEffectArg_ expectStringCustomEffectArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectStringCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced - "expectStringCustomEffectUnpack" - expectStringCustomEffectArg_ - , expectStringCustomEffectArg_0 - ] - - -{-| jsonResolverCustomEffect: - Dict.Dict String (Json.Decode.Decoder err) - -> Json.Decode.Decoder success - -> Effect.Http.Resolver restrictions (OpenApi.Common.Error err String) success --} -jsonResolverCustomEffect : Elm.Expression -> Elm.Expression -> Elm.Expression -jsonResolverCustomEffect jsonResolverCustomEffectArg_ jsonResolverCustomEffectArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ) - ) - } - ) - [ jsonResolverCustomEffectArg_, jsonResolverCustomEffectArg_0 ] - - -{-| expectJsonCustomEffect: - (Result.Result (OpenApi.Common.Error err String) success -> msg) - -> Dict.Dict String (Json.Decode.Decoder err) - -> Json.Decode.Decoder success - -> Effect.Http.Expect msg --} -expectJsonCustomEffect : - (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -expectJsonCustomEffect expectJsonCustomEffectArg_ expectJsonCustomEffectArg_0 expectJsonCustomEffectArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectJsonCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced - "expectJsonCustomEffectUnpack" - expectJsonCustomEffectArg_ - , expectJsonCustomEffectArg_0 - , expectJsonCustomEffectArg_1 - ] - - -{-| bytesResolverCustom: - Dict.Dict String (Json.Decode.Decoder err) - -> Http.Resolver (OpenApi.Common.Error err Bytes.Bytes) Bytes.Bytes --} -bytesResolverCustom : Elm.Expression -> Elm.Expression -bytesResolverCustom bytesResolverCustomArg_ = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "bytesResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ) - ) - } - ) - [ bytesResolverCustomArg_ ] - - -{-| expectBytesCustom: - (Result.Result (OpenApi.Common.Error err Bytes.Bytes) Bytes.Bytes -> msg) - -> Dict.Dict String (Json.Decode.Decoder err) - -> Http.Expect msg --} -expectBytesCustom : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -expectBytesCustom expectBytesCustomArg_ expectBytesCustomArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectBytesCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectBytesCustomUnpack" expectBytesCustomArg_ - , expectBytesCustomArg_0 - ] - - -{-| stringResolverCustom: - Dict.Dict String (Json.Decode.Decoder err) - -> Http.Resolver (OpenApi.Common.Error err String) String --} -stringResolverCustom : Elm.Expression -> Elm.Expression -stringResolverCustom stringResolverCustomArg_ = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "stringResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ) - ) - } - ) - [ stringResolverCustomArg_ ] - - -{-| expectStringCustom: - (Result.Result (OpenApi.Common.Error err String) String -> msg) - -> Dict.Dict String (Json.Decode.Decoder err) - -> Http.Expect msg --} -expectStringCustom : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -expectStringCustom expectStringCustomArg_ expectStringCustomArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectStringCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectStringCustomUnpack" expectStringCustomArg_ - , expectStringCustomArg_0 - ] - - -{-| jsonResolverCustom: - Dict.Dict String (Json.Decode.Decoder err) - -> Json.Decode.Decoder success - -> Http.Resolver (OpenApi.Common.Error err String) success --} -jsonResolverCustom : Elm.Expression -> Elm.Expression -> Elm.Expression -jsonResolverCustom jsonResolverCustomArg_ jsonResolverCustomArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ) - ) - } - ) - [ jsonResolverCustomArg_, jsonResolverCustomArg_0 ] - - -{-| expectJsonCustom: - (Result.Result (OpenApi.Common.Error err String) success -> msg) - -> Dict.Dict String (Json.Decode.Decoder err) - -> Json.Decode.Decoder success - -> Http.Expect msg --} -expectJsonCustom : - (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -expectJsonCustom expectJsonCustomArg_ expectJsonCustomArg_0 expectJsonCustomArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectJsonCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectJsonCustomUnpack" expectJsonCustomArg_ - , expectJsonCustomArg_0 - , expectJsonCustomArg_1 - ] - - -annotation_ : - { nullable : Type.Annotation -> Type.Annotation - , error : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { nullable = - \nullableArg0 -> - Type.namedWith [ "OpenApi", "Common" ] "Nullable" [ nullableArg0 ] - , error = - \errorArg0 errorArg1 -> - Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ errorArg0, errorArg1 ] - } - - -make_ : - { null : Elm.Expression - , present : Elm.Expression -> Elm.Expression - , badUrl : Elm.Expression -> Elm.Expression - , timeout : Elm.Expression - , networkError : Elm.Expression - , knownBadStatus : Elm.Expression -> Elm.Expression -> Elm.Expression - , unknownBadStatus : Elm.Expression -> Elm.Expression -> Elm.Expression - , badErrorBody : Elm.Expression -> Elm.Expression -> Elm.Expression - , badBody : Elm.Expression -> Elm.Expression -> Elm.Expression - } -make_ = - { null = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "Null" - , annotation = - Just (Type.namedWith [] "Nullable" [ Type.var "value" ]) - } - , present = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "Present" - , annotation = - Just - (Type.namedWith [] "Nullable" [ Type.var "value" ]) - } - ) - [ ar0 ] - , badUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "BadUrl" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - ) - [ ar0 ] - , timeout = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "Timeout" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - , networkError = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "NetworkError" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - , knownBadStatus = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "KnownBadStatus" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - ) - [ ar0, ar1 ] - , unknownBadStatus = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "UnknownBadStatus" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - ) - [ ar0, ar1 ] - , badErrorBody = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "BadErrorBody" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - ) - [ ar0, ar1 ] - , badBody = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "BadBody" - , annotation = - Just - (Type.namedWith - [] - "Error" - [ Type.var "err", Type.var "body" ] - ) - } - ) - [ ar0, ar1 ] - } - - -caseOf_ = - { nullable = - \nullableExpression nullableTags -> - Elm.Case.custom - nullableExpression - (Type.namedWith - [ "OpenApi", "Common" ] - "Nullable" - [ Type.var "value" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Null" nullableTags.null) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Present" - nullableTags.present |> Elm.Arg.item - (Elm.Arg.varWith - "value" - (Type.var "value") - ) - ) - Basics.identity - ] - , error = - \errorExpression errorTags -> - Elm.Case.custom - errorExpression - (Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.var "body" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "BadUrl" - errorTags.badUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Timeout" errorTags.timeout) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "NetworkError" errorTags.networkError) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "KnownBadStatus" - errorTags.knownBadStatus |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "err" - (Type.var - "err" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UnknownBadStatus" - errorTags.unknownBadStatus |> Elm.Arg.item - (Elm.Arg.varWith - "httpMetadata" - (Type.namedWith - [ "Http" - ] - "Metadata" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "body" - (Type.var - "body" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BadErrorBody" - errorTags.badErrorBody |> Elm.Arg.item - (Elm.Arg.varWith - "httpMetadata" - (Type.namedWith - [ "Http" ] - "Metadata" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "body" - (Type.var - "body" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BadBody" - errorTags.badBody |> Elm.Arg.item - (Elm.Arg.varWith - "httpMetadata" - (Type.namedWith - [ "Http" ] - "Metadata" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "body" - (Type.var - "body" - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { jsonDecodeAndMap : Elm.Expression -> Elm.Expression -> Elm.Expression - , decodeOptionalField : Elm.Expression -> Elm.Expression -> Elm.Expression - , bytesResolverCustomEffect : Elm.Expression -> Elm.Expression - , expectBytesCustomEffect : - Elm.Expression -> Elm.Expression -> Elm.Expression - , stringResolverCustomEffect : Elm.Expression -> Elm.Expression - , expectStringCustomEffect : - Elm.Expression -> Elm.Expression -> Elm.Expression - , jsonResolverCustomEffect : - Elm.Expression -> Elm.Expression -> Elm.Expression - , expectJsonCustomEffect : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , bytesResolverCustom : Elm.Expression -> Elm.Expression - , expectBytesCustom : Elm.Expression -> Elm.Expression -> Elm.Expression - , stringResolverCustom : Elm.Expression -> Elm.Expression - , expectStringCustom : Elm.Expression -> Elm.Expression -> Elm.Expression - , jsonResolverCustom : Elm.Expression -> Elm.Expression -> Elm.Expression - , expectJsonCustom : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { jsonDecodeAndMap = - \jsonDecodeAndMapArg_ jsonDecodeAndMapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonDecodeAndMap" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.function - [ Type.var "a" ] - (Type.var "value") - ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - ) - ) - } - ) - [ jsonDecodeAndMapArg_, jsonDecodeAndMapArg_0 ] - , decodeOptionalField = - \decodeOptionalFieldArg_ decodeOptionalFieldArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "decodeOptionalField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "t" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "t") ] - ) - ) - } - ) - [ decodeOptionalFieldArg_, decodeOptionalFieldArg_0 ] - , bytesResolverCustomEffect = - \bytesResolverCustomEffectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "bytesResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith - [ "Bytes" ] - "Bytes" - [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ) - ) - } - ) - [ bytesResolverCustomEffectArg_ ] - , expectBytesCustomEffect = - \expectBytesCustomEffectArg_ expectBytesCustomEffectArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectBytesCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith - [ "Bytes" ] - "Bytes" - [] - ] - , Type.namedWith - [ "Bytes" ] - "Bytes" - [] - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ expectBytesCustomEffectArg_, expectBytesCustomEffectArg_0 ] - , stringResolverCustomEffect = - \stringResolverCustomEffectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "stringResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ) - ) - } - ) - [ stringResolverCustomEffectArg_ ] - , expectStringCustomEffect = - \expectStringCustomEffectArg_ expectStringCustomEffectArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectStringCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ expectStringCustomEffectArg_, expectStringCustomEffectArg_0 ] - , jsonResolverCustomEffect = - \jsonResolverCustomEffectArg_ jsonResolverCustomEffectArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ) - ) - } - ) - [ jsonResolverCustomEffectArg_, jsonResolverCustomEffectArg_0 ] - , expectJsonCustomEffect = - \expectJsonCustomEffectArg_ expectJsonCustomEffectArg_0 expectJsonCustomEffectArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectJsonCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ expectJsonCustomEffectArg_ - , expectJsonCustomEffectArg_0 - , expectJsonCustomEffectArg_1 - ] - , bytesResolverCustom = - \bytesResolverCustomArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "bytesResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith - [ "Bytes" ] - "Bytes" - [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ) - ) - } - ) - [ bytesResolverCustomArg_ ] - , expectBytesCustom = - \expectBytesCustomArg_ expectBytesCustomArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectBytesCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith - [ "Bytes" ] - "Bytes" - [] - ] - , Type.namedWith - [ "Bytes" ] - "Bytes" - [] - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ expectBytesCustomArg_, expectBytesCustomArg_0 ] - , stringResolverCustom = - \stringResolverCustomArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "stringResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ) - ) - } - ) - [ stringResolverCustomArg_ ] - , expectStringCustom = - \expectStringCustomArg_ expectStringCustomArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectStringCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ expectStringCustomArg_, expectStringCustomArg_0 ] - , jsonResolverCustom = - \jsonResolverCustomArg_ jsonResolverCustomArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ) - ) - } - ) - [ jsonResolverCustomArg_, jsonResolverCustomArg_0 ] - , expectJsonCustom = - \expectJsonCustomArg_ expectJsonCustomArg_0 expectJsonCustomArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectJsonCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - ) - [ expectJsonCustomArg_ - , expectJsonCustomArg_0 - , expectJsonCustomArg_1 - ] - } - - -values_ : - { jsonDecodeAndMap : Elm.Expression - , decodeOptionalField : Elm.Expression - , bytesResolverCustomEffect : Elm.Expression - , expectBytesCustomEffect : Elm.Expression - , stringResolverCustomEffect : Elm.Expression - , expectStringCustomEffect : Elm.Expression - , jsonResolverCustomEffect : Elm.Expression - , expectJsonCustomEffect : Elm.Expression - , bytesResolverCustom : Elm.Expression - , expectBytesCustom : Elm.Expression - , stringResolverCustom : Elm.Expression - , expectStringCustom : Elm.Expression - , jsonResolverCustom : Elm.Expression - , expectJsonCustom : Elm.Expression - } -values_ = - { jsonDecodeAndMap = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonDecodeAndMap" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.function [ Type.var "a" ] (Type.var "value") - ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - ) - ) - } - , decodeOptionalField = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "decodeOptionalField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "t" ] - ] - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.maybe (Type.var "t") ] - ) - ) - } - , bytesResolverCustomEffect = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "bytesResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ) - ) - } - , expectBytesCustomEffect = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectBytesCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - , stringResolverCustomEffect = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "stringResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ) - ) - } - , expectStringCustomEffect = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectStringCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - , jsonResolverCustomEffect = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonResolverCustomEffect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Resolver" - [ Type.var "restrictions" - , Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ) - ) - } - , expectJsonCustomEffect = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectJsonCustomEffect" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Effect", "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ) - } - , bytesResolverCustom = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "bytesResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ) - ) - } - , expectBytesCustom = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectBytesCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err" - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ]) - ) - } - , stringResolverCustom = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "stringResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ) - ) - } - , expectStringCustom = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectStringCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.string - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ]) - ) - } - , jsonResolverCustom = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "jsonResolverCustom" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith - [ "Http" ] - "Resolver" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ) - ) - } - , expectJsonCustom = - Elm.value - { importFrom = [ "OpenApi", "Common" ] - , name = "expectJsonCustom" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "OpenApi", "Common" ] - "Error" - [ Type.var "err", Type.string ] - , Type.var "success" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "err" ] - ] - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "success" ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ]) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/ConcurrentSubmission.elm b/codegen/Gen/Pages/ConcurrentSubmission.elm deleted file mode 100644 index 4ac7c6d6..00000000 --- a/codegen/Gen/Pages/ConcurrentSubmission.elm +++ /dev/null @@ -1,283 +0,0 @@ -module Gen.Pages.ConcurrentSubmission exposing - ( moduleName_, map, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.ConcurrentSubmission - -@docs moduleName_, map, annotation_, make_, caseOf_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "ConcurrentSubmission" ] - - -{-| `map` a `ConcurrentSubmission`. Not needed for most high-level cases since this state is managed by the `elm-pages` framework for you. - -map: - (a -> b) - -> Pages.ConcurrentSubmission.ConcurrentSubmission a - -> Pages.ConcurrentSubmission.ConcurrentSubmission b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : - { concurrentSubmission : Type.Annotation -> Type.Annotation - , status : Type.Annotation -> Type.Annotation - } -annotation_ = - { concurrentSubmission = - \concurrentSubmissionArg0 -> - Type.alias - moduleName_ - "ConcurrentSubmission" - [ concurrentSubmissionArg0 ] - (Type.record - [ ( "status" - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ Type.var "actionData" ] - ) - , ( "payload" - , Type.namedWith [ "Pages", "FormData" ] "FormData" [] - ) - , ( "initiatedAt", Type.namedWith [ "Time" ] "Posix" [] ) - ] - ) - , status = - \statusArg0 -> - Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ statusArg0 ] - } - - -make_ : - { concurrentSubmission : - { status : Elm.Expression - , payload : Elm.Expression - , initiatedAt : Elm.Expression - } - -> Elm.Expression - , submitting : Elm.Expression - , reloading : Elm.Expression -> Elm.Expression - , complete : Elm.Expression -> Elm.Expression - } -make_ = - { concurrentSubmission = - \concurrentSubmission_args -> - Elm.withType - (Type.alias - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "actionData" ] - (Type.record - [ ( "status" - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ Type.var "actionData" ] - ) - , ( "payload" - , Type.namedWith - [ "Pages", "FormData" ] - "FormData" - [] - ) - , ( "initiatedAt" - , Type.namedWith [ "Time" ] "Posix" [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "status" concurrentSubmission_args.status - , Tuple.pair "payload" concurrentSubmission_args.payload - , Tuple.pair - "initiatedAt" - concurrentSubmission_args.initiatedAt - ] - ) - , submitting = - Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "Submitting" - , annotation = - Just (Type.namedWith [] "Status" [ Type.var "actionData" ]) - } - , reloading = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "Reloading" - , annotation = - Just - (Type.namedWith - [] - "Status" - [ Type.var "actionData" ] - ) - } - ) - [ ar0 ] - , complete = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "Complete" - , annotation = - Just - (Type.namedWith - [] - "Status" - [ Type.var "actionData" ] - ) - } - ) - [ ar0 ] - } - - -caseOf_ : - { status : - Elm.Expression - -> { submitting : Elm.Expression - , reloading : Elm.Expression -> Elm.Expression - , complete : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { status = - \statusExpression statusTags -> - Elm.Case.custom - statusExpression - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ Type.var "actionData" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Submitting" statusTags.submitting) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Reloading" - statusTags.reloading |> Elm.Arg.item - (Elm.Arg.varWith - "actionData" - (Type.var - "actionData" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Complete" - statusTags.complete |> Elm.Arg.item - (Elm.Arg.varWith - "actionData" - (Type.var - "actionData" - ) - ) - ) - Basics.identity - ] - } - - -call_ : { map : Elm.Expression -> Elm.Expression -> Elm.Expression } -call_ = - { map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : { map : Elm.Expression } -values_ = - { map = - Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "b" ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Fetcher.elm b/codegen/Gen/Pages/Fetcher.elm deleted file mode 100644 index 8c6df589..00000000 --- a/codegen/Gen/Pages/Fetcher.elm +++ /dev/null @@ -1,375 +0,0 @@ -module Gen.Pages.Fetcher exposing - ( moduleName_, submit, map, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for Pages.Fetcher - -@docs moduleName_, submit, map, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Fetcher" ] - - -{-| submit: - Bytes.Decode.Decoder decoded - -> { fields : List ( String, String ), headers : List ( String, String ) } - -> Pages.Fetcher.Fetcher (Result.Result Http.Error decoded) --} -submit : - Elm.Expression - -> { fields : List Elm.Expression, headers : List Elm.Expression } - -> Elm.Expression -submit submitArg_ submitArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "submit" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "decoded" ] - , Type.record - [ ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.var "decoded" - ] - ] - ) - ) - } - ) - [ submitArg_ - , Elm.record - [ Tuple.pair "fields" (Elm.list submitArg_0.fields) - , Tuple.pair "headers" (Elm.list submitArg_0.headers) - ] - ] - - -{-| map: (a -> b) -> Pages.Fetcher.Fetcher a -> Pages.Fetcher.Fetcher b -} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : - { fetcher : Type.Annotation -> Type.Annotation - , fetcherInfo : Type.Annotation -> Type.Annotation - } -annotation_ = - { fetcher = - \fetcherArg0 -> - Type.namedWith [ "Pages", "Fetcher" ] "Fetcher" [ fetcherArg0 ] - , fetcherInfo = - \fetcherInfoArg0 -> - Type.alias - moduleName_ - "FetcherInfo" - [ fetcherInfoArg0 ] - (Type.record - [ ( "decoder" - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "decoded") - ) - , ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "url", Type.maybe Type.string ) - ] - ) - } - - -make_ : - { fetcher : Elm.Expression -> Elm.Expression - , fetcherInfo : - { decoder : Elm.Expression - , fields : Elm.Expression - , headers : Elm.Expression - , url : Elm.Expression - } - -> Elm.Expression - } -make_ = - { fetcher = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "Fetcher" - , annotation = - Just - (Type.namedWith [] "Fetcher" [ Type.var "decoded" ] - ) - } - ) - [ ar0 ] - , fetcherInfo = - \fetcherInfo_args -> - Elm.withType - (Type.alias - [ "Pages", "Fetcher" ] - "FetcherInfo" - [ Type.var "decoded" ] - (Type.record - [ ( "decoder" - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "decoded") - ) - , ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "url", Type.maybe Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "decoder" fetcherInfo_args.decoder - , Tuple.pair "fields" fetcherInfo_args.fields - , Tuple.pair "headers" fetcherInfo_args.headers - , Tuple.pair "url" fetcherInfo_args.url - ] - ) - } - - -caseOf_ : - { fetcher : - Elm.Expression - -> { fetcher : Elm.Expression -> Elm.Expression } - -> Elm.Expression - } -caseOf_ = - { fetcher = - \fetcherExpression fetcherTags -> - Elm.Case.custom - fetcherExpression - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "decoded" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "Fetcher" - fetcherTags.fetcher |> Elm.Arg.item - (Elm.Arg.varWith - "pagesFetcherFetcherInfo" - (Type.namedWith - [ "Pages" - , "Fetcher" - ] - "FetcherInfo" - [ Type.var - "decoded" - ] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { submit : Elm.Expression -> Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { submit = - \submitArg_ submitArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "submit" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "decoded" ] - , Type.record - [ ( "fields" - , Type.list - (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list - (Type.tuple Type.string Type.string) - ) - ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Http" ] - "Error" - [] - , Type.var "decoded" - ] - ] - ) - ) - } - ) - [ submitArg_, submitArg_0 ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : { submit : Elm.Expression, map : Elm.Expression } -values_ = - { submit = - Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "submit" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "decoded" ] - , Type.record - [ ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.var "decoded" - ] - ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "b" ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Flags.elm b/codegen/Gen/Pages/Flags.elm deleted file mode 100644 index 7b364709..00000000 --- a/codegen/Gen/Pages/Flags.elm +++ /dev/null @@ -1,80 +0,0 @@ -module Gen.Pages.Flags exposing ( moduleName_, annotation_, make_, caseOf_ ) - -{-| -# Generated bindings for Pages.Flags - -@docs moduleName_, annotation_, make_, caseOf_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Flags" ] - - -annotation_ : { flags : Type.Annotation } -annotation_ = - { flags = Type.namedWith [ "Pages", "Flags" ] "Flags" [] } - - -make_ : - { browserFlags : Elm.Expression -> Elm.Expression - , preRenderFlags : Elm.Expression - } -make_ = - { browserFlags = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Flags" ] - , name = "BrowserFlags" - , annotation = Just (Type.namedWith [] "Flags" []) - } - ) - [ ar0 ] - , preRenderFlags = - Elm.value - { importFrom = [ "Pages", "Flags" ] - , name = "PreRenderFlags" - , annotation = Just (Type.namedWith [] "Flags" []) - } - } - - -caseOf_ = - { flags = - \flagsExpression flagsTags -> - Elm.Case.custom - flagsExpression - (Type.namedWith [ "Pages", "Flags" ] "Flags" []) - [ Elm.Case.branch - (Elm.Arg.customType - "BrowserFlags" - flagsTags.browserFlags |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PreRenderFlags" - flagsTags.preRenderFlags - ) - Basics.identity - ] - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Form.elm b/codegen/Gen/Pages/Form.elm deleted file mode 100644 index bee2445f..00000000 --- a/codegen/Gen/Pages/Form.elm +++ /dev/null @@ -1,1036 +0,0 @@ -module Gen.Pages.Form exposing - ( moduleName_, renderHtml, renderStyledHtml, withConcurrent, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.Form - -@docs moduleName_, renderHtml, renderStyledHtml, withConcurrent, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Form" ] - - -{-| A replacement for `Form.renderHtml` from `dillonkearns/elm-form` that integrates with `elm-pages`. Use this to render your [`Form`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form) -as `elm/html` `Html`. - -renderHtml: - List (Html.Attribute (PagesMsg.PagesMsg userMsg)) - -> Pages.Form.Options error parsed input userMsg - -> { app - | pageFormState : Form.Model - , navigation : Maybe Pages.Navigation.Navigation - , concurrentSubmissions : - Dict.Dict String (Pages.ConcurrentSubmission.ConcurrentSubmission (Maybe action)) - } - -> Form.Form error { combine : - Form.Validation.Validation error parsed named constraints - , view : - Form.Context error input -> List (Html.Html (PagesMsg.PagesMsg userMsg)) - } parsed input - -> Html.Html (PagesMsg.PagesMsg userMsg) --} -renderHtml : - List Elm.Expression - -> Elm.Expression - -> { app - | pageFormState : Elm.Expression - , navigation : Elm.Expression - , concurrentSubmissions : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -renderHtml renderHtmlArg_ renderHtmlArg_0 renderHtmlArg_1 renderHtmlArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ Elm.list renderHtmlArg_ - , renderHtmlArg_0 - , Elm.record - [ Tuple.pair "pageFormState" renderHtmlArg_1.pageFormState - , Tuple.pair "navigation" renderHtmlArg_1.navigation - , Tuple.pair - "concurrentSubmissions" - renderHtmlArg_1.concurrentSubmissions - ] - , renderHtmlArg_2 - ] - - -{-| A replacement for `Form.renderStyledHtml` from `dillonkearns/elm-form` that integrates with `elm-pages`. Use this to render your [`Form`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form) -as `rtfeldman/elm-css` `Html.Styled.Html`. - -renderStyledHtml: - List (Html.Styled.Attribute (PagesMsg.PagesMsg userMsg)) - -> Pages.Form.Options error parsed input userMsg - -> { app - | pageFormState : Form.Model - , navigation : Maybe Pages.Navigation.Navigation - , concurrentSubmissions : - Dict.Dict String (Pages.ConcurrentSubmission.ConcurrentSubmission (Maybe action)) - } - -> Form.Form error { combine : - Form.Validation.Validation error parsed named constraints - , view : - Form.Context error input - -> List (Html.Styled.Html (PagesMsg.PagesMsg userMsg)) - } parsed input - -> Html.Styled.Html (PagesMsg.PagesMsg userMsg) --} -renderStyledHtml : - List Elm.Expression - -> Elm.Expression - -> { app - | pageFormState : Elm.Expression - , navigation : Elm.Expression - , concurrentSubmissions : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -renderStyledHtml renderStyledHtmlArg_ renderStyledHtmlArg_0 renderStyledHtmlArg_1 renderStyledHtmlArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderStyledHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ Elm.list renderStyledHtmlArg_ - , renderStyledHtmlArg_0 - , Elm.record - [ Tuple.pair "pageFormState" renderStyledHtmlArg_1.pageFormState - , Tuple.pair "navigation" renderStyledHtmlArg_1.navigation - , Tuple.pair - "concurrentSubmissions" - renderStyledHtmlArg_1.concurrentSubmissions - ] - , renderStyledHtmlArg_2 - ] - - -{-| Instead of using the default submission strategy (tied to the page's navigation state), you can use `withConcurrent`. -`withConcurrent` allows multiple form submissions to be in flight at the same time. It is useful for more dynamic applications. A good rule of thumb -is if you could have multiple pending spinners on the page at the same time, you should use `withConcurrent`. For example, if you have a page with a list of items, -say a Twitter clone. If you click the like button on a Tweet, it won't result in a page navigation. You can click the like button on multiple Tweets at the same time -and they will all submit independently. - -In the case of Twitter, there isn't an indication of a loading spinner on the like button because it is expected that it will succeed. This is an example of a User Experience (UX) pattern -called Optimistic UI. Since it is very likely that liking a Tweet will be successful, the UI will update the UI as if it has immediately succeeded even though the request is still in flight. -If the request fails, the UI will be updated to reflect the failure with an animation to show that something went wrong. - -The `withConcurrent` is a good fit for either of these UX patterns (Optimistic UI or Pending UI, i.e. showing a loading spinner). You can derive either of these -visual states from the `app.concurrentSubmissions` field in your `Route` module. - -You can call `withConcurrent` on your `Form.Options`. Note that while `withConcurrent` will allow multiple form submissions to be in flight at the same time independently, -the ID of the Form will still have a unique submission. For example, if you click submit on a form with the ID `"edit-123"` and then submit it again before the first submission has completed, -the second submission will cancel the first submission. So it is important to use unique IDs for forms that represent unique operations. - - import Form - import Pages.Form - - todoItemView app todo = - deleteItemForm - |> Pages.Form.renderHtml [] - (Form.options ("delete-" ++ todo.id) - |> Form.withInput todo - |> Pages.Form.withConcurrent - ) - app - -withConcurrent: - Pages.Form.Options error parsed input msg - -> Pages.Form.Options error parsed input msg --} -withConcurrent : Elm.Expression -> Elm.Expression -withConcurrent withConcurrentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "withConcurrent" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ] - (Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ) - ) - } - ) - [ withConcurrentArg_ ] - - -annotation_ : - { options : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , formWithServerValidations : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , handler : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { options = - \optionsArg0 optionsArg1 optionsArg2 optionsArg3 -> - Type.alias - moduleName_ - "Options" - [ optionsArg0, optionsArg1, optionsArg2, optionsArg3 ] - (Type.namedWith - [ "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - , Type.record [ ( "concurrent", Type.bool ) ] - ] - ) - , formWithServerValidations = - \formWithServerValidationsArg0 formWithServerValidationsArg1 formWithServerValidationsArg2 formWithServerValidationsArg3 -> - Type.alias - moduleName_ - "FormWithServerValidations" - [ formWithServerValidationsArg0 - , formWithServerValidationsArg1 - , formWithServerValidationsArg2 - , formWithServerValidationsArg3 - ] - (Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "combined" - , Type.namedWith - [ "Basics" ] - "Never" - [] - , Type.namedWith - [ "Basics" ] - "Never" - [] - ] - ] - , Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error", Type.var "input" ] - ] - (Type.var "view") - ) - ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "combined" - , Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - , Type.var "input" - ] - ) - , handler = - \handlerArg0 handlerArg1 -> - Type.alias - moduleName_ - "Handler" - [ handlerArg0, handlerArg1 ] - (Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "combined" - , Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - ] - ) - } - - -call_ : - { renderHtml : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , renderStyledHtml : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , withConcurrent : Elm.Expression -> Elm.Expression - } -call_ = - { renderHtml = - \renderHtmlArg_ renderHtmlArg_0 renderHtmlArg_1 renderHtmlArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages" - , "ConcurrentSubmission" - ] - "ConcurrentSubmission" - [ Type.maybe - (Type.var "action") - ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var - "userMsg" - ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ renderHtmlArg_ - , renderHtmlArg_0 - , renderHtmlArg_1 - , renderHtmlArg_2 - ] - , renderStyledHtml = - \renderStyledHtmlArg_ renderStyledHtmlArg_0 renderStyledHtmlArg_1 renderStyledHtmlArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderStyledHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages" - , "ConcurrentSubmission" - ] - "ConcurrentSubmission" - [ Type.maybe - (Type.var "action") - ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" - , "Styled" - ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var - "userMsg" - ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ renderStyledHtmlArg_ - , renderStyledHtmlArg_0 - , renderStyledHtmlArg_1 - , renderStyledHtmlArg_2 - ] - , withConcurrent = - \withConcurrentArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "withConcurrent" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ] - (Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ) - ) - } - ) - [ withConcurrentArg_ ] - } - - -values_ : - { renderHtml : Elm.Expression - , renderStyledHtml : Elm.Expression - , withConcurrent : Elm.Expression - } -values_ = - { renderHtml = - Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - , renderStyledHtml = - Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderStyledHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - , withConcurrent = - Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "withConcurrent" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ] - (Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/FormData.elm b/codegen/Gen/Pages/FormData.elm deleted file mode 100644 index 8b3b6625..00000000 --- a/codegen/Gen/Pages/FormData.elm +++ /dev/null @@ -1,71 +0,0 @@ -module Gen.Pages.FormData exposing ( moduleName_, annotation_, make_ ) - -{-| -# Generated bindings for Pages.FormData - -@docs moduleName_, annotation_, make_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "FormData" ] - - -annotation_ : { formData : Type.Annotation } -annotation_ = - { formData = - Type.alias - moduleName_ - "FormData" - [] - (Type.record - [ ( "fields", Type.list (Type.tuple Type.string Type.string) ) - , ( "method", Type.namedWith [ "Form" ] "Method" [] ) - , ( "action", Type.string ) - , ( "id", Type.maybe Type.string ) - ] - ) - } - - -make_ : - { formData : - { fields : Elm.Expression - , method : Elm.Expression - , action : Elm.Expression - , id : Elm.Expression - } - -> Elm.Expression - } -make_ = - { formData = - \formData_args -> - Elm.withType - (Type.alias - [ "Pages", "FormData" ] - "FormData" - [] - (Type.record - [ ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "method", Type.namedWith [ "Form" ] "Method" [] ) - , ( "action", Type.string ) - , ( "id", Type.maybe Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "fields" formData_args.fields - , Tuple.pair "method" formData_args.method - , Tuple.pair "action" formData_args.action - , Tuple.pair "id" formData_args.id - ] - ) - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/NotFoundReason.elm b/codegen/Gen/Pages/Internal/NotFoundReason.elm deleted file mode 100644 index 55f843eb..00000000 --- a/codegen/Gen/Pages/Internal/NotFoundReason.elm +++ /dev/null @@ -1,410 +0,0 @@ -module Gen.Pages.Internal.NotFoundReason exposing - ( moduleName_, document, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.Internal.NotFoundReason - -@docs moduleName_, document, annotation_, make_, caseOf_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "NotFoundReason" ] - - -{-| document: - List Pages.Internal.RoutePattern.RoutePattern - -> Pages.Internal.NotFoundReason.Payload - -> { title : String, body : List (Html.Html msg) } --} -document : List Elm.Expression -> Elm.Expression -> Elm.Expression -document documentArg_ documentArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "document" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - ] - (Type.record - [ ( "title", Type.string ) - , ( "body" - , Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - ] - ) - ) - } - ) - [ Elm.list documentArg_, documentArg_0 ] - - -annotation_ : - { moduleContext : Type.Annotation - , notFoundReason : Type.Annotation - , payload : Type.Annotation - , record : Type.Annotation - } -annotation_ = - { moduleContext = - Type.alias - moduleName_ - "ModuleContext" - [] - (Type.record - [ ( "moduleName", Type.list Type.string ) - , ( "routePattern" - , Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , ( "matchedRouteParams" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Record" - [] - ) - ] - ) - , notFoundReason = - Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - , payload = - Type.alias - moduleName_ - "Payload" - [] - (Type.record - [ ( "path", Type.namedWith [ "UrlPath" ] "UrlPath" [] ) - , ( "reason" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - ) - ] - ) - , record = - Type.alias - moduleName_ - "Record" - [] - (Type.list (Type.tuple Type.string Type.string)) - } - - -make_ : - { moduleContext : - { moduleName : Elm.Expression - , routePattern : Elm.Expression - , matchedRouteParams : Elm.Expression - } - -> Elm.Expression - , noMatchingRoute : Elm.Expression - , notPrerendered : Elm.Expression -> Elm.Expression -> Elm.Expression - , notPrerenderedOrHandledByFallback : - Elm.Expression -> Elm.Expression -> Elm.Expression - , unhandledServerRoute : Elm.Expression -> Elm.Expression - , payload : - { path : Elm.Expression, reason : Elm.Expression } -> Elm.Expression - } -make_ = - { moduleContext = - \moduleContext_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "NotFoundReason" ] - "ModuleContext" - [] - (Type.record - [ ( "moduleName", Type.list Type.string ) - , ( "routePattern" - , Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , ( "matchedRouteParams" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Record" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "moduleName" moduleContext_args.moduleName - , Tuple.pair "routePattern" moduleContext_args.routePattern - , Tuple.pair - "matchedRouteParams" - moduleContext_args.matchedRouteParams - ] - ) - , noMatchingRoute = - Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "NoMatchingRoute" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - , notPrerendered = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "NotPrerendered" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - ) - [ ar0, ar1 ] - , notPrerenderedOrHandledByFallback = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "NotPrerenderedOrHandledByFallback" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - ) - [ ar0, ar1 ] - , unhandledServerRoute = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "UnhandledServerRoute" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - ) - [ ar0 ] - , payload = - \payload_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - (Type.record - [ ( "path" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "reason" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "path" payload_args.path - , Tuple.pair "reason" payload_args.reason - ] - ) - } - - -caseOf_ = - { notFoundReason = - \notFoundReasonExpression notFoundReasonTags -> - Elm.Case.custom - notFoundReasonExpression - (Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "NoMatchingRoute" - notFoundReasonTags.noMatchingRoute - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NotPrerendered" - notFoundReasonTags.notPrerendered |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalNotFoundReasonModuleContext" - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "ModuleContext" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "Record" - [] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NotPrerenderedOrHandledByFallback" - notFoundReasonTags.notPrerenderedOrHandledByFallback |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalNotFoundReasonModuleContext" - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "ModuleContext" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "Record" - [] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UnhandledServerRoute" - notFoundReasonTags.unhandledServerRoute |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalNotFoundReasonModuleContext" - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "ModuleContext" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : { document : Elm.Expression -> Elm.Expression -> Elm.Expression } -call_ = - { document = - \documentArg_ documentArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "document" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - ] - (Type.record - [ ( "title", Type.string ) - , ( "body" - , Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - ] - ) - ) - } - ) - [ documentArg_, documentArg_0 ] - } - - -values_ : { document : Elm.Expression } -values_ = - { document = - Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "document" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - ] - (Type.record - [ ( "title", Type.string ) - , ( "body" - , Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/Platform.elm b/codegen/Gen/Pages/Internal/Platform.elm deleted file mode 100644 index e5045262..00000000 --- a/codegen/Gen/Pages/Internal/Platform.elm +++ /dev/null @@ -1,2340 +0,0 @@ -module Gen.Pages.Internal.Platform exposing - ( moduleName_, application, init, update, view, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Platform - -@docs moduleName_, application, init, update, view, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Platform" ] - - -{-| application: - Pages.ProgramConfig.ProgramConfig userMsg userModel route pageData actionData sharedData effect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Platform.Program Pages.Internal.Platform.Flags (Pages.Internal.Platform.Model userModel pageData actionData sharedData) (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) --} -application : Elm.Expression -> Elm.Expression -application applicationArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "application" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ applicationArg_ ] - - -{-| init: - Pages.ProgramConfig.ProgramConfig userMsg userModel route pageData actionData sharedData userEffect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Pages.Internal.Platform.Flags - -> Url.Url - -> Maybe Browser.Navigation.Key - -> ( Pages.Internal.Platform.Model userModel pageData actionData sharedData, Pages.Internal.Platform.Effect userMsg pageData actionData sharedData userEffect errorPage ) --} -init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -init initArg_ initArg_0 initArg_1 initArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith [ "Url" ] "Url" [] - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - - -{-| update: - Pages.ProgramConfig.ProgramConfig userMsg userModel route pageData actionData sharedData userEffect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage - -> Pages.Internal.Platform.Model userModel pageData actionData sharedData - -> ( Pages.Internal.Platform.Model userModel pageData actionData sharedData, Pages.Internal.Platform.Effect userMsg pageData actionData sharedData userEffect errorPage ) --} -update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -update updateArg_ updateArg_0 updateArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0, updateArg_1 ] - - -{-| view: - Pages.ProgramConfig.ProgramConfig userMsg userModel route pageData actionData sharedData effect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Pages.Internal.Platform.Model userModel pageData actionData sharedData - -> Browser.Document (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) --} -view : Elm.Expression -> Elm.Expression -> Elm.Expression -view viewArg_ viewArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.namedWith - [ "Browser" ] - "Document" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ viewArg_, viewArg_0 ] - - -annotation_ : - { flags : Type.Annotation - , model : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , msg : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , program : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , effect : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , requestInfo : Type.Annotation - } -annotation_ = - { flags = - Type.alias - moduleName_ - "Flags" - [] - (Type.namedWith [ "Json", "Decode" ] "Value" []) - , model = - \modelArg0 modelArg1 modelArg2 modelArg3 -> - Type.alias - moduleName_ - "Model" - [ modelArg0, modelArg1, modelArg2, modelArg3 ] - (Type.record - [ ( "key" - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ) - , ( "url", Type.namedWith [ "Url" ] "Url" [] ) - , ( "currentPath", Type.string ) - , ( "ariaNavigationAnnouncement", Type.string ) - , ( "pageData" - , Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.record - [ ( "userModel", Type.var "userModel" ) - , ( "pageData", Type.var "pageData" ) - , ( "sharedData", Type.var "sharedData" ) - , ( "actionData" - , Type.maybe (Type.var "actionData") - ) - ] - ] - ) - , ( "notFound" - , Type.maybe - (Type.record - [ ( "reason" - , Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "NotFoundReason" - [] - ) - , ( "path" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - ] - ) - ) - , ( "userFlags" - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ) - , ( "transition" - , Type.maybe - (Type.tuple - Type.int - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - ) - , ( "nextTransitionKey", Type.int ) - , ( "inFlightFetchers" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.tuple - Type.int - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "actionData" ] - ) - ] - ) - , ( "pageFormState", Type.namedWith [ "Form" ] "Model" [] ) - , ( "pendingRedirect", Type.bool ) - , ( "pendingData" - , Type.maybe - (Type.triple - (Type.var "pageData") - (Type.var "sharedData") - (Type.maybe (Type.var "actionData")) - ) - ) - ] - ) - , msg = - \msgArg0 msgArg1 msgArg2 msgArg3 msgArg4 -> - Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ msgArg0, msgArg1, msgArg2, msgArg3, msgArg4 ] - , program = - \programArg0 programArg1 programArg2 programArg3 programArg4 programArg5 -> - Type.alias - moduleName_ - "Program" - [ programArg0 - , programArg1 - , programArg2 - , programArg3 - , programArg4 - , programArg5 - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - , effect = - \effectArg0 effectArg1 effectArg2 effectArg3 effectArg4 effectArg5 -> - Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ effectArg0 - , effectArg1 - , effectArg2 - , effectArg3 - , effectArg4 - , effectArg5 - ] - , requestInfo = - Type.alias - moduleName_ - "RequestInfo" - [] - (Type.record - [ ( "contentType", Type.string ), ( "body", Type.string ) ] - ) - } - - -make_ : - { model : - { key : Elm.Expression - , url : Elm.Expression - , currentPath : Elm.Expression - , ariaNavigationAnnouncement : Elm.Expression - , pageData : Elm.Expression - , notFound : Elm.Expression - , userFlags : Elm.Expression - , transition : Elm.Expression - , nextTransitionKey : Elm.Expression - , inFlightFetchers : Elm.Expression - , pageFormState : Elm.Expression - , pendingRedirect : Elm.Expression - , pendingData : Elm.Expression - } - -> Elm.Expression - , linkClicked : Elm.Expression -> Elm.Expression - , urlChanged : Elm.Expression -> Elm.Expression - , userMsg : Elm.Expression -> Elm.Expression - , formMsg : Elm.Expression -> Elm.Expression - , updateCacheAndUrlNew : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , fetcherComplete : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , fetcherStarted : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , pageScrollComplete : Elm.Expression - , hotReloadCompleteNew : Elm.Expression -> Elm.Expression - , processFetchResponse : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , scrollToTop : Elm.Expression - , noEffect : Elm.Expression - , browserLoadUrl : Elm.Expression -> Elm.Expression - , browserPushUrl : Elm.Expression -> Elm.Expression - , browserReplaceUrl : Elm.Expression -> Elm.Expression - , fetchPageData : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , submit : Elm.Expression -> Elm.Expression - , submitFetcher : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , batch : Elm.Expression -> Elm.Expression - , userCmd : Elm.Expression -> Elm.Expression - , cancelRequest : Elm.Expression -> Elm.Expression - , runCmd : Elm.Expression -> Elm.Expression - , requestInfo : - { contentType : Elm.Expression, body : Elm.Expression } - -> Elm.Expression - } -make_ = - { model = - \model_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - (Type.record - [ ( "key" - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ) - , ( "url", Type.namedWith [ "Url" ] "Url" [] ) - , ( "currentPath", Type.string ) - , ( "ariaNavigationAnnouncement", Type.string ) - , ( "pageData" - , Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.record - [ ( "userModel", Type.var "userModel" ) - , ( "pageData", Type.var "pageData" ) - , ( "sharedData", Type.var "sharedData" ) - , ( "actionData" - , Type.maybe (Type.var "actionData") - ) - ] - ] - ) - , ( "notFound" - , Type.maybe - (Type.record - [ ( "reason" - , Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "NotFoundReason" - [] - ) - , ( "path" - , Type.namedWith - [ "UrlPath" ] - "UrlPath" - [] - ) - ] - ) - ) - , ( "userFlags" - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ) - , ( "transition" - , Type.maybe - (Type.tuple - Type.int - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - ) - , ( "nextTransitionKey", Type.int ) - , ( "inFlightFetchers" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.tuple - Type.int - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "actionData" ] - ) - ] - ) - , ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "pendingRedirect", Type.bool ) - , ( "pendingData" - , Type.maybe - (Type.triple - (Type.var "pageData") - (Type.var "sharedData") - (Type.maybe (Type.var "actionData")) - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "key" model_args.key - , Tuple.pair "url" model_args.url - , Tuple.pair "currentPath" model_args.currentPath - , Tuple.pair - "ariaNavigationAnnouncement" - model_args.ariaNavigationAnnouncement - , Tuple.pair "pageData" model_args.pageData - , Tuple.pair "notFound" model_args.notFound - , Tuple.pair "userFlags" model_args.userFlags - , Tuple.pair "transition" model_args.transition - , Tuple.pair - "nextTransitionKey" - model_args.nextTransitionKey - , Tuple.pair "inFlightFetchers" model_args.inFlightFetchers - , Tuple.pair "pageFormState" model_args.pageFormState - , Tuple.pair "pendingRedirect" model_args.pendingRedirect - , Tuple.pair "pendingData" model_args.pendingData - ] - ) - , linkClicked = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "LinkClicked" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , urlChanged = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UrlChanged" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , userMsg = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UserMsg" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , formMsg = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FormMsg" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , updateCacheAndUrlNew = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UpdateCacheAndUrlNew" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , fetcherComplete = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FetcherComplete" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , fetcherStarted = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FetcherStarted" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , pageScrollComplete = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "PageScrollComplete" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - , hotReloadCompleteNew = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "HotReloadCompleteNew" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , processFetchResponse = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "ProcessFetchResponse" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2 ] - , scrollToTop = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "ScrollToTop" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - , noEffect = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "NoEffect" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - , browserLoadUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "BrowserLoadUrl" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , browserPushUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "BrowserPushUrl" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , browserReplaceUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "BrowserReplaceUrl" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , fetchPageData = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FetchPageData" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , submit = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "Submit" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , submitFetcher = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "SubmitFetcher" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2 ] - , batch = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "Batch" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , userCmd = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UserCmd" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , cancelRequest = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "CancelRequest" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , runCmd = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "RunCmd" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , requestInfo = - \requestInfo_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform" ] - "RequestInfo" - [] - (Type.record - [ ( "contentType", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "contentType" requestInfo_args.contentType - , Tuple.pair "body" requestInfo_args.body - ] - ) - } - - -caseOf_ = - { msg = - \msgExpression msgTags -> - Elm.Case.custom - msgExpression - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "LinkClicked" - msgTags.linkClicked |> Elm.Arg.item - (Elm.Arg.varWith - "browserUrlRequest" - (Type.namedWith - [ "Browser" ] - "UrlRequest" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UrlChanged" - msgTags.urlChanged |> Elm.Arg.item - (Elm.Arg.varWith - "urlUrl" - (Type.namedWith - [ "Url" ] - "Url" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UserMsg" - msgTags.userMsg |> Elm.Arg.item - (Elm.Arg.varWith - "pagesMsgPagesMsg" - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var - "userMsg" - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FormMsg" - msgTags.formMsg |> Elm.Arg.item - (Elm.Arg.varWith - "formMsg" - (Type.namedWith - [ "Form" ] - "Msg" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UpdateCacheAndUrlNew" - msgTags.updateCacheAndUrlNew |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.bool - ) |> Elm.Arg.item - (Elm.Arg.varWith - "urlUrl" - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "userMsg" - ) - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "resultResult" - (Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FetcherComplete" - msgTags.fetcherComplete |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.bool - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - Type.string - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_2" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "resultResult" - (Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.maybe - (Type.var - "userMsg" - ) - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "ActionDataOrRedirect" - [ Type.var - "actionData" - ] - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FetcherStarted" - msgTags.fetcherStarted |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalPlatformFormData" - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "timePosix" - (Type.namedWith - [ "Time" - ] - "Posix" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PageScrollComplete" - msgTags.pageScrollComplete - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "HotReloadCompleteNew" - msgTags.hotReloadCompleteNew |> Elm.Arg.item - (Elm.Arg.varWith - "bytesBytes" - (Type.namedWith - [ "Bytes" - ] - "Bytes" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ProcessFetchResponse" - msgTags.processFetchResponse |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "resultResult" - (Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_2" - (Type.function - [ Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ) - ) - ) - ) - Basics.identity - ] - , effect = - \effectExpression effectTags -> - Elm.Case.custom - effectExpression - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "ScrollToTop" effectTags.scrollToTop) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "NoEffect" effectTags.noEffect) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BrowserLoadUrl" - effectTags.browserLoadUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BrowserPushUrl" - effectTags.browserPushUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BrowserReplaceUrl" - effectTags.browserReplaceUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FetchPageData" - effectTags.fetchPageData |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "urlUrl" - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_3" - (Type.function - [ Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Submit" - effectTags.submit |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalPlatformFormData" - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "SubmitFetcher" - effectTags.submitFetcher |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalPlatformFormData" - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Batch" effectTags.batch |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Effect" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "userEffect" - , Type.var - "errorPage" - ] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UserCmd" - effectTags.userCmd |> Elm.Arg.item - (Elm.Arg.varWith - "userEffect" - (Type.var "userEffect" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "CancelRequest" - effectTags.cancelRequest |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "RunCmd" - effectTags.runCmd |> Elm.Arg.item - (Elm.Arg.varWith - "platformCmdCmd" - (Type.namedWith - [] - "Cmd" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { application : Elm.Expression -> Elm.Expression - , init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , update : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , view : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { application = - \applicationArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "application" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ applicationArg_ ] - , init = - \initArg_ initArg_0 initArg_1 initArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith [ "Url" ] "Url" [] - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - , update = - \updateArg_ updateArg_0 updateArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0, updateArg_1 ] - , view = - \viewArg_ viewArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.namedWith - [ "Browser" ] - "Document" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ viewArg_, viewArg_0 ] - } - - -values_ : - { application : Elm.Expression - , init : Elm.Expression - , update : Elm.Expression - , view : Elm.Expression - } -values_ = - { application = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "application" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - , init = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith [ "Url" ] "Url" [] - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - , update = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - , view = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.namedWith - [ "Browser" ] - "Document" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/Platform/Cli.elm b/codegen/Gen/Pages/Internal/Platform/Cli.elm deleted file mode 100644 index ba99f4a6..00000000 --- a/codegen/Gen/Pages/Internal/Platform/Cli.elm +++ /dev/null @@ -1,690 +0,0 @@ -module Gen.Pages.Internal.Platform.Cli exposing - ( moduleName_, cliApplication, init, requestDecoder, update, currentCompatibilityKey - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Platform.Cli - -@docs moduleName_, cliApplication, init, requestDecoder, update, currentCompatibilityKey -@docs annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Platform", "Cli" ] - - -{-| cliApplication: - Pages.ProgramConfig.ProgramConfig userMsg userModel (Maybe route) pageData actionData sharedData effect mappedMsg errorPage - -> Pages.Internal.Platform.Cli.Program (Maybe route) --} -cliApplication : Elm.Expression -> Elm.Expression -cliApplication cliApplicationArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "cliApplication" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.maybe (Type.var "route") - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Program" - [ Type.maybe (Type.var "route") ] - ) - ) - } - ) - [ cliApplicationArg_ ] - - -{-| init: - Pages.SiteConfig.SiteConfig - -> RenderRequest.RenderRequest route - -> Pages.ProgramConfig.ProgramConfig userMsg userModel route pageData actionData sharedData effect mappedMsg errorPage - -> Json.Decode.Value - -> ( Pages.Internal.Platform.Cli.Model route, Pages.Internal.Platform.Effect.Effect ) --} -init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -init initArg_ initArg_0 initArg_1 initArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "SiteConfig" ] - "SiteConfig" - [] - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - - -{-| requestDecoder: Json.Decode.Decoder Pages.StaticHttp.Request.Request -} -requestDecoder : Elm.Expression -requestDecoder = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - - -{-| update: - Pages.Internal.Platform.Cli.Msg - -> Pages.Internal.Platform.Cli.Model route - -> ( Pages.Internal.Platform.Cli.Model route, Pages.Internal.Platform.Effect.Effect ) --} -update : Elm.Expression -> Elm.Expression -> Elm.Expression -update updateArg_ updateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - - -{-| currentCompatibilityKey: Int -} -currentCompatibilityKey : Elm.Expression -currentCompatibilityKey = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "currentCompatibilityKey" - , annotation = Just Type.int - } - - -annotation_ : - { flags : Type.Annotation - , model : Type.Annotation -> Type.Annotation - , msg : Type.Annotation - , program : Type.Annotation -> Type.Annotation - } -annotation_ = - { flags = - Type.alias - moduleName_ - "Flags" - [] - (Type.namedWith [ "Json", "Decode" ] "Value" []) - , model = - \modelArg0 -> - Type.alias - moduleName_ - "Model" - [ modelArg0 ] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ] - ) - , ( "errors" - , Type.list - (Type.namedWith [ "BuildError" ] "BuildError" []) - ) - , ( "maybeRequestJson" - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - ) - , ( "isDevServer", Type.bool ) - ] - ) - , msg = Type.namedWith [ "Pages", "Internal", "Platform", "Cli" ] "Msg" [] - , program = - \programArg0 -> - Type.alias - moduleName_ - "Program" - [ programArg0 ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - ] - ) - } - - -make_ : - { model : - { staticResponses : Elm.Expression - , errors : Elm.Expression - , maybeRequestJson : Elm.Expression - , isDevServer : Elm.Expression - } - -> Elm.Expression - , gotDataBatch : Elm.Expression -> Elm.Expression - , gotBuildError : Elm.Expression -> Elm.Expression - } -make_ = - { model = - \model_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ] - ) - , ( "errors" - , Type.list - (Type.namedWith - [ "BuildError" ] - "BuildError" - [] - ) - ) - , ( "maybeRequestJson" - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - ) - , ( "isDevServer", Type.bool ) - ] - ) - ) - (Elm.record - [ Tuple.pair "staticResponses" model_args.staticResponses - , Tuple.pair "errors" model_args.errors - , Tuple.pair "maybeRequestJson" model_args.maybeRequestJson - , Tuple.pair "isDevServer" model_args.isDevServer - ] - ) - , gotDataBatch = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "GotDataBatch" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - , gotBuildError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "GotBuildError" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { msg = - \msgExpression msgTags -> - Elm.Case.custom - msgExpression - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "GotDataBatch" - msgTags.gotDataBatch |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "GotBuildError" - msgTags.gotBuildError |> Elm.Arg.item - (Elm.Arg.varWith - "buildErrorBuildError" - (Type.namedWith - [ "BuildError" - ] - "BuildError" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { cliApplication : Elm.Expression -> Elm.Expression - , init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , update : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { cliApplication = - \cliApplicationArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "cliApplication" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.maybe (Type.var "route") - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Cli" - ] - "Program" - [ Type.maybe (Type.var "route") ] - ) - ) - } - ) - [ cliApplicationArg_ ] - , init = - \initArg_ initArg_0 initArg_1 initArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "SiteConfig" ] - "SiteConfig" - [] - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Json", "Decode" ] - "Value" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Cli" - ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - , update = - \updateArg_ updateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Cli" - ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - } - - -values_ : - { cliApplication : Elm.Expression - , init : Elm.Expression - , requestDecoder : Elm.Expression - , update : Elm.Expression - , currentCompatibilityKey : Elm.Expression - } -values_ = - { cliApplication = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "cliApplication" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.maybe (Type.var "route") - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Program" - [ Type.maybe (Type.var "route") ] - ) - ) - } - , init = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "SiteConfig" ] - "SiteConfig" - [] - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , requestDecoder = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - , update = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , currentCompatibilityKey = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "currentCompatibilityKey" - , annotation = Just Type.int - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/Platform/GeneratorApplication.elm b/codegen/Gen/Pages/Internal/Platform/GeneratorApplication.elm deleted file mode 100644 index caf90648..00000000 --- a/codegen/Gen/Pages/Internal/Platform/GeneratorApplication.elm +++ /dev/null @@ -1,701 +0,0 @@ -module Gen.Pages.Internal.Platform.GeneratorApplication exposing - ( moduleName_, init, requestDecoder, update, app, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Platform.GeneratorApplication - -@docs moduleName_, init, requestDecoder, update, app, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - - -{-| init: - BackendTask.BackendTask FatalError.FatalError () - -> Cli.Program.FlagsIncludingArgv Pages.Internal.Platform.GeneratorApplication.Flags - -> ( Pages.Internal.Platform.GeneratorApplication.Model, Pages.Internal.Platform.Effect.Effect ) --} -init : Elm.Expression -> Elm.Expression -> Elm.Expression -init initArg_ initArg_0 = - Elm.apply - (Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - , Type.namedWith - [ "Cli", "Program" ] - "FlagsIncludingArgv" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Flags" - [] - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0 ] - - -{-| requestDecoder: Json.Decode.Decoder Pages.StaticHttp.Request.Request -} -requestDecoder : Elm.Expression -requestDecoder = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - - -{-| update: - Pages.Internal.Platform.GeneratorApplication.Msg - -> Pages.Internal.Platform.GeneratorApplication.Model - -> ( Pages.Internal.Platform.GeneratorApplication.Model, Pages.Internal.Platform.Effect.Effect ) --} -update : Elm.Expression -> Elm.Expression -> Elm.Expression -update updateArg_ updateArg_0 = - Elm.apply - (Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Msg" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - - -{-| app: - Pages.GeneratorProgramConfig.GeneratorProgramConfig - -> Pages.Internal.Platform.GeneratorApplication.Program --} -app : Elm.Expression -> Elm.Expression -app appArg_ = - Elm.apply - (Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "app" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "GeneratorProgramConfig" ] - "GeneratorProgramConfig" - [] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Program" - [] - ) - ) - } - ) - [ appArg_ ] - - -annotation_ : - { program : Type.Annotation - , flags : Type.Annotation - , model : Type.Annotation - , msg : Type.Annotation - , jsonValue : Type.Annotation - } -annotation_ = - { program = - Type.alias - moduleName_ - "Program" - [] - (Type.namedWith - [ "Cli", "Program" ] - "StatefulProgram" - [ Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Model" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Msg" - [] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Flags" - [] - ] - ) - , flags = - Type.alias - moduleName_ - "Flags" - [] - (Type.record [ ( "compatibilityKey", Type.int ) ]) - , model = - Type.alias - moduleName_ - "Model" - [] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - , ( "errors" - , Type.list (Type.namedWith [ "BuildError" ] "BuildError" []) - ) - ] - ) - , msg = - Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Msg" - [] - , jsonValue = - Type.alias - moduleName_ - "JsonValue" - [] - (Type.namedWith [ "Json", "Decode" ] "Value" []) - } - - -make_ : - { flags : { compatibilityKey : Elm.Expression } -> Elm.Expression - , model : - { staticResponses : Elm.Expression, errors : Elm.Expression } - -> Elm.Expression - , gotDataBatch : Elm.Expression -> Elm.Expression - , gotBuildError : Elm.Expression -> Elm.Expression - } -make_ = - { flags = - \flags_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Flags" - [] - (Type.record [ ( "compatibilityKey", Type.int ) ]) - ) - (Elm.record - [ Tuple.pair "compatibilityKey" flags_args.compatibilityKey - ] - ) - , model = - \model_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Model" - [] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - , ( "errors" - , Type.list - (Type.namedWith - [ "BuildError" ] - "BuildError" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "staticResponses" model_args.staticResponses - , Tuple.pair "errors" model_args.errors - ] - ) - , gotDataBatch = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "GotDataBatch" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - , gotBuildError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "GotBuildError" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { msg = - \msgExpression msgTags -> - Elm.Case.custom - msgExpression - (Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Msg" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "GotDataBatch" - msgTags.gotDataBatch |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "GotBuildError" - msgTags.gotBuildError |> Elm.Arg.item - (Elm.Arg.varWith - "buildErrorBuildError" - (Type.namedWith - [ "BuildError" - ] - "BuildError" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { init : Elm.Expression -> Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression -> Elm.Expression - , app : Elm.Expression -> Elm.Expression - } -call_ = - { init = - \initArg_ initArg_0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - , Type.namedWith - [ "Cli", "Program" ] - "FlagsIncludingArgv" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Flags" - [] - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0 ] - , update = - \updateArg_ updateArg_0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Msg" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - , app = - \appArg_ -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "app" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "GeneratorProgramConfig" ] - "GeneratorProgramConfig" - [] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Program" - [] - ) - ) - } - ) - [ appArg_ ] - } - - -values_ : - { init : Elm.Expression - , requestDecoder : Elm.Expression - , update : Elm.Expression - , app : Elm.Expression - } -values_ = - { init = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - , Type.namedWith - [ "Cli", "Program" ] - "FlagsIncludingArgv" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Flags" - [] - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , requestDecoder = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - , update = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Msg" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , app = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "app" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "GeneratorProgramConfig" ] - "GeneratorProgramConfig" - [] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Program" - [] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/ResponseSketch.elm b/codegen/Gen/Pages/Internal/ResponseSketch.elm deleted file mode 100644 index cf2488db..00000000 --- a/codegen/Gen/Pages/Internal/ResponseSketch.elm +++ /dev/null @@ -1,250 +0,0 @@ -module Gen.Pages.Internal.ResponseSketch exposing ( moduleName_, annotation_, make_, caseOf_ ) - -{-| -# Generated bindings for Pages.Internal.ResponseSketch - -@docs moduleName_, annotation_, make_, caseOf_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "ResponseSketch" ] - - -annotation_ : - { responseSketch : - Type.Annotation -> Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { responseSketch = - \responseSketchArg0 responseSketchArg1 responseSketchArg2 -> - Type.namedWith - [ "Pages", "Internal", "ResponseSketch" ] - "ResponseSketch" - [ responseSketchArg0, responseSketchArg1, responseSketchArg2 ] - } - - -make_ : - { renderPage : Elm.Expression -> Elm.Expression -> Elm.Expression - , hotUpdate : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , redirect : Elm.Expression -> Elm.Expression - , notFound : Elm.Expression -> Elm.Expression - , action : Elm.Expression -> Elm.Expression - } -make_ = - { renderPage = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "RenderPage" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0, ar1 ] - , hotUpdate = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "HotUpdate" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0, ar1, ar2 ] - , redirect = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "Redirect" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0 ] - , notFound = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "NotFound" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0 ] - , action = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "Action" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0 ] - } - - -caseOf_ = - { responseSketch = - \responseSketchExpression responseSketchTags -> - Elm.Case.custom - responseSketchExpression - (Type.namedWith - [ "Pages", "Internal", "ResponseSketch" ] - "ResponseSketch" - [ Type.var "data", Type.var "action", Type.var "shared" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "RenderPage" - responseSketchTags.renderPage |> Elm.Arg.item - (Elm.Arg.varWith - "data" - (Type.var - "data" - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "action" - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "HotUpdate" - responseSketchTags.hotUpdate |> Elm.Arg.item - (Elm.Arg.varWith - "data" - (Type.var - "data" - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "shared" - (Type.var - "shared" - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "action" - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Redirect" - responseSketchTags.redirect |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NotFound" - responseSketchTags.notFound |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.record - [ ( "reason" - , Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "NotFoundReason" - [] - ) - , ( "path" - , Type.namedWith - [ "UrlPath" - ] - "UrlPath" - [] - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Action" - responseSketchTags.action |> Elm.Arg.item - (Elm.Arg.varWith - "action" - (Type.var - "action" - ) - ) - ) - Basics.identity - ] - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/RoutePattern.elm b/codegen/Gen/Pages/Internal/RoutePattern.elm deleted file mode 100644 index ca453ef9..00000000 --- a/codegen/Gen/Pages/Internal/RoutePattern.elm +++ /dev/null @@ -1,1196 +0,0 @@ -module Gen.Pages.Internal.RoutePattern exposing - ( moduleName_, view, toVariant, routeToBranch, fromModuleName, hasRouteParams - , repeatWithoutOptionalEnding, toModuleName, toRouteParamTypes, toRouteParamsRecord, toVariantName, annotation_, make_ - , caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.RoutePattern - -@docs moduleName_, view, toVariant, routeToBranch, fromModuleName, hasRouteParams -@docs repeatWithoutOptionalEnding, toModuleName, toRouteParamTypes, toRouteParamsRecord, toVariantName, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "RoutePattern" ] - - -{-| view: Pages.Internal.RoutePattern.RoutePattern -> Html.Html msg -} -view : Elm.Expression -> Elm.Expression -view viewArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Html" ] "Html" [ Type.var "msg" ]) - ) - } - ) - [ viewArg_ ] - - -{-| toVariant: Pages.Internal.RoutePattern.RoutePattern -> Elm.Variant -} -toVariant : Elm.Expression -> Elm.Expression -toVariant toVariantArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariant" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Elm" ] "Variant" []) - ) - } - ) - [ toVariantArg_ ] - - -{-| routeToBranch: - Pages.Internal.RoutePattern.RoutePattern - -> List ( Elm.CodeGen.Pattern, Elm.CodeGen.Expression ) --} -routeToBranch : Elm.Expression -> Elm.Expression -routeToBranch routeToBranchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "routeToBranch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - (Type.namedWith - [ "Elm", "CodeGen" ] - "Pattern" - [] - ) - (Type.namedWith - [ "Elm", "CodeGen" ] - "Expression" - [] - ) - ) - ) - ) - } - ) - [ routeToBranchArg_ ] - - -{-| fromModuleName: List String -> Maybe Pages.Internal.RoutePattern.RoutePattern -} -fromModuleName : List String -> Elm.Expression -fromModuleName fromModuleNameArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "fromModuleName" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - ) - ) - } - ) - [ Elm.list (List.map Elm.string fromModuleNameArg_) ] - - -{-| hasRouteParams: Pages.Internal.RoutePattern.RoutePattern -> Bool -} -hasRouteParams : Elm.Expression -> Elm.Expression -hasRouteParams hasRouteParamsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "hasRouteParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - Type.bool - ) - } - ) - [ hasRouteParamsArg_ ] - - -{-| repeatWithoutOptionalEnding: - List Pages.Internal.RoutePattern.RouteParam - -> Maybe (List Pages.Internal.RoutePattern.RouteParam) --} -repeatWithoutOptionalEnding : List Elm.Expression -> Elm.Expression -repeatWithoutOptionalEnding repeatWithoutOptionalEndingArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "repeatWithoutOptionalEnding" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ] - (Type.maybe - (Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ) - ) - ) - } - ) - [ Elm.list repeatWithoutOptionalEndingArg_ ] - - -{-| toModuleName: Pages.Internal.RoutePattern.RoutePattern -> List String -} -toModuleName : Elm.Expression -> Elm.Expression -toModuleName toModuleNameArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toModuleName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list Type.string) - ) - } - ) - [ toModuleNameArg_ ] - - -{-| toRouteParamTypes: - Pages.Internal.RoutePattern.RoutePattern - -> List ( String, Pages.Internal.RoutePattern.Param ) --} -toRouteParamTypes : Elm.Expression -> Elm.Expression -toRouteParamTypes toRouteParamTypesArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamTypes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Param" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamTypesArg_ ] - - -{-| toRouteParamsRecord: - Pages.Internal.RoutePattern.RoutePattern - -> List ( String, Elm.Annotation.Annotation ) --} -toRouteParamsRecord : Elm.Expression -> Elm.Expression -toRouteParamsRecord toRouteParamsRecordArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamsRecord" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Elm", "Annotation" ] - "Annotation" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamsRecordArg_ ] - - -{-| toVariantName: - Pages.Internal.RoutePattern.RoutePattern - -> { variantName : String - , params : List Pages.Internal.RoutePattern.RouteParam - } --} -toVariantName : Elm.Expression -> Elm.Expression -toVariantName toVariantNameArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariantName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.record - [ ( "variantName", Type.string ) - , ( "params" - , Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ] - ) - ) - } - ) - [ toVariantNameArg_ ] - - -annotation_ : - { ending : Type.Annotation - , routePattern : Type.Annotation - , segment : Type.Annotation - , param : Type.Annotation - , routeParam : Type.Annotation - } -annotation_ = - { ending = - Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "Ending" [] - , routePattern = - Type.alias - moduleName_ - "RoutePattern" - [] - (Type.record - [ ( "segments" - , Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Segment" - [] - ) - ) - , ( "ending" - , Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Ending" - [] - ) - ) - ] - ) - , segment = - Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "Segment" [] - , param = Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "Param" [] - , routeParam = - Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "RouteParam" [] - } - - -make_ : - { optional : Elm.Expression -> Elm.Expression - , requiredSplat : Elm.Expression - , optionalSplat : Elm.Expression - , routePattern : - { segments : Elm.Expression, ending : Elm.Expression } -> Elm.Expression - , staticSegment : Elm.Expression -> Elm.Expression - , dynamicSegment : Elm.Expression -> Elm.Expression - , requiredParam : Elm.Expression - , optionalParam : Elm.Expression - , requiredSplatParam : Elm.Expression - , optionalSplatParam : Elm.Expression - , staticParam : Elm.Expression -> Elm.Expression - , dynamicParam : Elm.Expression -> Elm.Expression - , optionalParam2 : Elm.Expression -> Elm.Expression - , requiredSplatParam2 : Elm.Expression - , optionalSplatParam2 : Elm.Expression - } -make_ = - { optional = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "Optional" - , annotation = Just (Type.namedWith [] "Ending" []) - } - ) - [ ar0 ] - , requiredSplat = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredSplat" - , annotation = Just (Type.namedWith [] "Ending" []) - } - , optionalSplat = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalSplat" - , annotation = Just (Type.namedWith [] "Ending" []) - } - , routePattern = - \routePattern_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - (Type.record - [ ( "segments" - , Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Segment" - [] - ) - ) - , ( "ending" - , Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Ending" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "segments" routePattern_args.segments - , Tuple.pair "ending" routePattern_args.ending - ] - ) - , staticSegment = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "StaticSegment" - , annotation = Just (Type.namedWith [] "Segment" []) - } - ) - [ ar0 ] - , dynamicSegment = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "DynamicSegment" - , annotation = Just (Type.namedWith [] "Segment" []) - } - ) - [ ar0 ] - , requiredParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , optionalParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , requiredSplatParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredSplatParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , optionalSplatParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalSplatParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , staticParam = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "StaticParam" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - ) - [ ar0 ] - , dynamicParam = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "DynamicParam" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - ) - [ ar0 ] - , optionalParam2 = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalParam2" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - ) - [ ar0 ] - , requiredSplatParam2 = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredSplatParam2" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - , optionalSplatParam2 = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalSplatParam2" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - } - - -caseOf_ : - { ending : - Elm.Expression - -> { optional : Elm.Expression -> Elm.Expression - , requiredSplat : Elm.Expression - , optionalSplat : Elm.Expression - } - -> Elm.Expression - , segment : - Elm.Expression - -> { staticSegment : Elm.Expression -> Elm.Expression - , dynamicSegment : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - , param : - Elm.Expression - -> { requiredParam : Elm.Expression - , optionalParam : Elm.Expression - , requiredSplatParam : Elm.Expression - , optionalSplatParam : Elm.Expression - } - -> Elm.Expression - , routeParam : - Elm.Expression - -> { staticParam : Elm.Expression -> Elm.Expression - , dynamicParam : Elm.Expression -> Elm.Expression - , optionalParam2 : Elm.Expression -> Elm.Expression - , requiredSplatParam2 : Elm.Expression - , optionalSplatParam2 : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { ending = - \endingExpression endingTags -> - Elm.Case.custom - endingExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Ending" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "Optional" - endingTags.optional |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "RequiredSplat" endingTags.requiredSplat - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "OptionalSplat" endingTags.optionalSplat - ) - Basics.identity - ] - , segment = - \segmentExpression segmentTags -> - Elm.Case.custom - segmentExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Segment" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "StaticSegment" - segmentTags.staticSegment |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "DynamicSegment" - segmentTags.dynamicSegment |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - ] - , param = - \paramExpression paramTags -> - Elm.Case.custom - paramExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Param" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType "RequiredParam" paramTags.requiredParam) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "OptionalParam" paramTags.optionalParam) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "RequiredSplatParam" - paramTags.requiredSplatParam - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "OptionalSplatParam" - paramTags.optionalSplatParam - ) - Basics.identity - ] - , routeParam = - \routeParamExpression routeParamTags -> - Elm.Case.custom - routeParamExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "StaticParam" - routeParamTags.staticParam |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "DynamicParam" - routeParamTags.dynamicParam |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "OptionalParam2" - routeParamTags.optionalParam2 |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "RequiredSplatParam2" - routeParamTags.requiredSplatParam2 - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "OptionalSplatParam2" - routeParamTags.optionalSplatParam2 - ) - Basics.identity - ] - } - - -call_ : - { view : Elm.Expression -> Elm.Expression - , toVariant : Elm.Expression -> Elm.Expression - , routeToBranch : Elm.Expression -> Elm.Expression - , fromModuleName : Elm.Expression -> Elm.Expression - , hasRouteParams : Elm.Expression -> Elm.Expression - , repeatWithoutOptionalEnding : Elm.Expression -> Elm.Expression - , toModuleName : Elm.Expression -> Elm.Expression - , toRouteParamTypes : Elm.Expression -> Elm.Expression - , toRouteParamsRecord : Elm.Expression -> Elm.Expression - , toVariantName : Elm.Expression -> Elm.Expression - } -call_ = - { view = - \viewArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - } - ) - [ viewArg_ ] - , toVariant = - \toVariantArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariant" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Elm" ] "Variant" []) - ) - } - ) - [ toVariantArg_ ] - , routeToBranch = - \routeToBranchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "routeToBranch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - (Type.namedWith - [ "Elm", "CodeGen" ] - "Pattern" - [] - ) - (Type.namedWith - [ "Elm", "CodeGen" ] - "Expression" - [] - ) - ) - ) - ) - } - ) - [ routeToBranchArg_ ] - , fromModuleName = - \fromModuleNameArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "fromModuleName" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.maybe - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RoutePattern" - [] - ) - ) - ) - } - ) - [ fromModuleNameArg_ ] - , hasRouteParams = - \hasRouteParamsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "hasRouteParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - Type.bool - ) - } - ) - [ hasRouteParamsArg_ ] - , repeatWithoutOptionalEnding = - \repeatWithoutOptionalEndingArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "repeatWithoutOptionalEnding" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ] - (Type.maybe - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ) - ) - } - ) - [ repeatWithoutOptionalEndingArg_ ] - , toModuleName = - \toModuleNameArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toModuleName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list Type.string) - ) - } - ) - [ toModuleNameArg_ ] - , toRouteParamTypes = - \toRouteParamTypesArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamTypes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "Param" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamTypesArg_ ] - , toRouteParamsRecord = - \toRouteParamsRecordArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamsRecord" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Elm", "Annotation" ] - "Annotation" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamsRecordArg_ ] - , toVariantName = - \toVariantNameArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariantName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.record - [ ( "variantName", Type.string ) - , ( "params" - , Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ] - ) - ) - } - ) - [ toVariantNameArg_ ] - } - - -values_ : - { view : Elm.Expression - , toVariant : Elm.Expression - , routeToBranch : Elm.Expression - , fromModuleName : Elm.Expression - , hasRouteParams : Elm.Expression - , repeatWithoutOptionalEnding : Elm.Expression - , toModuleName : Elm.Expression - , toRouteParamTypes : Elm.Expression - , toRouteParamsRecord : Elm.Expression - , toVariantName : Elm.Expression - } -values_ = - { view = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Html" ] "Html" [ Type.var "msg" ]) - ) - } - , toVariant = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariant" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Elm" ] "Variant" []) - ) - } - , routeToBranch = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "routeToBranch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - (Type.namedWith - [ "Elm", "CodeGen" ] - "Pattern" - [] - ) - (Type.namedWith - [ "Elm", "CodeGen" ] - "Expression" - [] - ) - ) - ) - ) - } - , fromModuleName = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "fromModuleName" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - ) - ) - } - , hasRouteParams = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "hasRouteParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - Type.bool - ) - } - , repeatWithoutOptionalEnding = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "repeatWithoutOptionalEnding" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ] - (Type.maybe - (Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ) - ) - ) - } - , toModuleName = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toModuleName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list Type.string) - ) - } - , toRouteParamTypes = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamTypes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Param" - [] - ) - ) - ) - ) - } - , toRouteParamsRecord = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamsRecord" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Elm", "Annotation" ] - "Annotation" - [] - ) - ) - ) - ) - } - , toVariantName = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariantName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.record - [ ( "variantName", Type.string ) - , ( "params" - , Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Internal/Router.elm b/codegen/Gen/Pages/Internal/Router.elm deleted file mode 100644 index 07c43fe6..00000000 --- a/codegen/Gen/Pages/Internal/Router.elm +++ /dev/null @@ -1,340 +0,0 @@ -module Gen.Pages.Internal.Router exposing - ( moduleName_, firstMatch, fromOptionalSplat, maybeToList, nonEmptyToList, toNonEmpty - , annotation_, make_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Router - -@docs moduleName_, firstMatch, fromOptionalSplat, maybeToList, nonEmptyToList, toNonEmpty -@docs annotation_, make_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Router" ] - - -{-| firstMatch: List (Pages.Internal.Router.Matcher route) -> String -> Maybe route -} -firstMatch : List Elm.Expression -> String -> Elm.Expression -firstMatch firstMatchArg_ firstMatchArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "firstMatch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - ) - , Type.string - ] - (Type.maybe (Type.var "route")) - ) - } - ) - [ Elm.list firstMatchArg_, Elm.string firstMatchArg_0 ] - - -{-| fromOptionalSplat: Maybe String -> List String -} -fromOptionalSplat : Elm.Expression -> Elm.Expression -fromOptionalSplat fromOptionalSplatArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "fromOptionalSplat" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ fromOptionalSplatArg_ ] - - -{-| maybeToList: Maybe String -> List String -} -maybeToList : Elm.Expression -> Elm.Expression -maybeToList maybeToListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "maybeToList" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ maybeToListArg_ ] - - -{-| nonEmptyToList: ( String, List String ) -> List String -} -nonEmptyToList : Elm.Expression -> Elm.Expression -nonEmptyToList nonEmptyToListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "nonEmptyToList" - , annotation = - Just - (Type.function - [ Type.tuple Type.string (Type.list Type.string) ] - (Type.list Type.string) - ) - } - ) - [ nonEmptyToListArg_ ] - - -{-| toNonEmpty: String -> ( String, List String ) -} -toNonEmpty : String -> Elm.Expression -toNonEmpty toNonEmptyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "toNonEmpty" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.tuple Type.string (Type.list Type.string)) - ) - } - ) - [ Elm.string toNonEmptyArg_ ] - - -annotation_ : { matcher : Type.Annotation -> Type.Annotation } -annotation_ = - { matcher = - \matcherArg0 -> - Type.alias - moduleName_ - "Matcher" - [ matcherArg0 ] - (Type.record - [ ( "pattern", Type.string ) - , ( "toRoute" - , Type.function - [ Type.list (Type.maybe Type.string) ] - (Type.maybe (Type.var "route")) - ) - ] - ) - } - - -make_ : - { matcher : - { pattern : Elm.Expression, toRoute : Elm.Expression } -> Elm.Expression - } -make_ = - { matcher = - \matcher_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - (Type.record - [ ( "pattern", Type.string ) - , ( "toRoute" - , Type.function - [ Type.list (Type.maybe Type.string) ] - (Type.maybe (Type.var "route")) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "pattern" matcher_args.pattern - , Tuple.pair "toRoute" matcher_args.toRoute - ] - ) - } - - -call_ : - { firstMatch : Elm.Expression -> Elm.Expression -> Elm.Expression - , fromOptionalSplat : Elm.Expression -> Elm.Expression - , maybeToList : Elm.Expression -> Elm.Expression - , nonEmptyToList : Elm.Expression -> Elm.Expression - , toNonEmpty : Elm.Expression -> Elm.Expression - } -call_ = - { firstMatch = - \firstMatchArg_ firstMatchArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "firstMatch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - ) - , Type.string - ] - (Type.maybe (Type.var "route")) - ) - } - ) - [ firstMatchArg_, firstMatchArg_0 ] - , fromOptionalSplat = - \fromOptionalSplatArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "fromOptionalSplat" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ fromOptionalSplatArg_ ] - , maybeToList = - \maybeToListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "maybeToList" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ maybeToListArg_ ] - , nonEmptyToList = - \nonEmptyToListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "nonEmptyToList" - , annotation = - Just - (Type.function - [ Type.tuple - Type.string - (Type.list Type.string) - ] - (Type.list Type.string) - ) - } - ) - [ nonEmptyToListArg_ ] - , toNonEmpty = - \toNonEmptyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "toNonEmpty" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.tuple - Type.string - (Type.list Type.string) - ) - ) - } - ) - [ toNonEmptyArg_ ] - } - - -values_ : - { firstMatch : Elm.Expression - , fromOptionalSplat : Elm.Expression - , maybeToList : Elm.Expression - , nonEmptyToList : Elm.Expression - , toNonEmpty : Elm.Expression - } -values_ = - { firstMatch = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "firstMatch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - ) - , Type.string - ] - (Type.maybe (Type.var "route")) - ) - } - , fromOptionalSplat = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "fromOptionalSplat" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - , maybeToList = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "maybeToList" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - , nonEmptyToList = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "nonEmptyToList" - , annotation = - Just - (Type.function - [ Type.tuple Type.string (Type.list Type.string) ] - (Type.list Type.string) - ) - } - , toNonEmpty = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "toNonEmpty" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.tuple Type.string (Type.list Type.string)) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Manifest.elm b/codegen/Gen/Pages/Manifest.elm deleted file mode 100644 index a893938a..00000000 --- a/codegen/Gen/Pages/Manifest.elm +++ /dev/null @@ -1,1391 +0,0 @@ -module Gen.Pages.Manifest exposing - ( moduleName_, init, withBackgroundColor, withCategories, withDisplayMode, withIarcRatingId - , withLang, withOrientation, withShortName, withThemeColor, withField, generator, toJson - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Manifest - -@docs moduleName_, init, withBackgroundColor, withCategories, withDisplayMode, withIarcRatingId -@docs withLang, withOrientation, withShortName, withThemeColor, withField, generator -@docs toJson, annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Manifest" ] - - -{-| Setup a minimal Manifest.Config. You can then use the `with...` builder functions to set additional options. - -init: - { description : String - , name : String - , startUrl : UrlPath.UrlPath - , icons : List Pages.Manifest.Icon - } - -> Pages.Manifest.Config --} -init : - { description : String - , name : String - , startUrl : Elm.Expression - , icons : List Elm.Expression - } - -> Elm.Expression -init initArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.record - [ ( "description", Type.string ) - , ( "name", Type.string ) - , ( "startUrl" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - ] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "description" (Elm.string initArg_.description) - , Tuple.pair "name" (Elm.string initArg_.name) - , Tuple.pair "startUrl" initArg_.startUrl - , Tuple.pair "icons" (Elm.list initArg_.icons) - ] - ] - - -{-| Set . - -withBackgroundColor: Color.Color -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withBackgroundColor : Elm.Expression -> Elm.Expression -> Elm.Expression -withBackgroundColor withBackgroundColorArg_ withBackgroundColorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withBackgroundColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withBackgroundColorArg_, withBackgroundColorArg_0 ] - - -{-| Set . - -withCategories: - List Pages.Manifest.Category.Category - -> Pages.Manifest.Config - -> Pages.Manifest.Config --} -withCategories : List Elm.Expression -> Elm.Expression -> Elm.Expression -withCategories withCategoriesArg_ withCategoriesArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withCategories" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.list withCategoriesArg_, withCategoriesArg_0 ] - - -{-| Set . - -withDisplayMode: Pages.Manifest.DisplayMode -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withDisplayMode : Elm.Expression -> Elm.Expression -> Elm.Expression -withDisplayMode withDisplayModeArg_ withDisplayModeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withDisplayMode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withDisplayModeArg_, withDisplayModeArg_0 ] - - -{-| Set . - -withIarcRatingId: String -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withIarcRatingId : String -> Elm.Expression -> Elm.Expression -withIarcRatingId withIarcRatingIdArg_ withIarcRatingIdArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withIarcRatingId" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.string withIarcRatingIdArg_, withIarcRatingIdArg_0 ] - - -{-| Set . - -withLang: LanguageTag.LanguageTag -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withLang : Elm.Expression -> Elm.Expression -> Elm.Expression -withLang withLangArg_ withLangArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withLang" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withLangArg_, withLangArg_0 ] - - -{-| Set . - -withOrientation: Pages.Manifest.Orientation -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withOrientation : Elm.Expression -> Elm.Expression -> Elm.Expression -withOrientation withOrientationArg_ withOrientationArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withOrientation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withOrientationArg_, withOrientationArg_0 ] - - -{-| Set . - -withShortName: String -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withShortName : String -> Elm.Expression -> Elm.Expression -withShortName withShortNameArg_ withShortNameArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withShortName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.string withShortNameArg_, withShortNameArg_0 ] - - -{-| Set . - -withThemeColor: Color.Color -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withThemeColor : Elm.Expression -> Elm.Expression -> Elm.Expression -withThemeColor withThemeColorArg_ withThemeColorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withThemeColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withThemeColorArg_, withThemeColorArg_0 ] - - -{-| Escape hatch for specifying fields that aren't exposed through this module otherwise. The possible supported properties -in a manifest file can change over time, so see [MDN manifest.json docs](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json) -for a full listing of the current supported properties. - -withField: String -> Json.Encode.Value -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withField : String -> Elm.Expression -> Elm.Expression -> Elm.Expression -withField withFieldArg_ withFieldArg_0 withFieldArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.string withFieldArg_, withFieldArg_0, withFieldArg_1 ] - - -{-| A generator for `Api.elm` to include a manifest.json. The String argument is the canonical URL of the site. - - module Api exposing (routes) - - import ApiRoute - import Pages.Manifest - - routes : - BackendTask FatalError (List Route) - -> (Maybe { indent : Int, newLines : Bool } -> Html Never -> String) - -> List (ApiRoute.ApiRoute ApiRoute.Response) - routes getStaticRoutes htmlToString = - [ Pages.Manifest.generator - Site.canonicalUrl - Manifest.config - ] - -generator: - String - -> BackendTask.BackendTask FatalError.FatalError Pages.Manifest.Config - -> ApiRoute.ApiRoute ApiRoute.Response --} -generator : String -> Elm.Expression -> Elm.Expression -generator generatorArg_ generatorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "generator" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - ) - [ Elm.string generatorArg_, generatorArg_0 ] - - -{-| Feel free to use this, but in 99% of cases you won't need it. The generated -code will run this for you to generate your `manifest.json` file automatically! - -toJson: String -> Pages.Manifest.Config -> Json.Encode.Value --} -toJson : String -> Elm.Expression -> Elm.Expression -toJson toJsonArg_ toJsonArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ Elm.string toJsonArg_, toJsonArg_0 ] - - -annotation_ : - { config : Type.Annotation - , icon : Type.Annotation - , displayMode : Type.Annotation - , orientation : Type.Annotation - , iconPurpose : Type.Annotation - } -annotation_ = - { config = - Type.alias - moduleName_ - "Config" - [] - (Type.record - [ ( "backgroundColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "categories" - , Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - , ( "displayMode" - , Type.namedWith [ "Pages", "Manifest" ] "DisplayMode" [] - ) - , ( "orientation" - , Type.namedWith [ "Pages", "Manifest" ] "Orientation" [] - ) - , ( "description", Type.string ) - , ( "iarcRatingId", Type.maybe Type.string ) - , ( "name", Type.string ) - , ( "themeColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "startUrl", Type.namedWith [ "UrlPath" ] "UrlPath" [] ) - , ( "shortName", Type.maybe Type.string ) - , ( "icons" - , Type.list - (Type.namedWith [ "Pages", "Manifest" ] "Icon" []) - ) - , ( "lang", Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ) - , ( "otherFields" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - ) - ] - ) - , icon = - Type.alias - moduleName_ - "Icon" - [] - (Type.record - [ ( "src", Type.namedWith [ "Pages", "Url" ] "Url" [] ) - , ( "sizes", Type.list (Type.tuple Type.int Type.int) ) - , ( "mimeType" - , Type.maybe (Type.namedWith [ "MimeType" ] "MimeImage" []) - ) - , ( "purposes" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "IconPurpose" - [] - ) - ) - ] - ) - , displayMode = Type.namedWith [ "Pages", "Manifest" ] "DisplayMode" [] - , orientation = Type.namedWith [ "Pages", "Manifest" ] "Orientation" [] - , iconPurpose = Type.namedWith [ "Pages", "Manifest" ] "IconPurpose" [] - } - - -make_ : - { config : - { backgroundColor : Elm.Expression - , categories : Elm.Expression - , displayMode : Elm.Expression - , orientation : Elm.Expression - , description : Elm.Expression - , iarcRatingId : Elm.Expression - , name : Elm.Expression - , themeColor : Elm.Expression - , startUrl : Elm.Expression - , shortName : Elm.Expression - , icons : Elm.Expression - , lang : Elm.Expression - , otherFields : Elm.Expression - } - -> Elm.Expression - , icon : - { src : Elm.Expression - , sizes : Elm.Expression - , mimeType : Elm.Expression - , purposes : Elm.Expression - } - -> Elm.Expression - , fullscreen : Elm.Expression - , standalone : Elm.Expression - , minimalUi : Elm.Expression - , browser : Elm.Expression - , any : Elm.Expression - , natural : Elm.Expression - , landscape : Elm.Expression - , landscapePrimary : Elm.Expression - , landscapeSecondary : Elm.Expression - , portrait : Elm.Expression - , portraitPrimary : Elm.Expression - , portraitSecondary : Elm.Expression - , iconPurposeMonochrome : Elm.Expression - , iconPurposeMaskable : Elm.Expression - , iconPurposeAny : Elm.Expression - } -make_ = - { config = - \config_args -> - Elm.withType - (Type.alias - [ "Pages", "Manifest" ] - "Config" - [] - (Type.record - [ ( "backgroundColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "categories" - , Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - , ( "displayMode" - , Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - ) - , ( "orientation" - , Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - ) - , ( "description", Type.string ) - , ( "iarcRatingId", Type.maybe Type.string ) - , ( "name", Type.string ) - , ( "themeColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "startUrl" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "shortName", Type.maybe Type.string ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - , ( "lang" - , Type.namedWith [ "LanguageTag" ] "LanguageTag" [] - ) - , ( "otherFields" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "backgroundColor" config_args.backgroundColor - , Tuple.pair "categories" config_args.categories - , Tuple.pair "displayMode" config_args.displayMode - , Tuple.pair "orientation" config_args.orientation - , Tuple.pair "description" config_args.description - , Tuple.pair "iarcRatingId" config_args.iarcRatingId - , Tuple.pair "name" config_args.name - , Tuple.pair "themeColor" config_args.themeColor - , Tuple.pair "startUrl" config_args.startUrl - , Tuple.pair "shortName" config_args.shortName - , Tuple.pair "icons" config_args.icons - , Tuple.pair "lang" config_args.lang - , Tuple.pair "otherFields" config_args.otherFields - ] - ) - , icon = - \icon_args -> - Elm.withType - (Type.alias - [ "Pages", "Manifest" ] - "Icon" - [] - (Type.record - [ ( "src" - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ) - , ( "sizes" - , Type.list (Type.tuple Type.int Type.int) - ) - , ( "mimeType" - , Type.maybe - (Type.namedWith [ "MimeType" ] "MimeImage" []) - ) - , ( "purposes" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "IconPurpose" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "src" icon_args.src - , Tuple.pair "sizes" icon_args.sizes - , Tuple.pair "mimeType" icon_args.mimeType - , Tuple.pair "purposes" icon_args.purposes - ] - ) - , fullscreen = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Fullscreen" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , standalone = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Standalone" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , minimalUi = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "MinimalUi" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , browser = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Browser" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , any = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Any" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , natural = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Natural" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , landscape = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Landscape" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , landscapePrimary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "LandscapePrimary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , landscapeSecondary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "LandscapeSecondary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , portrait = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Portrait" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , portraitPrimary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "PortraitPrimary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , portraitSecondary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "PortraitSecondary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , iconPurposeMonochrome = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "IconPurposeMonochrome" - , annotation = Just (Type.namedWith [] "IconPurpose" []) - } - , iconPurposeMaskable = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "IconPurposeMaskable" - , annotation = Just (Type.namedWith [] "IconPurpose" []) - } - , iconPurposeAny = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "IconPurposeAny" - , annotation = Just (Type.namedWith [] "IconPurpose" []) - } - } - - -caseOf_ : - { displayMode : - Elm.Expression - -> { fullscreen : Elm.Expression - , standalone : Elm.Expression - , minimalUi : Elm.Expression - , browser : Elm.Expression - } - -> Elm.Expression - , orientation : - Elm.Expression - -> { any : Elm.Expression - , natural : Elm.Expression - , landscape : Elm.Expression - , landscapePrimary : Elm.Expression - , landscapeSecondary : Elm.Expression - , portrait : Elm.Expression - , portraitPrimary : Elm.Expression - , portraitSecondary : Elm.Expression - } - -> Elm.Expression - , iconPurpose : - Elm.Expression - -> { iconPurposeMonochrome : Elm.Expression - , iconPurposeMaskable : Elm.Expression - , iconPurposeAny : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { displayMode = - \displayModeExpression displayModeTags -> - Elm.Case.custom - displayModeExpression - (Type.namedWith [ "Pages", "Manifest" ] "DisplayMode" []) - [ Elm.Case.branch - (Elm.Arg.customType "Fullscreen" displayModeTags.fullscreen) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Standalone" displayModeTags.standalone) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "MinimalUi" displayModeTags.minimalUi) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Browser" displayModeTags.browser) - Basics.identity - ] - , orientation = - \orientationExpression orientationTags -> - Elm.Case.custom - orientationExpression - (Type.namedWith [ "Pages", "Manifest" ] "Orientation" []) - [ Elm.Case.branch - (Elm.Arg.customType "Any" orientationTags.any) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Natural" orientationTags.natural) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Landscape" orientationTags.landscape) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "LandscapePrimary" - orientationTags.landscapePrimary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "LandscapeSecondary" - orientationTags.landscapeSecondary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Portrait" orientationTags.portrait) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PortraitPrimary" - orientationTags.portraitPrimary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PortraitSecondary" - orientationTags.portraitSecondary - ) - Basics.identity - ] - , iconPurpose = - \iconPurposeExpression iconPurposeTags -> - Elm.Case.custom - iconPurposeExpression - (Type.namedWith [ "Pages", "Manifest" ] "IconPurpose" []) - [ Elm.Case.branch - (Elm.Arg.customType - "IconPurposeMonochrome" - iconPurposeTags.iconPurposeMonochrome - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "IconPurposeMaskable" - iconPurposeTags.iconPurposeMaskable - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "IconPurposeAny" - iconPurposeTags.iconPurposeAny - ) - Basics.identity - ] - } - - -call_ : - { init : Elm.Expression -> Elm.Expression - , withBackgroundColor : Elm.Expression -> Elm.Expression -> Elm.Expression - , withCategories : Elm.Expression -> Elm.Expression -> Elm.Expression - , withDisplayMode : Elm.Expression -> Elm.Expression -> Elm.Expression - , withIarcRatingId : Elm.Expression -> Elm.Expression -> Elm.Expression - , withLang : Elm.Expression -> Elm.Expression -> Elm.Expression - , withOrientation : Elm.Expression -> Elm.Expression -> Elm.Expression - , withShortName : Elm.Expression -> Elm.Expression -> Elm.Expression - , withThemeColor : Elm.Expression -> Elm.Expression -> Elm.Expression - , withField : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , generator : Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { init = - \initArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.record - [ ( "description", Type.string ) - , ( "name", Type.string ) - , ( "startUrl" - , Type.namedWith - [ "UrlPath" ] - "UrlPath" - [] - ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - ] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ initArg_ ] - , withBackgroundColor = - \withBackgroundColorArg_ withBackgroundColorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withBackgroundColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withBackgroundColorArg_, withBackgroundColorArg_0 ] - , withCategories = - \withCategoriesArg_ withCategoriesArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withCategories" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withCategoriesArg_, withCategoriesArg_0 ] - , withDisplayMode = - \withDisplayModeArg_ withDisplayModeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withDisplayMode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withDisplayModeArg_, withDisplayModeArg_0 ] - , withIarcRatingId = - \withIarcRatingIdArg_ withIarcRatingIdArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withIarcRatingId" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withIarcRatingIdArg_, withIarcRatingIdArg_0 ] - , withLang = - \withLangArg_ withLangArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withLang" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "LanguageTag" ] - "LanguageTag" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withLangArg_, withLangArg_0 ] - , withOrientation = - \withOrientationArg_ withOrientationArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withOrientation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withOrientationArg_, withOrientationArg_0 ] - , withShortName = - \withShortNameArg_ withShortNameArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withShortName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withShortNameArg_, withShortNameArg_0 ] - , withThemeColor = - \withThemeColorArg_ withThemeColorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withThemeColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withThemeColorArg_, withThemeColorArg_0 ] - , withField = - \withFieldArg_ withFieldArg_0 withFieldArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withFieldArg_, withFieldArg_0, withFieldArg_1 ] - , generator = - \generatorArg_ generatorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "generator" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith - [ "ApiRoute" ] - "Response" - [] - ] - ) - ) - } - ) - [ generatorArg_, generatorArg_0 ] - , toJson = - \toJsonArg_ toJsonArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_, toJsonArg_0 ] - } - - -values_ : - { init : Elm.Expression - , withBackgroundColor : Elm.Expression - , withCategories : Elm.Expression - , withDisplayMode : Elm.Expression - , withIarcRatingId : Elm.Expression - , withLang : Elm.Expression - , withOrientation : Elm.Expression - , withShortName : Elm.Expression - , withThemeColor : Elm.Expression - , withField : Elm.Expression - , generator : Elm.Expression - , toJson : Elm.Expression - } -values_ = - { init = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.record - [ ( "description", Type.string ) - , ( "name", Type.string ) - , ( "startUrl" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - ] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withBackgroundColor = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withBackgroundColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withCategories = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withCategories" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withDisplayMode = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withDisplayMode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withIarcRatingId = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withIarcRatingId" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withLang = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withLang" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withOrientation = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withOrientation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withShortName = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withShortName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withThemeColor = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withThemeColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withField = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , generator = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "generator" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - , toJson = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Manifest/Category.elm b/codegen/Gen/Pages/Manifest/Category.elm deleted file mode 100644 index d67f57cd..00000000 --- a/codegen/Gen/Pages/Manifest/Category.elm +++ /dev/null @@ -1,1068 +0,0 @@ -module Gen.Pages.Manifest.Category exposing - ( moduleName_, toString, books, business, education, entertainment - , finance, fitness, food, games, government, health, kids - , lifestyle, magazines, medical, music, navigation, news, personalization - , photo, politics, productivity, security, shopping, social, sports - , travel, utilities, weather, custom, annotation_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Manifest.Category - -@docs moduleName_, toString, books, business, education, entertainment -@docs finance, fitness, food, games, government, health -@docs kids, lifestyle, magazines, medical, music, navigation -@docs news, personalization, photo, politics, productivity, security -@docs shopping, social, sports, travel, utilities, weather -@docs custom, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Manifest", "Category" ] - - -{-| Turn a category into its official String representation, as seen -here: . - -toString: Pages.Manifest.Category.Category -> String --} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -{-| Creates the described category. - -books: Pages.Manifest.Category.Category --} -books : Elm.Expression -books = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "books" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -business: Pages.Manifest.Category.Category --} -business : Elm.Expression -business = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "business" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -education: Pages.Manifest.Category.Category --} -education : Elm.Expression -education = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "education" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -entertainment: Pages.Manifest.Category.Category --} -entertainment : Elm.Expression -entertainment = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "entertainment" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -finance: Pages.Manifest.Category.Category --} -finance : Elm.Expression -finance = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "finance" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -fitness: Pages.Manifest.Category.Category --} -fitness : Elm.Expression -fitness = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "fitness" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -food: Pages.Manifest.Category.Category --} -food : Elm.Expression -food = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "food" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -games: Pages.Manifest.Category.Category --} -games : Elm.Expression -games = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "games" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -government: Pages.Manifest.Category.Category --} -government : Elm.Expression -government = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "government" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -health: Pages.Manifest.Category.Category --} -health : Elm.Expression -health = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "health" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -kids: Pages.Manifest.Category.Category --} -kids : Elm.Expression -kids = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "kids" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -lifestyle: Pages.Manifest.Category.Category --} -lifestyle : Elm.Expression -lifestyle = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "lifestyle" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -magazines: Pages.Manifest.Category.Category --} -magazines : Elm.Expression -magazines = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "magazines" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -medical: Pages.Manifest.Category.Category --} -medical : Elm.Expression -medical = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "medical" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -music: Pages.Manifest.Category.Category --} -music : Elm.Expression -music = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "music" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -navigation: Pages.Manifest.Category.Category --} -navigation : Elm.Expression -navigation = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "navigation" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -news: Pages.Manifest.Category.Category --} -news : Elm.Expression -news = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "news" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -personalization: Pages.Manifest.Category.Category --} -personalization : Elm.Expression -personalization = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "personalization" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -photo: Pages.Manifest.Category.Category --} -photo : Elm.Expression -photo = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "photo" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -politics: Pages.Manifest.Category.Category --} -politics : Elm.Expression -politics = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "politics" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -productivity: Pages.Manifest.Category.Category --} -productivity : Elm.Expression -productivity = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "productivity" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -security: Pages.Manifest.Category.Category --} -security : Elm.Expression -security = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "security" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -shopping: Pages.Manifest.Category.Category --} -shopping : Elm.Expression -shopping = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "shopping" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -social: Pages.Manifest.Category.Category --} -social : Elm.Expression -social = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "social" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -sports: Pages.Manifest.Category.Category --} -sports : Elm.Expression -sports = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "sports" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -travel: Pages.Manifest.Category.Category --} -travel : Elm.Expression -travel = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "travel" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -utilities: Pages.Manifest.Category.Category --} -utilities : Elm.Expression -utilities = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "utilities" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -weather: Pages.Manifest.Category.Category --} -weather : Elm.Expression -weather = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "weather" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| It's best to use the pre-defined categories to ensure that clients (Android, iOS, -Chrome, Windows app store, etc.) are aware of it and can handle it appropriately. -But, if you're confident about using a custom one, you can do so with `Pages.Manifest.custom`. - -custom: String -> Pages.Manifest.Category.Category --} -custom : String -> Elm.Expression -custom customArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - } - ) - [ Elm.string customArg_ ] - - -annotation_ : { category : Type.Annotation } -annotation_ = - { category = - Type.namedWith [ "Pages", "Manifest", "Category" ] "Category" [] - } - - -call_ : - { toString : Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression - } -call_ = - { toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - , custom = - \customArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - } - ) - [ customArg_ ] - } - - -values_ : - { toString : Elm.Expression - , books : Elm.Expression - , business : Elm.Expression - , education : Elm.Expression - , entertainment : Elm.Expression - , finance : Elm.Expression - , fitness : Elm.Expression - , food : Elm.Expression - , games : Elm.Expression - , government : Elm.Expression - , health : Elm.Expression - , kids : Elm.Expression - , lifestyle : Elm.Expression - , magazines : Elm.Expression - , medical : Elm.Expression - , music : Elm.Expression - , navigation : Elm.Expression - , news : Elm.Expression - , personalization : Elm.Expression - , photo : Elm.Expression - , politics : Elm.Expression - , productivity : Elm.Expression - , security : Elm.Expression - , shopping : Elm.Expression - , social : Elm.Expression - , sports : Elm.Expression - , travel : Elm.Expression - , utilities : Elm.Expression - , weather : Elm.Expression - , custom : Elm.Expression - } -values_ = - { toString = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ] - Type.string - ) - } - , books = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "books" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , business = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "business" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , education = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "education" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , entertainment = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "entertainment" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , finance = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "finance" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , fitness = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "fitness" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , food = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "food" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , games = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "games" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , government = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "government" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , health = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "health" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , kids = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "kids" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , lifestyle = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "lifestyle" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , magazines = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "magazines" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , medical = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "medical" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , music = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "music" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , navigation = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "navigation" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , news = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "news" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , personalization = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "personalization" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , photo = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "photo" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , politics = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "politics" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , productivity = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "productivity" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , security = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "security" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , shopping = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "shopping" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , social = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "social" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , sports = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "sports" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , travel = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "travel" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , utilities = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "utilities" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , weather = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "weather" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , custom = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Navigation.elm b/codegen/Gen/Pages/Navigation.elm deleted file mode 100644 index 3828e233..00000000 --- a/codegen/Gen/Pages/Navigation.elm +++ /dev/null @@ -1,194 +0,0 @@ -module Gen.Pages.Navigation exposing ( moduleName_, annotation_, make_, caseOf_ ) - -{-| -# Generated bindings for Pages.Navigation - -@docs moduleName_, annotation_, make_, caseOf_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Navigation" ] - - -annotation_ : { navigation : Type.Annotation, loadingState : Type.Annotation } -annotation_ = - { navigation = Type.namedWith [ "Pages", "Navigation" ] "Navigation" [] - , loadingState = Type.namedWith [ "Pages", "Navigation" ] "LoadingState" [] - } - - -make_ : - { submitting : Elm.Expression -> Elm.Expression - , loadAfterSubmit : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , loading : Elm.Expression -> Elm.Expression -> Elm.Expression - , redirecting : Elm.Expression - , load : Elm.Expression - , actionRedirect : Elm.Expression - } -make_ = - { submitting = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Submitting" - , annotation = Just (Type.namedWith [] "Navigation" []) - } - ) - [ ar0 ] - , loadAfterSubmit = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "LoadAfterSubmit" - , annotation = Just (Type.namedWith [] "Navigation" []) - } - ) - [ ar0, ar1, ar2 ] - , loading = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Loading" - , annotation = Just (Type.namedWith [] "Navigation" []) - } - ) - [ ar0, ar1 ] - , redirecting = - Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Redirecting" - , annotation = Just (Type.namedWith [] "LoadingState" []) - } - , load = - Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Load" - , annotation = Just (Type.namedWith [] "LoadingState" []) - } - , actionRedirect = - Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "ActionRedirect" - , annotation = Just (Type.namedWith [] "LoadingState" []) - } - } - - -caseOf_ = - { navigation = - \navigationExpression navigationTags -> - Elm.Case.custom - navigationExpression - (Type.namedWith [ "Pages", "Navigation" ] "Navigation" []) - [ Elm.Case.branch - (Elm.Arg.customType - "Submitting" - navigationTags.submitting |> Elm.Arg.item - (Elm.Arg.varWith - "pagesFormDataFormData" - (Type.namedWith - [ "Pages" - , "FormData" - ] - "FormData" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "LoadAfterSubmit" - navigationTags.loadAfterSubmit |> Elm.Arg.item - (Elm.Arg.varWith - "pagesFormDataFormData" - (Type.namedWith - [ "Pages" - , "FormData" - ] - "FormData" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "urlPathUrlPath" - (Type.namedWith - [ "UrlPath" - ] - "UrlPath" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesNavigationLoadingState" - (Type.namedWith - [ "Pages" - , "Navigation" - ] - "LoadingState" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Loading" - navigationTags.loading |> Elm.Arg.item - (Elm.Arg.varWith - "urlPathUrlPath" - (Type.namedWith - [ "UrlPath" - ] - "UrlPath" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesNavigationLoadingState" - (Type.namedWith - [ "Pages" - , "Navigation" - ] - "LoadingState" - [] - ) - ) - ) - Basics.identity - ] - , loadingState = - \loadingStateExpression loadingStateTags -> - Elm.Case.custom - loadingStateExpression - (Type.namedWith [ "Pages", "Navigation" ] "LoadingState" []) - [ Elm.Case.branch - (Elm.Arg.customType - "Redirecting" - loadingStateTags.redirecting - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Load" loadingStateTags.load) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ActionRedirect" - loadingStateTags.actionRedirect - ) - Basics.identity - ] - } \ No newline at end of file diff --git a/codegen/Gen/Pages/PageUrl.elm b/codegen/Gen/Pages/PageUrl.elm deleted file mode 100644 index 56107042..00000000 --- a/codegen/Gen/Pages/PageUrl.elm +++ /dev/null @@ -1,212 +0,0 @@ -module Gen.Pages.PageUrl exposing - ( moduleName_, toUrl, parseQueryParams, annotation_, make_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.PageUrl - -@docs moduleName_, toUrl, parseQueryParams, annotation_, make_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "PageUrl" ] - - -{-| toUrl: Pages.PageUrl.PageUrl -> Url.Url -} -toUrl : Elm.Expression -> Elm.Expression -toUrl toUrlArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "toUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "PageUrl" ] "PageUrl" [] ] - (Type.namedWith [ "Url" ] "Url" []) - ) - } - ) - [ toUrlArg_ ] - - -{-| parseQueryParams: String -> Dict.Dict String (List String) -} -parseQueryParams : String -> Elm.Expression -parseQueryParams parseQueryParamsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "parseQueryParams" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ Elm.string parseQueryParamsArg_ ] - - -annotation_ : { pageUrl : Type.Annotation } -annotation_ = - { pageUrl = - Type.alias - moduleName_ - "PageUrl" - [] - (Type.record - [ ( "protocol", Type.namedWith [ "Url" ] "Protocol" [] ) - , ( "host", Type.string ) - , ( "port_", Type.maybe Type.int ) - , ( "path", Type.namedWith [ "UrlPath" ] "UrlPath" [] ) - , ( "query" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - , ( "fragment", Type.maybe Type.string ) - ] - ) - } - - -make_ : - { pageUrl : - { protocol : Elm.Expression - , host : Elm.Expression - , port_ : Elm.Expression - , path : Elm.Expression - , query : Elm.Expression - , fragment : Elm.Expression - } - -> Elm.Expression - } -make_ = - { pageUrl = - \pageUrl_args -> - Elm.withType - (Type.alias - [ "Pages", "PageUrl" ] - "PageUrl" - [] - (Type.record - [ ( "protocol" - , Type.namedWith [ "Url" ] "Protocol" [] - ) - , ( "host", Type.string ) - , ( "port_", Type.maybe Type.int ) - , ( "path" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "query" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - , ( "fragment", Type.maybe Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "protocol" pageUrl_args.protocol - , Tuple.pair "host" pageUrl_args.host - , Tuple.pair "port_" pageUrl_args.port_ - , Tuple.pair "path" pageUrl_args.path - , Tuple.pair "query" pageUrl_args.query - , Tuple.pair "fragment" pageUrl_args.fragment - ] - ) - } - - -call_ : - { toUrl : Elm.Expression -> Elm.Expression - , parseQueryParams : Elm.Expression -> Elm.Expression - } -call_ = - { toUrl = - \toUrlArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "toUrl" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "PageUrl" ] - "PageUrl" - [] - ] - (Type.namedWith [ "Url" ] "Url" []) - ) - } - ) - [ toUrlArg_ ] - , parseQueryParams = - \parseQueryParamsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "parseQueryParams" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ parseQueryParamsArg_ ] - } - - -values_ : { toUrl : Elm.Expression, parseQueryParams : Elm.Expression } -values_ = - { toUrl = - Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "toUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "PageUrl" ] "PageUrl" [] ] - (Type.namedWith [ "Url" ] "Url" []) - ) - } - , parseQueryParams = - Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "parseQueryParams" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Script.elm b/codegen/Gen/Pages/Script.elm deleted file mode 100644 index 598b6eff..00000000 --- a/codegen/Gen/Pages/Script.elm +++ /dev/null @@ -1,1063 +0,0 @@ -module Gen.Pages.Script exposing - ( moduleName_, withCliOptions, withoutCliOptions, writeFile, command, exec - , log, sleep, doThen, which, expectWhich, question, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Script - -@docs moduleName_, withCliOptions, withoutCliOptions, writeFile, command, exec -@docs log, sleep, doThen, which, expectWhich, question -@docs annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Script" ] - - -{-| Same as [`withoutCliOptions`](#withoutCliOptions), but allows you to define a CLI Options Parser so the user can -pass in additional options for the script. - -Uses . - -Read more at . - -withCliOptions: - Cli.Program.Config cliOptions - -> (cliOptions -> BackendTask.BackendTask FatalError.FatalError ()) - -> Pages.Script.Script --} -withCliOptions : - Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -withCliOptions withCliOptionsArg_ withCliOptionsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Program" ] - "Config" - [ Type.var "cliOptions" ] - , Type.function - [ Type.var "cliOptions" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - ) - [ withCliOptionsArg_ - , Elm.functionReduced "withCliOptionsUnpack" withCliOptionsArg_0 - ] - - -{-| Define a simple Script (no CLI Options). - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello!" - |> BackendTask.allowFatal - ) - -withoutCliOptions: BackendTask.BackendTask FatalError.FatalError () -> Pages.Script.Script --} -withoutCliOptions : Elm.Expression -> Elm.Expression -withoutCliOptions withoutCliOptionsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withoutCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - ) - [ withoutCliOptionsArg_ ] - - -{-| Write a file to the file system. - -File paths are relative to the root of your `elm-pages` project (next to the `elm.json` file and `src/` directory), or you can pass in absolute paths beginning with a `/`. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.writeFile - { path = "hello.json" - , body = """{ "message": "Hello, World!" }""" - } - |> BackendTask.allowFatal - ) - -writeFile: - { path : String, body : String } - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : Pages.Script.Error - } () --} -writeFile : { path : String, body : String } -> Elm.Expression -writeFile writeFileArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "writeFile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "Pages", "Script" ] - "Error" - [] - ) - ] - , Type.unit - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "path" (Elm.string writeFileArg_.path) - , Tuple.pair "body" (Elm.string writeFileArg_.body) - ] - ] - - -{-| Run a single command and return stderr and stdout combined as a single String. - -If you want to do more advanced things like piping together multiple commands in a pipeline, or piping in a file to a command, etc., see the [`Stream`](BackendTask-Stream) module. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Script.command "ls" [] - |> BackendTask.andThen - (\files -> - Script.log ("Files: " ++ files) - ) - ) - -command: String -> List String -> BackendTask.BackendTask FatalError.FatalError String --} -command : String -> List String -> Elm.Expression -command commandArg_ commandArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - ) - [ Elm.string commandArg_, Elm.list (List.map Elm.string commandArg_0) ] - - -{-| Like [`command`](#command), but prints stderr and stdout to the console as the command runs instead of capturing them. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Script.exec "ls" []) - -exec: String -> List String -> BackendTask.BackendTask FatalError.FatalError () --} -exec : String -> List String -> Elm.Expression -exec execArg_ execArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - ) - } - ) - [ Elm.string execArg_, Elm.list (List.map Elm.string execArg_0) ] - - -{-| Log to stdout. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello!" - |> BackendTask.allowFatal - ) - -log: String -> BackendTask.BackendTask error () --} -log : String -> Elm.Expression -log logArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ Elm.string logArg_ ] - - -{-| Sleep for a number of milliseconds. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello..." - |> Script.doThen - (Script.sleep 1000) - |> Script.doThen - (Script.log "World!") - ) - -sleep: Int -> BackendTask.BackendTask error () --} -sleep : Int -> Elm.Expression -sleep sleepArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ Elm.int sleepArg_ ] - - -{-| Run a command with no output, then run another command. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello!" - |> Script.doThen - (Script.log "World!") - ) - -doThen: - BackendTask.BackendTask error value - -> BackendTask.BackendTask error () - -> BackendTask.BackendTask error value --} -doThen : Elm.Expression -> Elm.Expression -> Elm.Expression -doThen doThenArg_ doThenArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "doThen" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ doThenArg_, doThenArg_0 ] - - -{-| Same as [`expectWhich`](#expectWhich), but returns `Nothing` if the command is not found instead of failing with a [`FatalError`](FatalError). - -which: String -> BackendTask.BackendTask error (Maybe String) --} -which : String -> Elm.Expression -which whichArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "which" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.maybe Type.string ] - ) - ) - } - ) - [ Elm.string whichArg_ ] - - -{-| Check if a command is available on the system. If it is, return the full path to the command, otherwise fail with a [`FatalError`](FatalError). - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run : Script - run = - Script.withoutCliOptions - (Script.expectWhich "elm-review" - |> BackendTask.andThen - (\path -> - Script.log ("The path to `elm-review` is: " ++ path) - ) - ) - -If you run it with a command that is not available, you will see an error like this: - - Script.expectWhich "hype-script" - -```shell --- COMMAND NOT FOUND --------------- -I expected to find `hype-script`, but it was not on your PATH. Make sure it is installed and included in your PATH. -``` - -expectWhich: String -> BackendTask.BackendTask FatalError.FatalError String --} -expectWhich : String -> Elm.Expression -expectWhich expectWhichArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "expectWhich" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - ) - [ Elm.string expectWhichArg_ ] - - -{-| module QuestionDemo exposing (run) - - import BackendTask - - run : Script - run = - Script.withoutCliOptions - (Script.question "What is your name? " - |> BackendTask.andThen - (\name -> - Script.log ("Hello, " ++ name ++ "!") - ) - ) - -question: String -> BackendTask.BackendTask error String --} -question : String -> Elm.Expression -question questionArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "question" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.string ] - ) - ) - } - ) - [ Elm.string questionArg_ ] - - -annotation_ : { script : Type.Annotation, error : Type.Annotation } -annotation_ = - { script = - Type.alias - moduleName_ - "Script" - [] - (Type.namedWith [ "Pages", "Internal", "Script" ] "Script" []) - , error = Type.namedWith [ "Pages", "Script" ] "Error" [] - } - - -make_ : { fileWriteError : Elm.Expression } -make_ = - { fileWriteError = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "FileWriteError" - , annotation = Just (Type.namedWith [] "Error" []) - } - } - - -caseOf_ : - { error : - Elm.Expression -> { fileWriteError : Elm.Expression } -> Elm.Expression - } -caseOf_ = - { error = - \errorExpression errorTags -> - Elm.Case.custom - errorExpression - (Type.namedWith [ "Pages", "Script" ] "Error" []) - [ Elm.Case.branch - (Elm.Arg.customType - "FileWriteError" - errorTags.fileWriteError - ) - Basics.identity - ] - } - - -call_ : - { withCliOptions : Elm.Expression -> Elm.Expression -> Elm.Expression - , withoutCliOptions : Elm.Expression -> Elm.Expression - , writeFile : Elm.Expression -> Elm.Expression - , command : Elm.Expression -> Elm.Expression -> Elm.Expression - , exec : Elm.Expression -> Elm.Expression -> Elm.Expression - , log : Elm.Expression -> Elm.Expression - , sleep : Elm.Expression -> Elm.Expression - , doThen : Elm.Expression -> Elm.Expression -> Elm.Expression - , which : Elm.Expression -> Elm.Expression - , expectWhich : Elm.Expression -> Elm.Expression - , question : Elm.Expression -> Elm.Expression - } -call_ = - { withCliOptions = - \withCliOptionsArg_ withCliOptionsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Program" ] - "Config" - [ Type.var "cliOptions" ] - , Type.function - [ Type.var "cliOptions" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ] - (Type.namedWith - [ "Pages", "Script" ] - "Script" - [] - ) - ) - } - ) - [ withCliOptionsArg_, withCliOptionsArg_0 ] - , withoutCliOptions = - \withoutCliOptionsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withoutCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ] - (Type.namedWith - [ "Pages", "Script" ] - "Script" - [] - ) - ) - } - ) - [ withoutCliOptionsArg_ ] - , writeFile = - \writeFileArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "writeFile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "Pages", "Script" ] - "Error" - [] - ) - ] - , Type.unit - ] - ) - ) - } - ) - [ writeFileArg_ ] - , command = - \commandArg_ commandArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - ) - ) - } - ) - [ commandArg_, commandArg_0 ] - , exec = - \execArg_ execArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ) - } - ) - [ execArg_, execArg_0 ] - , log = - \logArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ logArg_ ] - , sleep = - \sleepArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ sleepArg_ ] - , doThen = - \doThenArg_ doThenArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "doThen" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ doThenArg_, doThenArg_0 ] - , which = - \whichArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "which" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.maybe Type.string - ] - ) - ) - } - ) - [ whichArg_ ] - , expectWhich = - \expectWhichArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "expectWhich" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - ) - ) - } - ) - [ expectWhichArg_ ] - , question = - \questionArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "question" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.string ] - ) - ) - } - ) - [ questionArg_ ] - } - - -values_ : - { withCliOptions : Elm.Expression - , withoutCliOptions : Elm.Expression - , writeFile : Elm.Expression - , command : Elm.Expression - , exec : Elm.Expression - , log : Elm.Expression - , sleep : Elm.Expression - , doThen : Elm.Expression - , which : Elm.Expression - , expectWhich : Elm.Expression - , question : Elm.Expression - } -values_ = - { withCliOptions = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Program" ] - "Config" - [ Type.var "cliOptions" ] - , Type.function - [ Type.var "cliOptions" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - , withoutCliOptions = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withoutCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - , writeFile = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "writeFile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "Pages", "Script" ] - "Error" - [] - ) - ] - , Type.unit - ] - ) - ) - } - , command = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - , exec = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - ) - } - , log = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - , sleep = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - , doThen = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "doThen" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , which = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "which" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.maybe Type.string ] - ) - ) - } - , expectWhich = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "expectWhich" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - , question = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "question" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.string ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Script/Spinner.elm b/codegen/Gen/Pages/Script/Spinner.elm deleted file mode 100644 index 98877f11..00000000 --- a/codegen/Gen/Pages/Script/Spinner.elm +++ /dev/null @@ -1,1230 +0,0 @@ -module Gen.Pages.Script.Spinner exposing - ( moduleName_, steps, withStep, withStepWithOptions, runSteps, options - , withOnCompletion, runTask, runTaskWithOptions, showStep, runSpinnerWithTask, annotation_, make_ - , caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Script.Spinner - -@docs moduleName_, steps, withStep, withStepWithOptions, runSteps, options -@docs withOnCompletion, runTask, runTaskWithOptions, showStep, runSpinnerWithTask, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Script", "Spinner" ] - - -{-| Initialize an empty series of `Steps`. - -steps: Pages.Script.Spinner.Steps FatalError.FatalError () --} -steps : Elm.Expression -steps = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "steps" - , annotation = - Just - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - } - - -{-| Add a `Step`. See [`withStepWithOptions`](#withStepWithOptions) to configure the step's spinner. - -withStep: - String - -> (oldValue -> BackendTask.BackendTask FatalError.FatalError newValue) - -> Pages.Script.Spinner.Steps FatalError.FatalError oldValue - -> Pages.Script.Spinner.Steps FatalError.FatalError newValue --} -withStep : - String - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withStep withStepArg_ withStepArg_0 withStepArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStep" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ Elm.string withStepArg_ - , Elm.functionReduced "withStepUnpack" withStepArg_0 - , withStepArg_1 - ] - - -{-| Add a step with custom [`Options`](#Options). - -withStepWithOptions: - Pages.Script.Spinner.Options FatalError.FatalError newValue - -> (oldValue -> BackendTask.BackendTask FatalError.FatalError newValue) - -> Pages.Script.Spinner.Steps FatalError.FatalError oldValue - -> Pages.Script.Spinner.Steps FatalError.FatalError newValue --} -withStepWithOptions : - Elm.Expression - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withStepWithOptions withStepWithOptionsArg_ withStepWithOptionsArg_0 withStepWithOptionsArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStepWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ withStepWithOptionsArg_ - , Elm.functionReduced - "withStepWithOptionsUnpack" - withStepWithOptionsArg_0 - , withStepWithOptionsArg_1 - ] - - -{-| Perform the `Steps` in sequence. - -runSteps: - Pages.Script.Spinner.Steps FatalError.FatalError value - -> BackendTask.BackendTask FatalError.FatalError value --} -runSteps : Elm.Expression -> Elm.Expression -runSteps runStepsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSteps" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ) - ) - } - ) - [ runStepsArg_ ] - - -{-| The default options for a spinner. The spinner `text` is a required argument and will be displayed as the step name. - - import Pages.Script.Spinner as Spinner - - example = - Spinner.options "Compile Main.elm" - -options: String -> Pages.Script.Spinner.Options error value --} -options : String -> Elm.Expression -options optionsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "options" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ Elm.string optionsArg_ ] - - -{-| Set the completion icon and text based on the result of the task. - - import Pages.Script.Spinner as Spinner - - example = - Spinner.options "Fetching data" - |> Spinner.withOnCompletion - (\result -> - case result of - Ok _ -> - ( Spinner.Succeed, "Fetched data!" ) - - Err _ -> - ( Spinner.Fail - , Just "Could not fetch data." - ) - ) - -withOnCompletion: - (Result.Result error value - -> ( Pages.Script.Spinner.CompletionIcon, Maybe String )) - -> Pages.Script.Spinner.Options error value - -> Pages.Script.Spinner.Options error value --} -withOnCompletion : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -withOnCompletion withOnCompletionArg_ withOnCompletionArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withOnCompletion" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.var "error", Type.var "value" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - (Type.maybe Type.string) - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ Elm.functionReduced "withOnCompletionUnpack" withOnCompletionArg_ - , withOnCompletionArg_0 - ] - - -{-| Run a `BackendTask` with a spinner. The spinner will show a success icon if the task succeeds, and a failure icon if the task fails. - -It's often easier to use [`steps`](#steps) when possible. - - module SequentialSteps exposing (run) - - import Pages.Script as Script exposing (Script, doThen, sleep) - import Pages.Script.Spinner as Spinner - - - run : Script - run = - Script.withoutCliOptions - (sleep 3000 - |> Spinner.runTask "Step 1..." - |> doThen - (sleep 3000 - |> Spinner.runTask "Step 2..." - |> doThen - (sleep 3000 - |> Spinner.runTask "Step 3..." - ) - ) - ) - -runTask: - String - -> BackendTask.BackendTask error value - -> BackendTask.BackendTask error value --} -runTask : String -> Elm.Expression -> Elm.Expression -runTask runTaskArg_ runTaskArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTask" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ Elm.string runTaskArg_, runTaskArg_0 ] - - -{-| runTaskWithOptions: - Pages.Script.Spinner.Options error value - -> BackendTask.BackendTask error value - -> BackendTask.BackendTask error value --} -runTaskWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression -runTaskWithOptions runTaskWithOptionsArg_ runTaskWithOptionsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runTaskWithOptionsArg_, runTaskWithOptionsArg_0 ] - - -{-| `showStep` gives you a `Spinner` reference which you can use to start the spinner later with `runSpinnerWithTask`. - -Most use cases can be achieved more easily using more high-level helpers, like [`runTask`](#runTask) or [`steps`](#steps). -`showStep` can be useful if you have more dynamic steps that you want to reveal over time. - - module ShowStepDemo exposing (run) - - import BackendTask exposing (BackendTask) - import Pages.Script as Script exposing (Script, doThen, sleep) - import Pages.Script.Spinner as Spinner - - run : Script - run = - Script.withoutCliOptions - (BackendTask.succeed - (\spinner1 spinner2 spinner3 -> - sleep 3000 - |> Spinner.runSpinnerWithTask spinner1 - |> doThen - (sleep 3000 - |> Spinner.runSpinnerWithTask spinner2 - |> doThen - (sleep 3000 - |> Spinner.runSpinnerWithTask spinner3 - ) - ) - ) - |> BackendTask.andMap - (Spinner.options "Step 1" |> Spinner.showStep) - |> BackendTask.andMap - (Spinner.options "Step 2" |> Spinner.showStep) - |> BackendTask.andMap - (Spinner.options "Step 3" |> Spinner.showStep) - |> BackendTask.andThen identity - ) - -showStep: - Pages.Script.Spinner.Options error value - -> BackendTask.BackendTask error (Pages.Script.Spinner.Spinner error value) --} -showStep : Elm.Expression -> Elm.Expression -showStep showStepArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "showStep" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - ] - ) - ) - } - ) - [ showStepArg_ ] - - -{-| After calling `showStep` to get a reference to a `Spinner`, use `runSpinnerWithTask` to run a `BackendTask` and show a failure or success -completion status once it is done. - -runSpinnerWithTask: - Pages.Script.Spinner.Spinner error value - -> BackendTask.BackendTask error value - -> BackendTask.BackendTask error value --} -runSpinnerWithTask : Elm.Expression -> Elm.Expression -> Elm.Expression -runSpinnerWithTask runSpinnerWithTaskArg_ runSpinnerWithTaskArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSpinnerWithTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runSpinnerWithTaskArg_, runSpinnerWithTaskArg_0 ] - - -annotation_ : - { steps : Type.Annotation -> Type.Annotation -> Type.Annotation - , options : Type.Annotation -> Type.Annotation -> Type.Annotation - , completionIcon : Type.Annotation - , spinner : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { steps = - \stepsArg0 stepsArg1 -> - Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ stepsArg0, stepsArg1 ] - , options = - \optionsArg0 optionsArg1 -> - Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ optionsArg0, optionsArg1 ] - , completionIcon = - Type.namedWith [ "Pages", "Script", "Spinner" ] "CompletionIcon" [] - , spinner = - \spinnerArg0 spinnerArg1 -> - Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ spinnerArg0, spinnerArg1 ] - } - - -make_ : - { steps : Elm.Expression -> Elm.Expression - , succeed : Elm.Expression - , fail : Elm.Expression - , warn : Elm.Expression - , info : Elm.Expression - } -make_ = - { steps = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Steps" - , annotation = - Just - (Type.namedWith - [] - "Steps" - [ Type.var "error", Type.var "value" ] - ) - } - ) - [ ar0 ] - , succeed = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Succeed" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - , fail = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Fail" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - , warn = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Warn" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - , info = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Info" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - } - - -caseOf_ : - { steps : - Elm.Expression - -> { steps : Elm.Expression -> Elm.Expression } - -> Elm.Expression - , completionIcon : - Elm.Expression - -> { succeed : Elm.Expression - , fail : Elm.Expression - , warn : Elm.Expression - , info : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { steps = - \stepsExpression stepsTags -> - Elm.Case.custom - stepsExpression - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.var "error", Type.var "value" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Steps" stepsTags.steps |> Elm.Arg.item - (Elm.Arg.varWith - "backendTaskBackendTask" - (Type.namedWith - [ "BackendTask" - ] - "BackendTask" - [ Type.var - "error" - , Type.var - "value" - ] - ) - ) - ) - Basics.identity - ] - , completionIcon = - \completionIconExpression completionIconTags -> - Elm.Case.custom - completionIconExpression - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Succeed" completionIconTags.succeed) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Fail" completionIconTags.fail) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Warn" completionIconTags.warn) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Info" completionIconTags.info) - Basics.identity - ] - } - - -call_ : - { withStep : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withStepWithOptions : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , runSteps : Elm.Expression -> Elm.Expression - , options : Elm.Expression -> Elm.Expression - , withOnCompletion : Elm.Expression -> Elm.Expression -> Elm.Expression - , runTask : Elm.Expression -> Elm.Expression -> Elm.Expression - , runTaskWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression - , showStep : Elm.Expression -> Elm.Expression - , runSpinnerWithTask : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { withStep = - \withStepArg_ withStepArg_0 withStepArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStep" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ withStepArg_, withStepArg_0, withStepArg_1 ] - , withStepWithOptions = - \withStepWithOptionsArg_ withStepWithOptionsArg_0 withStepWithOptionsArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStepWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ withStepWithOptionsArg_ - , withStepWithOptionsArg_0 - , withStepWithOptionsArg_1 - ] - , runSteps = - \runStepsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSteps" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "value" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "value" - ] - ) - ) - } - ) - [ runStepsArg_ ] - , options = - \optionsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "options" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ optionsArg_ ] - , withOnCompletion = - \withOnCompletionArg_ withOnCompletionArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withOnCompletion" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.var "error" - , Type.var "value" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - (Type.maybe Type.string) - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ withOnCompletionArg_, withOnCompletionArg_0 ] - , runTask = - \runTaskArg_ runTaskArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTask" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runTaskArg_, runTaskArg_0 ] - , runTaskWithOptions = - \runTaskWithOptionsArg_ runTaskWithOptionsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runTaskWithOptionsArg_, runTaskWithOptionsArg_0 ] - , showStep = - \showStepArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "showStep" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error" - , Type.var "value" - ] - ] - ) - ) - } - ) - [ showStepArg_ ] - , runSpinnerWithTask = - \runSpinnerWithTaskArg_ runSpinnerWithTaskArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSpinnerWithTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runSpinnerWithTaskArg_, runSpinnerWithTaskArg_0 ] - } - - -values_ : - { steps : Elm.Expression - , withStep : Elm.Expression - , withStepWithOptions : Elm.Expression - , runSteps : Elm.Expression - , options : Elm.Expression - , withOnCompletion : Elm.Expression - , runTask : Elm.Expression - , runTaskWithOptions : Elm.Expression - , showStep : Elm.Expression - , runSpinnerWithTask : Elm.Expression - } -values_ = - { steps = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "steps" - , annotation = - Just - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - } - , withStep = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStep" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - , withStepWithOptions = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStepWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - , runSteps = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSteps" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ) - ) - } - , options = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "options" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , withOnCompletion = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withOnCompletion" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.var "error", Type.var "value" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - (Type.maybe Type.string) - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , runTask = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTask" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , runTaskWithOptions = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , showStep = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "showStep" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - ] - ) - ) - } - , runSpinnerWithTask = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSpinnerWithTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Pages/Url.elm b/codegen/Gen/Pages/Url.elm deleted file mode 100644 index afb27878..00000000 --- a/codegen/Gen/Pages/Url.elm +++ /dev/null @@ -1,228 +0,0 @@ -module Gen.Pages.Url exposing - ( moduleName_, external, fromPath, toAbsoluteUrl, toString, annotation_ - , call_, values_ - ) - -{-| -# Generated bindings for Pages.Url - -@docs moduleName_, external, fromPath, toAbsoluteUrl, toString, annotation_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Url" ] - - -{-| external: String -> Pages.Url.Url -} -external : String -> Elm.Expression -external externalArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "external" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ Elm.string externalArg_ ] - - -{-| fromPath: UrlPath.UrlPath -> Pages.Url.Url -} -fromPath : Elm.Expression -> Elm.Expression -fromPath fromPathArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "fromPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ fromPathArg_ ] - - -{-| toAbsoluteUrl: String -> Pages.Url.Url -> String -} -toAbsoluteUrl : String -> Elm.Expression -> Elm.Expression -toAbsoluteUrl toAbsoluteUrlArg_ toAbsoluteUrlArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toAbsoluteUrl" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - Type.string - ) - } - ) - [ Elm.string toAbsoluteUrlArg_, toAbsoluteUrlArg_0 ] - - -{-| toString: Pages.Url.Url -> String -} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -annotation_ : { url : Type.Annotation } -annotation_ = - { url = Type.namedWith [ "Pages", "Url" ] "Url" [] } - - -call_ : - { external : Elm.Expression -> Elm.Expression - , fromPath : Elm.Expression -> Elm.Expression - , toAbsoluteUrl : Elm.Expression -> Elm.Expression -> Elm.Expression - , toString : Elm.Expression -> Elm.Expression - } -call_ = - { external = - \externalArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "external" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ externalArg_ ] - , fromPath = - \fromPathArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "fromPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ fromPathArg_ ] - , toAbsoluteUrl = - \toAbsoluteUrlArg_ toAbsoluteUrlArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toAbsoluteUrl" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - Type.string - ) - } - ) - [ toAbsoluteUrlArg_, toAbsoluteUrlArg_0 ] - , toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - Type.string - ) - } - ) - [ toStringArg_ ] - } - - -values_ : - { external : Elm.Expression - , fromPath : Elm.Expression - , toAbsoluteUrl : Elm.Expression - , toString : Elm.Expression - } -values_ = - { external = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "external" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - , fromPath = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "fromPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - , toAbsoluteUrl = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toAbsoluteUrl" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - Type.string - ) - } - , toString = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - Type.string - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/PagesMsg.elm b/codegen/Gen/PagesMsg.elm deleted file mode 100644 index 0f7dea25..00000000 --- a/codegen/Gen/PagesMsg.elm +++ /dev/null @@ -1,250 +0,0 @@ -module Gen.PagesMsg exposing - ( moduleName_, fromMsg, map, noOp, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for PagesMsg - -@docs moduleName_, fromMsg, map, noOp, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "PagesMsg" ] - - -{-| import Form - import Pages.Form - import PagesMsg exposing (PagesMsg) - - type Msg - = ToggleMenu - - view : - Maybe PageUrl - -> Shared.Model - -> Model - -> App Data ActionData RouteParams - -> View (PagesMsg Msg) - view maybeUrl sharedModel model app = - { title = "My Page" - , view = - [ button - -- we need to wrap our Route module's `Msg` here so we have a `PagesMsg Msg` - [ onClick (PagesMsg.fromMsg ToggleMenu) ] - [] - - -- `Pages.Form.renderHtml` gives us `Html (PagesMsg msg)`, so we don't need to wrap its Msg type - , logoutForm - |> Pages.Form.renderHtml [] - Pages.Form.Serial - (Form.options "logout" - |> Form.withOnSubmit (\_ -> NewItemSubmitted) - ) - app - ] - } - -fromMsg: userMsg -> PagesMsg.PagesMsg userMsg --} -fromMsg : Elm.Expression -> Elm.Expression -fromMsg fromMsgArg_ = - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "fromMsg" - , annotation = - Just - (Type.function - [ Type.var "userMsg" ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - ) - } - ) - [ fromMsgArg_ ] - - -{-| map: (a -> b) -> PagesMsg.PagesMsg a -> PagesMsg.PagesMsg b -} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "a" ] - ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| A Msg that is handled by the elm-pages framework and does nothing. Helpful for when you don't want to register a callback. - - import Browser.Dom as Dom - import PagesMsg exposing (PagesMsg) - import Task - - resetViewport : Cmd (PagesMsg msg) - resetViewport = - Dom.setViewport 0 0 - |> Task.perform (\() -> PagesMsg.noOp) - -noOp: PagesMsg.PagesMsg userMsg --} -noOp : Elm.Expression -noOp = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "noOp" - , annotation = - Just - (Type.namedWith [ "PagesMsg" ] "PagesMsg" [ Type.var "userMsg" ] - ) - } - - -annotation_ : { pagesMsg : Type.Annotation -> Type.Annotation } -annotation_ = - { pagesMsg = - \pagesMsgArg0 -> - Type.alias - moduleName_ - "PagesMsg" - [ pagesMsgArg0 ] - (Type.namedWith - [ "Pages", "Internal", "Msg" ] - "Msg" - [ Type.var "userMsg" ] - ) - } - - -call_ : - { fromMsg : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { fromMsg = - \fromMsgArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "fromMsg" - , annotation = - Just - (Type.function - [ Type.var "userMsg" ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - ) - } - ) - [ fromMsgArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "a" ] - ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : - { fromMsg : Elm.Expression, map : Elm.Expression, noOp : Elm.Expression } -values_ = - { fromMsg = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "fromMsg" - , annotation = - Just - (Type.function - [ Type.var "userMsg" ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "a" ] - ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "b" ] - ) - ) - } - , noOp = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "noOp" - , annotation = - Just - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Parser.elm b/codegen/Gen/Parser.elm deleted file mode 100644 index 742e4994..00000000 --- a/codegen/Gen/Parser.elm +++ /dev/null @@ -1,3210 +0,0 @@ -module Gen.Parser exposing - ( moduleName_, run, int, float, number, symbol - , keyword, variable, end, succeed, lazy, andThen, problem - , oneOf, map, backtrackable, commit, token, sequence, loop - , spaces, lineComment, multiComment, getChompedString, chompIf, chompWhile, chompUntil - , chompUntilEndOr, mapChompedString, deadEndsToString, withIndent, getIndent, getPosition, getRow - , getCol, getOffset, getSource, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Parser - -@docs moduleName_, run, int, float, number, symbol -@docs keyword, variable, end, succeed, lazy, andThen -@docs problem, oneOf, map, backtrackable, commit, token -@docs sequence, loop, spaces, lineComment, multiComment, getChompedString -@docs chompIf, chompWhile, chompUntil, chompUntilEndOr, mapChompedString, deadEndsToString -@docs withIndent, getIndent, getPosition, getRow, getCol, getOffset -@docs getSource, annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Parser" ] - - -{-| Try a parser. Here are some examples using the [`keyword`](#keyword) -parser: - - run (keyword "true") "true" == Ok () - run (keyword "true") "True" == Err ... - run (keyword "true") "false" == Err ... - run (keyword "true") "true!" == Ok () - -Notice the last case! A `Parser` will chomp as much as possible and not worry -about the rest. Use the [`end`](#end) parser to ensure you made it to the end -of the string! - -run: Parser.Parser a -> String -> Result.Result (List Parser.DeadEnd) a --} -run : Elm.Expression -> String -> Elm.Expression -run runArg_ runArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.list - (Type.namedWith [ "Parser" ] "DeadEnd" []) - , Type.var "a" - ] - ) - ) - } - ) - [ runArg_, Elm.string runArg_0 ] - - -{-| Parse integers. - - run int "1" == Ok 1 - run int "1234" == Ok 1234 - - run int "-789" == Err ... - run int "0123" == Err ... - run int "1.34" == Err ... - run int "1e31" == Err ... - run int "123a" == Err ... - run int "0x1A" == Err ... - -If you want to handle a leading `+` or `-` you should do it with a custom -parser like this: - - myInt : Parser Int - myInt = - oneOf - [ succeed negate - |. symbol "-" - |= int - , int - ] - -**Note:** If you want a parser for both `Int` and `Float` literals, check out -[`number`](#number) below. It will be faster than using `oneOf` to combining -`int` and `float` yourself. - -int: Parser.Parser Int --} -int : Elm.Expression -int = - Elm.value - { importFrom = [ "Parser" ] - , name = "int" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Parse floats. - - run float "123" == Ok 123 - run float "3.1415" == Ok 3.1415 - run float "0.1234" == Ok 0.1234 - run float ".1234" == Ok 0.1234 - run float "1e-42" == Ok 1e-42 - run float "6.022e23" == Ok 6.022e23 - run float "6.022E23" == Ok 6.022e23 - run float "6.022e+23" == Ok 6.022e23 - -If you want to disable literals like `.123` (like in Elm) you could write -something like this: - - elmFloat : Parser Float - elmFloat = - oneOf - [ symbol "." - |. problem "floating point numbers must start with a digit, like 0.25" - , float - ] - -**Note:** If you want a parser for both `Int` and `Float` literals, check out -[`number`](#number) below. It will be faster than using `oneOf` to combining -`int` and `float` yourself. - -float: Parser.Parser Float --} -float : Elm.Expression -float = - Elm.value - { importFrom = [ "Parser" ] - , name = "float" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.float ]) - } - - -{-| Parse a bunch of different kinds of numbers without backtracking. A parser -for Elm would need to handle integers, floats, and hexadecimal like this: - - type Expr - = Variable String - | Int Int - | Float Float - | Apply Expr Expr - - elmNumber : Parser Expr - elmNumber = - number - { int = Just Int - , hex = Just Int -- 0x001A is allowed - , octal = Nothing -- 0o0731 is not - , binary = Nothing -- 0b1101 is not - , float = Just Float - } - -If you wanted to implement the [`float`](#float) parser, it would be like this: - - float : Parser Float - float = - number - { int = Just toFloat - , hex = Nothing - , octal = Nothing - , binary = Nothing - , float = Just identity - } - -Notice that it actually is processing `int` results! This is because `123` -looks like an integer to me, but maybe it looks like a float to you. If you had -`int = Nothing`, floats would need a decimal like `1.0` in every case. If you -like explicitness, that may actually be preferable! - -**Note:** This function does not check for weird trailing characters in the -current implementation, so parsing `123abc` can succeed up to `123` and then -move on. This is helpful for people who want to parse things like `40px` or -`3m`, but it requires a bit of extra code to rule out trailing characters in -other cases. - -number: - { int : Maybe (Int -> a) - , hex : Maybe (Int -> a) - , octal : Maybe (Int -> a) - , binary : Maybe (Int -> a) - , float : Maybe (Float -> a) - } - -> Parser.Parser a --} -number : - { int : Elm.Expression - , hex : Elm.Expression - , octal : Elm.Expression - , binary : Elm.Expression - , float : Elm.Expression - } - -> Elm.Expression -number numberArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "number" - , annotation = - Just - (Type.function - [ Type.record - [ ( "int" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "hex" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "octal" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "binary" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "float" - , Type.maybe - (Type.function [ Type.float ] (Type.var "a") - ) - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "int" numberArg_.int - , Tuple.pair "hex" numberArg_.hex - , Tuple.pair "octal" numberArg_.octal - , Tuple.pair "binary" numberArg_.binary - , Tuple.pair "float" numberArg_.float - ] - ] - - -{-| Parse symbols like `(` and `,`. - - run (symbol "[") "[" == Ok () - run (symbol "[") "4" == Err ... (ExpectingSymbol "[") ... - -**Note:** This is good for stuff like brackets and semicolons, but it probably -should not be used for binary operators like `+` and `-` because you can find -yourself in weird situations. For example, is `3--4` a typo? Or is it `3 - -4`? -I have had better luck with `chompWhile isSymbol` and sorting out which -operator it is afterwards. - -symbol: String -> Parser.Parser () --} -symbol : String -> Elm.Expression -symbol symbolArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "symbol" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string symbolArg_ ] - - -{-| Parse keywords like `let`, `case`, and `type`. - - run (keyword "let") "let" == Ok () - run (keyword "let") "var" == Err ... (ExpectingKeyword "let") ... - run (keyword "let") "letters" == Err ... (ExpectingKeyword "let") ... - -**Note:** Notice the third case there! `keyword` actually looks ahead one -character to make sure it is not a letter, number, or underscore. The goal is -to help with parsers like this: - - succeed identity - |. keyword "let" - |. spaces - |= elmVar - |. spaces - |. symbol "=" - -The trouble is that `spaces` may chomp zero characters (to handle expressions -like `[1,2]` and `[ 1 , 2 ]`) and in this case, it would mean `letters` could -be parsed as `let ters` and then wonder where the equals sign is! Check out the -[`token`](#token) docs if you need to customize this! - -keyword: String -> Parser.Parser () --} -keyword : String -> Elm.Expression -keyword keywordArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "keyword" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string keywordArg_ ] - - -{-| Create a parser for variables. If we wanted to parse type variables in Elm, -we could try something like this: - - import Char - import Parser exposing (..) - import Set - - typeVar : Parser String - typeVar = - variable - { start = Char.isLower - , inner = \c -> Char.isAlphaNum c || c == '_' - , reserved = Set.fromList [ "let", "in", "case", "of" ] - } - -This is saying it _must_ start with a lower-case character. After that, -characters can be letters, numbers, or underscores. It is also saying that if -you run into any of these reserved names, it is definitely not a variable. - -variable: - { start : Char.Char -> Bool - , inner : Char.Char -> Bool - , reserved : Set.Set String - } - -> Parser.Parser String --} -variable : - { start : Elm.Expression -> Elm.Expression - , inner : Elm.Expression -> Elm.Expression - , reserved : Elm.Expression - } - -> Elm.Expression -variable variableArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "variable" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start" - , Type.function [ Type.char ] Type.bool - ) - , ( "inner" - , Type.function [ Type.char ] Type.bool - ) - , ( "reserved" - , Type.namedWith [ "Set" ] "Set" [ Type.string ] - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - ) - [ Elm.record - [ Tuple.pair - "start" - (Elm.functionReduced "variableUnpack" variableArg_.start) - , Tuple.pair - "inner" - (Elm.functionReduced "variableUnpack" variableArg_.inner) - , Tuple.pair "reserved" variableArg_.reserved - ] - ] - - -{-| Check if you have reached the end of the string you are parsing. - - justAnInt : Parser Int - justAnInt = - succeed identity - |= int - |. end - - -- run justAnInt "90210" == Ok 90210 - -- run justAnInt "1 + 2" == Err ... - -- run int "1 + 2" == Ok 1 - -Parsers can succeed without parsing the whole string. Ending your parser -with `end` guarantees that you have successfully parsed the whole string. - -end: Parser.Parser () --} -end : Elm.Expression -end = - Elm.value - { importFrom = [ "Parser" ] - , name = "end" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - - -{-| A parser that succeeds without chomping any characters. - - run (succeed 90210 ) "mississippi" == Ok 90210 - run (succeed 3.141 ) "mississippi" == Ok 3.141 - run (succeed () ) "mississippi" == Ok () - run (succeed Nothing) "mississippi" == Ok Nothing - -Seems weird on its own, but it is very useful in combination with other -functions. The docs for [`(|=)`](#|=) and [`andThen`](#andThen) have some neat -examples. - -succeed: a -> Parser.Parser a --} -succeed : Elm.Expression -> Elm.Expression -succeed succeedArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ succeedArg_ ] - - -{-| Helper to define recursive parsers. Say we want a parser for simple -boolean expressions: - - true - false - (true || false) - (true || (true || false)) - -Notice that a boolean expression might contain *other* boolean expressions. -That means we will want to define our parser in terms of itself: - - type Boolean - = MyTrue - | MyFalse - | MyOr Boolean Boolean - - boolean : Parser Boolean - boolean = - oneOf - [ succeed MyTrue - |. keyword "true" - , succeed MyFalse - |. keyword "false" - , succeed MyOr - |. symbol "(" - |. spaces - |= lazy (\_ -> boolean) - |. spaces - |. symbol "||" - |. spaces - |= lazy (\_ -> boolean) - |. spaces - |. symbol ")" - ] - -**Notice that `boolean` uses `boolean` in its definition!** In Elm, you can -only define a value in terms of itself it is behind a function call. So -`lazy` helps us define these self-referential parsers. (`andThen` can be used -for this as well!) - -lazy: (() -> Parser.Parser a) -> Parser.Parser a --} -lazy : (Elm.Expression -> Elm.Expression) -> Elm.Expression -lazy lazyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lazy" - , annotation = - Just - (Type.function - [ Type.function - [ Type.unit ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.functionReduced "lazyUnpack" lazyArg_ ] - - -{-| Parse one thing `andThen` parse another thing. This is useful when you want -to check on what you just parsed. For example, maybe you want U.S. zip codes -and `int` is not suitable because it does not allow leading zeros. You could -say: - - zipCode : Parser String - zipCode = - getChompedString (chompWhile Char.isDigit) - |> andThen checkZipCode - - checkZipCode : String -> Parser String - checkZipCode code = - if String.length code == 5 then - succeed code - else - problem "a U.S. zip code has exactly 5 digits" - -First we chomp digits `andThen` we check if it is a valid U.S. zip code. We -`succeed` if it has exactly five digits and report a `problem` if not. - -Check out [`examples/DoubleQuoteString.elm`](https://github.com/elm/parser/blob/master/examples/DoubleQuoteString.elm) -for another example, this time using `andThen` to verify unicode code points. - -**Note:** If you are using `andThen` recursively and blowing the stack, check -out the [`loop`](#loop) function to limit stack usage. - -andThen: (a -> Parser.Parser b) -> Parser.Parser a -> Parser.Parser b --} -andThen : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -andThen andThenArg_ andThenArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "andThen" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "andThenUnpack" andThenArg_, andThenArg_0 ] - - -{-| Indicate that a parser has reached a dead end. "Everything was going fine -until I ran into this problem." Check out the [`andThen`](#andThen) docs to see -an example usage. - -problem: String -> Parser.Parser a --} -problem : String -> Elm.Expression -problem problemArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "problem" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.string problemArg_ ] - - -{-| If you are parsing JSON, the values can be strings, floats, booleans, -arrays, objects, or null. You need a way to pick `oneOf` them! Here is a -sample of what that code might look like: - - type Json - = Number Float - | Boolean Bool - | Null - - json : Parser Json - json = - oneOf - [ map Number float - , map (\_ -> Boolean True) (keyword "true") - , map (\_ -> Boolean False) (keyword "false") - , map (\_ -> Null) keyword "null" - ] - -This parser will keep trying parsers until `oneOf` them starts chomping -characters. Once a path is chosen, it does not come back and try the others. - -**Note:** I highly recommend reading [this document][semantics] to learn how -`oneOf` and `backtrackable` interact. It is subtle and important! - -[semantics]: https://github.com/elm/parser/blob/master/semantics.md - -oneOf: List (Parser.Parser a) -> Parser.Parser a --} -oneOf : List Elm.Expression -> Elm.Expression -oneOf oneOfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.list oneOfArg_ ] - - -{-| Transform the result of a parser. Maybe you have a value that is -an integer or `null`: - - nullOrInt : Parser (Maybe Int) - nullOrInt = - oneOf - [ map Just int - , map (\_ -> Nothing) (keyword "null") - ] - - -- run nullOrInt "0" == Ok (Just 0) - -- run nullOrInt "13" == Ok (Just 13) - -- run nullOrInt "null" == Ok Nothing - -- run nullOrInt "zero" == Err ... - -map: (a -> b) -> Parser.Parser a -> Parser.Parser b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| It is quite tricky to use `backtrackable` well! It can be very useful, but -also can degrade performance and error message quality. - -Read [this document](https://github.com/elm/parser/blob/master/semantics.md) -to learn how `oneOf`, `backtrackable`, and `commit` work and interact with -each other. It is subtle and important! - -backtrackable: Parser.Parser a -> Parser.Parser a --} -backtrackable : Elm.Expression -> Elm.Expression -backtrackable backtrackableArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "backtrackable" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ backtrackableArg_ ] - - -{-| `commit` is almost always paired with `backtrackable` in some way, and it -is tricky to use well. - -Read [this document](https://github.com/elm/parser/blob/master/semantics.md) -to learn how `oneOf`, `backtrackable`, and `commit` work and interact with -each other. It is subtle and important! - -commit: a -> Parser.Parser a --} -commit : Elm.Expression -> Elm.Expression -commit commitArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "commit" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ commitArg_ ] - - -{-| Parse exactly the given string, without any regard to what comes next. - -A potential pitfall when parsing keywords is getting tricked by variables that -start with a keyword, like `let` in `letters` or `import` in `important`. This -is especially likely if you have a whitespace parser that can consume zero -charcters. So the [`keyword`](#keyword) parser is defined with `token` and a -trick to peek ahead a bit: - - keyword : String -> Parser () - keyword kwd = - succeed identity - |. backtrackable (token kwd) - |= oneOf - [ map (\_ -> True) (backtrackable (chompIf isVarChar)) - , succeed False - ] - |> andThen (checkEnding kwd) - - checkEnding : String -> Bool -> Parser () - checkEnding kwd isBadEnding = - if isBadEnding then - problem ("expecting the `" ++ kwd ++ "` keyword") - else - commit () - - isVarChar : Char -> Bool - isVarChar char = - Char.isAlphaNum char || char == '_' - -This definition is specially designed so that (1) if you really see `let` you -commit to that path and (2) if you see `letters` instead you can backtrack and -try other options. If I had just put a `backtrackable` around the whole thing -you would not get (1) anymore. - -token: String -> Parser.Parser () --} -token : String -> Elm.Expression -token tokenArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "token" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string tokenArg_ ] - - -{-| Handle things like lists and records, but you can customize the details -however you need. Say you want to parse C-style code blocks: - - import Parser exposing (Parser, Trailing(..)) - - block : Parser (List Stmt) - block = - Parser.sequence - { start = "{" - , separator = ";" - , end = "}" - , spaces = spaces - , item = statement - , trailing = Mandatory -- demand a trailing semi-colon - } - - -- statement : Parser Stmt - -**Note:** If you need something more custom, do not be afraid to check -out the implementation and customize it for your case. It is better to -get nice error messages with a lower-level implementation than to try -to hack high-level parsers to do things they are not made for. - -sequence: - { start : String - , separator : String - , end : String - , spaces : Parser.Parser () - , item : Parser.Parser a - , trailing : Parser.Trailing - } - -> Parser.Parser (List a) --} -sequence : - { start : String - , separator : String - , end : String - , spaces : Elm.Expression - , item : Elm.Expression - , trailing : Elm.Expression - } - -> Elm.Expression -sequence sequenceArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start", Type.string ) - , ( "separator", Type.string ) - , ( "end", Type.string ) - , ( "spaces" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - , ( "item" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - , ( "trailing" - , Type.namedWith [ "Parser" ] "Trailing" [] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "start" (Elm.string sequenceArg_.start) - , Tuple.pair "separator" (Elm.string sequenceArg_.separator) - , Tuple.pair "end" (Elm.string sequenceArg_.end) - , Tuple.pair "spaces" sequenceArg_.spaces - , Tuple.pair "item" sequenceArg_.item - , Tuple.pair "trailing" sequenceArg_.trailing - ] - ] - - -{-| A parser that can loop indefinitely. This can be helpful when parsing -repeated structures, like a bunch of statements: - - statements : Parser (List Stmt) - statements = - loop [] statementsHelp - - statementsHelp : List Stmt -> Parser (Step (List Stmt) (List Stmt)) - statementsHelp revStmts = - oneOf - [ succeed (\stmt -> Loop (stmt :: revStmts)) - |= statement - |. spaces - |. symbol ";" - |. spaces - , succeed () - |> map (\_ -> Done (List.reverse revStmts)) - ] - - -- statement : Parser Stmt - -Notice that the statements are tracked in reverse as we `Loop`, and we reorder -them only once we are `Done`. This is a very common pattern with `loop`! - -Check out [`examples/DoubleQuoteString.elm`](https://github.com/elm/parser/blob/master/examples/DoubleQuoteString.elm) -for another example. - -**IMPORTANT NOTE:** Parsers like `succeed ()` and `chompWhile Char.isAlpha` can -succeed without consuming any characters. So in some cases you may want to use -[`getOffset`](#getOffset) to ensure that each step actually consumed characters. -Otherwise you could end up in an infinite loop! - -**Note:** Anything you can write with `loop`, you can also write as a parser -that chomps some characters `andThen` calls itself with new arguments. The -problem with calling `andThen` recursively is that it grows the stack, so you -cannot do it indefinitely. So `loop` is important because enables tail-call -elimination, allowing you to parse however many repeats you want. - -loop: state -> (state -> Parser.Parser (Parser.Step state a)) -> Parser.Parser a --} -loop : Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -loop loopArg_ loopArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "loop" - , annotation = - Just - (Type.function - [ Type.var "state" - , Type.function - [ Type.var "state" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state", Type.var "a" ] - ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ loopArg_, Elm.functionReduced "loopUnpack" loopArg_0 ] - - -{-| Parse zero or more `' '`, `'\n'`, and `'\r'` characters. - -The implementation is pretty simple: - - spaces : Parser () - spaces = - chompWhile (\c -> c == ' ' || c == '\n' || c == '\r') - -So if you need something different (like tabs) just define an alternative with -the necessary tweaks! Check out [`lineComment`](#lineComment) and -[`multiComment`](#multiComment) for more complex situations. - -spaces: Parser.Parser () --} -spaces : Elm.Expression -spaces = - Elm.value - { importFrom = [ "Parser" ] - , name = "spaces" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - - -{-| Parse single-line comments: - - elm : Parser () - elm = - lineComment "--" - - js : Parser () - js = - lineComment "//" - - python : Parser () - python = - lineComment "#" - -This parser is defined like this: - - lineComment : String -> Parser () - lineComment str = - symbol str - |. chompUntilEndOr "\n" - -So it will consume the remainder of the line. If the file ends before you see -a newline, that is fine too. - -lineComment: String -> Parser.Parser () --} -lineComment : String -> Elm.Expression -lineComment lineCommentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lineComment" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string lineCommentArg_ ] - - -{-| Parse multi-line comments. So if you wanted to parse Elm whitespace or -JS whitespace, you could say: - - elm : Parser () - elm = - loop 0 <| ifProgress <| - oneOf - [ lineComment "--" - , multiComment "{-" "-}" Nestable - , spaces - ] - - js : Parser () - js = - loop 0 <| ifProgress <| - oneOf - [ lineComment "//" - , multiComment "/*" "*/" NotNestable - , chompWhile (\c -> c == ' ' || c == '\n' || c == '\r' || c == '\t') - ] - - ifProgress : Parser a -> Int -> Parser (Step Int ()) - ifProgress parser offset = - succeed identity - |. parser - |= getOffset - |> map (\newOffset -> if offset == newOffset then Done () else Loop newOffset) - -**Note:** The fact that `spaces` comes last in the definition of `elm` is very -important! It can succeed without consuming any characters, so if it were the -first option, it would always succeed and bypass the others! (Same is true of -`chompWhile` in `js`.) This possibility of success without consumption is also -why wee need the `ifProgress` helper. It detects if there is no more whitespace -to consume. - -multiComment: String -> String -> Parser.Nestable -> Parser.Parser () --} -multiComment : String -> String -> Elm.Expression -> Elm.Expression -multiComment multiCommentArg_ multiCommentArg_0 multiCommentArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "multiComment" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Parser" ] "Nestable" [] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string multiCommentArg_ - , Elm.string multiCommentArg_0 - , multiCommentArg_1 - ] - - -{-| Sometimes parsers like `int` or `variable` cannot do exactly what you -need. The "chomping" family of functions is meant for that case! Maybe you -need to parse [valid PHP variables][php] like `$x` and `$txt`: - - php : Parser String - php = - getChompedString <| - succeed () - |. chompIf (\c -> c == '$') - |. chompIf (\c -> Char.isAlpha c || c == '_') - |. chompWhile (\c -> Char.isAlphaNum c || c == '_') - -The idea is that you create a bunch of chompers that validate the underlying -characters. Then `getChompedString` extracts the underlying `String` efficiently. - -**Note:** Maybe it is helpful to see how you can use [`getOffset`](#getOffset) -and [`getSource`](#getSource) to implement this function: - - getChompedString : Parser a -> Parser String - getChompedString parser = - succeed String.slice - |= getOffset - |. parser - |= getOffset - |= getSource - -[php]: https://www.w3schools.com/php/php_variables.asp - -getChompedString: Parser.Parser a -> Parser.Parser String --} -getChompedString : Elm.Expression -> Elm.Expression -getChompedString getChompedStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "getChompedString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - ) - [ getChompedStringArg_ ] - - -{-| Chomp one character if it passes the test. - - chompUpper : Parser () - chompUpper = - chompIf Char.isUpper - -So this can chomp a character like `T` and produces a `()` value. - -chompIf: (Char.Char -> Bool) -> Parser.Parser () --} -chompIf : (Elm.Expression -> Elm.Expression) -> Elm.Expression -chompIf chompIfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompIf" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.functionReduced "chompIfUnpack" chompIfArg_ ] - - -{-| Chomp zero or more characters if they pass the test. This is commonly -useful for chomping whitespace or variable names: - - whitespace : Parser () - whitespace = - chompWhile (\c -> c == ' ' || c == '\t' || c == '\n' || c == '\r') - - elmVar : Parser String - elmVar = - getChompedString <| - succeed () - |. chompIf Char.isLower - |. chompWhile (\c -> Char.isAlphaNum c || c == '_') - -**Note:** a `chompWhile` parser always succeeds! This can lead to tricky -situations, especially if you define your whitespace with it. In that case, -you could accidentally interpret `letx` as the keyword `let` followed by -"spaces" followed by the variable `x`. This is why the `keyword` and `number` -parsers peek ahead, making sure they are not followed by anything unexpected. - -chompWhile: (Char.Char -> Bool) -> Parser.Parser () --} -chompWhile : (Elm.Expression -> Elm.Expression) -> Elm.Expression -chompWhile chompWhileArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompWhile" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.functionReduced "chompWhileUnpack" chompWhileArg_ ] - - -{-| Chomp until you see a certain string. You could define C-style multi-line -comments like this: - - comment : Parser () - comment = - symbol "/*" - |. chompUntil "*/" - -I recommend using [`multiComment`](#multiComment) for this particular scenario -though. It can be trickier than it looks! - -chompUntil: String -> Parser.Parser () --} -chompUntil : String -> Elm.Expression -chompUntil chompUntilArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntil" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string chompUntilArg_ ] - - -{-| Chomp until you see a certain string or until you run out of characters to -chomp! You could define single-line comments like this: - - elm : Parser () - elm = - symbol "--" - |. chompUntilEndOr "\n" - -A file may end with a single-line comment, so the file can end before you see -a newline. Tricky! - -I recommend just using [`lineComment`](#lineComment) for this particular -scenario. - -chompUntilEndOr: String -> Parser.Parser () --} -chompUntilEndOr : String -> Elm.Expression -chompUntilEndOr chompUntilEndOrArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntilEndOr" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string chompUntilEndOrArg_ ] - - -{-| This works just like [`getChompedString`](#getChompedString) but gives -a bit more flexibility. For example, maybe you want to parse Elm doc comments -and get (1) the full comment and (2) all of the names listed in the docs. - -You could implement `mapChompedString` like this: - - mapChompedString : (String -> a -> b) -> Parser a -> Parser String - mapChompedString func parser = - succeed (\start value end src -> func (String.slice start end src) value) - |= getOffset - |= parser - |= getOffset - |= getSource - -mapChompedString: (String -> a -> b) -> Parser.Parser a -> Parser.Parser b --} -mapChompedString : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -mapChompedString mapChompedStringArg_ mapChompedStringArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "mapChompedString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string, Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced - "mapChompedStringUnpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (mapChompedStringArg_ functionReducedUnpack) - ) - , mapChompedStringArg_0 - ] - - -{-| Turn all the `DeadEnd` data into a string that is easier for people to -read. - -**Note:** This is just a baseline of quality. It cannot do anything with colors. -It is not interactivite. It just turns the raw data into strings. I really hope -folks will check out the source code for some inspiration on how to turn errors -into `Html` with nice colors and interaction! The `Parser.Advanced` module lets -you work with context as well, which really unlocks another level of quality! -The "context" technique is how the Elm compiler can say "I think I am parsing a -list, so I was expecting a closing `]` here." Telling users what the parser -_thinks_ is happening can be really helpful! - -deadEndsToString: List Parser.DeadEnd -> String --} -deadEndsToString : List Elm.Expression -> Elm.Expression -deadEndsToString deadEndsToStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "deadEndsToString" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Parser" ] "DeadEnd" []) - ] - Type.string - ) - } - ) - [ Elm.list deadEndsToStringArg_ ] - - -{-| Some languages are indentation sensitive. Python cares about tabs. Elm -cares about spaces sometimes. `withIndent` and `getIndent` allow you to manage -"indentation state" yourself, however is necessary in your scenario. - -withIndent: Int -> Parser.Parser a -> Parser.Parser a --} -withIndent : Int -> Elm.Expression -> Elm.Expression -withIndent withIndentArg_ withIndentArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "withIndent" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.int withIndentArg_, withIndentArg_0 ] - - -{-| When someone said `withIndent` earlier, what number did they put in there? - -- `getIndent` results in `0`, the default value -- `withIndent 4 getIndent` results in `4` - -So you are just asking about things you said earlier. These numbers do not leak -out of `withIndent`, so say we have: - - succeed Tuple.pair - |= withIndent 4 getIndent - |= getIndent - -Assuming there are no `withIndent` above this, you would get `(4,0)` from this. - -getIndent: Parser.Parser Int --} -getIndent : Elm.Expression -getIndent = - Elm.value - { importFrom = [ "Parser" ] - , name = "getIndent" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Code editors treat code like a grid, with rows and columns. The start is -`row=1` and `col=1`. As you chomp characters, the `col` increments. When you -run into a `\n` character, the `row` increments and `col` goes back to `1`. - -In the Elm compiler, I track the start and end position of every expression -like this: - - type alias Located a = - { start : (Int, Int) - , value : a - , end : (Int, Int) - } - - located : Parser a -> Parser (Located a) - located parser = - succeed Located - |= getPosition - |= parser - |= getPosition - -So if there is a problem during type inference, I use this saved position -information to underline the exact problem! - -**Note:** Tabs count as one character, so if you are parsing something like -Python, I recommend sorting that out *after* parsing. So if I wanted the `^^^^` -underline like in Elm, I would find the `row` in the source code and do -something like this: - - makeUnderline : String -> Int -> Int -> String - makeUnderline row minCol maxCol = - String.toList row - |> List.indexedMap (toUnderlineChar minCol maxCol) - |> String.fromList - - toUnderlineChar : Int -> Int -> Int -> Char -> Char - toUnderlineChar minCol maxCol col char = - if minCol <= col && col <= maxCol then - '^' - else if char == '\t' then - '\t' - else - ' ' - -So it would preserve any tabs from the source line. There are tons of other -ways to do this though. The point is just that you handle the tabs after -parsing but before anyone looks at the numbers in a context where tabs may -equal 2, 4, or 8. - -getPosition: Parser.Parser ( Int, Int ) --} -getPosition : Elm.Expression -getPosition = - Elm.value - { importFrom = [ "Parser" ] - , name = "getPosition" - , annotation = - Just - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.tuple Type.int Type.int ] - ) - } - - -{-| This is a more efficient version of `map Tuple.first getPosition`. Maybe -you just want to track the line number for some reason? This lets you do that. - -See [`getPosition`](#getPosition) for an explanation of rows and columns. - -getRow: Parser.Parser Int --} -getRow : Elm.Expression -getRow = - Elm.value - { importFrom = [ "Parser" ] - , name = "getRow" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| This is a more efficient version of `map Tuple.second getPosition`. This -can be useful in combination with [`withIndent`](#withIndent) and -[`getIndent`](#getIndent), like this: - - checkIndent : Parser () - checkIndent = - succeed (\indent column -> indent <= column) - |= getIndent - |= getCol - |> andThen checkIndentHelp - - checkIndentHelp : Bool -> Parser () - checkIndentHelp isIndented = - if isIndented then - succeed () - else - problem "expecting more spaces" - -So the `checkIndent` parser only succeeds when you are "deeper" than the -current indent level. You could use this to parse Elm-style `let` expressions. - -getCol: Parser.Parser Int --} -getCol : Elm.Expression -getCol = - Elm.value - { importFrom = [ "Parser" ] - , name = "getCol" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Editors think of code as a grid, but behind the scenes it is just a flat -array of UTF-16 characters. `getOffset` tells you your index in that flat -array. So if you chomp `"\n\n\n\n"` you are on row 5, column 1, and offset 4. - -**Note:** JavaScript uses a somewhat odd version of UTF-16 strings, so a single -character may take two slots. So in JavaScript, `'abc'.length === 3` but -`'🙈🙉🙊'.length === 6`. Try it out! And since Elm runs in JavaScript, the offset -moves by those rules. - -getOffset: Parser.Parser Int --} -getOffset : Elm.Expression -getOffset = - Elm.value - { importFrom = [ "Parser" ] - , name = "getOffset" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Get the full string that is being parsed. You could use this to define -`getChompedString` or `mapChompedString` if you wanted: - - getChompedString : Parser a -> Parser String - getChompedString parser = - succeed String.slice - |= getOffset - |. parser - |= getOffset - |= getSource - -getSource: Parser.Parser String --} -getSource : Elm.Expression -getSource = - Elm.value - { importFrom = [ "Parser" ] - , name = "getSource" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - } - - -annotation_ : - { parser : Type.Annotation -> Type.Annotation - , trailing : Type.Annotation - , step : Type.Annotation -> Type.Annotation -> Type.Annotation - , nestable : Type.Annotation - , deadEnd : Type.Annotation - , problem : Type.Annotation - } -annotation_ = - { parser = - \parserArg0 -> - Type.alias - moduleName_ - "Parser" - [ parserArg0 ] - (Type.namedWith - [ "Parser", "Advanced" ] - "Parser" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Parser" ] "Problem" [] - , Type.var "a" - ] - ) - , trailing = Type.namedWith [ "Parser" ] "Trailing" [] - , step = - \stepArg0 stepArg1 -> - Type.namedWith [ "Parser" ] "Step" [ stepArg0, stepArg1 ] - , nestable = Type.namedWith [ "Parser" ] "Nestable" [] - , deadEnd = - Type.alias - moduleName_ - "DeadEnd" - [] - (Type.record - [ ( "row", Type.int ) - , ( "col", Type.int ) - , ( "problem", Type.namedWith [ "Parser" ] "Problem" [] ) - ] - ) - , problem = Type.namedWith [ "Parser" ] "Problem" [] - } - - -make_ : - { forbidden : Elm.Expression - , optional : Elm.Expression - , mandatory : Elm.Expression - , loop : Elm.Expression -> Elm.Expression - , done : Elm.Expression -> Elm.Expression - , notNestable : Elm.Expression - , nestable : Elm.Expression - , deadEnd : - { row : Elm.Expression, col : Elm.Expression, problem : Elm.Expression } - -> Elm.Expression - , expecting : Elm.Expression -> Elm.Expression - , expectingInt : Elm.Expression - , expectingHex : Elm.Expression - , expectingOctal : Elm.Expression - , expectingBinary : Elm.Expression - , expectingFloat : Elm.Expression - , expectingNumber : Elm.Expression - , expectingVariable : Elm.Expression - , expectingSymbol : Elm.Expression -> Elm.Expression - , expectingKeyword : Elm.Expression -> Elm.Expression - , expectingEnd : Elm.Expression - , unexpectedChar : Elm.Expression - , problem : Elm.Expression -> Elm.Expression - , badRepeat : Elm.Expression - } -make_ = - { forbidden = - Elm.value - { importFrom = [ "Parser" ] - , name = "Forbidden" - , annotation = Just (Type.namedWith [] "Trailing" []) - } - , optional = - Elm.value - { importFrom = [ "Parser" ] - , name = "Optional" - , annotation = Just (Type.namedWith [] "Trailing" []) - } - , mandatory = - Elm.value - { importFrom = [ "Parser" ] - , name = "Mandatory" - , annotation = Just (Type.namedWith [] "Trailing" []) - } - , loop = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Loop" - , annotation = - Just - (Type.namedWith - [] - "Step" - [ Type.var "state", Type.var "a" ] - ) - } - ) - [ ar0 ] - , done = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Done" - , annotation = - Just - (Type.namedWith - [] - "Step" - [ Type.var "state", Type.var "a" ] - ) - } - ) - [ ar0 ] - , notNestable = - Elm.value - { importFrom = [ "Parser" ] - , name = "NotNestable" - , annotation = Just (Type.namedWith [] "Nestable" []) - } - , nestable = - Elm.value - { importFrom = [ "Parser" ] - , name = "Nestable" - , annotation = Just (Type.namedWith [] "Nestable" []) - } - , deadEnd = - \deadEnd_args -> - Elm.withType - (Type.alias - [ "Parser" ] - "DeadEnd" - [] - (Type.record - [ ( "row", Type.int ) - , ( "col", Type.int ) - , ( "problem" - , Type.namedWith [ "Parser" ] "Problem" [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "row" deadEnd_args.row - , Tuple.pair "col" deadEnd_args.col - , Tuple.pair "problem" deadEnd_args.problem - ] - ) - , expecting = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Expecting" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , expectingInt = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingInt" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingHex = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingHex" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingOctal = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingOctal" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingBinary = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingBinary" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingFloat = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingFloat" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingNumber = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingNumber" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingVariable = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingVariable" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingSymbol = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingSymbol" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , expectingKeyword = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingKeyword" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , expectingEnd = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingEnd" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , unexpectedChar = - Elm.value - { importFrom = [ "Parser" ] - , name = "UnexpectedChar" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , problem = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Problem" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , badRepeat = - Elm.value - { importFrom = [ "Parser" ] - , name = "BadRepeat" - , annotation = Just (Type.namedWith [] "Problem" []) - } - } - - -caseOf_ : - { trailing : - Elm.Expression - -> { forbidden : Elm.Expression - , optional : Elm.Expression - , mandatory : Elm.Expression - } - -> Elm.Expression - , step : - Elm.Expression - -> { loop : Elm.Expression -> Elm.Expression - , done : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - , nestable : - Elm.Expression - -> { notNestable : Elm.Expression, nestable : Elm.Expression } - -> Elm.Expression - , problem : - Elm.Expression - -> { expecting : Elm.Expression -> Elm.Expression - , expectingInt : Elm.Expression - , expectingHex : Elm.Expression - , expectingOctal : Elm.Expression - , expectingBinary : Elm.Expression - , expectingFloat : Elm.Expression - , expectingNumber : Elm.Expression - , expectingVariable : Elm.Expression - , expectingSymbol : Elm.Expression -> Elm.Expression - , expectingKeyword : Elm.Expression -> Elm.Expression - , expectingEnd : Elm.Expression - , unexpectedChar : Elm.Expression - , problem : Elm.Expression -> Elm.Expression - , badRepeat : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { trailing = - \trailingExpression trailingTags -> - Elm.Case.custom - trailingExpression - (Type.namedWith [ "Parser" ] "Trailing" []) - [ Elm.Case.branch - (Elm.Arg.customType "Forbidden" trailingTags.forbidden) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Optional" trailingTags.optional) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Mandatory" trailingTags.mandatory) - Basics.identity - ] - , step = - \stepExpression stepTags -> - Elm.Case.custom - stepExpression - (Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state", Type.var "a" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Loop" stepTags.loop |> Elm.Arg.item - (Elm.Arg.varWith - "state" - (Type.var - "state" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Done" stepTags.done |> Elm.Arg.item - (Elm.Arg.varWith - "a" - (Type.var - "a" - ) - ) - ) - Basics.identity - ] - , nestable = - \nestableExpression nestableTags -> - Elm.Case.custom - nestableExpression - (Type.namedWith [ "Parser" ] "Nestable" []) - [ Elm.Case.branch - (Elm.Arg.customType "NotNestable" nestableTags.notNestable) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Nestable" nestableTags.nestable) - Basics.identity - ] - , problem = - \problemExpression problemTags -> - Elm.Case.custom - problemExpression - (Type.namedWith [ "Parser" ] "Problem" []) - [ Elm.Case.branch - (Elm.Arg.customType - "Expecting" - problemTags.expecting |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "ExpectingInt" problemTags.expectingInt) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "ExpectingHex" problemTags.expectingHex) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingOctal" - problemTags.expectingOctal - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingBinary" - problemTags.expectingBinary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingFloat" - problemTags.expectingFloat - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingNumber" - problemTags.expectingNumber - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingVariable" - problemTags.expectingVariable - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingSymbol" - problemTags.expectingSymbol |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingKeyword" - problemTags.expectingKeyword |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "ExpectingEnd" problemTags.expectingEnd) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UnexpectedChar" - problemTags.unexpectedChar - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Problem" - problemTags.problem |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "BadRepeat" problemTags.badRepeat) - Basics.identity - ] - } - - -call_ : - { run : Elm.Expression -> Elm.Expression -> Elm.Expression - , number : Elm.Expression -> Elm.Expression - , symbol : Elm.Expression -> Elm.Expression - , keyword : Elm.Expression -> Elm.Expression - , variable : Elm.Expression -> Elm.Expression - , succeed : Elm.Expression -> Elm.Expression - , lazy : Elm.Expression -> Elm.Expression - , andThen : Elm.Expression -> Elm.Expression -> Elm.Expression - , problem : Elm.Expression -> Elm.Expression - , oneOf : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , backtrackable : Elm.Expression -> Elm.Expression - , commit : Elm.Expression -> Elm.Expression - , token : Elm.Expression -> Elm.Expression - , sequence : Elm.Expression -> Elm.Expression - , loop : Elm.Expression -> Elm.Expression -> Elm.Expression - , lineComment : Elm.Expression -> Elm.Expression - , multiComment : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , getChompedString : Elm.Expression -> Elm.Expression - , chompIf : Elm.Expression -> Elm.Expression - , chompWhile : Elm.Expression -> Elm.Expression - , chompUntil : Elm.Expression -> Elm.Expression - , chompUntilEndOr : Elm.Expression -> Elm.Expression - , mapChompedString : Elm.Expression -> Elm.Expression -> Elm.Expression - , deadEndsToString : Elm.Expression -> Elm.Expression - , withIndent : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { run = - \runArg_ runArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.list - (Type.namedWith - [ "Parser" ] - "DeadEnd" - [] - ) - , Type.var "a" - ] - ) - ) - } - ) - [ runArg_, runArg_0 ] - , number = - \numberArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "number" - , annotation = - Just - (Type.function - [ Type.record - [ ( "int" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "hex" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "octal" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "binary" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "float" - , Type.maybe - (Type.function - [ Type.float ] - (Type.var "a") - ) - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ numberArg_ ] - , symbol = - \symbolArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "symbol" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ symbolArg_ ] - , keyword = - \keywordArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "keyword" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ keywordArg_ ] - , variable = - \variableArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "variable" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start" - , Type.function [ Type.char ] Type.bool - ) - , ( "inner" - , Type.function [ Type.char ] Type.bool - ) - , ( "reserved" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.string ] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.string ] - ) - ) - } - ) - [ variableArg_ ] - , succeed = - \succeedArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ succeedArg_ ] - , lazy = - \lazyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lazy" - , annotation = - Just - (Type.function - [ Type.function - [ Type.unit ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ lazyArg_ ] - , andThen = - \andThenArg_ andThenArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "andThen" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ andThenArg_, andThenArg_0 ] - , problem = - \problemArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "problem" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ problemArg_ ] - , oneOf = - \oneOfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ oneOfArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , backtrackable = - \backtrackableArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "backtrackable" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ backtrackableArg_ ] - , commit = - \commitArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "commit" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ commitArg_ ] - , token = - \tokenArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "token" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ tokenArg_ ] - , sequence = - \sequenceArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start", Type.string ) - , ( "separator", Type.string ) - , ( "end", Type.string ) - , ( "spaces" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - , ( "item" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - , ( "trailing" - , Type.namedWith - [ "Parser" ] - "Trailing" - [] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ sequenceArg_ ] - , loop = - \loopArg_ loopArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "loop" - , annotation = - Just - (Type.function - [ Type.var "state" - , Type.function - [ Type.var "state" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state" - , Type.var "a" - ] - ] - ) - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ loopArg_, loopArg_0 ] - , lineComment = - \lineCommentArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lineComment" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ lineCommentArg_ ] - , multiComment = - \multiCommentArg_ multiCommentArg_0 multiCommentArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "multiComment" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Parser" ] "Nestable" [] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ multiCommentArg_, multiCommentArg_0, multiCommentArg_1 ] - , getChompedString = - \getChompedStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "getChompedString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.string ] - ) - ) - } - ) - [ getChompedStringArg_ ] - , chompIf = - \chompIfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompIf" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompIfArg_ ] - , chompWhile = - \chompWhileArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompWhile" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompWhileArg_ ] - , chompUntil = - \chompUntilArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntil" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompUntilArg_ ] - , chompUntilEndOr = - \chompUntilEndOrArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntilEndOr" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompUntilEndOrArg_ ] - , mapChompedString = - \mapChompedStringArg_ mapChompedStringArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "mapChompedString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string, Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ mapChompedStringArg_, mapChompedStringArg_0 ] - , deadEndsToString = - \deadEndsToStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "deadEndsToString" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Parser" ] "DeadEnd" []) - ] - Type.string - ) - } - ) - [ deadEndsToStringArg_ ] - , withIndent = - \withIndentArg_ withIndentArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "withIndent" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ withIndentArg_, withIndentArg_0 ] - } - - -values_ : - { run : Elm.Expression - , int : Elm.Expression - , float : Elm.Expression - , number : Elm.Expression - , symbol : Elm.Expression - , keyword : Elm.Expression - , variable : Elm.Expression - , end : Elm.Expression - , succeed : Elm.Expression - , lazy : Elm.Expression - , andThen : Elm.Expression - , problem : Elm.Expression - , oneOf : Elm.Expression - , map : Elm.Expression - , backtrackable : Elm.Expression - , commit : Elm.Expression - , token : Elm.Expression - , sequence : Elm.Expression - , loop : Elm.Expression - , spaces : Elm.Expression - , lineComment : Elm.Expression - , multiComment : Elm.Expression - , getChompedString : Elm.Expression - , chompIf : Elm.Expression - , chompWhile : Elm.Expression - , chompUntil : Elm.Expression - , chompUntilEndOr : Elm.Expression - , mapChompedString : Elm.Expression - , deadEndsToString : Elm.Expression - , withIndent : Elm.Expression - , getIndent : Elm.Expression - , getPosition : Elm.Expression - , getRow : Elm.Expression - , getCol : Elm.Expression - , getOffset : Elm.Expression - , getSource : Elm.Expression - } -values_ = - { run = - Elm.value - { importFrom = [ "Parser" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.list - (Type.namedWith [ "Parser" ] "DeadEnd" []) - , Type.var "a" - ] - ) - ) - } - , int = - Elm.value - { importFrom = [ "Parser" ] - , name = "int" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , float = - Elm.value - { importFrom = [ "Parser" ] - , name = "float" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.float ]) - } - , number = - Elm.value - { importFrom = [ "Parser" ] - , name = "number" - , annotation = - Just - (Type.function - [ Type.record - [ ( "int" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "hex" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "octal" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "binary" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "float" - , Type.maybe - (Type.function [ Type.float ] (Type.var "a")) - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , symbol = - Elm.value - { importFrom = [ "Parser" ] - , name = "symbol" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , keyword = - Elm.value - { importFrom = [ "Parser" ] - , name = "keyword" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , variable = - Elm.value - { importFrom = [ "Parser" ] - , name = "variable" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start" - , Type.function [ Type.char ] Type.bool - ) - , ( "inner" - , Type.function [ Type.char ] Type.bool - ) - , ( "reserved" - , Type.namedWith [ "Set" ] "Set" [ Type.string ] - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - , end = - Elm.value - { importFrom = [ "Parser" ] - , name = "end" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - , succeed = - Elm.value - { importFrom = [ "Parser" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , lazy = - Elm.value - { importFrom = [ "Parser" ] - , name = "lazy" - , annotation = - Just - (Type.function - [ Type.function - [ Type.unit ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , andThen = - Elm.value - { importFrom = [ "Parser" ] - , name = "andThen" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ]) - ) - } - , problem = - Elm.value - { importFrom = [ "Parser" ] - , name = "problem" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , oneOf = - Elm.value - { importFrom = [ "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , map = - Elm.value - { importFrom = [ "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ]) - ) - } - , backtrackable = - Elm.value - { importFrom = [ "Parser" ] - , name = "backtrackable" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , commit = - Elm.value - { importFrom = [ "Parser" ] - , name = "commit" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , token = - Elm.value - { importFrom = [ "Parser" ] - , name = "token" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , sequence = - Elm.value - { importFrom = [ "Parser" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start", Type.string ) - , ( "separator", Type.string ) - , ( "end", Type.string ) - , ( "spaces" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - , ( "item" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - , ( "trailing" - , Type.namedWith [ "Parser" ] "Trailing" [] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.list (Type.var "a") ] - ) - ) - } - , loop = - Elm.value - { importFrom = [ "Parser" ] - , name = "loop" - , annotation = - Just - (Type.function - [ Type.var "state" - , Type.function - [ Type.var "state" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state", Type.var "a" ] - ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , spaces = - Elm.value - { importFrom = [ "Parser" ] - , name = "spaces" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - , lineComment = - Elm.value - { importFrom = [ "Parser" ] - , name = "lineComment" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , multiComment = - Elm.value - { importFrom = [ "Parser" ] - , name = "multiComment" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Parser" ] "Nestable" [] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , getChompedString = - Elm.value - { importFrom = [ "Parser" ] - , name = "getChompedString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - , chompIf = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompIf" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , chompWhile = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompWhile" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , chompUntil = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntil" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , chompUntilEndOr = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntilEndOr" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , mapChompedString = - Elm.value - { importFrom = [ "Parser" ] - , name = "mapChompedString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string, Type.var "a" ] - (Type.var "b") - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ]) - ) - } - , deadEndsToString = - Elm.value - { importFrom = [ "Parser" ] - , name = "deadEndsToString" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Parser" ] "DeadEnd" []) - ] - Type.string - ) - } - , withIndent = - Elm.value - { importFrom = [ "Parser" ] - , name = "withIndent" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , getIndent = - Elm.value - { importFrom = [ "Parser" ] - , name = "getIndent" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getPosition = - Elm.value - { importFrom = [ "Parser" ] - , name = "getPosition" - , annotation = - Just - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.tuple Type.int Type.int ] - ) - } - , getRow = - Elm.value - { importFrom = [ "Parser" ] - , name = "getRow" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getCol = - Elm.value - { importFrom = [ "Parser" ] - , name = "getCol" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getOffset = - Elm.value - { importFrom = [ "Parser" ] - , name = "getOffset" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getSource = - Elm.value - { importFrom = [ "Parser" ] - , name = "getSource" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - } - } \ No newline at end of file diff --git a/codegen/Gen/Platform.elm b/codegen/Gen/Platform.elm deleted file mode 100644 index 2078e448..00000000 --- a/codegen/Gen/Platform.elm +++ /dev/null @@ -1,427 +0,0 @@ -module Gen.Platform exposing - ( moduleName_, worker, sendToApp, sendToSelf, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Platform - -@docs moduleName_, worker, sendToApp, sendToSelf, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Platform" ] - - -{-| Create a [headless][] program with no user interface. - -This is great if you want to use Elm as the “brain” for something -else. For example, you could send messages out ports to modify the DOM, but do -all the complex logic in Elm. - -[headless]: https://en.wikipedia.org/wiki/Headless_software - -Initializing a headless program from JavaScript looks like this: - -```javascript -var app = Elm.MyThing.init(); -``` - -If you _do_ want to control the user interface in Elm, the [`Browser`][browser] -module has a few ways to create that kind of `Program` instead! - -[headless]: https://en.wikipedia.org/wiki/Headless_software -[browser]: /packages/elm/browser/latest/Browser - -worker: - { init : flags -> ( model, Platform.Cmd.Cmd msg ) - , update : msg -> model -> ( model, Platform.Cmd.Cmd msg ) - , subscriptions : model -> Platform.Sub.Sub msg - } - -> Platform.Program flags model msg --} -worker : - { init : Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression -> Elm.Expression - , subscriptions : Elm.Expression -> Elm.Expression - } - -> Elm.Expression -worker workerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "worker" - , annotation = - Just - (Type.function - [ Type.record - [ ( "init" - , Type.function - [ Type.var "flags" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "update" - , Type.function - [ Type.var "msg", Type.var "model" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "subscriptions" - , Type.function - [ Type.var "model" ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.var "flags" - , Type.var "model" - , Type.var "msg" - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "init" - (Elm.functionReduced "workerUnpack" workerArg_.init) - , Tuple.pair - "update" - (Elm.functionReduced - "workerUnpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (workerArg_.update functionReducedUnpack) - ) - ) - , Tuple.pair - "subscriptions" - (Elm.functionReduced "workerUnpack" workerArg_.subscriptions) - ] - ] - - -{-| Send the router a message for the main loop of your app. This message will -be handled by the overall `update` function, just like events from `Html`. - -sendToApp: Platform.Router msg a -> msg -> Platform.Task x () --} -sendToApp : Elm.Expression -> Elm.Expression -> Elm.Expression -sendToApp sendToAppArg_ sendToAppArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToApp" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "msg", Type.var "a" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToAppArg_, sendToAppArg_0 ] - - -{-| Send the router a message for your effect manager. This message will -be routed to the `onSelfMsg` function, where you can update the state of your -effect manager as necessary. - -As an example, the effect manager for web sockets - -sendToSelf: Platform.Router a msg -> msg -> Platform.Task x () --} -sendToSelf : Elm.Expression -> Elm.Expression -> Elm.Expression -sendToSelf sendToSelfArg_ sendToSelfArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToSelf" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "a", Type.var "msg" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToSelfArg_, sendToSelfArg_0 ] - - -annotation_ : - { program : - Type.Annotation -> Type.Annotation -> Type.Annotation -> Type.Annotation - , task : Type.Annotation -> Type.Annotation -> Type.Annotation - , processId : Type.Annotation - , router : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { program = - \programArg0 programArg1 programArg2 -> - Type.namedWith - [] - "Program" - [ programArg0, programArg1, programArg2 ] - , task = - \taskArg0 taskArg1 -> - Type.namedWith [ "Platform" ] "Task" [ taskArg0, taskArg1 ] - , processId = Type.namedWith [ "Platform" ] "ProcessId" [] - , router = - \routerArg0 routerArg1 -> - Type.namedWith [ "Platform" ] "Router" [ routerArg0, routerArg1 ] - } - - -call_ : - { worker : Elm.Expression -> Elm.Expression - , sendToApp : Elm.Expression -> Elm.Expression -> Elm.Expression - , sendToSelf : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { worker = - \workerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "worker" - , annotation = - Just - (Type.function - [ Type.record - [ ( "init" - , Type.function - [ Type.var "flags" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "update" - , Type.function - [ Type.var "msg", Type.var "model" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "subscriptions" - , Type.function - [ Type.var "model" ] - (Type.namedWith - [] - "Sub" - [ Type.var "msg" ] - ) - ) - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.var "flags" - , Type.var "model" - , Type.var "msg" - ] - ) - ) - } - ) - [ workerArg_ ] - , sendToApp = - \sendToAppArg_ sendToAppArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToApp" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "msg", Type.var "a" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToAppArg_, sendToAppArg_0 ] - , sendToSelf = - \sendToSelfArg_ sendToSelfArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToSelf" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "a", Type.var "msg" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToSelfArg_, sendToSelfArg_0 ] - } - - -values_ : - { worker : Elm.Expression - , sendToApp : Elm.Expression - , sendToSelf : Elm.Expression - } -values_ = - { worker = - Elm.value - { importFrom = [ "Platform" ] - , name = "worker" - , annotation = - Just - (Type.function - [ Type.record - [ ( "init" - , Type.function - [ Type.var "flags" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "update" - , Type.function - [ Type.var "msg", Type.var "model" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "subscriptions" - , Type.function - [ Type.var "model" ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.var "flags" - , Type.var "model" - , Type.var "msg" - ] - ) - ) - } - , sendToApp = - Elm.value - { importFrom = [ "Platform" ] - , name = "sendToApp" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "msg", Type.var "a" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - , sendToSelf = - Elm.value - { importFrom = [ "Platform" ] - , name = "sendToSelf" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "a", Type.var "msg" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Platform/Cmd.elm b/codegen/Gen/Platform/Cmd.elm deleted file mode 100644 index 9e408f36..00000000 --- a/codegen/Gen/Platform/Cmd.elm +++ /dev/null @@ -1,183 +0,0 @@ -module Gen.Platform.Cmd exposing - ( moduleName_, none, batch, map, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Cmd - -@docs moduleName_, none, batch, map, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Cmd" ] - - -{-| Tell the runtime that there are no commands. - -none: Platform.Cmd.Cmd msg --} -none : Elm.Expression -none = - Elm.value - { importFrom = [ "Cmd" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - } - - -{-| When you need the runtime system to perform a couple commands, you -can batch them together. Each is handed to the runtime at the same time, -and since each can perform arbitrary operations in the world, there are -no ordering guarantees about the results. - -**Note:** `Cmd.none` and `Cmd.batch [ Cmd.none, Cmd.none ]` and `Cmd.batch []` -all do the same thing. - -batch: List (Platform.Cmd.Cmd msg) -> Platform.Cmd.Cmd msg --} -batch : List Elm.Expression -> Elm.Expression -batch batchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.list batchArg_ ] - - -{-| Transform the messages produced by a command. -Very similar to [`Html.map`](/packages/elm/html/latest/Html#map). - -This is very rarely useful in well-structured Elm code, so definitely read the -section on [structure][] in the guide before reaching for this! - -[structure]: https://guide.elm-lang.org/webapps/structure.html - -map: (a -> msg) -> Platform.Cmd.Cmd a -> Platform.Cmd.Cmd msg --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Cmd" [ Type.var "a" ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : { cmd : Type.Annotation -> Type.Annotation } -annotation_ = - { cmd = \cmdArg0 -> Type.namedWith [ "Cmd" ] "Cmd" [ cmdArg0 ] } - - -call_ : - { batch : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { batch = - \batchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ batchArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "msg") - , Type.namedWith [] "Cmd" [ Type.var "a" ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : - { none : Elm.Expression, batch : Elm.Expression, map : Elm.Expression } -values_ = - { none = - Elm.value - { importFrom = [ "Cmd" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - } - , batch = - Elm.value - { importFrom = [ "Cmd" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - , map = - Elm.value - { importFrom = [ "Cmd" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Cmd" [ Type.var "a" ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Platform/Sub.elm b/codegen/Gen/Platform/Sub.elm deleted file mode 100644 index 702ac712..00000000 --- a/codegen/Gen/Platform/Sub.elm +++ /dev/null @@ -1,181 +0,0 @@ -module Gen.Platform.Sub exposing - ( moduleName_, none, batch, map, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Sub - -@docs moduleName_, none, batch, map, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Sub" ] - - -{-| Tell the runtime that there are no subscriptions. - -none: Platform.Sub.Sub msg --} -none : Elm.Expression -none = - Elm.value - { importFrom = [ "Sub" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Sub" [ Type.var "msg" ]) - } - - -{-| When you need to subscribe to multiple things, you can create a `batch` of -subscriptions. - -**Note:** `Sub.none` and `Sub.batch [ Sub.none, Sub.none ]` and -`Sub.batch []` all do the same thing. - -batch: List (Platform.Sub.Sub msg) -> Platform.Sub.Sub msg --} -batch : List Elm.Expression -> Elm.Expression -batch batchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ Elm.list batchArg_ ] - - -{-| Transform the messages produced by a subscription. -Very similar to [`Html.map`](/packages/elm/html/latest/Html#map). - -This is very rarely useful in well-structured Elm code, so definitely read the -section on [structure][] in the guide before reaching for this! - -[structure]: https://guide.elm-lang.org/webapps/structure.html - -map: (a -> msg) -> Platform.Sub.Sub a -> Platform.Sub.Sub msg --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Sub" [ Type.var "a" ] - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : { sub : Type.Annotation -> Type.Annotation } -annotation_ = - { sub = \subArg0 -> Type.namedWith [ "Sub" ] "Sub" [ subArg0 ] } - - -call_ : - { batch : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { batch = - \batchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [] - "Sub" - [ Type.var "msg" ] - ) - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ batchArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "msg") - , Type.namedWith [] "Sub" [ Type.var "a" ] - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : - { none : Elm.Expression, batch : Elm.Expression, map : Elm.Expression } -values_ = - { none = - Elm.value - { importFrom = [ "Sub" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Sub" [ Type.var "msg" ]) - } - , batch = - Elm.value - { importFrom = [ "Sub" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - , map = - Elm.value - { importFrom = [ "Sub" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Sub" [ Type.var "a" ] - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Process.elm b/codegen/Gen/Process.elm deleted file mode 100644 index 6f868d7b..00000000 --- a/codegen/Gen/Process.elm +++ /dev/null @@ -1,259 +0,0 @@ -module Gen.Process exposing - ( moduleName_, spawn, sleep, kill, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Process - -@docs moduleName_, spawn, sleep, kill, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Process" ] - - -{-| Run a task in its own light-weight process. In the following example, -`task1` and `task2` will be interleaved. If `task1` makes a long HTTP request -or is just taking a long time, we can hop over to `task2` and do some work -there. - - spawn task1 - |> Task.andThen (\_ -> spawn task2) - -**Note:** This creates a relatively restricted kind of `Process` because it -cannot receive any messages. More flexibility for user-defined processes will -come in a later release! - -spawn: Task.Task x a -> Task.Task y Process.Id --} -spawn : Elm.Expression -> Elm.Expression -spawn spawnArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "spawn" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.var "a" ] - ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "y" - , Type.namedWith [ "Process" ] "Id" [] - ] - ) - ) - } - ) - [ spawnArg_ ] - - -{-| Block progress on the current process for the given number of milliseconds. -The JavaScript equivalent of this is [`setTimeout`][setTimeout] which lets you -delay work until later. - -[setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout - -sleep: Float -> Task.Task x () --} -sleep : Float -> Elm.Expression -sleep sleepArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.float ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ Elm.float sleepArg_ ] - - -{-| Sometimes you `spawn` a process, but later decide it would be a waste to -have it keep running and doing stuff. The `kill` function will force a process -to bail on whatever task it is running. So if there is an HTTP request in -flight, it will also abort the request. - -kill: Process.Id -> Task.Task x () --} -kill : Elm.Expression -> Elm.Expression -kill killArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "kill" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Process" ] "Id" [] ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ killArg_ ] - - -annotation_ : { id : Type.Annotation } -annotation_ = - { id = - Type.alias - moduleName_ - "Id" - [] - (Type.namedWith [ "Platform" ] "ProcessId" []) - } - - -call_ : - { spawn : Elm.Expression -> Elm.Expression - , sleep : Elm.Expression -> Elm.Expression - , kill : Elm.Expression -> Elm.Expression - } -call_ = - { spawn = - \spawnArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "spawn" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.var "a" ] - ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "y" - , Type.namedWith [ "Process" ] "Id" [] - ] - ) - ) - } - ) - [ spawnArg_ ] - , sleep = - \sleepArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.float ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sleepArg_ ] - , kill = - \killArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "kill" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Process" ] "Id" [] ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ killArg_ ] - } - - -values_ : - { spawn : Elm.Expression, sleep : Elm.Expression, kill : Elm.Expression } -values_ = - { spawn = - Elm.value - { importFrom = [ "Process" ] - , name = "spawn" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.var "a" ] - ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "y" - , Type.namedWith [ "Process" ] "Id" [] - ] - ) - ) - } - , sleep = - Elm.value - { importFrom = [ "Process" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.float ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - , kill = - Elm.value - { importFrom = [ "Process" ] - , name = "kill" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Process" ] "Id" [] ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Scaffold/Form.elm b/codegen/Gen/Scaffold/Form.elm deleted file mode 100644 index 16322aa3..00000000 --- a/codegen/Gen/Scaffold/Form.elm +++ /dev/null @@ -1,678 +0,0 @@ -module Gen.Scaffold.Form exposing - ( moduleName_, provide, restArgsParser, recordEncoder, fieldEncoder, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Scaffold.Form - -@docs moduleName_, provide, restArgsParser, recordEncoder, fieldEncoder, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Scaffold", "Form" ] - - -{-| provide: - { fields : List ( String, Scaffold.Form.Kind ) - , elmCssView : Bool - , view : - { formState : Scaffold.Form.Context - , params : - List { name : String - , kind : Scaffold.Form.Kind - , param : Elm.Expression - } - } - -> Elm.Expression - } - -> Maybe { formHandlers : Elm.Expression - , form : Elm.Expression - , declarations : List Elm.Declaration - } --} -provide : - { fields : List Elm.Expression - , elmCssView : Bool - , view : Elm.Expression -> Elm.Expression - } - -> Elm.Expression -provide provideArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "provide" - , annotation = - Just - (Type.function - [ Type.record - [ ( "fields" - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ) - , ( "elmCssView", Type.bool ) - , ( "view" - , Type.function - [ Type.record - [ ( "formState" - , Type.namedWith - [ "Scaffold", "Form" ] - "Context" - [] - ) - , ( "params" - , Type.list - (Type.record - [ ( "name", Type.string ) - , ( "kind" - , Type.namedWith - [ "Scaffold" - , "Form" - ] - "Kind" - [] - ) - , ( "param" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ) - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - ] - (Type.maybe - (Type.record - [ ( "formHandlers" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "form" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "declarations" - , Type.list - (Type.namedWith - [ "Elm" ] - "Declaration" - [] - ) - ) - ] - ) - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "fields" (Elm.list provideArg_.fields) - , Tuple.pair "elmCssView" (Elm.bool provideArg_.elmCssView) - , Tuple.pair - "view" - (Elm.functionReduced "provideUnpack" provideArg_.view) - ] - ] - - -{-| This parser handles the following field types (or `text` if none is provided): - - - `text` - - `textarea` - - `checkbox` - - `time` - - `date` - -The naming convention follows the same naming as the HTML form field elements or attributes that are used to represent them. -In addition to using the appropriate field type, this will also give you an Elm type with the corresponding base type (like `Date` for `date` or `Bool` for `checkbox`). - -restArgsParser: Cli.Option.Option (List String) (List ( String, Scaffold.Form.Kind )) Cli.Option.RestArgsOption --} -restArgsParser : Elm.Expression -restArgsParser = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "restArgsParser" - , annotation = - Just - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.list Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Scaffold", "Form" ] "Kind" []) - ) - , Type.namedWith [ "Cli", "Option" ] "RestArgsOption" [] - ] - ) - } - - -{-| Generate a JSON Encoder for the form fields. This can be helpful for sending the validated form data through a -BackendTask.Custom or to an external API from your scaffolded Route Module code. - -recordEncoder: Elm.Expression -> List ( String, Scaffold.Form.Kind ) -> Elm.Expression --} -recordEncoder : Elm.Expression -> List Elm.Expression -> Elm.Expression -recordEncoder recordEncoderArg_ recordEncoderArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "recordEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ recordEncoderArg_, Elm.list recordEncoderArg_0 ] - - -{-| A lower-level, more granular version of `recordEncoder` - lets you generate a JSON Encoder `Expression` for an individual Field rather than a group of Fields. - -fieldEncoder: Elm.Expression -> String -> Scaffold.Form.Kind -> Elm.Expression --} -fieldEncoder : Elm.Expression -> String -> Elm.Expression -> Elm.Expression -fieldEncoder fieldEncoderArg_ fieldEncoderArg_0 fieldEncoderArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "fieldEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.string - , Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ fieldEncoderArg_, Elm.string fieldEncoderArg_0, fieldEncoderArg_1 ] - - -annotation_ : { kind : Type.Annotation, context : Type.Annotation } -annotation_ = - { kind = Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - , context = - Type.alias - moduleName_ - "Context" - [] - (Type.record - [ ( "errors", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "submitting", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "submitAttempted" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "data", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "expression", Type.namedWith [ "Elm" ] "Expression" [] ) - ] - ) - } - - -make_ : - { fieldInt : Elm.Expression - , fieldText : Elm.Expression - , fieldTextarea : Elm.Expression - , fieldFloat : Elm.Expression - , fieldTime : Elm.Expression - , fieldDate : Elm.Expression - , fieldCheckbox : Elm.Expression - , context : - { errors : Elm.Expression - , submitting : Elm.Expression - , submitAttempted : Elm.Expression - , data : Elm.Expression - , expression : Elm.Expression - } - -> Elm.Expression - } -make_ = - { fieldInt = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldInt" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldText = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldText" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldTextarea = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldTextarea" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldFloat = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldFloat" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldTime = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldTime" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldDate = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldDate" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldCheckbox = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldCheckbox" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , context = - \context_args -> - Elm.withType - (Type.alias - [ "Scaffold", "Form" ] - "Context" - [] - (Type.record - [ ( "errors" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "submitting" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "submitAttempted" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "data", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "expression" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "errors" context_args.errors - , Tuple.pair "submitting" context_args.submitting - , Tuple.pair "submitAttempted" context_args.submitAttempted - , Tuple.pair "data" context_args.data - , Tuple.pair "expression" context_args.expression - ] - ) - } - - -caseOf_ : - { kind : - Elm.Expression - -> { fieldInt : Elm.Expression - , fieldText : Elm.Expression - , fieldTextarea : Elm.Expression - , fieldFloat : Elm.Expression - , fieldTime : Elm.Expression - , fieldDate : Elm.Expression - , fieldCheckbox : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { kind = - \kindExpression kindTags -> - Elm.Case.custom - kindExpression - (Type.namedWith [ "Scaffold", "Form" ] "Kind" []) - [ Elm.Case.branch - (Elm.Arg.customType "FieldInt" kindTags.fieldInt) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldText" kindTags.fieldText) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldTextarea" kindTags.fieldTextarea) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldFloat" kindTags.fieldFloat) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldTime" kindTags.fieldTime) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldDate" kindTags.fieldDate) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldCheckbox" kindTags.fieldCheckbox) - Basics.identity - ] - } - - -call_ : - { provide : Elm.Expression -> Elm.Expression - , recordEncoder : Elm.Expression -> Elm.Expression -> Elm.Expression - , fieldEncoder : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { provide = - \provideArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "provide" - , annotation = - Just - (Type.function - [ Type.record - [ ( "fields" - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ) - , ( "elmCssView", Type.bool ) - , ( "view" - , Type.function - [ Type.record - [ ( "formState" - , Type.namedWith - [ "Scaffold", "Form" ] - "Context" - [] - ) - , ( "params" - , Type.list - (Type.record - [ ( "name" - , Type.string - ) - , ( "kind" - , Type.namedWith - [ "Scaffold" - , "Form" - ] - "Kind" - [] - ) - , ( "param" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ) - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ] - ] - (Type.maybe - (Type.record - [ ( "formHandlers" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "form" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "declarations" - , Type.list - (Type.namedWith - [ "Elm" ] - "Declaration" - [] - ) - ) - ] - ) - ) - ) - } - ) - [ provideArg_ ] - , recordEncoder = - \recordEncoderArg_ recordEncoderArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "recordEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ recordEncoderArg_, recordEncoderArg_0 ] - , fieldEncoder = - \fieldEncoderArg_ fieldEncoderArg_0 fieldEncoderArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "fieldEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.string - , Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ fieldEncoderArg_, fieldEncoderArg_0, fieldEncoderArg_1 ] - } - - -values_ : - { provide : Elm.Expression - , restArgsParser : Elm.Expression - , recordEncoder : Elm.Expression - , fieldEncoder : Elm.Expression - } -values_ = - { provide = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "provide" - , annotation = - Just - (Type.function - [ Type.record - [ ( "fields" - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ) - , ( "elmCssView", Type.bool ) - , ( "view" - , Type.function - [ Type.record - [ ( "formState" - , Type.namedWith - [ "Scaffold", "Form" ] - "Context" - [] - ) - , ( "params" - , Type.list - (Type.record - [ ( "name", Type.string ) - , ( "kind" - , Type.namedWith - [ "Scaffold" - , "Form" - ] - "Kind" - [] - ) - , ( "param" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ) - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - ] - (Type.maybe - (Type.record - [ ( "formHandlers" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "form" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "declarations" - , Type.list - (Type.namedWith - [ "Elm" ] - "Declaration" - [] - ) - ) - ] - ) - ) - ) - } - , restArgsParser = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "restArgsParser" - , annotation = - Just - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.list Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ) - ) - , Type.namedWith - [ "Cli", "Option" ] - "RestArgsOption" - [] - ] - ) - } - , recordEncoder = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "recordEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ) - ) - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - , fieldEncoder = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "fieldEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.string - , Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Scaffold/Route.elm b/codegen/Gen/Scaffold/Route.elm deleted file mode 100644 index 8567444a..00000000 --- a/codegen/Gen/Scaffold/Route.elm +++ /dev/null @@ -1,1962 +0,0 @@ -module Gen.Scaffold.Route exposing - ( moduleName_, buildWithLocalState, buildWithSharedState, buildNoState, serverRender, preRender - , single, addDeclarations, moduleNameCliArg, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Scaffold.Route - -@docs moduleName_, buildWithLocalState, buildWithSharedState, buildNoState, serverRender, preRender -@docs single, addDeclarations, moduleNameCliArg, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Scaffold", "Route" ] - - -{-| buildWithLocalState: - { view : - { shared : Elm.Expression, model : Elm.Expression, app : Elm.Expression } - -> Elm.Expression - , update : - { shared : Elm.Expression - , app : Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , init : { shared : Elm.Expression, app : Elm.Expression } -> Elm.Expression - , subscriptions : - { routeParams : Elm.Expression - , path : Elm.Expression - , shared : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , msg : Scaffold.Route.Type - , model : Scaffold.Route.Type - } - -> Scaffold.Route.Builder - -> { path : String, body : String } --} -buildWithLocalState : - { view : Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression - , init : Elm.Expression -> Elm.Expression - , subscriptions : Elm.Expression -> Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -buildWithLocalState buildWithLocalStateArg_ buildWithLocalStateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithLocalState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "view" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.view - ) - , Tuple.pair - "update" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.update - ) - , Tuple.pair - "init" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.init - ) - , Tuple.pair - "subscriptions" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.subscriptions - ) - , Tuple.pair "msg" buildWithLocalStateArg_.msg - , Tuple.pair "model" buildWithLocalStateArg_.model - ] - , buildWithLocalStateArg_0 - ] - - -{-| buildWithSharedState: - { view : - { shared : Elm.Expression, model : Elm.Expression, app : Elm.Expression } - -> Elm.Expression - , update : - { shared : Elm.Expression - , app : Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , init : { shared : Elm.Expression, app : Elm.Expression } -> Elm.Expression - , subscriptions : - { routeParams : Elm.Expression - , path : Elm.Expression - , shared : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , msg : Scaffold.Route.Type - , model : Scaffold.Route.Type - } - -> Scaffold.Route.Builder - -> { path : String, body : String } --} -buildWithSharedState : - { view : Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression - , init : Elm.Expression -> Elm.Expression - , subscriptions : Elm.Expression -> Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -buildWithSharedState buildWithSharedStateArg_ buildWithSharedStateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithSharedState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "view" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.view - ) - , Tuple.pair - "update" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.update - ) - , Tuple.pair - "init" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.init - ) - , Tuple.pair - "subscriptions" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.subscriptions - ) - , Tuple.pair "msg" buildWithSharedStateArg_.msg - , Tuple.pair "model" buildWithSharedStateArg_.model - ] - , buildWithSharedStateArg_0 - ] - - -{-| buildNoState: - { view : { shared : Elm.Expression, app : Elm.Expression } -> Elm.Expression } - -> Scaffold.Route.Builder - -> { path : String, body : String } --} -buildNoState : - { view : Elm.Expression -> Elm.Expression } - -> Elm.Expression - -> Elm.Expression -buildNoState buildNoStateArg_ buildNoStateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildNoState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "view" - (Elm.functionReduced - "buildNoStateUnpack" - buildNoStateArg_.view - ) - ] - , buildNoStateArg_0 - ] - - -{-| serverRender: - { data : - ( Scaffold.Route.Type, Elm.Expression -> Elm.Expression -> Elm.Expression ) - , action : - ( Scaffold.Route.Type, Elm.Expression -> Elm.Expression -> Elm.Expression ) - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Scaffold.Route.Builder --} -serverRender : - { data : Elm.Expression - , action : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Elm.Expression -serverRender serverRenderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" [] - ) - ) - ) - , ( "action" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" [] - ) - ) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "data" serverRenderArg_.data - , Tuple.pair "action" serverRenderArg_.action - , Tuple.pair - "head" - (Elm.functionReduced - "serverRenderUnpack" - serverRenderArg_.head - ) - , Tuple.pair - "moduleName" - (Elm.list (List.map Elm.string serverRenderArg_.moduleName)) - ] - ] - - -{-| Will scaffold using `RouteBuilder.preRender` if there are any dynamic segments (as in `Company.Team.Name_`), -or using `RouteBuilder.single` if there are no dynamic segments (as in `Company.AboutUs`). - -When there are no dynamic segments, the `pages` field will be ignored as it is only relevant for Routes with dynamic segments. - -For dynamic segments, the `routeParams` parameter in the `data` function will be an `Elm.Expression` with the `RouteParams` parameter in the `data` function. -For static segments, it will be a hardcoded empty record (`{}`). - -preRender: - { data : ( Scaffold.Route.Type, Elm.Expression -> Elm.Expression ) - , pages : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Scaffold.Route.Builder --} -preRender : - { data : Elm.Expression - , pages : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Elm.Expression -preRender preRenderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" [] - ) - ) - ) - , ( "pages" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "data" preRenderArg_.data - , Tuple.pair "pages" preRenderArg_.pages - , Tuple.pair - "head" - (Elm.functionReduced "preRenderUnpack" preRenderArg_.head) - , Tuple.pair - "moduleName" - (Elm.list (List.map Elm.string preRenderArg_.moduleName)) - ] - ] - - -{-| @depreacted. This is obsolete and will be removed in a future release. Use [`preRender`](#preRender) instead. - -If you pass in only static route segments as the `moduleName` to `preRender` it will yield the same result as `single`. - -single: - { data : ( Scaffold.Route.Type, Elm.Expression ) - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Scaffold.Route.Builder --} -single : - { data : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Elm.Expression -single singleArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "data" singleArg_.data - , Tuple.pair - "head" - (Elm.functionReduced "singleUnpack" singleArg_.head) - , Tuple.pair - "moduleName" - (Elm.list (List.map Elm.string singleArg_.moduleName)) - ] - ] - - -{-| The helpers in this module help you generate a Route module file with the core boilerplate abstracted away. - -You can also define additional top-level declarations in the generated Route module using this helper. - -addDeclarations: List Elm.Declaration -> Scaffold.Route.Builder -> Scaffold.Route.Builder --} -addDeclarations : List Elm.Expression -> Elm.Expression -> Elm.Expression -addDeclarations addDeclarationsArg_ addDeclarationsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "addDeclarations" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Elm" ] "Declaration" []) - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.list addDeclarationsArg_, addDeclarationsArg_0 ] - - -{-| A positional argument for elm-cli-options-parser that does a Regex validation to check that the module name is a valid Elm Route module name. - -moduleNameCliArg: - Cli.Option.Option from String builderState - -> Cli.Option.Option from (List String) builderState --} -moduleNameCliArg : Elm.Expression -> Elm.Expression -moduleNameCliArg moduleNameCliArgArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "moduleNameCliArg" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.string - , Type.var "builderState" - ] - ] - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.list Type.string - , Type.var "builderState" - ] - ) - ) - } - ) - [ moduleNameCliArgArg_ ] - - -annotation_ : { builder : Type.Annotation, type_ : Type.Annotation } -annotation_ = - { builder = Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - , type_ = Type.namedWith [ "Scaffold", "Route" ] "Type" [] - } - - -make_ : - { alias : Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression - } -make_ = - { alias = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "Alias" - , annotation = Just (Type.namedWith [] "Type" []) - } - ) - [ ar0 ] - , custom = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "Custom" - , annotation = Just (Type.namedWith [] "Type" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { type_ = - \typeExpression typeTags -> - Elm.Case.custom - typeExpression - (Type.namedWith [ "Scaffold", "Route" ] "Type" []) - [ Elm.Case.branch - (Elm.Arg.customType "Alias" typeTags.alias |> Elm.Arg.item - (Elm.Arg.varWith - "elmAnnotationAnnotation" - (Type.namedWith - [ "Elm" - , "Annotation" - ] - "Annotation" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Custom" typeTags.custom |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.list - (Type.namedWith - [ "Elm" - ] - "Variant" - [] - ) - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { buildWithLocalState : Elm.Expression -> Elm.Expression -> Elm.Expression - , buildWithSharedState : Elm.Expression -> Elm.Expression -> Elm.Expression - , buildNoState : Elm.Expression -> Elm.Expression -> Elm.Expression - , serverRender : Elm.Expression -> Elm.Expression - , preRender : Elm.Expression -> Elm.Expression - , single : Elm.Expression -> Elm.Expression - , addDeclarations : Elm.Expression -> Elm.Expression -> Elm.Expression - , moduleNameCliArg : Elm.Expression -> Elm.Expression - } -call_ = - { buildWithLocalState = - \buildWithLocalStateArg_ buildWithLocalStateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithLocalState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ buildWithLocalStateArg_, buildWithLocalStateArg_0 ] - , buildWithSharedState = - \buildWithSharedStateArg_ buildWithSharedStateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithSharedState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ buildWithSharedStateArg_, buildWithSharedStateArg_0 ] - , buildNoState = - \buildNoStateArg_ buildNoStateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildNoState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ] - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ buildNoStateArg_, buildNoStateArg_0 ] - , serverRender = - \serverRenderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ) - , ( "action" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ) - , ( "head" - , Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ serverRenderArg_ ] - , preRender = - \preRenderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ) - , ( "pages" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "head" - , Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ preRenderArg_ ] - , single = - \singleArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "head" - , Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ singleArg_ ] - , addDeclarations = - \addDeclarationsArg_ addDeclarationsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "addDeclarations" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Elm" ] "Declaration" [] - ) - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ addDeclarationsArg_, addDeclarationsArg_0 ] - , moduleNameCliArg = - \moduleNameCliArgArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "moduleNameCliArg" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.string - , Type.var "builderState" - ] - ] - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.list Type.string - , Type.var "builderState" - ] - ) - ) - } - ) - [ moduleNameCliArgArg_ ] - } - - -values_ : - { buildWithLocalState : Elm.Expression - , buildWithSharedState : Elm.Expression - , buildNoState : Elm.Expression - , serverRender : Elm.Expression - , preRender : Elm.Expression - , single : Elm.Expression - , addDeclarations : Elm.Expression - , moduleNameCliArg : Elm.Expression - } -values_ = - { buildWithLocalState = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithLocalState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - , buildWithSharedState = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithSharedState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - , buildNoState = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildNoState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - , serverRender = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.namedWith [ "Elm" ] "Expression" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ) - , ( "action" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.namedWith [ "Elm" ] "Expression" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , preRender = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ) - , ( "pages" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , single = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , addDeclarations = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "addDeclarations" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Elm" ] "Declaration" []) - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , moduleNameCliArg = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "moduleNameCliArg" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.string - , Type.var "builderState" - ] - ] - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.list Type.string - , Type.var "builderState" - ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Server/Request.elm b/codegen/Gen/Server/Request.elm deleted file mode 100644 index cfe1569f..00000000 --- a/codegen/Gen/Server/Request.elm +++ /dev/null @@ -1,1502 +0,0 @@ -module Gen.Server.Request exposing - ( moduleName_, requestTime, header, headers, method, methodToString - , body, jsonBody, formData, formDataWithServerValidation, rawFormData, rawUrl, queryParam - , queryParams, matchesContentType, cookie, cookies, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for Server.Request - -@docs moduleName_, requestTime, header, headers, method, methodToString -@docs body, jsonBody, formData, formDataWithServerValidation, rawFormData, rawUrl -@docs queryParam, queryParams, matchesContentType, cookie, cookies, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "Request" ] - - -{-| Get the `Time.Posix` when the incoming HTTP request was received. - -requestTime: Server.Request.Request -> Time.Posix --} -requestTime : Elm.Expression -> Elm.Expression -requestTime requestTimeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "requestTime" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ requestTimeArg_ ] - - -{-| Get a header from the request. The header name is case-insensitive. - -Header: Accept-Language: en-US,en;q=0.5 - - request |> Request.header "Accept-Language" - -- Just "Accept-Language: en-US,en;q=0.5" - -header: String -> Server.Request.Request -> Maybe String --} -header : String -> Elm.Expression -> Elm.Expression -header headerArg_ headerArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string headerArg_, headerArg_0 ] - - -{-| headers: Server.Request.Request -> Dict.Dict String String -} -headers : Elm.Expression -> Elm.Expression -headers headersArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "headers" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ headersArg_ ] - - -{-| The [HTTP request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the incoming request. - -Note that Route modules `data` is run for `GET` requests, and `action` is run for other request methods (including `POST`, `PUT`, `DELETE`). -So you don't need to check the `method` in your Route Module's `data` function, though you can choose to do so in its `action`. - -method: Server.Request.Request -> Server.Request.Method --} -method : Elm.Expression -> Elm.Expression -method methodArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "method" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith [ "Server", "Request" ] "Method" []) - ) - } - ) - [ methodArg_ ] - - -{-| Gets the HTTP Method as an uppercase String. - -Examples: - - Get - |> methodToString - -- "GET" - -methodToString: Server.Request.Method -> String --} -methodToString : Elm.Expression -> Elm.Expression -methodToString methodToStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "methodToString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Method" [] ] - Type.string - ) - } - ) - [ methodToStringArg_ ] - - -{-| The Request body, if present (or `Nothing` if there is no request body). - -body: Server.Request.Request -> Maybe String --} -body : Elm.Expression -> Elm.Expression -body bodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ bodyArg_ ] - - -{-| If the request has a body and its `Content-Type` matches JSON, then -try running a JSON decoder on the body of the request. Otherwise, return `Nothing`. - -Example: - - Body: { "name": "John" } - Headers: - Content-Type: application/json - request |> jsonBody (Json.Decode.field "name" Json.Decode.string) - -- Just (Ok "John") - - Body: { "name": "John" } - No Headers - jsonBody (Json.Decode.field "name" Json.Decode.string) request - -- Nothing - - No Body - No Headers - jsonBody (Json.Decode.field "name" Json.Decode.string) request - -- Nothing - -jsonBody: - Json.Decode.Decoder value - -> Server.Request.Request - -> Maybe (Result.Result Json.Decode.Error value) --} -jsonBody : Elm.Expression -> Elm.Expression -> Elm.Expression -jsonBody jsonBodyArg_ jsonBodyArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - , Type.var "value" - ] - ) - ) - ) - } - ) - [ jsonBodyArg_, jsonBodyArg_0 ] - - -{-| Takes a [`Form.Handler.Handler`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form-Handler) and -parses the raw form data into a [`Form.Validated`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#Validated) value. - -This is the standard pattern for dealing with form data in `elm-pages`. You can share your code for your [`Form`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#Form) -definitions between your client and server code, using this function to parse the raw form data into a `Form.Validated` value for the backend, -and [`Pages.Form`](Pages-Form) to render the `Form` on the client. - -Since we are sharing the `Form` definition between frontend and backend, we get to re-use the same validation logic so we gain confidence that -the validation errors that the user sees on the client are protected on our backend, and vice versa. - - import BackendTask exposing (BackendTask) - import FatalError exposing (FatalError) - import Form - import Server.Request as Request exposing (Request) - import Server.Response as Response exposing (Response) - - type Action - = Delete - | CreateOrUpdate Post - - formHandlers : Form.Handler.Handler String Action - formHandlers = - deleteForm - |> Form.Handler.init (\() -> Delete) - |> Form.Handler.with CreateOrUpdate createOrUpdateForm - - deleteForm : Form.HtmlForm String () input msg - - createOrUpdateForm : Form.HtmlForm String Post Post msg - - action : - RouteParams - -> Request - -> BackendTask FatalError (Response ActionData ErrorPage) - action routeParams request = - case request |> Server.Request.formData formHandlers of - Nothing -> - BackendTask.fail (FatalError.fromString "Missing form data") - - Just ( formResponse, parsedForm ) -> - case parsedForm of - Form.Valid Delete -> - deletePostBySlug routeParams.slug - |> BackendTask.map - (\() -> Route.redirectTo Route.Index) - - Form.Valid (CreateOrUpdate post) -> - let - createPost : Bool - createPost = - okForm.slug == "new" - in - createOrUpdatePost post - |> BackendTask.map - (\() -> - Route.redirectTo - (Route.Admin__Slug_ { slug = okForm.slug }) - ) - - Form.Invalid _ invalidForm -> - BackendTask.succeed - (Server.Response.render - { errors = formResponse } - ) - -You can handle form submissions as either GET or POST requests. Note that for security reasons, it's important to performing mutations with care from GET requests, -since a GET request can be performed from an outside origin by embedding an image that points to the given URL. So a logout submission should be protected by -using `POST` to ensure that you can't log users out by embedding an image with a logout URL in it. - -If the request has HTTP method `GET`, the form data will come from the query parameters. - -If the request has the HTTP method `POST` _and_ the `Content-Type` is `application/x-www-form-urlencoded`, it will return the -decoded form data from the body of the request. - -Otherwise, this `Parser` will not match. - -Note that in server-rendered Route modules, your `data` function will handle `GET` requests (and will _not_ receive any `POST` requests), -while your `action` will receive POST (and other non-GET) requests. - -By default, [`Form`]'s are rendered with a `POST` method, and you can configure them to submit `GET` requests using [`withGetMethod`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#withGetMethod). -So you will want to handle any `Form`'s rendered using `withGetMethod` in your Route's `data` function, or otherwise handle forms in `action`. - -formData: - Form.Handler.Handler error combined - -> Server.Request.Request - -> Maybe ( Form.ServerResponse error, Form.Validated error combined ) --} -formData : Elm.Expression -> Elm.Expression -> Elm.Expression -formData formDataArg_ formDataArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.namedWith - [ "Form" ] - "Validated" - [ Type.var "error" - , Type.var "combined" - ] - ) - ) - ) - ) - } - ) - [ formDataArg_, formDataArg_0 ] - - -{-| formDataWithServerValidation: - Pages.Form.Handler error combined - -> Server.Request.Request - -> Maybe (BackendTask.BackendTask FatalError.FatalError (Result.Result (Form.ServerResponse error) ( Form.ServerResponse error, combined ))) --} -formDataWithServerValidation : - Elm.Expression -> Elm.Expression -> Elm.Expression -formDataWithServerValidation formDataWithServerValidationArg_ formDataWithServerValidationArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formDataWithServerValidation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - , Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.var "combined") - ] - ] - ) - ) - ) - } - ) - [ formDataWithServerValidationArg_, formDataWithServerValidationArg_0 ] - - -{-| Get the raw key-value pairs from a form submission. - -If the request has the HTTP method `GET`, it will return the query parameters. - -If the request has the HTTP method `POST` _and_ the `Content-Type` is `application/x-www-form-urlencoded`, it will return the -decoded form data from the body of the request. - -Otherwise, this `Parser` will not match. - -Note that in server-rendered Route modules, your `data` function will handle `GET` requests (and will _not_ receive any `POST` requests), -while your `action` will receive POST (and other non-GET) requests. - -By default, [`Form`]'s are rendered with a `POST` method, and you can configure them to submit `GET` requests using [`withGetMethod`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#withGetMethod). -So you will want to handle any `Form`'s rendered using `withGetMethod` in your Route's `data` function, or otherwise handle forms in `action`. - -rawFormData: Server.Request.Request -> Maybe (List ( String, String )) --} -rawFormData : Elm.Expression -> Elm.Expression -rawFormData rawFormDataArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawFormData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.list (Type.tuple Type.string Type.string)) - ) - ) - } - ) - [ rawFormDataArg_ ] - - -{-| The full URL of the incoming HTTP request, including the query params. - -Note that the fragment is not included because this is client-only (not sent to the server). - - rawUrl request - - -- url: http://example.com?coupon=abc - -- parses into: "http://example.com?coupon=abc" - - rawUrl request - - -- url: https://example.com?coupon=abc&coupon=xyz - -- parses into: "https://example.com?coupon=abc&coupon=xyz" - -rawUrl: Server.Request.Request -> String --} -rawUrl : Elm.Expression -> Elm.Expression -rawUrl rawUrlArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - Type.string - ) - } - ) - [ rawUrlArg_ ] - - -{-| Get `Nothing` if the query param with the given name is missing, or `Just` the value if it is present. - -If there are multiple query params with the same name, the first one is returned. - - queryParam "coupon" - - -- url: http://example.com?coupon=abc - -- parses into: Just "abc" - - queryParam "coupon" - - -- url: http://example.com?coupon=abc&coupon=xyz - -- parses into: Just "abc" - - queryParam "coupon" - - -- url: http://example.com - -- parses into: Nothing - -See also [`queryParams`](#queryParams), or [`rawUrl`](#rawUrl) if you need something more low-level. - -queryParam: String -> Server.Request.Request -> Maybe String --} -queryParam : String -> Elm.Expression -> Elm.Expression -queryParam queryParamArg_ queryParamArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParam" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string queryParamArg_, queryParamArg_0 ] - - -{-| Gives all query params from the URL. - - queryParam "coupon" - - -- url: http://example.com?coupon=abc - -- parses into: Dict.fromList [("coupon", ["abc"])] - - queryParam "coupon" - - -- url: http://example.com?coupon=abc&coupon=xyz - -- parses into: Dict.fromList [("coupon", ["abc", "xyz"])] - -queryParams: Server.Request.Request -> Dict.Dict String (List String) --} -queryParams : Elm.Expression -> Elm.Expression -queryParams queryParamsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParams" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ queryParamsArg_ ] - - -{-| True if the `content-type` header is present AND matches the given argument. - -Examples: - - Content-Type: application/json; charset=utf-8 - request |> matchesContentType "application/json" - -- True - - Content-Type: application/json - request |> matchesContentType "application/json" - -- True - - Content-Type: application/json - request |> matchesContentType "application/xml" - -- False - -matchesContentType: String -> Server.Request.Request -> Bool --} -matchesContentType : String -> Elm.Expression -> Elm.Expression -matchesContentType matchesContentTypeArg_ matchesContentTypeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "matchesContentType" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - Type.bool - ) - } - ) - [ Elm.string matchesContentTypeArg_, matchesContentTypeArg_0 ] - - -{-| Get a cookie from the request. For a more high-level API, see [`Server.Session`](Server-Session). - -cookie: String -> Server.Request.Request -> Maybe String --} -cookie : String -> Elm.Expression -> Elm.Expression -cookie cookieArg_ cookieArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string cookieArg_, cookieArg_0 ] - - -{-| Get all of the cookies from the incoming HTTP request. For a more high-level API, see [`Server.Session`](Server-Session). - -cookies: Server.Request.Request -> Dict.Dict String String --} -cookies : Elm.Expression -> Elm.Expression -cookies cookiesArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookies" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ cookiesArg_ ] - - -annotation_ : { request : Type.Annotation, method : Type.Annotation } -annotation_ = - { request = - Type.alias - moduleName_ - "Request" - [] - (Type.namedWith [ "Internal", "Request" ] "Request" []) - , method = Type.namedWith [ "Server", "Request" ] "Method" [] - } - - -make_ : - { connect : Elm.Expression - , delete : Elm.Expression - , get : Elm.Expression - , head : Elm.Expression - , options : Elm.Expression - , patch : Elm.Expression - , post : Elm.Expression - , put : Elm.Expression - , trace : Elm.Expression - , nonStandard : Elm.Expression -> Elm.Expression - } -make_ = - { connect = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Connect" - , annotation = Just (Type.namedWith [] "Method" []) - } - , delete = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Delete" - , annotation = Just (Type.namedWith [] "Method" []) - } - , get = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Get" - , annotation = Just (Type.namedWith [] "Method" []) - } - , head = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Head" - , annotation = Just (Type.namedWith [] "Method" []) - } - , options = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Options" - , annotation = Just (Type.namedWith [] "Method" []) - } - , patch = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Patch" - , annotation = Just (Type.namedWith [] "Method" []) - } - , post = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Post" - , annotation = Just (Type.namedWith [] "Method" []) - } - , put = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Put" - , annotation = Just (Type.namedWith [] "Method" []) - } - , trace = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Trace" - , annotation = Just (Type.namedWith [] "Method" []) - } - , nonStandard = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "NonStandard" - , annotation = Just (Type.namedWith [] "Method" []) - } - ) - [ ar0 ] - } - - -caseOf_ : - { method : - Elm.Expression - -> { connect : Elm.Expression - , delete : Elm.Expression - , get : Elm.Expression - , head : Elm.Expression - , options : Elm.Expression - , patch : Elm.Expression - , post : Elm.Expression - , put : Elm.Expression - , trace : Elm.Expression - , nonStandard : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { method = - \methodExpression methodTags -> - Elm.Case.custom - methodExpression - (Type.namedWith [ "Server", "Request" ] "Method" []) - [ Elm.Case.branch - (Elm.Arg.customType "Connect" methodTags.connect) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Delete" methodTags.delete) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Get" methodTags.get) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Head" methodTags.head) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Options" methodTags.options) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Patch" methodTags.patch) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Post" methodTags.post) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Put" methodTags.put) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Trace" methodTags.trace) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NonStandard" - methodTags.nonStandard |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - ] - } - - -call_ : - { requestTime : Elm.Expression -> Elm.Expression - , header : Elm.Expression -> Elm.Expression -> Elm.Expression - , headers : Elm.Expression -> Elm.Expression - , method : Elm.Expression -> Elm.Expression - , methodToString : Elm.Expression -> Elm.Expression - , body : Elm.Expression -> Elm.Expression - , jsonBody : Elm.Expression -> Elm.Expression -> Elm.Expression - , formData : Elm.Expression -> Elm.Expression -> Elm.Expression - , formDataWithServerValidation : - Elm.Expression -> Elm.Expression -> Elm.Expression - , rawFormData : Elm.Expression -> Elm.Expression - , rawUrl : Elm.Expression -> Elm.Expression - , queryParam : Elm.Expression -> Elm.Expression -> Elm.Expression - , queryParams : Elm.Expression -> Elm.Expression - , matchesContentType : Elm.Expression -> Elm.Expression -> Elm.Expression - , cookie : Elm.Expression -> Elm.Expression -> Elm.Expression - , cookies : Elm.Expression -> Elm.Expression - } -call_ = - { requestTime = - \requestTimeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "requestTime" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ requestTimeArg_ ] - , header = - \headerArg_ headerArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ headerArg_, headerArg_0 ] - , headers = - \headersArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "headers" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ headersArg_ ] - , method = - \methodArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "method" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Server", "Request" ] - "Method" - [] - ) - ) - } - ) - [ methodArg_ ] - , methodToString = - \methodToStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "methodToString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Method" - [] - ] - Type.string - ) - } - ) - [ methodToStringArg_ ] - , body = - \bodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ bodyArg_ ] - , jsonBody = - \jsonBodyArg_ jsonBodyArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - , Type.var "value" - ] - ) - ) - ) - } - ) - [ jsonBodyArg_, jsonBodyArg_0 ] - , formData = - \formDataArg_ formDataArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.namedWith - [ "Form" ] - "Validated" - [ Type.var "error" - , Type.var "combined" - ] - ) - ) - ) - ) - } - ) - [ formDataArg_, formDataArg_0 ] - , formDataWithServerValidation = - \formDataWithServerValidationArg_ formDataWithServerValidationArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formDataWithServerValidation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - , Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.var "combined") - ] - ] - ) - ) - ) - } - ) - [ formDataWithServerValidationArg_ - , formDataWithServerValidationArg_0 - ] - , rawFormData = - \rawFormDataArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawFormData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.list - (Type.tuple Type.string Type.string) - ) - ) - ) - } - ) - [ rawFormDataArg_ ] - , rawUrl = - \rawUrlArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawUrl" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - Type.string - ) - } - ) - [ rawUrlArg_ ] - , queryParam = - \queryParamArg_ queryParamArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParam" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ queryParamArg_, queryParamArg_0 ] - , queryParams = - \queryParamsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ queryParamsArg_ ] - , matchesContentType = - \matchesContentTypeArg_ matchesContentTypeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "matchesContentType" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - Type.bool - ) - } - ) - [ matchesContentTypeArg_, matchesContentTypeArg_0 ] - , cookie = - \cookieArg_ cookieArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ cookieArg_, cookieArg_0 ] - , cookies = - \cookiesArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookies" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ cookiesArg_ ] - } - - -values_ : - { requestTime : Elm.Expression - , header : Elm.Expression - , headers : Elm.Expression - , method : Elm.Expression - , methodToString : Elm.Expression - , body : Elm.Expression - , jsonBody : Elm.Expression - , formData : Elm.Expression - , formDataWithServerValidation : Elm.Expression - , rawFormData : Elm.Expression - , rawUrl : Elm.Expression - , queryParam : Elm.Expression - , queryParams : Elm.Expression - , matchesContentType : Elm.Expression - , cookie : Elm.Expression - , cookies : Elm.Expression - } -values_ = - { requestTime = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "requestTime" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , header = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - , headers = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "headers" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - , method = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "method" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith [ "Server", "Request" ] "Method" []) - ) - } - , methodToString = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "methodToString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Method" [] ] - Type.string - ) - } - , body = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.maybe Type.string) - ) - } - , jsonBody = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - , Type.var "value" - ] - ) - ) - ) - } - , formData = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.namedWith - [ "Form" ] - "Validated" - [ Type.var "error" - , Type.var "combined" - ] - ) - ) - ) - ) - } - , formDataWithServerValidation = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formDataWithServerValidation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - , Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.var "combined") - ] - ] - ) - ) - ) - } - , rawFormData = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawFormData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.maybe - (Type.list (Type.tuple Type.string Type.string)) - ) - ) - } - , rawUrl = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - Type.string - ) - } - , queryParam = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParam" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - , queryParams = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParams" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - , matchesContentType = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "matchesContentType" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - Type.bool - ) - } - , cookie = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - , cookies = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookies" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Server/Response.elm b/codegen/Gen/Server/Response.elm deleted file mode 100644 index 489fcee5..00000000 --- a/codegen/Gen/Server/Response.elm +++ /dev/null @@ -1,1275 +0,0 @@ -module Gen.Server.Response exposing - ( moduleName_, render, map, errorPage, mapError, temporaryRedirect - , permanentRedirect, json, plainText, emptyBody, body, bytesBody, base64Body - , withHeader, withHeaders, withStatusCode, withSetCookieHeader, toJson, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Server.Response - -@docs moduleName_, render, map, errorPage, mapError, temporaryRedirect -@docs permanentRedirect, json, plainText, emptyBody, body, bytesBody -@docs base64Body, withHeader, withHeaders, withStatusCode, withSetCookieHeader, toJson -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "Response" ] - - -{-| Render the Route Module with the supplied data. Used for both the `data` and `action` functions in a server-rendered Route Module. - - Response.render project - -render: data -> Server.Response.Response data error --} -render : Elm.Expression -> Elm.Expression -render renderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "render" - , annotation = - Just - (Type.function - [ Type.var "data" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ renderArg_ ] - - -{-| Maps the `data` for a Render response. Usually not needed, but always good to have the option. - -map: - (data -> mappedData) - -> Server.Response.Response data error - -> Server.Response.Response mappedData error --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "data" ] - (Type.var "mappedData") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "mappedData", Type.var "error" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Instead of rendering the current Route Module, you can render an `ErrorPage` such as a 404 page or a 500 error page. - -[Read more about Error Pages](https://elm-pages.com/docs/error-pages) to learn about -defining and rendering your custom ErrorPage type. - -errorPage: errorPage -> Server.Response.Response data errorPage --} -errorPage : Elm.Expression -> Elm.Expression -errorPage errorPageArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "errorPage" - , annotation = - Just - (Type.function - [ Type.var "errorPage" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ) - ) - } - ) - [ errorPageArg_ ] - - -{-| Maps the `error` for an ErrorPage response. Usually not needed, but always good to have the option. - -mapError: - (errorPage -> mappedErrorPage) - -> Server.Response.Response data errorPage - -> Server.Response.Response data mappedErrorPage --} -mapError : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -mapError mapErrorArg_ mapErrorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "mapError" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "errorPage" ] - (Type.var "mappedErrorPage") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "mappedErrorPage" ] - ) - ) - } - ) - [ Elm.functionReduced "mapErrorUnpack" mapErrorArg_, mapErrorArg_0 ] - - -{-| temporaryRedirect: String -> Server.Response.Response data error -} -temporaryRedirect : String -> Elm.Expression -temporaryRedirect temporaryRedirectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "temporaryRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string temporaryRedirectArg_ ] - - -{-| Build a 308 permanent redirect response. - -Permanent redirects tell the browser that a resource has permanently moved. If you redirect because a user is not logged in, -then you **do not** want to use a permanent redirect because the page they are looking for hasn't changed, you are just -temporarily pointing them to a new page since they need to authenticate. - -Permanent redirects are aggressively cached so be careful not to use them when you mean to use temporary redirects instead. - -If you need to specifically rely on a 301 permanent redirect (see on the difference between 301 and 308), -use `customResponse` instead. - -permanentRedirect: String -> Server.Response.Response data error --} -permanentRedirect : String -> Elm.Expression -permanentRedirect permanentRedirectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "permanentRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string permanentRedirectArg_ ] - - -{-| Build a JSON body from a `Json.Encode.Value`. - - Json.Encode.object - [ ( "message", Json.Encode.string "Hello" ) ] - |> Response.json - -Sets the `Content-Type` to `application/json`. - -json: Json.Encode.Value -> Server.Response.Response data error --} -json : Elm.Expression -> Elm.Expression -json jsonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "json" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ jsonArg_ ] - - -{-| Build a `Response` with a String body. Sets the `Content-Type` to `text/plain`. - - Response.plainText "Hello" - -plainText: String -> Server.Response.Response data error --} -plainText : String -> Elm.Expression -plainText plainTextArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "plainText" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string plainTextArg_ ] - - -{-| Build a `Response` with no HTTP response body. - -emptyBody: Server.Response.Response data error --} -emptyBody : Elm.Expression -emptyBody = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "emptyBody" - , annotation = - Just - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - } - - -{-| Same as [`plainText`](#plainText), but doesn't set a `Content-Type`. - -body: String -> Server.Response.Response data error --} -body : String -> Elm.Expression -body bodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string bodyArg_ ] - - -{-| Build a `Response` with a `Bytes`. - -Under the hood, it will be converted to a base64 encoded String with `isBase64Encoded = True`. -Your adapter will need to handle `isBase64Encoded` to turn it into the appropriate response. - -bytesBody: Bytes.Bytes -> Server.Response.Response data error --} -bytesBody : Elm.Expression -> Elm.Expression -bytesBody bytesBodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ bytesBodyArg_ ] - - -{-| Build a `Response` with a String that should represent a base64 encoded value. - -Your adapter will need to handle `isBase64Encoded` to turn it into the appropriate response. - - Response.base64Body "SGVsbG8gV29ybGQ=" - -base64Body: String -> Server.Response.Response data error --} -base64Body : String -> Elm.Expression -base64Body base64BodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "base64Body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string base64BodyArg_ ] - - -{-| Add a header to the response. - - Response.plainText "Hello!" - -- allow CORS requests - |> Response.withHeader "Access-Control-Allow-Origin" "*" - |> Response.withHeader "Access-Control-Allow-Methods" "GET, POST, OPTIONS" - -withHeader: - String - -> String - -> Server.Response.Response data error - -> Server.Response.Response data error --} -withHeader : String -> String -> Elm.Expression -> Elm.Expression -withHeader withHeaderArg_ withHeaderArg_0 withHeaderArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeader" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string withHeaderArg_ - , Elm.string withHeaderArg_0 - , withHeaderArg_1 - ] - - -{-| Same as [`withHeader`](#withHeader), but allows you to add multiple headers at once. - - Response.plainText "Hello!" - -- allow CORS requests - |> Response.withHeaders - [ ( "Access-Control-Allow-Origin", "*" ) - , ( "Access-Control-Allow-Methods", "GET, POST, OPTIONS" ) - ] - -withHeaders: - List ( String, String ) - -> Server.Response.Response data error - -> Server.Response.Response data error --} -withHeaders : List Elm.Expression -> Elm.Expression -> Elm.Expression -withHeaders withHeadersArg_ withHeadersArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeaders" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.string Type.string) - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.list withHeadersArg_, withHeadersArg_0 ] - - -{-| Set the [HTTP Response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for the `Response`. - - Response.plainText "Not Authorized" - |> Response.withStatusCode 401 - -withStatusCode: - Int - -> Server.Response.Response data Basics.Never - -> Server.Response.Response data Basics.Never --} -withStatusCode : Int -> Elm.Expression -> Elm.Expression -withStatusCode withStatusCodeArg_ withStatusCodeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withStatusCode" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - ) - } - ) - [ Elm.int withStatusCodeArg_, withStatusCodeArg_0 ] - - -{-| Set a [`Server.SetCookie`](Server-SetCookie) value on the response. - -The easiest way to manage cookies in your Routes is through the [`Server.Session`](Server-Session) API, but this -provides a more granular way to set cookies. - -withSetCookieHeader: - Server.SetCookie.SetCookie - -> Server.Response.Response data error - -> Server.Response.Response data error --} -withSetCookieHeader : Elm.Expression -> Elm.Expression -> Elm.Expression -withSetCookieHeader withSetCookieHeaderArg_ withSetCookieHeaderArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withSetCookieHeader" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withSetCookieHeaderArg_, withSetCookieHeaderArg_0 ] - - -{-| For internal use or more advanced use cases for meta frameworks. - -toJson: Server.Response.Response Basics.Never Basics.Never -> Json.Encode.Value --} -toJson : Elm.Expression -> Elm.Expression -toJson toJsonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ toJsonArg_ ] - - -annotation_ : - { response : Type.Annotation -> Type.Annotation -> Type.Annotation } -annotation_ = - { response = - \responseArg0 responseArg1 -> - Type.alias - moduleName_ - "Response" - [ responseArg0, responseArg1 ] - (Type.namedWith - [ "PageServerResponse" ] - "PageServerResponse" - [ Type.var "data", Type.var "error" ] - ) - } - - -call_ : - { render : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , errorPage : Elm.Expression -> Elm.Expression - , mapError : Elm.Expression -> Elm.Expression -> Elm.Expression - , temporaryRedirect : Elm.Expression -> Elm.Expression - , permanentRedirect : Elm.Expression -> Elm.Expression - , json : Elm.Expression -> Elm.Expression - , plainText : Elm.Expression -> Elm.Expression - , body : Elm.Expression -> Elm.Expression - , bytesBody : Elm.Expression -> Elm.Expression - , base64Body : Elm.Expression -> Elm.Expression - , withHeader : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withHeaders : Elm.Expression -> Elm.Expression -> Elm.Expression - , withStatusCode : Elm.Expression -> Elm.Expression -> Elm.Expression - , withSetCookieHeader : Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : Elm.Expression -> Elm.Expression - } -call_ = - { render = - \renderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "render" - , annotation = - Just - (Type.function - [ Type.var "data" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ renderArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "data" ] - (Type.var "mappedData") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "mappedData" - , Type.var "error" - ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , errorPage = - \errorPageArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "errorPage" - , annotation = - Just - (Type.function - [ Type.var "errorPage" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ) - ) - } - ) - [ errorPageArg_ ] - , mapError = - \mapErrorArg_ mapErrorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "mapError" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "errorPage" ] - (Type.var "mappedErrorPage") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "mappedErrorPage" - ] - ) - ) - } - ) - [ mapErrorArg_, mapErrorArg_0 ] - , temporaryRedirect = - \temporaryRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "temporaryRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ temporaryRedirectArg_ ] - , permanentRedirect = - \permanentRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "permanentRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ permanentRedirectArg_ ] - , json = - \jsonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "json" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ jsonArg_ ] - , plainText = - \plainTextArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "plainText" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ plainTextArg_ ] - , body = - \bodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ bodyArg_ ] - , bytesBody = - \bytesBodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ bytesBodyArg_ ] - , base64Body = - \base64BodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "base64Body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ base64BodyArg_ ] - , withHeader = - \withHeaderArg_ withHeaderArg_0 withHeaderArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeader" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withHeaderArg_, withHeaderArg_0, withHeaderArg_1 ] - , withHeaders = - \withHeadersArg_ withHeadersArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeaders" - , annotation = - Just - (Type.function - [ Type.list - (Type.tuple Type.string Type.string) - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withHeadersArg_, withHeadersArg_0 ] - , withStatusCode = - \withStatusCodeArg_ withStatusCodeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withStatusCode" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - ) - } - ) - [ withStatusCodeArg_, withStatusCodeArg_0 ] - , withSetCookieHeader = - \withSetCookieHeaderArg_ withSetCookieHeaderArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withSetCookieHeader" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withSetCookieHeaderArg_, withSetCookieHeaderArg_0 ] - , toJson = - \toJsonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_ ] - } - - -values_ : - { render : Elm.Expression - , map : Elm.Expression - , errorPage : Elm.Expression - , mapError : Elm.Expression - , temporaryRedirect : Elm.Expression - , permanentRedirect : Elm.Expression - , json : Elm.Expression - , plainText : Elm.Expression - , emptyBody : Elm.Expression - , body : Elm.Expression - , bytesBody : Elm.Expression - , base64Body : Elm.Expression - , withHeader : Elm.Expression - , withHeaders : Elm.Expression - , withStatusCode : Elm.Expression - , withSetCookieHeader : Elm.Expression - , toJson : Elm.Expression - } -values_ = - { render = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "render" - , annotation = - Just - (Type.function - [ Type.var "data" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "data" ] - (Type.var "mappedData") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "mappedData", Type.var "error" ] - ) - ) - } - , errorPage = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "errorPage" - , annotation = - Just - (Type.function - [ Type.var "errorPage" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ) - ) - } - , mapError = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "mapError" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "errorPage" ] - (Type.var "mappedErrorPage") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "mappedErrorPage" ] - ) - ) - } - , temporaryRedirect = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "temporaryRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , permanentRedirect = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "permanentRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , json = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "json" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , plainText = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "plainText" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , emptyBody = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "emptyBody" - , annotation = - Just - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - } - , body = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , bytesBody = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , base64Body = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "base64Body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , withHeader = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeader" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , withHeaders = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeaders" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.string Type.string) - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , withStatusCode = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withStatusCode" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - ) - } - , withSetCookieHeader = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withSetCookieHeader" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , toJson = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Server/Session.elm b/codegen/Gen/Server/Session.elm deleted file mode 100644 index b9aa0911..00000000 --- a/codegen/Gen/Server/Session.elm +++ /dev/null @@ -1,974 +0,0 @@ -module Gen.Server.Session exposing - ( moduleName_, withSession, withSessionResult, empty, get, insert - , remove, update, withFlash, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Server.Session - -@docs moduleName_, withSession, withSessionResult, empty, get, insert -@docs remove, update, withFlash, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "Session" ] - - -{-| The main function for using sessions. If you need more fine-grained control over cases where a session can't be loaded, see -[`withSessionResult`](#withSessionResult). - -withSession: - { name : String - , secrets : BackendTask.BackendTask error (List String) - , options : Maybe Server.SetCookie.Options - } - -> (Server.Session.Session - -> BackendTask.BackendTask error ( Server.Session.Session, Server.Response.Response data errorPage )) - -> Server.Request.Request - -> BackendTask.BackendTask error (Server.Response.Response data errorPage) --} -withSession : - { name : String, secrets : Elm.Expression, options : Elm.Expression } - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withSession withSessionArg_ withSessionArg_0 withSessionArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSession" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "name" (Elm.string withSessionArg_.name) - , Tuple.pair "secrets" withSessionArg_.secrets - , Tuple.pair "options" withSessionArg_.options - ] - , Elm.functionReduced "withSessionUnpack" withSessionArg_0 - , withSessionArg_1 - ] - - -{-| Same as `withSession`, but gives you an `Err` with the reason why the Session couldn't be loaded instead of -using `Session.empty` as a default in the cases where there is an error loading the session. - -A session won't load if there is no session, or if it cannot be unsigned with your secrets. This could be because the cookie was tampered with -or otherwise corrupted, or because the cookie was signed with a secret that is no longer in the rotation. - -withSessionResult: - { name : String - , secrets : BackendTask.BackendTask error (List String) - , options : Maybe Server.SetCookie.Options - } - -> (Result.Result Server.Session.NotLoadedReason Server.Session.Session - -> BackendTask.BackendTask error ( Server.Session.Session, Server.Response.Response data errorPage )) - -> Server.Request.Request - -> BackendTask.BackendTask error (Server.Response.Response data errorPage) --} -withSessionResult : - { name : String, secrets : Elm.Expression, options : Elm.Expression } - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withSessionResult withSessionResultArg_ withSessionResultArg_0 withSessionResultArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSessionResult" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Server", "Session" ] - "NotLoadedReason" - [] - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "name" (Elm.string withSessionResultArg_.name) - , Tuple.pair "secrets" withSessionResultArg_.secrets - , Tuple.pair "options" withSessionResultArg_.options - ] - , Elm.functionReduced "withSessionResultUnpack" withSessionResultArg_0 - , withSessionResultArg_1 - ] - - -{-| An empty `Session` with no key-value pairs. - -empty: Server.Session.Session --} -empty : Elm.Expression -empty = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Server", "Session" ] "Session" []) - } - - -{-| Retrieve a String value from the session for the given key (or `Nothing` if the key is not present). - - (session - |> Session.get "mode" - |> Maybe.withDefault "light" - ) - == "dark" - -get: String -> Server.Session.Session -> Maybe String --} -get : String -> Elm.Expression -> Elm.Expression -get getArg_ getArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string getArg_, getArg_0 ] - - -{-| Insert a value under the given key in the `Session`. - - session - |> Session.insert "mode" "dark" - -insert: String -> String -> Server.Session.Session -> Server.Session.Session --} -insert : String -> String -> Elm.Expression -> Elm.Expression -insert insertArg_ insertArg_0 insertArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string insertArg_, Elm.string insertArg_0, insertArg_1 ] - - -{-| Remove a key from the `Session`. - -remove: String -> Server.Session.Session -> Server.Session.Session --} -remove : String -> Elm.Expression -> Elm.Expression -remove removeArg_ removeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string removeArg_, removeArg_0 ] - - -{-| Update the `Session`, given a `Maybe String` of the current value for the given key, and returning a `Maybe String`. - -If you return `Nothing`, the key-value pair will be removed from the `Session` (or left out if it didn't exist in the first place). - - session - |> Session.update "mode" - (\mode -> - case mode of - Just "dark" -> - Just "light" - - Just "light" -> - Just "dark" - - Nothing -> - Just "dark" - ) - -update: - String - -> (Maybe String -> Maybe String) - -> Server.Session.Session - -> Server.Session.Session --} -update : - String - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -update updateArg_ updateArg_0 updateArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.maybe Type.string ] - (Type.maybe Type.string) - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string updateArg_ - , Elm.functionReduced "updateUnpack" updateArg_0 - , updateArg_1 - ] - - -{-| Flash session values are values that are only available for the next request. - - session - |> Session.withFlash "message" "Your payment was successful!" - -withFlash: String -> String -> Server.Session.Session -> Server.Session.Session --} -withFlash : String -> String -> Elm.Expression -> Elm.Expression -withFlash withFlashArg_ withFlashArg_0 withFlashArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withFlash" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string withFlashArg_, Elm.string withFlashArg_0, withFlashArg_1 ] - - -annotation_ : { notLoadedReason : Type.Annotation, session : Type.Annotation } -annotation_ = - { notLoadedReason = - Type.namedWith [ "Server", "Session" ] "NotLoadedReason" [] - , session = Type.namedWith [ "Server", "Session" ] "Session" [] - } - - -make_ : - { noSessionCookie : Elm.Expression, invalidSessionCookie : Elm.Expression } -make_ = - { noSessionCookie = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "NoSessionCookie" - , annotation = Just (Type.namedWith [] "NotLoadedReason" []) - } - , invalidSessionCookie = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "InvalidSessionCookie" - , annotation = Just (Type.namedWith [] "NotLoadedReason" []) - } - } - - -caseOf_ : - { notLoadedReason : - Elm.Expression - -> { noSessionCookie : Elm.Expression - , invalidSessionCookie : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { notLoadedReason = - \notLoadedReasonExpression notLoadedReasonTags -> - Elm.Case.custom - notLoadedReasonExpression - (Type.namedWith [ "Server", "Session" ] "NotLoadedReason" []) - [ Elm.Case.branch - (Elm.Arg.customType - "NoSessionCookie" - notLoadedReasonTags.noSessionCookie - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "InvalidSessionCookie" - notLoadedReasonTags.invalidSessionCookie - ) - Basics.identity - ] - } - - -call_ : - { withSession : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withSessionResult : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , get : Elm.Expression -> Elm.Expression -> Elm.Expression - , insert : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , remove : Elm.Expression -> Elm.Expression -> Elm.Expression - , update : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withFlash : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { withSession = - \withSessionArg_ withSessionArg_0 withSessionArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSession" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list Type.string - ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ withSessionArg_, withSessionArg_0, withSessionArg_1 ] - , withSessionResult = - \withSessionResultArg_ withSessionResultArg_0 withSessionResultArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSessionResult" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list Type.string - ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Server", "Session" ] - "NotLoadedReason" - [] - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ withSessionResultArg_ - , withSessionResultArg_0 - , withSessionResultArg_1 - ] - , get = - \getArg_ getArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ getArg_, getArg_0 ] - , insert = - \insertArg_ insertArg_0 insertArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ insertArg_, insertArg_0, insertArg_1 ] - , remove = - \removeArg_ removeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ removeArg_, removeArg_0 ] - , update = - \updateArg_ updateArg_0 updateArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.maybe Type.string ] - (Type.maybe Type.string) - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ updateArg_, updateArg_0, updateArg_1 ] - , withFlash = - \withFlashArg_ withFlashArg_0 withFlashArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withFlash" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ withFlashArg_, withFlashArg_0, withFlashArg_1 ] - } - - -values_ : - { withSession : Elm.Expression - , withSessionResult : Elm.Expression - , empty : Elm.Expression - , get : Elm.Expression - , insert : Elm.Expression - , remove : Elm.Expression - , update : Elm.Expression - , withFlash : Elm.Expression - } -values_ = - { withSession = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSession" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - , withSessionResult = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSessionResult" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Server", "Session" ] - "NotLoadedReason" - [] - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - , empty = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Server", "Session" ] "Session" []) - } - , get = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.maybe Type.string) - ) - } - , insert = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - , remove = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - , update = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.maybe Type.string ] - (Type.maybe Type.string) - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - , withFlash = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withFlash" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Server/SetCookie.elm b/codegen/Gen/Server/SetCookie.elm deleted file mode 100644 index 18f0fe6d..00000000 --- a/codegen/Gen/Server/SetCookie.elm +++ /dev/null @@ -1,985 +0,0 @@ -module Gen.Server.SetCookie exposing - ( moduleName_, setCookie, options, withSameSite, withImmediateExpiration, makeVisibleToJavaScript - , nonSecure, withDomain, withExpiration, withMaxAge, withPath, withoutPath, toString - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Server.SetCookie - -@docs moduleName_, setCookie, options, withSameSite, withImmediateExpiration, makeVisibleToJavaScript -@docs nonSecure, withDomain, withExpiration, withMaxAge, withPath, withoutPath -@docs toString, annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "SetCookie" ] - - -{-| Create a `SetCookie` record with the given name, value, and [`Options`](Options]. To add a `Set-Cookie` header, you can -pass this value with [`Server.Response.withSetCookieHeader`](Server-Response#withSetCookieHeader). Or for more low-level -uses you can stringify the value manually with [`toString`](#toString). - -setCookie: String -> String -> Server.SetCookie.Options -> Server.SetCookie.SetCookie --} -setCookie : String -> String -> Elm.Expression -> Elm.Expression -setCookie setCookieArg_ setCookieArg_0 setCookieArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "setCookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ) - ) - } - ) - [ Elm.string setCookieArg_, Elm.string setCookieArg_0, setCookieArg_1 ] - - -{-| Initialize the default `SetCookie` `Options`. Can be configured directly through a record update, or with `withExpiration`, etc. - -options: Server.SetCookie.Options --} -options : Elm.Expression -options = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "options" - , annotation = - Just (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - } - - -{-| The default SameSite policy is Lax if one is not explicitly set. See the SameSite section in . - -withSameSite: - Server.SetCookie.SameSite - -> Server.SetCookie.Options - -> Server.SetCookie.Options --} -withSameSite : Elm.Expression -> Elm.Expression -> Elm.Expression -withSameSite withSameSiteArg_ withSameSiteArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withSameSite" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withSameSiteArg_, withSameSiteArg_0 ] - - -{-| Sets [`Expires`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#expiresdate) to `Time.millisToPosix 0`, -which effectively tells the browser to delete the cookie immediately (by giving it an expiration date in the past). - -withImmediateExpiration: Server.SetCookie.Options -> Server.SetCookie.Options --} -withImmediateExpiration : Elm.Expression -> Elm.Expression -withImmediateExpiration withImmediateExpirationArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withImmediateExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withImmediateExpirationArg_ ] - - -{-| The default option in this API is for HttpOnly cookies . - -Cookies can be exposed so you can read them from JavaScript using `Document.cookie`. When this is intended and understood -then there's nothing unsafe about that (for example, if you are setting a `darkMode` cookie and what to access that -dynamically). In this API you opt into exposing a cookie you set to JavaScript to ensure cookies aren't exposed to JS unintentionally. - -In general if you can accomplish your goal using HttpOnly cookies (i.e. not using `makeVisibleToJavaScript`) then -it's a good practice. With server-rendered `elm-pages` applications you can often manage your session state by pulling -in session data from cookies in a `BackendTask` (which is resolved server-side before it ever reaches the browser). - -makeVisibleToJavaScript: Server.SetCookie.Options -> Server.SetCookie.Options --} -makeVisibleToJavaScript : Elm.Expression -> Elm.Expression -makeVisibleToJavaScript makeVisibleToJavaScriptArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "makeVisibleToJavaScript" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ makeVisibleToJavaScriptArg_ ] - - -{-| Secure (only sent over https, or localhost on http) is the default. This overrides that and -removes the `Secure` attribute from the cookie. - -nonSecure: Server.SetCookie.Options -> Server.SetCookie.Options --} -nonSecure : Elm.Expression -> Elm.Expression -nonSecure nonSecureArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "nonSecure" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ nonSecureArg_ ] - - -{-| Sets the `Set-Cookie`'s [`Domain`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#domaindomain-value). - -withDomain: String -> Server.SetCookie.Options -> Server.SetCookie.Options --} -withDomain : String -> Elm.Expression -> Elm.Expression -withDomain withDomainArg_ withDomainArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withDomain" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ Elm.string withDomainArg_, withDomainArg_0 ] - - -{-| withExpiration: Time.Posix -> Server.SetCookie.Options -> Server.SetCookie.Options -} -withExpiration : Elm.Expression -> Elm.Expression -> Elm.Expression -withExpiration withExpirationArg_ withExpirationArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withExpirationArg_, withExpirationArg_0 ] - - -{-| Sets the `Set-Cookie`'s [`Max-Age`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#max-agenumber). - -withMaxAge: Int -> Server.SetCookie.Options -> Server.SetCookie.Options --} -withMaxAge : Int -> Elm.Expression -> Elm.Expression -withMaxAge withMaxAgeArg_ withMaxAgeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withMaxAge" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ Elm.int withMaxAgeArg_, withMaxAgeArg_0 ] - - -{-| Sets the `Set-Cookie`'s [`Path`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value). - -The default value is `/`, which will match any sub-directories or the root directory. See also [\`withoutPath](#withoutPath) - -withPath: String -> Server.SetCookie.Options -> Server.SetCookie.Options --} -withPath : String -> Elm.Expression -> Elm.Expression -withPath withPathArg_ withPathArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withPath" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ Elm.string withPathArg_, withPathArg_0 ] - - -{-| > If the server omits the Path attribute, the user agent will use the "directory" of the request-uri's path component as the default value. - -Source: . See . - -withoutPath: Server.SetCookie.Options -> Server.SetCookie.Options --} -withoutPath : Elm.Expression -> Elm.Expression -withoutPath withoutPathArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withoutPath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withoutPathArg_ ] - - -{-| Usually you'll want to use [`Server.Response.withSetCookieHeader`](Server-Response#withSetCookieHeader) instead. - -This is a low-level helper that's there in case you want it but most users will never need this. - -toString: Server.SetCookie.SetCookie -> String --} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -annotation_ : - { setCookie : Type.Annotation - , options : Type.Annotation - , sameSite : Type.Annotation - } -annotation_ = - { setCookie = - Type.alias - moduleName_ - "SetCookie" - [] - (Type.record - [ ( "name", Type.string ) - , ( "value", Type.string ) - , ( "options" - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ] - ) - , options = - Type.alias - moduleName_ - "Options" - [] - (Type.record - [ ( "expiration" - , Type.maybe (Type.namedWith [ "Time" ] "Posix" []) - ) - , ( "visibleToJavaScript", Type.bool ) - , ( "maxAge", Type.maybe Type.int ) - , ( "path", Type.maybe Type.string ) - , ( "domain", Type.maybe Type.string ) - , ( "secure", Type.bool ) - , ( "sameSite" - , Type.maybe - (Type.namedWith [ "Server", "SetCookie" ] "SameSite" [] - ) - ) - ] - ) - , sameSite = Type.namedWith [ "Server", "SetCookie" ] "SameSite" [] - } - - -make_ : - { setCookie : - { name : Elm.Expression - , value : Elm.Expression - , options : Elm.Expression - } - -> Elm.Expression - , options : - { expiration : Elm.Expression - , visibleToJavaScript : Elm.Expression - , maxAge : Elm.Expression - , path : Elm.Expression - , domain : Elm.Expression - , secure : Elm.Expression - , sameSite : Elm.Expression - } - -> Elm.Expression - , strict : Elm.Expression - , lax : Elm.Expression - , none : Elm.Expression - } -make_ = - { setCookie = - \setCookie_args -> - Elm.withType - (Type.alias - [ "Server", "SetCookie" ] - "SetCookie" - [] - (Type.record - [ ( "name", Type.string ) - , ( "value", Type.string ) - , ( "options" - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "name" setCookie_args.name - , Tuple.pair "value" setCookie_args.value - , Tuple.pair "options" setCookie_args.options - ] - ) - , options = - \options_args -> - Elm.withType - (Type.alias - [ "Server", "SetCookie" ] - "Options" - [] - (Type.record - [ ( "expiration" - , Type.maybe (Type.namedWith [ "Time" ] "Posix" []) - ) - , ( "visibleToJavaScript", Type.bool ) - , ( "maxAge", Type.maybe Type.int ) - , ( "path", Type.maybe Type.string ) - , ( "domain", Type.maybe Type.string ) - , ( "secure", Type.bool ) - , ( "sameSite" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "expiration" options_args.expiration - , Tuple.pair - "visibleToJavaScript" - options_args.visibleToJavaScript - , Tuple.pair "maxAge" options_args.maxAge - , Tuple.pair "path" options_args.path - , Tuple.pair "domain" options_args.domain - , Tuple.pair "secure" options_args.secure - , Tuple.pair "sameSite" options_args.sameSite - ] - ) - , strict = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "Strict" - , annotation = Just (Type.namedWith [] "SameSite" []) - } - , lax = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "Lax" - , annotation = Just (Type.namedWith [] "SameSite" []) - } - , none = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "None" - , annotation = Just (Type.namedWith [] "SameSite" []) - } - } - - -caseOf_ : - { sameSite : - Elm.Expression - -> { strict : Elm.Expression - , lax : Elm.Expression - , none : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { sameSite = - \sameSiteExpression sameSiteTags -> - Elm.Case.custom - sameSiteExpression - (Type.namedWith [ "Server", "SetCookie" ] "SameSite" []) - [ Elm.Case.branch - (Elm.Arg.customType "Strict" sameSiteTags.strict) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Lax" sameSiteTags.lax) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "None" sameSiteTags.none) - Basics.identity - ] - } - - -call_ : - { setCookie : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withSameSite : Elm.Expression -> Elm.Expression -> Elm.Expression - , withImmediateExpiration : Elm.Expression -> Elm.Expression - , makeVisibleToJavaScript : Elm.Expression -> Elm.Expression - , nonSecure : Elm.Expression -> Elm.Expression - , withDomain : Elm.Expression -> Elm.Expression -> Elm.Expression - , withExpiration : Elm.Expression -> Elm.Expression -> Elm.Expression - , withMaxAge : Elm.Expression -> Elm.Expression -> Elm.Expression - , withPath : Elm.Expression -> Elm.Expression -> Elm.Expression - , withoutPath : Elm.Expression -> Elm.Expression - , toString : Elm.Expression -> Elm.Expression - } -call_ = - { setCookie = - \setCookieArg_ setCookieArg_0 setCookieArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "setCookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ) - ) - } - ) - [ setCookieArg_, setCookieArg_0, setCookieArg_1 ] - , withSameSite = - \withSameSiteArg_ withSameSiteArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withSameSite" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withSameSiteArg_, withSameSiteArg_0 ] - , withImmediateExpiration = - \withImmediateExpirationArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withImmediateExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withImmediateExpirationArg_ ] - , makeVisibleToJavaScript = - \makeVisibleToJavaScriptArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "makeVisibleToJavaScript" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ makeVisibleToJavaScriptArg_ ] - , nonSecure = - \nonSecureArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "nonSecure" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ nonSecureArg_ ] - , withDomain = - \withDomainArg_ withDomainArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withDomain" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withDomainArg_, withDomainArg_0 ] - , withExpiration = - \withExpirationArg_ withExpirationArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withExpirationArg_, withExpirationArg_0 ] - , withMaxAge = - \withMaxAgeArg_ withMaxAgeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withMaxAge" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withMaxAgeArg_, withMaxAgeArg_0 ] - , withPath = - \withPathArg_ withPathArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withPath" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withPathArg_, withPathArg_0 ] - , withoutPath = - \withoutPathArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withoutPath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withoutPathArg_ ] - , toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - } - - -values_ : - { setCookie : Elm.Expression - , options : Elm.Expression - , withSameSite : Elm.Expression - , withImmediateExpiration : Elm.Expression - , makeVisibleToJavaScript : Elm.Expression - , nonSecure : Elm.Expression - , withDomain : Elm.Expression - , withExpiration : Elm.Expression - , withMaxAge : Elm.Expression - , withPath : Elm.Expression - , withoutPath : Elm.Expression - , toString : Elm.Expression - } -values_ = - { setCookie = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "setCookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ) - ) - } - , options = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "options" - , annotation = - Just (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - } - , withSameSite = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withSameSite" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withImmediateExpiration = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withImmediateExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , makeVisibleToJavaScript = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "makeVisibleToJavaScript" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , nonSecure = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "nonSecure" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withDomain = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withDomain" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withExpiration = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withMaxAge = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withMaxAge" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withPath = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withPath" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withoutPath = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withoutPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , toString = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ] - Type.string - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Set.elm b/codegen/Gen/Set.elm deleted file mode 100644 index 91093a12..00000000 --- a/codegen/Gen/Set.elm +++ /dev/null @@ -1,1250 +0,0 @@ -module Gen.Set exposing - ( moduleName_, empty, singleton, insert, remove, isEmpty - , member, size, union, intersect, diff, toList, fromList - , map, foldl, foldr, filter, partition, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Set - -@docs moduleName_, empty, singleton, insert, remove, isEmpty -@docs member, size, union, intersect, diff, toList -@docs fromList, map, foldl, foldr, filter, partition -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Set" ] - - -{-| Create an empty set. - -empty: Set.Set a --} -empty : Elm.Expression -empty = - Elm.value - { importFrom = [ "Set" ] - , name = "empty" - , annotation = Just (Type.namedWith [ "Set" ] "Set" [ Type.var "a" ]) - } - - -{-| Create a set with one value. - -singleton: comparable -> Set.Set comparable --} -singleton : Elm.Expression -> Elm.Expression -singleton singletonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "singleton" - , annotation = - Just - (Type.function - [ Type.var "comparable" ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ singletonArg_ ] - - -{-| Insert a value into a set. - -insert: comparable -> Set.Set comparable -> Set.Set comparable --} -insert : Elm.Expression -> Elm.Expression -> Elm.Expression -insert insertArg_ insertArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ insertArg_, insertArg_0 ] - - -{-| Remove a value from a set. If the value is not found, no changes are made. - -remove: comparable -> Set.Set comparable -> Set.Set comparable --} -remove : Elm.Expression -> Elm.Expression -> Elm.Expression -remove removeArg_ removeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ removeArg_, removeArg_0 ] - - -{-| Determine if a set is empty. - -isEmpty: Set.Set a -> Bool --} -isEmpty : Elm.Expression -> Elm.Expression -isEmpty isEmptyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.bool - ) - } - ) - [ isEmptyArg_ ] - - -{-| Determine if a value is in a set. - -member: comparable -> Set.Set comparable -> Bool --} -member : Elm.Expression -> Elm.Expression -> Elm.Expression -member memberArg_ memberArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "member" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - Type.bool - ) - } - ) - [ memberArg_, memberArg_0 ] - - -{-| Determine the number of elements in a set. - -size: Set.Set a -> Int --} -size : Elm.Expression -> Elm.Expression -size sizeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "size" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.int - ) - } - ) - [ sizeArg_ ] - - -{-| Get the union of two sets. Keep all values. - -union: Set.Set comparable -> Set.Set comparable -> Set.Set comparable --} -union : Elm.Expression -> Elm.Expression -> Elm.Expression -union unionArg_ unionArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "union" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ unionArg_, unionArg_0 ] - - -{-| Get the intersection of two sets. Keeps values that appear in both sets. - -intersect: Set.Set comparable -> Set.Set comparable -> Set.Set comparable --} -intersect : Elm.Expression -> Elm.Expression -> Elm.Expression -intersect intersectArg_ intersectArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "intersect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ intersectArg_, intersectArg_0 ] - - -{-| Get the difference between the first set and the second. Keeps values -that do not appear in the second set. - -diff: Set.Set comparable -> Set.Set comparable -> Set.Set comparable --} -diff : Elm.Expression -> Elm.Expression -> Elm.Expression -diff diffArg_ diffArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ diffArg_, diffArg_0 ] - - -{-| Convert a set into a list, sorted from lowest to highest. - -toList: Set.Set a -> List a --} -toList : Elm.Expression -> Elm.Expression -toList toListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - (Type.list (Type.var "a")) - ) - } - ) - [ toListArg_ ] - - -{-| Convert a list into a set, removing any duplicates. - -fromList: List comparable -> Set.Set comparable --} -fromList : List Elm.Expression -> Elm.Expression -fromList fromListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "comparable") ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ Elm.list fromListArg_ ] - - -{-| Map a function onto a set, creating a new set with no duplicates. - -map: (comparable -> comparable2) -> Set.Set comparable -> Set.Set comparable2 --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - (Type.var "comparable2") - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable2" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Fold over the values in a set, in order from lowest to highest. - -foldl: (a -> b -> b) -> b -> Set.Set a -> b --} -foldl : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -foldl foldlArg_ foldlArg_0 foldlArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ Elm.functionReduced - "foldlUnpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (foldlArg_ functionReducedUnpack) - ) - , foldlArg_0 - , foldlArg_1 - ] - - -{-| Fold over the values in a set, in order from highest to lowest. - -foldr: (a -> b -> b) -> b -> Set.Set a -> b --} -foldr : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -foldr foldrArg_ foldrArg_0 foldrArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ Elm.functionReduced - "foldrUnpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (foldrArg_ functionReducedUnpack) - ) - , foldrArg_0 - , foldrArg_1 - ] - - -{-| Only keep elements that pass the given test. - - import Set exposing (Set) - - numbers : Set Int - numbers = - Set.fromList [-2,-1,0,1,2] - - positives : Set Int - positives = - Set.filter (\x -> x > 0) numbers - - -- positives == Set.fromList [1,2] - -filter: (comparable -> Bool) -> Set.Set comparable -> Set.Set comparable --} -filter : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -filter filterArg_ filterArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ Elm.functionReduced "filterUnpack" filterArg_, filterArg_0 ] - - -{-| Create two new sets. The first contains all the elements that passed the -given test, and the second contains all the elements that did not. - -partition: - (comparable -> Bool) - -> Set.Set comparable - -> ( Set.Set comparable, Set.Set comparable ) --} -partition : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -partition partitionArg_ partitionArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "partition" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.tuple - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - ) - } - ) - [ Elm.functionReduced "partitionUnpack" partitionArg_, partitionArg_0 ] - - -annotation_ : { set : Type.Annotation -> Type.Annotation } -annotation_ = - { set = \setArg0 -> Type.namedWith [ "Set" ] "Set" [ setArg0 ] } - - -call_ : - { singleton : Elm.Expression -> Elm.Expression - , insert : Elm.Expression -> Elm.Expression -> Elm.Expression - , remove : Elm.Expression -> Elm.Expression -> Elm.Expression - , isEmpty : Elm.Expression -> Elm.Expression - , member : Elm.Expression -> Elm.Expression -> Elm.Expression - , size : Elm.Expression -> Elm.Expression - , union : Elm.Expression -> Elm.Expression -> Elm.Expression - , intersect : Elm.Expression -> Elm.Expression -> Elm.Expression - , diff : Elm.Expression -> Elm.Expression -> Elm.Expression - , toList : Elm.Expression -> Elm.Expression - , fromList : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , foldl : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , foldr : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , filter : Elm.Expression -> Elm.Expression -> Elm.Expression - , partition : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { singleton = - \singletonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "singleton" - , annotation = - Just - (Type.function - [ Type.var "comparable" ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ singletonArg_ ] - , insert = - \insertArg_ insertArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ insertArg_, insertArg_0 ] - , remove = - \removeArg_ removeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ removeArg_, removeArg_0 ] - , isEmpty = - \isEmptyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - Type.bool - ) - } - ) - [ isEmptyArg_ ] - , member = - \memberArg_ memberArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "member" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - Type.bool - ) - } - ) - [ memberArg_, memberArg_0 ] - , size = - \sizeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "size" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - Type.int - ) - } - ) - [ sizeArg_ ] - , union = - \unionArg_ unionArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "union" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ unionArg_, unionArg_0 ] - , intersect = - \intersectArg_ intersectArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "intersect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ intersectArg_, intersectArg_0 ] - , diff = - \diffArg_ diffArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ diffArg_, diffArg_0 ] - , toList = - \toListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - (Type.list (Type.var "a")) - ) - } - ) - [ toListArg_ ] - , fromList = - \fromListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "comparable") ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ fromListArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - (Type.var "comparable2") - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable2" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , foldl = - \foldlArg_ foldlArg_0 foldlArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ foldlArg_, foldlArg_0, foldlArg_1 ] - , foldr = - \foldrArg_ foldrArg_0 foldrArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ foldrArg_, foldrArg_0, foldrArg_1 ] - , filter = - \filterArg_ filterArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ filterArg_, filterArg_0 ] - , partition = - \partitionArg_ partitionArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "partition" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.tuple - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - ) - } - ) - [ partitionArg_, partitionArg_0 ] - } - - -values_ : - { empty : Elm.Expression - , singleton : Elm.Expression - , insert : Elm.Expression - , remove : Elm.Expression - , isEmpty : Elm.Expression - , member : Elm.Expression - , size : Elm.Expression - , union : Elm.Expression - , intersect : Elm.Expression - , diff : Elm.Expression - , toList : Elm.Expression - , fromList : Elm.Expression - , map : Elm.Expression - , foldl : Elm.Expression - , foldr : Elm.Expression - , filter : Elm.Expression - , partition : Elm.Expression - } -values_ = - { empty = - Elm.value - { importFrom = [ "Set" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Set" ] "Set" [ Type.var "a" ]) - } - , singleton = - Elm.value - { importFrom = [ "Set" ] - , name = "singleton" - , annotation = - Just - (Type.function - [ Type.var "comparable" ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , insert = - Elm.value - { importFrom = [ "Set" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , remove = - Elm.value - { importFrom = [ "Set" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , isEmpty = - Elm.value - { importFrom = [ "Set" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.bool - ) - } - , member = - Elm.value - { importFrom = [ "Set" ] - , name = "member" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - Type.bool - ) - } - , size = - Elm.value - { importFrom = [ "Set" ] - , name = "size" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.int - ) - } - , union = - Elm.value - { importFrom = [ "Set" ] - , name = "union" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , intersect = - Elm.value - { importFrom = [ "Set" ] - , name = "intersect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , diff = - Elm.value - { importFrom = [ "Set" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , toList = - Elm.value - { importFrom = [ "Set" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - (Type.list (Type.var "a")) - ) - } - , fromList = - Elm.value - { importFrom = [ "Set" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "comparable") ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Set" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - (Type.var "comparable2") - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable2" ] - ) - ) - } - , foldl = - Elm.value - { importFrom = [ "Set" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - , foldr = - Elm.value - { importFrom = [ "Set" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - , filter = - Elm.value - { importFrom = [ "Set" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , partition = - Elm.value - { importFrom = [ "Set" ] - , name = "partition" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.tuple - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Time/Extra.elm b/codegen/Gen/Time/Extra.elm deleted file mode 100644 index a1216681..00000000 --- a/codegen/Gen/Time/Extra.elm +++ /dev/null @@ -1,976 +0,0 @@ -module Gen.Time.Extra exposing - ( moduleName_, partsToPosix, posixToParts, compare, diff, add - , floor, ceiling, range, toOffset, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for Time.Extra - -@docs moduleName_, partsToPosix, posixToParts, compare, diff, add -@docs floor, ceiling, range, toOffset, annotation_, make_ -@docs caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Time", "Extra" ] - - -{-| Create a `Posix` from a description of a time and a specific time zone. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Parts, partsToPosix) - - partsToPosix utc (Parts 2018 Sep 26 14 30 0 0) - -Any out-of-range day or time values will be clamped within range. - - partsToPosix utc (Parts 2018 Sep 31 24 60 -60 -500) - == partsToPosix utc (Parts 2018 Sep 30 23 59 0 0) - -partsToPosix: Time.Zone -> Time.Extra.Parts -> Time.Posix --} -partsToPosix : Elm.Expression -> Elm.Expression -> Elm.Expression -partsToPosix partsToPosixArg_ partsToPosixArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "partsToPosix" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time", "Extra" ] "Parts" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ partsToPosixArg_, partsToPosixArg_0 ] - - -{-| Convert a `Posix` to a description of a time in a specific time zone. This -is a convenience function for extracting parts of a time into a single record. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Parts, partsToPosix, posixToParts) - - posixToParts - utc - (partsToPosix utc (Parts 2018 Sep 26 14 30 0 0)) - == { year = 2018 - , month = Sep - , day = 26 - , hour = 14 - , minute = 30 - , second = 0 - , millisecond = 0 - } - -posixToParts: Time.Zone -> Time.Posix -> Time.Extra.Parts --} -posixToParts : Elm.Expression -> Elm.Expression -> Elm.Expression -posixToParts posixToPartsArg_ posixToPartsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "posixToParts" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time", "Extra" ] "Parts" []) - ) - } - ) - [ posixToPartsArg_, posixToPartsArg_0 ] - - -{-| Compare the first time to the second time. - - import Time - import Time.Extra as Time - - Time.compare (Time.millisToPosix 0) (Time.millisToPosix 1000) - == LT - -compare: Time.Posix -> Time.Posix -> Basics.Order --} -compare : Elm.Expression -> Elm.Expression -> Elm.Expression -compare compareArg_ compareArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "compare" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Basics" ] "Order" []) - ) - } - ) - [ compareArg_, compareArg_0 ] - - -{-| Get the difference, as a number of whole intervals, between two times. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, diff) - - diff Month utc - (partsToPosix utc (Parts 2020 Jan 2 0 0 0 0)) - (partsToPosix utc (Parts 2020 Apr 1 0 0 0 0)) - == 2 - -diff: Time.Extra.Interval -> Time.Zone -> Time.Posix -> Time.Posix -> Int --} -diff : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -diff diffArg_ diffArg_0 diffArg_1 diffArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ diffArg_, diffArg_0, diffArg_1, diffArg_2 ] - - -{-| Shift a time into the past or future by adding a number of whole intervals. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, add) - - add Week 2 utc (partsToPosix utc (Parts 2018 Sep 1 11 55 0 0)) - == partsToPosix utc (Parts 2018 Sep 15 11 55 0 0) - -When adding `Month`, `Quarter`, or `Year` intervals, day values are clamped to -the end of the month if necessary. - - add Month 1 utc (partsToPosix utc (Parts 2020 Jan 31 0 0 0 0)) - == partsToPosix utc (Parts 2020 Feb 29 0 0 0 0) - -add: Time.Extra.Interval -> Int -> Time.Zone -> Time.Posix -> Time.Posix --} -add : - Elm.Expression -> Int -> Elm.Expression -> Elm.Expression -> Elm.Expression -add addArg_ addArg_0 addArg_1 addArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "add" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ addArg_, Elm.int addArg_0, addArg_1, addArg_2 ] - - -{-| Round down a time to the beginning of the closest interval. The resulting -time will be less than or equal to the one provided. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, floor) - - floor Hour utc - (partsToPosix utc (Parts 1999 Dec 31 23 59 59 999)) - == (partsToPosix utc (Parts 1999 Dec 31 23 0 0 0)) - -floor: Time.Extra.Interval -> Time.Zone -> Time.Posix -> Time.Posix --} -floor : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -floor floorArg_ floorArg_0 floorArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "floor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ floorArg_, floorArg_0, floorArg_1 ] - - -{-| Round up a time to the beginning of the closest interval. The resulting -time will be greater than or equal to the one provided. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, ceiling) - - ceiling Hour utc - (partsToPosix utc (Parts 1999 Dec 31 23 59 59 999)) - == (partsToPosix utc (Parts 2000 Jan 1 0 0 0 0)) - -ceiling: Time.Extra.Interval -> Time.Zone -> Time.Posix -> Time.Posix --} -ceiling : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -ceiling ceilingArg_ ceilingArg_0 ceilingArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "ceiling" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ ceilingArg_, ceilingArg_0, ceilingArg_1 ] - - -{-| Create a list of times, at rounded intervals, increasing by a step value, -between two times. The list will start on or after the first time, and end -before the second time. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, range) - - start = Parts 2020 Jan 1 12 0 0 0 - until = Parts 2020 Jan 8 0 0 0 0 - - range Day 2 utc (partsToPosix utc start) (partsToPosix utc until) - == List.map (partsToPosix utc) - [ Parts 2020 Jan 2 0 0 0 0 - , Parts 2020 Jan 4 0 0 0 0 - , Parts 2020 Jan 6 0 0 0 0 - ] - -range: - Time.Extra.Interval - -> Int - -> Time.Zone - -> Time.Posix - -> Time.Posix - -> List Time.Posix --} -range : - Elm.Expression - -> Int - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -range rangeArg_ rangeArg_0 rangeArg_1 rangeArg_2 rangeArg_3 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "range" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.list (Type.namedWith [ "Time" ] "Posix" [])) - ) - } - ) - [ rangeArg_, Elm.int rangeArg_0, rangeArg_1, rangeArg_2, rangeArg_3 ] - - -{-| What is the offset from UTC, in minutes, for this `Zone` at this -`Posix` time? - - import Time exposing (Month(..)) - import Time.Extra exposing (Parts, partsToPosix, toOffset) - - toOffset nyc - (partsToPosix nyc (Parts 2018 Sep 26 10 30 0 0)) - == -240 - - -- assuming `nyc` is a `Zone` for America/New_York - -**Note:** It's possible to verify the example above by using time zone data -from the package [justinmimbs/timezone-data][tzdata] to define `nyc`: - - import TimeZone - - nyc = - TimeZone.america__new_york () - -[tzdata]: https://package.elm-lang.org/packages/justinmimbs/timezone-data/latest/ - -toOffset: Time.Zone -> Time.Posix -> Int --} -toOffset : Elm.Expression -> Elm.Expression -> Elm.Expression -toOffset toOffsetArg_ toOffsetArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "toOffset" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ toOffsetArg_, toOffsetArg_0 ] - - -annotation_ : { parts : Type.Annotation, interval : Type.Annotation } -annotation_ = - { parts = - Type.alias - moduleName_ - "Parts" - [] - (Type.record - [ ( "year", Type.int ) - , ( "month", Type.namedWith [ "Time" ] "Month" [] ) - , ( "day", Type.int ) - , ( "hour", Type.int ) - , ( "minute", Type.int ) - , ( "second", Type.int ) - , ( "millisecond", Type.int ) - ] - ) - , interval = Type.namedWith [ "Time", "Extra" ] "Interval" [] - } - - -make_ : - { parts : - { year : Elm.Expression - , month : Elm.Expression - , day : Elm.Expression - , hour : Elm.Expression - , minute : Elm.Expression - , second : Elm.Expression - , millisecond : Elm.Expression - } - -> Elm.Expression - , year : Elm.Expression - , quarter : Elm.Expression - , month : Elm.Expression - , week : Elm.Expression - , monday : Elm.Expression - , tuesday : Elm.Expression - , wednesday : Elm.Expression - , thursday : Elm.Expression - , friday : Elm.Expression - , saturday : Elm.Expression - , sunday : Elm.Expression - , day : Elm.Expression - , hour : Elm.Expression - , minute : Elm.Expression - , second : Elm.Expression - , millisecond : Elm.Expression - } -make_ = - { parts = - \parts_args -> - Elm.withType - (Type.alias - [ "Time", "Extra" ] - "Parts" - [] - (Type.record - [ ( "year", Type.int ) - , ( "month", Type.namedWith [ "Time" ] "Month" [] ) - , ( "day", Type.int ) - , ( "hour", Type.int ) - , ( "minute", Type.int ) - , ( "second", Type.int ) - , ( "millisecond", Type.int ) - ] - ) - ) - (Elm.record - [ Tuple.pair "year" parts_args.year - , Tuple.pair "month" parts_args.month - , Tuple.pair "day" parts_args.day - , Tuple.pair "hour" parts_args.hour - , Tuple.pair "minute" parts_args.minute - , Tuple.pair "second" parts_args.second - , Tuple.pair "millisecond" parts_args.millisecond - ] - ) - , year = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Year" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , quarter = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Quarter" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , month = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Month" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , week = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Week" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , monday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Monday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , tuesday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Tuesday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , wednesday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Wednesday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , thursday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Thursday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , friday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Friday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , saturday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Saturday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , sunday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Sunday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , day = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Day" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , hour = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Hour" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , minute = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Minute" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , second = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Second" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , millisecond = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Millisecond" - , annotation = Just (Type.namedWith [] "Interval" []) - } - } - - -caseOf_ : - { interval : - Elm.Expression - -> { year : Elm.Expression - , quarter : Elm.Expression - , month : Elm.Expression - , week : Elm.Expression - , monday : Elm.Expression - , tuesday : Elm.Expression - , wednesday : Elm.Expression - , thursday : Elm.Expression - , friday : Elm.Expression - , saturday : Elm.Expression - , sunday : Elm.Expression - , day : Elm.Expression - , hour : Elm.Expression - , minute : Elm.Expression - , second : Elm.Expression - , millisecond : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { interval = - \intervalExpression intervalTags -> - Elm.Case.custom - intervalExpression - (Type.namedWith [ "Time", "Extra" ] "Interval" []) - [ Elm.Case.branch - (Elm.Arg.customType "Year" intervalTags.year) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Quarter" intervalTags.quarter) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Month" intervalTags.month) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Week" intervalTags.week) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Monday" intervalTags.monday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Tuesday" intervalTags.tuesday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Wednesday" intervalTags.wednesday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Thursday" intervalTags.thursday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Friday" intervalTags.friday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Saturday" intervalTags.saturday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Sunday" intervalTags.sunday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Day" intervalTags.day) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Hour" intervalTags.hour) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Minute" intervalTags.minute) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Second" intervalTags.second) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Millisecond" intervalTags.millisecond) - Basics.identity - ] - } - - -call_ : - { partsToPosix : Elm.Expression -> Elm.Expression -> Elm.Expression - , posixToParts : Elm.Expression -> Elm.Expression -> Elm.Expression - , compare : Elm.Expression -> Elm.Expression -> Elm.Expression - , diff : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , add : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , floor : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , ceiling : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , range : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , toOffset : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { partsToPosix = - \partsToPosixArg_ partsToPosixArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "partsToPosix" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith - [ "Time", "Extra" ] - "Parts" - [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ partsToPosixArg_, partsToPosixArg_0 ] - , posixToParts = - \posixToPartsArg_ posixToPartsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "posixToParts" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time", "Extra" ] "Parts" [] - ) - ) - } - ) - [ posixToPartsArg_, posixToPartsArg_0 ] - , compare = - \compareArg_ compareArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "compare" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Basics" ] "Order" []) - ) - } - ) - [ compareArg_, compareArg_0 ] - , diff = - \diffArg_ diffArg_0 diffArg_1 diffArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ diffArg_, diffArg_0, diffArg_1, diffArg_2 ] - , add = - \addArg_ addArg_0 addArg_1 addArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "add" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ addArg_, addArg_0, addArg_1, addArg_2 ] - , floor = - \floorArg_ floorArg_0 floorArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "floor" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ floorArg_, floorArg_0, floorArg_1 ] - , ceiling = - \ceilingArg_ ceilingArg_0 ceilingArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "ceiling" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ ceilingArg_, ceilingArg_0, ceilingArg_1 ] - , range = - \rangeArg_ rangeArg_0 rangeArg_1 rangeArg_2 rangeArg_3 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "range" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.list - (Type.namedWith [ "Time" ] "Posix" []) - ) - ) - } - ) - [ rangeArg_, rangeArg_0, rangeArg_1, rangeArg_2, rangeArg_3 ] - , toOffset = - \toOffsetArg_ toOffsetArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "toOffset" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ toOffsetArg_, toOffsetArg_0 ] - } - - -values_ : - { partsToPosix : Elm.Expression - , posixToParts : Elm.Expression - , compare : Elm.Expression - , diff : Elm.Expression - , add : Elm.Expression - , floor : Elm.Expression - , ceiling : Elm.Expression - , range : Elm.Expression - , toOffset : Elm.Expression - } -values_ = - { partsToPosix = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "partsToPosix" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time", "Extra" ] "Parts" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , posixToParts = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "posixToParts" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time", "Extra" ] "Parts" []) - ) - } - , compare = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "compare" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Basics" ] "Order" []) - ) - } - , diff = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - , add = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "add" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , floor = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "floor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , ceiling = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "ceiling" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , range = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "range" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.list (Type.namedWith [ "Time" ] "Posix" [])) - ) - } - , toOffset = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "toOffset" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Tuple.elm b/codegen/Gen/Tuple.elm deleted file mode 100644 index 3676e6a3..00000000 --- a/codegen/Gen/Tuple.elm +++ /dev/null @@ -1,391 +0,0 @@ -module Gen.Tuple exposing - ( moduleName_, pair, first, second, mapFirst, mapSecond - , mapBoth, call_, values_ - ) - -{-| -# Generated bindings for Tuple - -@docs moduleName_, pair, first, second, mapFirst, mapSecond -@docs mapBoth, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Tuple" ] - - -{-| Create a 2-tuple. - - -- pair 3 4 == (3, 4) - - zip : List a -> List b -> List (a, b) - zip xs ys = - List.map2 Tuple.pair xs ys - -pair: a -> b -> ( a, b ) --} -pair : Elm.Expression -> Elm.Expression -> Elm.Expression -pair pairArg_ pairArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "pair" - , annotation = - Just - (Type.function - [ Type.var "a", Type.var "b" ] - (Type.tuple (Type.var "a") (Type.var "b")) - ) - } - ) - [ pairArg_, pairArg_0 ] - - -{-| Extract the first value from a tuple. - - first (3, 4) == 3 - first ("john", "doe") == "john" - -first: ( a, b ) -> a --} -first : Elm.Expression -> Elm.Expression -first firstArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "first" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "a") - ) - } - ) - [ firstArg_ ] - - -{-| Extract the second value from a tuple. - - second (3, 4) == 4 - second ("john", "doe") == "doe" - -second: ( a, b ) -> b --} -second : Elm.Expression -> Elm.Expression -second secondArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "second" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "b") - ) - } - ) - [ secondArg_ ] - - -{-| Transform the first value in a tuple. - - import String - - mapFirst String.reverse ("stressed", 16) == ("desserts", 16) - mapFirst String.length ("stressed", 16) == (8, 16) - -mapFirst: (a -> x) -> ( a, b ) -> ( x, b ) --} -mapFirst : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -mapFirst mapFirstArg_ mapFirstArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapFirst" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "b")) - ) - } - ) - [ Elm.functionReduced "mapFirstUnpack" mapFirstArg_, mapFirstArg_0 ] - - -{-| Transform the second value in a tuple. - - mapSecond sqrt ("stressed", 16) == ("stressed", 4) - mapSecond negate ("stressed", 16) == ("stressed", -16) - -mapSecond: (b -> y) -> ( a, b ) -> ( a, y ) --} -mapSecond : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -mapSecond mapSecondArg_ mapSecondArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapSecond" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "a") (Type.var "y")) - ) - } - ) - [ Elm.functionReduced "mapSecondUnpack" mapSecondArg_, mapSecondArg_0 ] - - -{-| Transform both parts of a tuple. - - import String - - mapBoth String.reverse sqrt ("stressed", 16) == ("desserts", 4) - mapBoth String.length negate ("stressed", 16) == (8, -16) - -mapBoth: (a -> x) -> (b -> y) -> ( a, b ) -> ( x, y ) --} -mapBoth : - (Elm.Expression -> Elm.Expression) - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -mapBoth mapBothArg_ mapBothArg_0 mapBothArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapBoth" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "y")) - ) - } - ) - [ Elm.functionReduced "mapBothUnpack" mapBothArg_ - , Elm.functionReduced "mapBothUnpack" mapBothArg_0 - , mapBothArg_1 - ] - - -call_ : - { pair : Elm.Expression -> Elm.Expression -> Elm.Expression - , first : Elm.Expression -> Elm.Expression - , second : Elm.Expression -> Elm.Expression - , mapFirst : Elm.Expression -> Elm.Expression -> Elm.Expression - , mapSecond : Elm.Expression -> Elm.Expression -> Elm.Expression - , mapBoth : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { pair = - \pairArg_ pairArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "pair" - , annotation = - Just - (Type.function - [ Type.var "a", Type.var "b" ] - (Type.tuple (Type.var "a") (Type.var "b")) - ) - } - ) - [ pairArg_, pairArg_0 ] - , first = - \firstArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "first" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "a") - ) - } - ) - [ firstArg_ ] - , second = - \secondArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "second" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "b") - ) - } - ) - [ secondArg_ ] - , mapFirst = - \mapFirstArg_ mapFirstArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapFirst" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "x") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "b")) - ) - } - ) - [ mapFirstArg_, mapFirstArg_0 ] - , mapSecond = - \mapSecondArg_ mapSecondArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapSecond" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "b" ] - (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "a") (Type.var "y")) - ) - } - ) - [ mapSecondArg_, mapSecondArg_0 ] - , mapBoth = - \mapBothArg_ mapBothArg_0 mapBothArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapBoth" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "x") - , Type.function - [ Type.var "b" ] - (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "y")) - ) - } - ) - [ mapBothArg_, mapBothArg_0, mapBothArg_1 ] - } - - -values_ : - { pair : Elm.Expression - , first : Elm.Expression - , second : Elm.Expression - , mapFirst : Elm.Expression - , mapSecond : Elm.Expression - , mapBoth : Elm.Expression - } -values_ = - { pair = - Elm.value - { importFrom = [ "Tuple" ] - , name = "pair" - , annotation = - Just - (Type.function - [ Type.var "a", Type.var "b" ] - (Type.tuple (Type.var "a") (Type.var "b")) - ) - } - , first = - Elm.value - { importFrom = [ "Tuple" ] - , name = "first" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "a") - ) - } - , second = - Elm.value - { importFrom = [ "Tuple" ] - , name = "second" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "b") - ) - } - , mapFirst = - Elm.value - { importFrom = [ "Tuple" ] - , name = "mapFirst" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "b")) - ) - } - , mapSecond = - Elm.value - { importFrom = [ "Tuple" ] - , name = "mapSecond" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "a") (Type.var "y")) - ) - } - , mapBoth = - Elm.value - { importFrom = [ "Tuple" ] - , name = "mapBoth" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "y")) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Url/Parser.elm b/codegen/Gen/Url/Parser.elm deleted file mode 100644 index 02714377..00000000 --- a/codegen/Gen/Url/Parser.elm +++ /dev/null @@ -1,849 +0,0 @@ -module Gen.Url.Parser exposing - ( moduleName_, string, int, s, map, oneOf - , top, custom, query, fragment, parse, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Url.Parser - -@docs moduleName_, string, int, s, map, oneOf -@docs top, custom, query, fragment, parse, annotation_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Url", "Parser" ] - - -{-| Parse a segment of the path as a `String`. - - -- /alice/ ==> Just "alice" - -- /bob ==> Just "bob" - -- /42/ ==> Just "42" - -- / ==> Nothing - -string: Url.Parser.Parser (String -> a) a --} -string : Elm.Expression -string = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "string" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.string ] (Type.var "a") - , Type.var "a" - ] - ) - } - - -{-| Parse a segment of the path as an `Int`. - - -- /alice/ ==> Nothing - -- /bob ==> Nothing - -- /42/ ==> Just 42 - -- / ==> Nothing - -int: Url.Parser.Parser (Int -> a) a --} -int : Elm.Expression -int = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "int" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.int ] (Type.var "a"), Type.var "a" ] - ) - } - - -{-| Parse a segment of the path if it matches a given string. It is almost -always used with [``](#) or [`oneOf`](#oneOf). For example: - - blog : Parser (Int -> a) a - blog = - s "blog" int - - -- /blog/42 ==> Just 42 - -- /tree/42 ==> Nothing - -The path segment must be an exact match! - -s: String -> Url.Parser.Parser a a --} -s : String -> Elm.Expression -s sArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "s" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - ) - } - ) - [ Elm.string sArg_ ] - - -{-| Transform a path parser. - - type alias Comment = { user : String, id : Int } - - userAndId : Parser (String -> Int -> a) a - userAndId = - s "user" string s "comment" int - - comment : Parser (Comment -> a) a - comment = - map Comment userAndId - - -- /user/bob/comment/42 ==> Just { user = "bob", id = 42 } - -- /user/tom/comment/35 ==> Just { user = "tom", id = 35 } - -- /user/sam/ ==> Nothing - -map: a -> Url.Parser.Parser a b -> Url.Parser.Parser (b -> c) c --} -map : Elm.Expression -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "b" ] (Type.var "c") - , Type.var "c" - ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - - -{-| Try a bunch of different path parsers. - - type Route - = Topic String - | Blog Int - | User String - | Comment String Int - - route : Parser (Route -> a) a - route = - oneOf - [ map Topic (s "topic" string) - , map Blog (s "blog" int) - , map User (s "user" string) - , map Comment (s "user" string s "comment" int) - ] - - -- /topic/wolf ==> Just (Topic "wolf") - -- /topic/ ==> Nothing - - -- /blog/42 ==> Just (Blog 42) - -- /blog/wolf ==> Nothing - - -- /user/sam/ ==> Just (User "sam") - -- /user/bob/comment/42 ==> Just (Comment "bob" 42) - -- /user/tom/comment/35 ==> Just (Comment "tom" 35) - -- /user/ ==> Nothing - -If there are multiple parsers that could succeed, the first one wins. - -oneOf: List (Url.Parser.Parser a b) -> Url.Parser.Parser a b --} -oneOf : List Elm.Expression -> Elm.Expression -oneOf oneOfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ) - } - ) - [ Elm.list oneOfArg_ ] - - -{-| A parser that does not consume any path segments. - - type Route = Overview | Post Int - - blog : Parser (BlogRoute -> a) a - blog = - s "blog" - oneOf - [ map Overview top - , map Post (s "post" int) - ] - - -- /blog/ ==> Just Overview - -- /blog/post/42 ==> Just (Post 42) - -top: Url.Parser.Parser a a --} -top : Elm.Expression -top = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "top" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - } - - -{-| Create a custom path segment parser. Here is how it is used to define the -`int` parser: - - int : Parser (Int -> a) a - int = - custom "NUMBER" String.toInt - -You can use it to define something like “only CSS files” like this: - - css : Parser (String -> a) a - css = - custom "CSS_FILE" <| \segment -> - if String.endsWith ".css" segment then - Just segment - else - Nothing - -custom: String -> (String -> Maybe a) -> Url.Parser.Parser (a -> b) b --} -custom : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -custom customArg_ customArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.maybe (Type.var "a")) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.string customArg_ - , Elm.functionReduced "customUnpack" customArg_0 - ] - - -{-| The [`Url.Parser.Query`](Url-Parser-Query) module defines its own -[`Parser`](Url-Parser-Query#Parser) type. This function is a helper to convert -those into normal parsers. - - import Url.Parser.Query as Query - - -- the following expressions are both the same! - -- - -- s "blog" Query.string "search" - -- s "blog" query (Query.string "search") - -This may be handy if you need query parameters but are not parsing any path -segments. - -query: Url.Parser.Query.Parser query -> Url.Parser.Parser (query -> a) a --} -query : Elm.Expression -> Elm.Expression -query queryArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "query" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "query" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "query" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ queryArg_ ] - - -{-| Create a parser for the URL fragment, the stuff after the `#`. This can -be handy for handling links to DOM elements within a page. Pages like this one! - - type alias Docs = - (String, Maybe String) - - docs : Parser (Docs -> a) a - docs = - map Tuple.pair (string fragment identity) - - -- /List/map ==> Nothing - -- /List/#map ==> Just ("List", Just "map") - -- /List#map ==> Just ("List", Just "map") - -- /List# ==> Just ("List", Just "") - -- /List ==> Just ("List", Nothing) - -- / ==> Nothing - -fragment: (Maybe String -> fragment) -> Url.Parser.Parser (fragment -> a) a --} -fragment : (Elm.Expression -> Elm.Expression) -> Elm.Expression -fragment fragmentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "fragment" - , annotation = - Just - (Type.function - [ Type.function - [ Type.maybe Type.string ] - (Type.var "fragment") - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "fragment" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ Elm.functionReduced "fragmentUnpack" fragmentArg_ ] - - -{-| Actually run a parser! You provide some [`Url`](Url#Url) that -represent a valid URL. From there `parse` runs your parser on the path, query -parameters, and fragment. - - import Url - import Url.Parser exposing (Parser, parse, int, map, oneOf, s, top) - - type Route = Home | Blog Int | NotFound - - route : Parser (Route -> a) a - route = - oneOf - [ map Home top - , map Blog (s "blog" int) - ] - - toRoute : String -> Route - toRoute string = - case Url.fromString string of - Nothing -> - NotFound - - Just url -> - Maybe.withDefault NotFound (parse route url) - - -- toRoute "/blog/42" == NotFound - -- toRoute "https://example.com/" == Home - -- toRoute "https://example.com/blog" == NotFound - -- toRoute "https://example.com/blog/42" == Blog 42 - -- toRoute "https://example.com/blog/42/" == Blog 42 - -- toRoute "https://example.com/blog/42#wolf" == Blog 42 - -- toRoute "https://example.com/blog/42?q=wolf" == Blog 42 - -- toRoute "https://example.com/settings" == NotFound - -Functions like `toRoute` are useful when creating single-page apps with -[`Browser.fullscreen`][fs]. I use them in `init` and `onNavigation` to handle -the initial URL and any changes. - -[fs]: /packages/elm/browser/latest/Browser#fullscreen - -parse: Url.Parser.Parser (a -> a) a -> Url.Url -> Maybe a --} -parse : Elm.Expression -> Elm.Expression -> Elm.Expression -parse parseArg_ parseArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "a") - , Type.var "a" - ] - , Type.namedWith [ "Url" ] "Url" [] - ] - (Type.maybe (Type.var "a")) - ) - } - ) - [ parseArg_, parseArg_0 ] - - -annotation_ : { parser : Type.Annotation -> Type.Annotation -> Type.Annotation } -annotation_ = - { parser = - \parserArg0 parserArg1 -> - Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ parserArg0, parserArg1 ] - } - - -call_ : - { s : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , oneOf : Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression -> Elm.Expression - , query : Elm.Expression -> Elm.Expression - , fragment : Elm.Expression -> Elm.Expression - , parse : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { s = - \sArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "s" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - ) - } - ) - [ sArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "b" ] - (Type.var "c") - , Type.var "c" - ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , oneOf = - \oneOfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ) - } - ) - [ oneOfArg_ ] - , custom = - \customArg_ customArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.maybe (Type.var "a")) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.var "b" - ] - ) - ) - } - ) - [ customArg_, customArg_0 ] - , query = - \queryArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "query" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "query" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "query" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ queryArg_ ] - , fragment = - \fragmentArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "fragment" - , annotation = - Just - (Type.function - [ Type.function - [ Type.maybe Type.string ] - (Type.var "fragment") - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "fragment" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ fragmentArg_ ] - , parse = - \parseArg_ parseArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "a" ] - (Type.var "a") - , Type.var "a" - ] - , Type.namedWith [ "Url" ] "Url" [] - ] - (Type.maybe (Type.var "a")) - ) - } - ) - [ parseArg_, parseArg_0 ] - } - - -values_ : - { string : Elm.Expression - , int : Elm.Expression - , s : Elm.Expression - , map : Elm.Expression - , oneOf : Elm.Expression - , top : Elm.Expression - , custom : Elm.Expression - , query : Elm.Expression - , fragment : Elm.Expression - , parse : Elm.Expression - } -values_ = - { string = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "string" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.string ] (Type.var "a") - , Type.var "a" - ] - ) - } - , int = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "int" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.int ] (Type.var "a") - , Type.var "a" - ] - ) - } - , s = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "s" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "b" ] (Type.var "c") - , Type.var "c" - ] - ) - ) - } - , oneOf = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ) - } - , top = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "top" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - } - , custom = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.maybe (Type.var "a")) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.var "b" - ] - ) - ) - } - , query = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "query" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "query" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "query" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - , fragment = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "fragment" - , annotation = - Just - (Type.function - [ Type.function - [ Type.maybe Type.string ] - (Type.var "fragment") - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "fragment" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - , parse = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "a") - , Type.var "a" - ] - , Type.namedWith [ "Url" ] "Url" [] - ] - (Type.maybe (Type.var "a")) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Url/Parser/Query.elm b/codegen/Gen/Url/Parser/Query.elm deleted file mode 100644 index 76c35b9e..00000000 --- a/codegen/Gen/Url/Parser/Query.elm +++ /dev/null @@ -1,1922 +0,0 @@ -module Gen.Url.Parser.Query exposing - ( moduleName_, string, int, enum, custom, map - , map2, map3, map4, map5, map6, map7, map8 - , annotation_, call_, values_ - ) - -{-| -# Generated bindings for Url.Parser.Query - -@docs moduleName_, string, int, enum, custom, map -@docs map2, map3, map4, map5, map6, map7 -@docs map8, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Url", "Parser", "Query" ] - - -{-| Handle `String` parameters. - - search : Parser (Maybe String) - search = - string "search" - - -- ?search=cats == Just "cats" - -- ?search=42 == Just "42" - -- ?branch=left == Nothing - -- ?search=cats&search=dogs == Nothing - -Check out [`custom`](#custom) if you need to handle multiple `search` -parameters for some reason. - -string: String -> Url.Parser.Query.Parser (Maybe String) --} -string : String -> Elm.Expression -string stringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.string ] - ) - ) - } - ) - [ Elm.string stringArg_ ] - - -{-| Handle `Int` parameters. Maybe you want to show paginated search results: - - page : Parser (Maybe Int) - page = - int "page" - - -- ?page=2 == Just 2 - -- ?page=17 == Just 17 - -- ?page=two == Nothing - -- ?sort=date == Nothing - -- ?page=2&page=3 == Nothing - -Check out [`custom`](#custom) if you need to handle multiple `page` parameters -or something like that. - -int: String -> Url.Parser.Query.Parser (Maybe Int) --} -int : String -> Elm.Expression -int intArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "int" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.int ] - ) - ) - } - ) - [ Elm.string intArg_ ] - - -{-| Handle enumerated parameters. Maybe you want a true-or-false parameter: - - import Dict - - debug : Parser (Maybe Bool) - debug = - enum "debug" (Dict.fromList [ ("true", True), ("false", False) ]) - - -- ?debug=true == Just True - -- ?debug=false == Just False - -- ?debug=1 == Nothing - -- ?debug=0 == Nothing - -- ?true=true == Nothing - -- ?debug=true&debug=true == Nothing - -You could add `0` and `1` to the dictionary if you want to handle those as -well. You can also use [`map`](#map) to say `map (Result.withDefault False) debug` -to get a parser of type `Parser Bool` that swallows any errors and defaults to -`False`. - -**Note:** Parameters like `?debug` with no `=` are not supported by this library. - -enum: String -> Dict.Dict String a -> Url.Parser.Query.Parser (Maybe a) --} -enum : String -> Elm.Expression -> Elm.Expression -enum enumArg_ enumArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "enum" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ Elm.string enumArg_, enumArg_0 ] - - -{-| Create a custom query parser. The [`string`](#string), [`int`](#int), and -[`enum`](#enum) parsers are defined using this function. It can help you handle -anything though! - -Say you are unlucky enough to need to handle `?post=2&post=7` to show a couple -posts on screen at once. You could say: - - posts : Parser (Maybe (List Int)) - posts = - custom "post" (List.maybeMap String.toInt) - - -- ?post=2 == [2] - -- ?post=2&post=7 == [2, 7] - -- ?post=2&post=x == [2] - -- ?hats=2 == [] - -custom: String -> (List String -> a) -> Url.Parser.Query.Parser a --} -custom : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -custom customArg_ customArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.var "a") - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ Elm.string customArg_ - , Elm.functionReduced "customUnpack" customArg_0 - ] - - -{-| Transform a parser in some way. Maybe you want your `page` query parser to -default to `1` if there is any problem? - - page : Parser Int - page = - map (Result.withDefault 1) (int "page") - -map: (a -> b) -> Url.Parser.Query.Parser a -> Url.Parser.Query.Parser b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Combine two parsers. A query like `?search=hats&page=2` could be parsed -with something like this: - - type alias Query = - { search : Maybe String - , page : Maybe Int - } - - query : Parser Query - query = - map2 Query (string "search") (int "page") - -map2: - (a -> b -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser result --} -map2 : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map2 map2Arg_ map2Arg_0 map2Arg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map2" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map2Unpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (map2Arg_ functionReducedUnpack) - ) - , map2Arg_0 - , map2Arg_1 - ] - - -{-| Combine three parsers. A query like `?search=hats&page=2&sort=ascending` -could be parsed with something like this: - - import Dict - - type alias Query = - { search : Maybe String - , page : Maybe Int - , sort : Maybe Order - } - - type Order = Ascending | Descending - - query : Parser Query - query = - map3 Query (string "search") (int "page") (enum "sort" order) - - order : Dict.Dict String Order - order = - Dict.fromList - [ ( "ascending", Ascending ) - , ( "descending", Descending ) - ] - -map3: - (a -> b -> c -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser result --} -map3 : - (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map3 map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map3" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b", Type.var "c" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map3Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - ((map3Arg_ functionReducedUnpack) - functionReducedUnpack0 - ) - ) - ) - , map3Arg_0 - , map3Arg_1 - , map3Arg_2 - ] - - -{-| map4: - (a -> b -> c -> d -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser result --} -map4 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map4 map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map4" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map4Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (((map4Arg_ functionReducedUnpack) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - , map4Arg_0 - , map4Arg_1 - , map4Arg_2 - , map4Arg_3 - ] - - -{-| map5: - (a -> b -> c -> d -> e -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser result --} -map5 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map5 map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map5" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map5Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - ((((map5Arg_ functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - , map5Arg_0 - , map5Arg_1 - , map5Arg_2 - , map5Arg_3 - , map5Arg_4 - ] - - -{-| map6: - (a -> b -> c -> d -> e -> f -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser f - -> Url.Parser.Query.Parser result --} -map6 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map6 map6Arg_ map6Arg_0 map6Arg_1 map6Arg_2 map6Arg_3 map6Arg_4 map6Arg_5 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map6" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map6Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (((((map6Arg_ - functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - ) - , map6Arg_0 - , map6Arg_1 - , map6Arg_2 - , map6Arg_3 - , map6Arg_4 - , map6Arg_5 - ] - - -{-| map7: - (a -> b -> c -> d -> e -> f -> g -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser f - -> Url.Parser.Query.Parser g - -> Url.Parser.Query.Parser result --} -map7 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map7 map7Arg_ map7Arg_0 map7Arg_1 map7Arg_2 map7Arg_3 map7Arg_4 map7Arg_5 map7Arg_6 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map7" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map7Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - ((((((map7Arg_ - functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - ) - ) - , map7Arg_0 - , map7Arg_1 - , map7Arg_2 - , map7Arg_3 - , map7Arg_4 - , map7Arg_5 - , map7Arg_6 - ] - - -{-| If you need higher than eight, you can define a function like this: - - apply : Parser a -> Parser (a -> b) -> Parser b - apply argParser funcParser = - map2 (<|) funcParser argParser - -And then you can chain it to do as many of these as you would like: - - map func (string "search") - |> apply (int "page") - |> apply (int "per-page") - -map8: - (a -> b -> c -> d -> e -> f -> g -> h -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser f - -> Url.Parser.Query.Parser g - -> Url.Parser.Query.Parser h - -> Url.Parser.Query.Parser result --} -map8 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map8 map8Arg_ map8Arg_0 map8Arg_1 map8Arg_2 map8Arg_3 map8Arg_4 map8Arg_5 map8Arg_6 map8Arg_7 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map8" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - , Type.var "h" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "h" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map8Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (((((((map8Arg_ - functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - ) - ) - ) - , map8Arg_0 - , map8Arg_1 - , map8Arg_2 - , map8Arg_3 - , map8Arg_4 - , map8Arg_5 - , map8Arg_6 - , map8Arg_7 - ] - - -annotation_ : { parser : Type.Annotation -> Type.Annotation } -annotation_ = - { parser = - \parserArg0 -> - Type.alias - moduleName_ - "Parser" - [ parserArg0 ] - (Type.namedWith - [ "Url", "Parser", "Internal" ] - "QueryParser" - [ Type.var "a" ] - ) - } - - -call_ : - { string : Elm.Expression -> Elm.Expression - , int : Elm.Expression -> Elm.Expression - , enum : Elm.Expression -> Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , map2 : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , map3 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map4 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map5 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map6 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map7 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map8 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - } -call_ = - { string = - \stringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.string ] - ) - ) - } - ) - [ stringArg_ ] - , int = - \intArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "int" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.int ] - ) - ) - } - ) - [ intArg_ ] - , enum = - \enumArg_ enumArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "enum" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ enumArg_, enumArg_0 ] - , custom = - \customArg_ customArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.var "a") - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ customArg_, customArg_0 ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , map2 = - \map2Arg_ map2Arg_0 map2Arg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map2" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map2Arg_, map2Arg_0, map2Arg_1 ] - , map3 = - \map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map3" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map3Arg_, map3Arg_0, map3Arg_1, map3Arg_2 ] - , map4 = - \map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map4" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map4Arg_, map4Arg_0, map4Arg_1, map4Arg_2, map4Arg_3 ] - , map5 = - \map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map5" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map5Arg_ - , map5Arg_0 - , map5Arg_1 - , map5Arg_2 - , map5Arg_3 - , map5Arg_4 - ] - , map6 = - \map6Arg_ map6Arg_0 map6Arg_1 map6Arg_2 map6Arg_3 map6Arg_4 map6Arg_5 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map6" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map6Arg_ - , map6Arg_0 - , map6Arg_1 - , map6Arg_2 - , map6Arg_3 - , map6Arg_4 - , map6Arg_5 - ] - , map7 = - \map7Arg_ map7Arg_0 map7Arg_1 map7Arg_2 map7Arg_3 map7Arg_4 map7Arg_5 map7Arg_6 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map7" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map7Arg_ - , map7Arg_0 - , map7Arg_1 - , map7Arg_2 - , map7Arg_3 - , map7Arg_4 - , map7Arg_5 - , map7Arg_6 - ] - , map8 = - \map8Arg_ map8Arg_0 map8Arg_1 map8Arg_2 map8Arg_3 map8Arg_4 map8Arg_5 map8Arg_6 map8Arg_7 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map8" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - , Type.var "h" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "h" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map8Arg_ - , map8Arg_0 - , map8Arg_1 - , map8Arg_2 - , map8Arg_3 - , map8Arg_4 - , map8Arg_5 - , map8Arg_6 - , map8Arg_7 - ] - } - - -values_ : - { string : Elm.Expression - , int : Elm.Expression - , enum : Elm.Expression - , custom : Elm.Expression - , map : Elm.Expression - , map2 : Elm.Expression - , map3 : Elm.Expression - , map4 : Elm.Expression - , map5 : Elm.Expression - , map6 : Elm.Expression - , map7 : Elm.Expression - , map8 : Elm.Expression - } -values_ = - { string = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.string ] - ) - ) - } - , int = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "int" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.int ] - ) - ) - } - , enum = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "enum" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe (Type.var "a") ] - ) - ) - } - , custom = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.var "a") - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - , map2 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map2" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map3 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map3" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b", Type.var "c" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map4 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map4" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map5 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map5" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map6 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map6" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map7 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map7" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map8 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map8" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - , Type.var "h" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "h" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/UrlPath.elm b/codegen/Gen/UrlPath.elm deleted file mode 100644 index 643049c1..00000000 --- a/codegen/Gen/UrlPath.elm +++ /dev/null @@ -1,276 +0,0 @@ -module Gen.UrlPath exposing - ( moduleName_, join, fromString, toAbsolute, toRelative, toSegments - , annotation_, call_, values_ - ) - -{-| -# Generated bindings for UrlPath - -@docs moduleName_, join, fromString, toAbsolute, toRelative, toSegments -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "UrlPath" ] - - -{-| Turn a Path to a relative URL. - -join: UrlPath.UrlPath -> UrlPath.UrlPath --} -join : Elm.Expression -> Elm.Expression -join joinArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "join" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ joinArg_ ] - - -{-| Create a UrlPath from a path String. - - UrlPath.fromString "blog/post-1/" - |> UrlPath.toAbsolute - |> Expect.equal "/blog/post-1" - -fromString: String -> UrlPath.UrlPath --} -fromString : String -> Elm.Expression -fromString fromStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ Elm.string fromStringArg_ ] - - -{-| Turn a UrlPath to an absolute URL (with no trailing slash). - -toAbsolute: UrlPath.UrlPath -> String --} -toAbsolute : Elm.Expression -> Elm.Expression -toAbsolute toAbsoluteArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toAbsolute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toAbsoluteArg_ ] - - -{-| Turn a UrlPath to a relative URL. - -toRelative: UrlPath.UrlPath -> String --} -toRelative : Elm.Expression -> Elm.Expression -toRelative toRelativeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toRelative" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toRelativeArg_ ] - - -{-| toSegments: String -> List String -} -toSegments : String -> Elm.Expression -toSegments toSegmentsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toSegments" - , annotation = - Just (Type.function [ Type.string ] (Type.list Type.string)) - } - ) - [ Elm.string toSegmentsArg_ ] - - -annotation_ : { urlPath : Type.Annotation } -annotation_ = - { urlPath = Type.alias moduleName_ "UrlPath" [] (Type.list Type.string) } - - -call_ : - { join : Elm.Expression -> Elm.Expression - , fromString : Elm.Expression -> Elm.Expression - , toAbsolute : Elm.Expression -> Elm.Expression - , toRelative : Elm.Expression -> Elm.Expression - , toSegments : Elm.Expression -> Elm.Expression - } -call_ = - { join = - \joinArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "join" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ joinArg_ ] - , fromString = - \fromStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ fromStringArg_ ] - , toAbsolute = - \toAbsoluteArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toAbsolute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toAbsoluteArg_ ] - , toRelative = - \toRelativeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toRelative" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toRelativeArg_ ] - , toSegments = - \toSegmentsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toSegments" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.list Type.string) - ) - } - ) - [ toSegmentsArg_ ] - } - - -values_ : - { join : Elm.Expression - , fromString : Elm.Expression - , toAbsolute : Elm.Expression - , toRelative : Elm.Expression - , toSegments : Elm.Expression - } -values_ = - { join = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "join" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - , fromString = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - , toAbsolute = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "toAbsolute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - , toRelative = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "toRelative" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - , toSegments = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "toSegments" - , annotation = - Just (Type.function [ Type.string ] (Type.list Type.string)) - } - } \ No newline at end of file From 439fb97e838095fa76501cf6a79788280b8b05bd Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Wed, 2 Jul 2025 23:47:59 +0200 Subject: [PATCH 2/2] elm-review config to signal unused modules --- package-lock.json | 138 ++++++++++++++---------------------- package.json | 2 +- review/elm.json | 17 +++-- review/src/ReviewConfig.elm | 17 +++-- 4 files changed, 75 insertions(+), 99 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3425734..4fbfb2a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "elm-format": "0.8.7", "elm-optimize-level-2": "0.3.5", "elm-pages": "^3.0.19", - "elm-review": "2.11.1", + "elm-review": "^2.13.3", "elm-test": "^0.19.1-revision12", "vite": "^6.0.3" } @@ -1136,14 +1136,6 @@ "dev": true, "license": "MIT" }, - "node_modules/at-least-node": { - "version": "1.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/available-typed-arrays": { "version": "1.0.7", "dev": true, @@ -2344,28 +2336,28 @@ } }, "node_modules/elm-review": { - "version": "2.11.1", + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/elm-review/-/elm-review-2.13.3.tgz", + "integrity": "sha512-iEUihHeqTv0Xr5CVcUf1hDPxypXNtFPVunyEpn2LKAaa/FtEfTHKOVeBYfFNnt+bIDHbGA+hkWPv1qfzxEDH8Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "chalk": "^4.0.0", "chokidar": "^3.5.2", "cross-spawn": "^7.0.3", - "elm-solve-deps-wasm": "^1.0.2", + "elm-solve-deps-wasm": "^1.0.2 || ^2.0.0", "fastest-levenshtein": "^1.0.16", - "find-up": "^4.1.0", + "find-up": "^4.1.0 || ^5.0.0", "folder-hash": "^3.3.0", - "fs-extra": "^9.0.0", - "glob": "^7.1.4", "got": "^11.8.5", "graceful-fs": "^4.2.11", "minimist": "^1.2.6", "ora": "^5.4.0", "path-key": "^3.1.1", "prompts": "^2.2.1", - "rimraf": "^5.0.0", "strip-ansi": "^6.0.0", "terminal-link": "^2.1.1", + "tinyglobby": "^0.2.10", "which": "^2.0.2", "wrap-ansi": "^7.0.0" }, @@ -2373,81 +2365,12 @@ "elm-review": "bin/elm-review" }, "engines": { - "node": ">=10.0.0" + "node": "14 >=14.21 || 16 >=16.20 || 18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/jfmengels" } }, - "node_modules/elm-review/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/elm-review/node_modules/fs-extra": { - "version": "9.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/elm-review/node_modules/minimatch": { - "version": "9.0.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/elm-review/node_modules/rimraf": { - "version": "5.0.10", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^10.3.7" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/elm-review/node_modules/rimraf/node_modules/glob": { - "version": "10.4.5", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/elm-solve-deps-wasm": { "version": "1.0.2", "dev": true, @@ -7439,6 +7362,51 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.1.0", "dev": true, diff --git a/package.json b/package.json index dd4ab8ab..aa477679 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "elm-format": "0.8.7", "elm-optimize-level-2": "0.3.5", "elm-pages": "^3.0.19", - "elm-review": "2.11.1", + "elm-review": "^2.13.3", "elm-test": "^0.19.1-revision12", "vite": "^6.0.3" }, diff --git a/review/elm.json b/review/elm.json index 9926eacf..cfdbc4d2 100644 --- a/review/elm.json +++ b/review/elm.json @@ -9,15 +9,15 @@ "elm/core": "1.0.5", "elm/json": "1.1.3", "elm/project-metadata-utils": "1.0.2", - "jfmengels/elm-review": "2.14.0", - "jfmengels/elm-review-code-style": "1.1.4", + "jfmengels/elm-review": "2.15.1", + "jfmengels/elm-review-code-style": "1.2.0", "jfmengels/elm-review-common": "1.3.3", "jfmengels/elm-review-debug": "1.0.8", "jfmengels/elm-review-documentation": "2.0.4", - "jfmengels/elm-review-simplify": "2.1.5", - "jfmengels/elm-review-unused": "1.2.3", - "lue-bird/elm-review-import-simple": "1.0.2", - "stil4m/elm-syntax": "7.3.2" + "jfmengels/elm-review-simplify": "2.1.9", + "jfmengels/elm-review-unused": "1.2.4", + "lue-bird/elm-review-import-simple": "1.0.3", + "stil4m/elm-syntax": "7.3.9" }, "indirect": { "elm/bytes": "1.0.8", @@ -26,10 +26,9 @@ "elm/random": "1.0.0", "elm/regex": "1.0.0", "elm/time": "1.0.0", - "elm/virtual-dom": "1.0.3", + "elm/virtual-dom": "1.0.4", "elm-explorations/test": "2.2.0", - "miniBill/elm-fast-dict": "1.1.0", - "miniBill/elm-unicode": "1.1.1", + "miniBill/elm-fast-dict": "1.2.4", "pzp1997/assoc-list": "1.0.0", "rtfeldman/elm-hex": "1.0.0", "stil4m/structured-writer": "1.0.3" diff --git a/review/src/ReviewConfig.elm b/review/src/ReviewConfig.elm index 88604b2a..2754d112 100644 --- a/review/src/ReviewConfig.elm +++ b/review/src/ReviewConfig.elm @@ -18,6 +18,7 @@ import NoUnused.CustomTypeConstructorArgs import NoUnused.CustomTypeConstructors import NoUnused.Dependencies import NoUnused.Exports +import NoUnused.Modules import NoUnused.Parameters import NoUnused.Patterns import NoUnused.Variables @@ -33,8 +34,9 @@ config = , from = exposedModules } , Docs.ReviewLinksAndSections.rule - |> Rule.ignoreErrorsForDirectories [ "src/Gen" ] + |> Rule.ignoreErrorsForDirectories [ "src/Gen", "codegen" ] , Docs.ReviewAtDocs.rule + |> Rule.ignoreErrorsForDirectories [ "codegen" ] , Docs.UpToDateReadmeLinks.rule , NoConfusingPrefixOperator.rule , NoDebug.Log.rule @@ -43,12 +45,15 @@ config = , NoExposingEverything.rule , NoImportingEverything.rule [] , NoMissingTypeAnnotation.rule + |> Rule.ignoreErrorsForDirectories [ "codegen" ] , NoMissingTypeAnnotationInLetIn.rule + |> Rule.ignoreErrorsForDirectories [ "codegen" ] , NoMissingTypeExpose.rule , NoSimpleLetBody.rule , NoPrematureLetComputation.rule , NoUnused.CustomTypeConstructors.rule [] , NoUnused.CustomTypeConstructorArgs.rule + |> Rule.ignoreErrorsForDirectories [ "codegen" ] , NoUnused.Dependencies.rule , NoUnused.Exports.rule |> Rule.ignoreErrorsForFiles @@ -56,12 +61,16 @@ config = , "src/OpenApi/Config.elm" , "src/TestGenScript.elm" ] + |> Rule.ignoreErrorsForDirectories [ "codegen" ] + + -- NoUnused.Modules would normally be redundant, but we are excluding codegen from NoUnused.Exports, and yet we still want to check for unused modules + , NoUnused.Modules.rule + |> Rule.ignoreErrorsForFiles [ "src/TestGenScript.elm" ] , NoUnused.Parameters.rule , NoUnused.Patterns.rule , NoUnused.Variables.rule , Simplify.rule Simplify.defaults - |> Rule.ignoreErrorsForDirectories [ "src/Gen" ] + |> Rule.ignoreErrorsForDirectories [ "src/Gen", "codegen" ] , Review.ImportSimple.rule - |> Rule.ignoreErrorsForDirectories [ "src/Gen" ] + |> Rule.ignoreErrorsForDirectories [ "src/Gen", "codegen" ] ] - |> List.map (Rule.ignoreErrorsForDirectories [ "codegen" ])