-
-
Save kozross/7bcc45d37347d8c7c253713937e55771 to your computer and use it in GitHub Desktop.
This file contains 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 Freeder where | |
import Control.Applicative.Free (Ap) | |
data ReaderF (r :: Type) (a :: Type) where | |
Ask :: ReaderF r r | |
newtype Reader (r :: Type) (a :: Type) = | |
Reader (Ap (ReaderF r) a) | |
deriving (Functor, Applicative) via (Ap (ReaderF r)) | |
local :: (r -> r) -> Reader r a -> Reader r a | |
local = ??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment