Skip to content

Can an extra operation help explain things? #39

@treeowl

Description

@treeowl
appEval :: forall a (b :: TYPE rep).
   (a -> b) -> Eval a -> b
appEval f (Eval (IO m)) =
  case runRW# m of
    (# _, a #) -> f a

Ignoring levity polymorphism, this could be implemented

appEval f m = runEval (f <$> m)

Moreover,

runEval = appEval id

But what makes this interesting, I think, is its relationship with >>=: aside from arity wibbles,

m >>= f = appEval f m

This strikes me as a really pleasant property.

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