Created
July 15, 2022 17:21
-
-
Save pete-murphy/0af4ae4f5f141509e9bca4f19826eeca to your computer and use it in GitHub Desktop.
Derive Functor for Cont-like type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main where | |
| import Prelude | |
| import Effect (Effect) | |
| import Elmish.Dispatch (Dispatch) | |
| import Control.Monad.Cont (Cont, runCont) | |
| import Data.Newtype (class Newtype) | |
| newtype Effect' a = Effect' (Cont (Effect Unit) a) | |
| derive instance Newtype (Effect' a) _ | |
| derive newtype instance Functor Effect' | |
| runEffect' :: forall a. Effect' a -> (Dispatch a -> Effect Unit) | |
| runEffect' (Effect' c) = runCont c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment