Skip to content

Instantly share code, notes, and snippets.

@lydell
Created May 5, 2024 17:39
Show Gist options
  • Save lydell/e84d89114cf79a65e60a592f95fdfee8 to your computer and use it in GitHub Desktop.
Save lydell/e84d89114cf79a65e60a592f95fdfee8 to your computer and use it in GitHub Desktop.
Elm functions that return Cmd
// https://elm.dmy.fr/?q=elm%2F
// https://elm.dmy.fr/?q=elm-explorations%2F
copy(Array.from(document.querySelectorAll(".pkg-summary-title a"), e => e.textContent).filter(s => s.startsWith("elm/") || s.startsWith("elm-explorations/")).join("\n"))
while read name
echo $name
curl -sH 'accept-encoding: gzip' https://package.elm-lang.org/packages/$name/latest/docs.json | gunzip | jq . > docs/(string replace / __ $name).json
end < packages.txt
import * as fs from "node:fs";
console.log(fs.readdirSync("docs").flatMap(file =>
JSON.parse(fs.readFileSync(`docs/${file}`, "utf8"))
.flatMap(m =>
m.values
.filter(v => v.type.endsWith("Platform.Cmd.Cmd msg"))
.map(v => `${m.name}.${v.name}`)
)
).sort().join("\n"));
Browser.Navigation.back
Browser.Navigation.forward
Browser.Navigation.load
Browser.Navigation.pushUrl
Browser.Navigation.reload
Browser.Navigation.reloadAndSkipCache
Browser.Navigation.replaceUrl
File.Download.bytes
File.Download.string
File.Download.url
File.Select.file
File.Select.files
Http.cancel
Http.get
Http.post
Http.request
Http.riskyRequest
Platform.Cmd.batch
Platform.Cmd.map
Platform.Cmd.none
Random.generate
Task.attempt
Task.perform
elm-explorations/test
elm-explorations/markdown
elm-explorations/linear-algebra
elm-explorations/webgl
elm-explorations/benchmark
elm/core
elm/html
elm/browser
elm/json
elm/http
elm/url
elm/time
elm/random
elm/svg
elm/parser
elm/regex
elm/file
elm/bytes
elm/virtual-dom
elm/project-metadata-utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment