Skip to content

Commit

Permalink
Demonstrate isomorphism of one-type-parameter with multi
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjaguarpaw committed Oct 30, 2024
1 parent 8f348b9 commit 0c0d4a7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bluefin-internal/src/Bluefin/Internal/Examples.hs
Original file line number Diff line number Diff line change
Expand Up @@ -963,3 +963,33 @@ runCounter7 stb y k =
(State Int e, State Bool e, Stream String e) ->
Eff (e :& es) r
useImplk = useImpl @e . k

foo ::
(e1 :> es, e2 :> es, e3 :> es) =>
State () e1 ->
State Bool e2 ->
State Int e3 ->
Eff es ()
foo _ _ _ = pure ()

bar ::
State () e ->
State Bool e ->
State Int e ->
Eff e ()
bar _ _ _ = pure ()

barFromFoo ::
State () e ->
State Bool e ->
State Int e ->
Eff e ()
barFromFoo = foo

fooFromBar ::
(e1 :> es, e2 :> es, e3 :> es) =>
State () e1 ->
State Bool e2 ->
State Int e3 ->
Eff es ()
fooFromBar s1 s2 s3 = bar (mapHandle s1) (mapHandle s2) (mapHandle s3)

0 comments on commit 0c0d4a7

Please sign in to comment.