diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/world/net/uri/scheme.lux | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/stdlib/source/library/lux/world/net/uri/scheme.lux b/stdlib/source/library/lux/world/net/uri/scheme.lux new file mode 100644 index 000000000..7db4b9583 --- /dev/null +++ b/stdlib/source/library/lux/world/net/uri/scheme.lux @@ -0,0 +1,141 @@ +(.require + [library + [lux (.except) + [abstract + ["[0]" equivalence (.only Equivalence)] + ["[0]" hash (.only Hash)]] + [data + ["[0]" text]] + [meta + [type + ["[0]" primitive (.only primitive)]]]]]) + +... https://en.wikipedia.org/wiki/List_of_URI_schemes +(primitive .public Scheme + Text + + (with_template [<scheme> <name>] + [(def .public <name> + Scheme + (primitive.abstraction <scheme>))] + + ["about" about] + ["acap" acap] + ["acct" user_account] + ["acr" anonymous_customer_reference] + ["attachment" attachment] + + ["bitcoin" bitcoin] + ["blob" blob] + + ["cap" calendar_access_protocol] + + ["data" data] + ["dns" dns] + ["dntp" dntp] + ["doi" digital_object_identifier] + ["drm" drm] + + ["feed" feed] + ["file" file] + ["finger" finger] + ["fish" fish] + ["fm" fm] + ["ftp" ftp] + + ["geo" geo] + ["git" git] + + ["http" http] + ["https" https] + + ["imap" imap] + ["ipp" ipp] + ["ipps" ipps] + ["irc" irc] + ["irc6" irc6] + ["ircs" ircs] + + ["jar" jar] + + ["ldap" ldap] + ["ldaps" ldaps] + + ["magnet" magnet] + ["mailto" mail_to] + ["mvn" apache_maven] + + ["pop" pop] + + ["sip" sip] + ["sips" sips] + ["sms" sms] + ["snmp" snmp] + ["ssh" ssh] + ["stun" stun] + ["stuns" stuns] + + ["tel" telephone_number] + ["turn" turn] + ["turns" turns] + + ["xmpp" xmpp] + ) + + (with_template [<name> <alias>] + [(def .public <alias> + Scheme + <name>)] + + [acap application_configuration_access_protocol] + + [dns domain_name_system] + [dntp direct_network_transfer_protocol] + + [ftp file_transfer_protocol] + + [http hypertext_transfer_protocol] + [https secure_hypertext_transfer_protocol] + + [imap internet_message_access_protocol] + [ipp internet_printing_protocol] + [ipps secure_internet_printing_protocol] + [irc internet_relay_chat] + [ircs secure_internet_relay_chat] + + [ldap lightweight_directory_access_protocol] + [ldaps secure_lightweight_directory_access_protocol] + + [pop post_office_protocol] + + [sip session_initiation_protocol] + [sips secure_session_initiation_protocol] + [sms short_message_service] + [snmp simple_network_management_protocol] + [ssh secure_shell_protocol] + + [stun session_traversal_utilities_for_nat] + [stuns secure_session_traversal_utilities_for_nat] + + [turn traversal_using_relays_around_nat] + [turns secure_traversal_using_relays_around_nat] + + [xmpp extensible_messaging_and_presence_protocol] + ) + + (def .public scheme + (-> Text Scheme) + (|>> primitive.abstraction)) + + (def .public name + (-> Scheme Text) + (|>> primitive.representation)) + + (def .public equivalence + (Equivalence Scheme) + (at equivalence.functor each ..name text.equivalence)) + + (def .public hash + (Hash Scheme) + (at hash.functor each ..name text.hash)) + ) |