Skip to content

Move to spago. Remove pulp. #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/bower_components/
/.pulp-cache/
/output/
/output/
.spago/
.purs-repl
node_modules/
44 changes: 0 additions & 44 deletions bower.json

This file was deleted.

7 changes: 4 additions & 3 deletions examples/billpay-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"private": true,
"scripts": {
"compile": "webpack --progress --colors --optimize-minimize",
"compile-psc": "pulp build",
"start": "npm run start-psc & webpack-dev-server --watch",
"start-psc": "pulp --watch build"
"start": "webpack-dev-server --watch"
},
"dependencies": {
"es6-promise": "^4.1.0",
Expand All @@ -25,7 +23,10 @@
"babel-preset-stage-0": "^6.5.0",
"css-loader": "^0.28.7",
"image-webpack-loader": "^3.4.2",
"parcel-bundler": "^1.12.4",
"purescript": "^0.13.6",
"react-hot-loader": "^1.3.0",
"spago": "^0.14.0",
"webpack": "^3.5.5",
"webpack-dev-server": "^2.7.1",
"webpack-shell-plugin": "^0.5.0"
Expand Down
22 changes: 22 additions & 0 deletions examples/billpay-react/spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{-
Welcome to a Spago project!
You can edit this file as you like.
-}
{ name = "presto-app"
, dependencies =
[ "aff"
, "arrays"
, "console"
, "effect"
, "folds"
, "foreign-generic"
, "free"
, "newtype"
, "prelude"
, "presto"
, "psci-support"
, "transformers"
]
, packages = ../../packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
}
43 changes: 21 additions & 22 deletions examples/billpay-react/src/UI/Flow.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,37 @@ import UI.Types (AskAmountScreen(..), AskAmountScreenAction(..), AskMobileNumber

splashScreen :: Flow BillPayFailure SplashScreenAction
splashScreen = do
action <- runUI' SplashScreen
case action of
SplashScreenRendered -> pure SplashScreenRendered
SplashScreenAbort -> liftLeft UserAbort
action <- runUI' SplashScreen
case action of
SplashScreenRendered -> pure SplashScreenRendered
SplashScreenAbort -> liftLeft UserAbort

chooseOperator :: Array Operator -> Flow BillPayFailure Operator
chooseOperator operators = do
action <- runUI' (ChooseOperatorScreen operators)
case action of
OperatorSelected operator-> pure operator
ChooseOperatorScreenAbort -> liftLeft UserAbort
action <- runUI' (ChooseOperatorScreen operators)
case action of
OperatorSelected operator-> pure operator
ChooseOperatorScreenAbort -> liftLeft UserAbort


askMobileNumber :: Flow BillPayFailure MobileNumber
askMobileNumber = do
action <- runUI' AskMobileNumberScreen
case action of
SubmitMobileNumber mobileNumber -> pure mobileNumber
AskMobileNumberScreenAbort -> liftLeft UserAbort
action <- runUI' AskMobileNumberScreen
case action of
SubmitMobileNumber mobileNumber -> pure mobileNumber
AskMobileNumberScreenAbort -> liftLeft UserAbort

askAmount :: Flow BillPayFailure Amount
askAmount = do
action <- runUI' AskAmountScreen
case action of
SubmitAmount amount -> pure amount
AskAmountScreenAbort -> liftLeft UserAbort
action <- runUI' AskAmountScreen
case action of
SubmitAmount amount -> pure amount
AskAmountScreenAbort -> liftLeft UserAbort


billPayStatus :: MobileNumber -> Amount -> BillPayStatus -> Flow BillPayFailure StatusScreenAction
billPayStatus mobileNumber amount payStatus = do
action <- runUI' (StatusScreen mobileNumber amount payStatus)
case action of
SuccessResult -> pure SuccessResult
StatusScreenAbort -> liftLeft UserAbort

action <- runUI' (StatusScreen mobileNumber amount payStatus)
case action of
SuccessResult -> pure SuccessResult
StatusScreenAbort -> liftLeft UserAbort
11 changes: 11 additions & 0 deletions examples/billpay-react/test/Main.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Test.Main where

import Prelude

import Effect (Effect)
import Effect.Class.Console (log)

main :: Effect Unit
main = do
log "🍝"
log "You should add some tests."
Loading