Created
May 8, 2020 03:35
-
-
Save Ebmtranceboy/8310c59bc763026718b6d35240cef4bb 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 Main where | |
import Prelude | |
type Make m = | |
{ | |
make :: forall x . m x | |
} | |
type Context m r = | |
{ | |
bm :: Make m | r | |
} | |
test :: forall m r. (Monad m) => Context m r -> m Unit | |
test ctx = do | |
-- works fine | |
_ <- ctx.bm.make | |
-- bm seems to have a different type after deconstruction because this fails to compile | |
let { bm } = ctx | |
_ <- bm.make | |
-- this again works | |
let { bm: bm' :: Make m } = ctx | |
_ <- bm'.make | |
-- this works too | |
let { bm: bm'' :: { make :: forall x . m x }} = ctx | |
_ <- bm''.make | |
pure unit | |
main = pure unit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment