Skip to content

Commit

Permalink
Helpers around launcAff_
Browse files Browse the repository at this point in the history
  • Loading branch information
rlamacraft committed Feb 24, 2019
1 parent 1d9b099 commit 4cecd41
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/PurelyScriptable.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module PurelyScriptable
( run
, runWithErrorLogging
) where

import Control.Applicative (pure)
import Control.Semigroupoid ((>>>))
import Data.Either (either)
import Data.Functor (map)
import Data.Unit (Unit)
import Effect (Effect)
import Effect.Aff (Aff, attempt, launchAff_)
import Effect.Exception (throwException)

run :: forall a . Aff a -> Effect Unit
run = launchAff_

runWithErrorLogging :: forall a . Aff a -> Effect Unit
runWithErrorLogging = attempt >>> map (either throwException pure) >>> launchAff_

0 comments on commit 4cecd41

Please sign in to comment.