diff --git a/.gitignore b/.gitignore index 36ffd29..46e7934 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ ebin/ erl_crash.dump output/ .psc-package/ +.spago/ diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..e1bbdf5 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: [ process.env.PRETTIER_PURESCRIPT ], +} diff --git a/Makefile b/Makefile index 30a0efb..0c82143 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ -.PHONY: ps erl all test +.PHONY: ps erl all test clean distclean -all: ps erl +.DEFAULT_GOAL := ps + +all: test ps: - psc-package sources | xargs purs compile 'test/**/*.purs' 'src/**/*.purs' + @spago build -erl: ps - mkdir -p ebin - erlc -o ebin/ output/*/*.erl +clean: + rm -rf output -test: erl - erl -pa ebin -noshell -eval '(test_main@ps:main())()' -eval 'init:stop()' +distclean: clean + rm -rf .spago +test: + @spago -x test.dhall test diff --git a/spago.dhall b/spago.dhall index 067dcdc..eedec09 100644 --- a/spago.dhall +++ b/spago.dhall @@ -10,7 +10,6 @@ You can edit this file as you like. , "foreign" , "integers" , "prelude" - , "unsafe-coerce" ] , packages = ./packages.dhall , sources = [ "src/**/*.purs" ] diff --git a/src/Erl/Process.purs b/src/Erl/Process.purs index 846abbc..d4d4eea 100644 --- a/src/Erl/Process.purs +++ b/src/Erl/Process.purs @@ -24,14 +24,13 @@ module Erl.Process import Prelude import Data.Either (Either) -import Data.Time.Duration (Milliseconds(..)) +import Data.Time.Duration (Milliseconds) import Effect (Effect) import Effect.Class (class MonadEffect, liftEffect) import Erl.Process.Raw (ExitReason(..), ExitMsg(..)) as RawExport -import Erl.Process.Raw (ExitReason, getPid) +import Erl.Process.Raw (ExitReason) import Erl.Process.Raw as Raw import Foreign (Foreign) -import Unsafe.Coerce (unsafeCoerce) newtype Process (a :: Type) = Process Raw.Pid