diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..43317ce --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,16 @@ +name: Verify + +on: + push: + branches: + - master + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: asdf-vm/actions/install@v1 + - run: spago build --path example/**/*.purs + - run: spago test + - run: for example in $(ls example); do spago run -m Example.${example%.*} -p example/$example; done diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b791477..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -dist: bionic -sudo: required -node_js: stable - -env: - - PATH=$HOME:$HOME/purescript:$PATH - -install: - - PURS_VER=v0.13.3 - - SPAGO_VER=0.10.0.0 - - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$PURS_VER/linux64.tar.gz - - wget -O $HOME/spago.tar.gz https://github.com/spacchetti/spago/releases/download/$SPAGO_VER/linux.tar.gz - - tar -xvf $HOME/purescript.tar.gz -C $HOME/ - - tar -xvf $HOME/spago.tar.gz -C $HOME/ - - chmod a+x $HOME/purescript/purs - - chmod a+x $HOME/spago - - spago install -script: - - spago build --path example/**/*.purs - - spago test diff --git a/packages.dhall b/packages.dhall index f3024ad..79ccb88 100644 --- a/packages.dhall +++ b/packages.dhall @@ -109,10 +109,10 @@ let additions = -} let mkPackage = - https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.3-20190831/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57 + https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.0-20190626/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57 let upstream = - https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.3-20190831/src/packages.dhall sha256:852cd4b9e463258baf4e253e8524bcfe019124769472ca50b316fe93217c3a47 + https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210324/packages.dhall sha256:b4564d575da6aed1c042ca7936da97c8b7a29473b63f4515f09bb95fae8dddab let overrides = {=} diff --git a/spago.dhall b/spago.dhall index 6900324..e98661f 100644 --- a/spago.dhall +++ b/spago.dhall @@ -8,7 +8,6 @@ You can edit this file as you like. [ "console" , "effect" , "foreign-object" - , "generics-rep" , "integers" , "node-process" , "numbers" diff --git a/src/TypedEnv.purs b/src/TypedEnv.purs index 5d3eae0..5f27783 100644 --- a/src/TypedEnv.purs +++ b/src/TypedEnv.purs @@ -21,7 +21,7 @@ module TypedEnv import Prelude import Data.Either (Either, note) import Data.Generic.Rep (class Generic) -import Data.Generic.Rep.Show (genericShow) +import Data.Show.Generic (genericShow) import Data.Int (fromString) as Int import Data.Maybe (Maybe(..)) import Data.Number (fromString) as Number @@ -30,7 +30,7 @@ import Data.String.Common (toLower) import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol) import Foreign.Object (Object, lookup) import Prim.Row (class Cons, class Lacks) as Row -import Prim.RowList (class RowToList, kind RowList, Cons, Nil) +import Prim.RowList (class RowToList, RowList, Cons, Nil) import Record (insert) as Record import Type.Data.RowList (RLProxy(..)) import Type.Equality (class TypeEquals, to) @@ -66,6 +66,7 @@ envErrorMessage = case _ of EnvParseError var -> "The variable \"" <> var <> "\" was formatted incorrectly." -- | Useful for a type alias representing a resolved environment +type Resolved :: forall k. Symbol -> k -> k type Resolved (name :: Symbol) ty = ty -- | Parses a `String` value to the specified type. @@ -110,7 +111,7 @@ else instance readValueRequired :: ParseValue a => ReadValue a where >>= (parseValue >>> note (EnvParseError name)) -- | Transforms a row of environment variable specifications to a record. -class ReadEnv (e :: # Type) (r :: # Type) where +class ReadEnv (e :: Row Type) (r :: Row Type) where readEnv :: forall proxy. proxy e -> Object String -> Either EnvError (Record r) instance readEnvImpl :: @@ -123,7 +124,7 @@ instance readEnvImpl :: readEnv _ = readEnvFields (RLProxy :: RLProxy el) (RLProxy :: RLProxy rl) -- | Transforms a list of environment variable specifications to a record. -class ReadEnvFields (el :: RowList) (rl :: RowList) (r :: # Type) | el -> rl where +class ReadEnvFields (el :: RowList Type) (rl :: RowList Type) (r :: Row Type) | el -> rl where readEnvFields :: forall proxy . proxy el