Skip to content

Commit

Permalink
Inline variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjaguarpaw committed Jun 19, 2024
1 parent 342c96a commit a5c9ff7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions bluefin-internal/src/Bluefin/Internal/Examples.hs
Original file line number Diff line number Diff line change
Expand Up @@ -591,18 +591,18 @@ runFileSystemPure' ex fs0 k =
-- This extra handler confirms that we can create our handle in
-- the context of more than one handler
evalState () $ \_ ->
let fsh0 =
MkFileSystem
{ readFileImpl = \path -> do
fs' <- get fs
case lookup path fs' of
Nothing ->
throw ex ("File not found: " <> path)
Just s -> pure s,
writeFileImpl = \path contents ->
modify fs ((path, contents) :)
}
in within k fsh0
within
k
MkFileSystem
{ readFileImpl = \path -> do
fs' <- get fs
case lookup path fs' of
Nothing ->
throw ex ("File not found: " <> path)
Just s -> pure s,
writeFileImpl = \path contents ->
modify fs ((path, contents) :)
}

action :: (e :> es) => FileSystem e -> Eff es String
action fs = do
Expand Down

0 comments on commit a5c9ff7

Please sign in to comment.