~toastal/purescript-web-network-information

0e475bd3d8d8a939456791bd8d2c63805a4e5e0b — toastal 3 years ago 62bccc6 v0.3.2
upgrade dependencies, license comment block condensed, purs-tidy
M flake.lock => flake.lock +9 -9
@@ 3,11 3,11 @@
    "easy-purescript-nix": {
      "flake": false,
      "locked": {
        "lastModified": 1634991731,
        "narHash": "sha256-uAS889Rpl//h0Ne2M7NyNk6tDFOkr9O3R8yny3qHKVk=",
        "lastModified": 1637830227,
        "narHash": "sha256-S/n17xSJ9uSOY3EfIXWby/iNkQ+6LqHQmBM7T3yC4tg=",
        "owner": "justinwoo",
        "repo": "easy-purescript-nix",
        "rev": "7802db65618c2ead3a55121355816b4c41d276d9",
        "rev": "721bbd957c62594c46ea4c94f1a9f3cb341b2d25",
        "type": "github"
      },
      "original": {


@@ 18,11 18,11 @@
    },
    "flake-utils": {
      "locked": {
        "lastModified": 1637014545,
        "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
        "lastModified": 1638122382,
        "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
        "rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
        "type": "github"
      },
      "original": {


@@ 33,11 33,11 @@
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1636976544,
        "narHash": "sha256-9ZmdyoRz4Qu8bP5BKR1T10YbzcB9nvCeQjOEw2cRKR0=",
        "lastModified": 1638198142,
        "narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "931ab058daa7e4cd539533963f95e2bb0dbd41e6",
        "rev": "8a308775674e178495767df90c419425474582a1",
        "type": "github"
      },
      "original": {

M src/Web/HTML/Navigator/Extra.purs => src/Web/HTML/Navigator/Extra.purs +2 -2
@@ 1,5 1,5 @@
{-! SPDX-License-Identifier: BSD-3-Clause
    Copyright © 2021 toastal purescript-web-network-information
{-@license BSD-3-Clause
Copyright © 2021 toastal purescript-web-network-information
-}
module Web.HTML.Navigator.Extra
   ( connection

M src/Web/NetworkInformation.purs => src/Web/NetworkInformation.purs +2 -2
@@ 1,5 1,5 @@
{-! SPDX-License-Identifier: BSD-3-Clause
    Copyright © 2021 toastal purescript-web-network-information
{-@license BSD-3-Clause
Copyright © 2021 toastal purescript-web-network-information
-}
-- | https://wicg.github.io/netinfo/#networkinformation-interface
module Web.NetworkInformation

M src/Web/NetworkInformation/ConnectionType.purs => src/Web/NetworkInformation/ConnectionType.purs +38 -38
@@ 1,5 1,5 @@
{-! SPDX-License-Identifier: BSD-3-Clause
    Copyright © 2021 toastal purescript-web-network-information
{-@license BSD-3-Clause
Copyright © 2021 toastal purescript-web-network-information
-}
-- | https://wicg.github.io/netinfo/#connectiontype-enum
module Web.NetworkInformation.ConnectionType where


@@ 9,51 9,51 @@ import Prelude
import Data.Maybe (Maybe(..))

data ConnectionType
  = Bluetooth
  | Cellular
  | Ethernet
  | Mixed
  | None
  | Other
  | Unknown
  | WiFi
  | WiMAX
   = Bluetooth
   | Cellular
   | Ethernet
   | Mixed
   | None
   | Other
   | Unknown
   | WiFi
   | WiMAX

derive instance eqConnectionType ∷ Eq ConnectionType

instance showConnectionType ∷ Show ConnectionType where
   show = case _ of
      Bluetooth -> "Bluetooth"
      Cellular -> "Cellular"
      Ethernet -> "Ethernet"
      Mixed -> "Mixed"
      None -> "None"
      Other -> "Other"
      Unknown -> "Unknown"
      WiFi -> "WiFi"
      WiMAX -> "WiMAX"
      Bluetooth → "Bluetooth"
      Cellular → "Cellular"
      Ethernet → "Ethernet"
      Mixed → "Mixed"
      None → "None"
      Other → "Other"
      Unknown → "Unknown"
      WiFi → "WiFi"
      WiMAX → "WiMAX"

parse ∷ String → Maybe ConnectionType
parse = case _ of
   "bluetooth" -> Just Bluetooth
   "cellular" -> Just Cellular
   "ethernet" -> Just Ethernet
   "mixed" -> Just Mixed
   "none" -> Just None
   "other" -> Just Other
   "unknown" -> Just Unknown
   "wifi" -> Just WiFi
   "wimax" -> Just WiMAX
   "bluetooth" → Just Bluetooth
   "cellular" → Just Cellular
   "ethernet" → Just Ethernet
   "mixed" → Just Mixed
   "none" → Just None
   "other" → Just Other
   "unknown" → Just Unknown
   "wifi" → Just WiFi
   "wimax" → Just WiMAX
   _ → Nothing

print ∷ ConnectionType → String
print = case _ of
   Bluetooth -> "bluetooth"
   Cellular -> "cellular"
   Ethernet -> "ethernet"
   Mixed -> "mixed"
   None -> "none"
   Other -> "other"
   Unknown -> "unknown"
   WiFi -> "wifi"
   WiMAX -> "wimax"
   Bluetooth → "bluetooth"
   Cellular → "cellular"
   Ethernet → "ethernet"
   Mixed → "mixed"
   None → "none"
   Other → "other"
   Unknown → "unknown"
   WiFi → "wifi"
   WiMAX → "wimax"

M src/Web/NetworkInformation/EffectiveConnectionType.purs => src/Web/NetworkInformation/EffectiveConnectionType.purs +2 -2
@@ 1,5 1,5 @@
{-! SPDX-License-Identifier: BSD-3-Clause
    Copyright © 2021 toastal purescript-web-network-information
{-@license BSD-3-Clause
Copyright © 2021 toastal purescript-web-network-information
-}
-- | https://wicg.github.io/netinfo/#x4-3-effective-connection-types
module Web.NetworkInformation.EffectiveConnectionType

M src/Web/NetworkInformation/Megabit.purs => src/Web/NetworkInformation/Megabit.purs +2 -2
@@ 1,5 1,5 @@
{-! SPDX-License-Identifier: BSD-3-Clause
   Copyright © 2021 toastal purescript-web-network-information
{-@license BSD-3-Clause
Copyright © 2021 toastal purescript-web-network-information
-}
-- | This can hopefully be relpaced with something like `Data.Time.Duration`
-- | where values can easily be converted to kilobits, kilobytes, etc.