Skip to content

Attempt to deconstruct Aff to either Pure or Effect #197

Description

@jvliwanag

Any chance we can get something similar to

data Step a = PureStep a | EffectStep (Effect a) | AffStep (Aff a)

deconstruct :: forall a. Aff a -> Step a

Examples:

  • deconstruct (pure 5) -- returns (PureStep 5)
  • deconstruct (liftEffect (log "hello world")) -- returns (EffectStep ...)

Not sure about the names. But there are incidents when I'd like to be able to take a peek at Aff a. And whether I can take advantage of JS' single threaded runtime if it turns out that the Aff is just Effect.

I can try to implement this if this change is welcome - and if it's possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions