polysemy-research / polysemy

:gemini: higher-order, no-boilerplate monads
BSD 3-Clause "New" or "Revised" License
1.04k stars 72 forks source link

Real life program core #288

Closed isovector closed 3 years ago

isovector commented 4 years ago

I just finished writing a real program, and have some core to look at. This thing has an explicit SPECIALIZE pragma on the main Sem entry point. This is with loopbreaker turned off (because it's broken.... @TheMatten ;) ), but it looks like most of the core should get specialized away with GHC 8.10's !668.

Thought I'd share; this is way more promising than I was expecting.


==================== Tidy Core ====================
2019-11-27 10:18:54.633199165 UTC

Result size of Tidy Core
  = {terms: 1,432, types: 65,298, coercions: 201,596, joins: 2/57}

-- RHS size: {terms: 1, types: 384, coercions: 1,265, joins: 0/0}
$d~~7_rtCk
  :: ContentStore (AST [Block])
     ~~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ContentStore (AST [Block])))
$d~~7_rtCk
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ (ContentStore (AST [Block]))
      @ (IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ContentStore (AST [Block]))))
      @~ <Co:1265>

-- RHS size: {terms: 1, types: 382, coercions: 1,679, joins: 0/0}
$d~~5_rtCl
  :: ScratchMgr [Block]
     ~~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ScratchMgr [Block]))
$d~~5_rtCl
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ (ScratchMgr [Block])
      @ (IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ScratchMgr [Block])))
      @~ <Co:1679>

-- RHS size: {terms: 1, types: 358, coercions: 567, joins: 0/0}
$d~~2_rtCm
  :: State (LastLoadedSnippets [Block])
     ~~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (State (LastLoadedSnippets [Block])))
$d~~2_rtCm
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ (State (LastLoadedSnippets [Block]))
      @ (IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (State (LastLoadedSnippets [Block]))))
      @~ <Co:567>

-- RHS size: {terms: 3, types: 535, coercions: 707, joins: 0/0}
$d(%,%)12_rtCn
  :: (Find
        '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
          ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
          HashNaming, Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (State (LastLoadedSnippets [Block])),
      State (LastLoadedSnippets [Block])
      ~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (State (LastLoadedSnippets [Block]))))
$d(%,%)12_rtCn = ($WSZ `cast` <Co:351>, $d~~2_rtCm `cast` <Co:356>)

-- RHS size: {terms: 3, types: 1,708, coercions: 2,234, joins: 0/0}
$d(%,%)15_rtCo
  :: ((Find
         '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
           HashNaming, Filesystem, Output Message, Input Command, Input Event,
           Input Command, Trace, Embed IO, Final IO]
         (State (LastLoadedSnippets [Block])),
       State (LastLoadedSnippets [Block])
       ~ IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (State (LastLoadedSnippets [Block])))),
      IfStuck
        (IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (State (LastLoadedSnippets [Block]))))
        (IfStuck
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (TypeError ...)
           (Pure (TypeError ...)))
        NoErrorFcf)
$d(%,%)15_rtCo = ($d(%,%)12_rtCn, C:(%%) `cast` <Co:2234>)

-- RHS size: {terms: 1, types: 23, coercions: 4, joins: 0/0}
$d~~1_rtCq :: Error LookupFailure ~~ Error LookupFailure
$d~~1_rtCq
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ (Error LookupFailure)
      @ (Error LookupFailure)
      @~ <Co:4>

-- RHS size: {terms: 3, types: 207, coercions: 391, joins: 0/0}
$d(%,%)1_rtCr
  :: (Find
        '[Error LookupFailure, State (LastLoadedSnippets [Block]),
          ContentStore (AST [Block]), ScratchMgr [Block],
          LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
          Output Message, Input Command, Input Event, Input Command, Trace,
          Embed IO, Final IO]
        (Error LookupFailure),
      Error LookupFailure ~ Error LookupFailure)
$d(%,%)1_rtCr = ($WSZ `cast` <Co:374>, $d~~1_rtCq `cast` <Co:17>)

-- RHS size: {terms: 3, types: 208, coercions: 0, joins: 0/0}
$d(%,%)10_rtCs
  :: ((Find
         '[Error LookupFailure, State (LastLoadedSnippets [Block]),
           ContentStore (AST [Block]), ScratchMgr [Block],
           LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
           Output Message, Input Command, Input Event, Input Command, Trace,
           Embed IO, Final IO]
         (Error LookupFailure),
       Error LookupFailure ~ Error LookupFailure),
      () :: Constraint)
$d(%,%)10_rtCs = ($d(%,%)1_rtCr, C:(%%))

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl_rtCt :: Addr#
lvl_rtCt = "error"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl1_rtCu :: [Char]
lvl1_rtCu = unpackCString# lvl_rtCt

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl2_rtCv :: Addr#
lvl2_rtCv = "polysemy-1.2.3.0-JBwn8UWAd5FH0hKLukWWQj"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl3_rtCw :: [Char]
lvl3_rtCw = unpackCString# lvl2_rtCv

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl4_rtCx :: Addr#
lvl4_rtCx = "Polysemy.Internal.Union"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl5_rtCy :: [Char]
lvl5_rtCy = unpackCString# lvl4_rtCx

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl6_rtCz :: Addr#
lvl6_rtCz = "src/Polysemy/Internal/Union.hs"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl7_rtCA :: [Char]
lvl7_rtCA = unpackCString# lvl6_rtCz

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl8_rtCB :: Int
lvl8_rtCB = I# 216#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl9_rtCC :: Int
lvl9_rtCC = I# 13#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl10_rtCD :: Int
lvl10_rtCD = I# 31#

-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
lvl11_rtCE :: SrcLoc
lvl11_rtCE
  = SrcLoc
      lvl3_rtCw
      lvl5_rtCy
      lvl7_rtCA
      lvl8_rtCB
      lvl9_rtCC
      lvl8_rtCB
      lvl10_rtCD

-- RHS size: {terms: 4, types: 0, coercions: 0, joins: 0/0}
lvl12_rtCF :: CallStack
lvl12_rtCF = PushCallStack lvl1_rtCu lvl11_rtCE EmptyCallStack

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl13_rtCG :: Addr#
lvl13_rtCG = "impossible"#

-- RHS size: {terms: 5, types: 28, coercions: 4, joins: 0/0}
lvl14_rtCH :: forall x. Weaving (Final IO) (Sem '[Final IO]) x
lvl14_rtCH
  = \ (@ x_aqYa) ->
      error
        @ 'LiftedRep
        @ (Weaving (Final IO) (Sem '[Final IO]) x_aqYa)
        (lvl12_rtCF `cast` <Co:4>)
        (unpackCString# lvl13_rtCG)

-- RHS size: {terms: 7, types: 15, coercions: 3, joins: 0/0}
$susingSem
  :: forall (r :: EffectRow) a.
     (forall x. Union r (Sem r) x -> IO x) -> Sem r a -> IO a
$susingSem
  = \ (@ (r_XssU :: EffectRow))
      (@ a_XssW)
      (k_assU :: forall x. Union r_XssU (Sem r_XssU) x -> IO x)
      (m1_assW :: Sem r_XssU a_XssW) ->
      (m1_assW `cast` <Co:3>) @ IO $fMonadIO k_assU

Rec {
-- RHS size: {terms: 31, types: 298, coercions: 67, joins: 0/0}
lvl15_rtCI
  :: forall x.
     Union '[Final IO] (Sem '[Final IO]) x
     -> State# RealWorld -> (# State# RealWorld, x #)
lvl15_rtCI
  = \ (@ x_aqYa)
      (u_aqYb :: Union '[Final IO] (Sem '[Final IO]) x_aqYa)
      (eta_B1 :: State# RealWorld) ->
      case u_aqYb of { Union @ n_aqYe ds1_aqYf a1_aqYg ->
      case ds1_aqYf of {
        SZ co_aqYk ->
          case a1_aqYg `cast` <Co:60> of
          { Weaving @ f_stsk @ m1_stsl @ a2_stsm $dFunctor1_stsn ds_stso
                    s_stsp wv_stsq ex_stsr ins_stss ->
          case (((ds_stso `cast` <Co:4>)
                   @ f_stsk
                   $dFunctor1_stsn
                   s_stsp
                   (\ (@ x1_aqYy) (x2_aqYz :: f_stsk (m1_stsl x1_aqYy)) ->
                      $srunFinal @ (f_stsk x1_aqYy) (wv_stsq @ x1_aqYy x2_aqYz))
                   ins_stss)
                `cast` <Co:3>)
                 eta_B1
          of
          { (# ipv_ipmH, ipv1_ipmI #) ->
          (# ipv_ipmH, ex_stsr ipv1_ipmI #)
          }
          };
        SS @ ipv_ar0i ipv1_assG ipv2_assH ->
          case lvl14_rtCH of wild2_00 { }
      }
      }

-- RHS size: {terms: 3, types: 22, coercions: 50, joins: 0/0}
$srunFinal :: forall a. Sem '[Final IO] a -> IO a
$srunFinal
  = \ (@ a_XqY3) ->
      $susingSem @ '[Final IO] @ a_XqY3 (lvl15_rtCI `cast` <Co:50>)
end Rec }

-- RHS size: {terms: 4, types: 3, coercions: 3, joins: 0/0}
main16 :: P Command
main16
  = $fRead()6
      @ Command
      ($fReadCommand2 `cast` <Co:3>)
      minPrec
      @ Command
      ($fApplicativeP_$cpure @ Command)

-- RHS size: {terms: 28, types: 37, coercions: 5, joins: 0/0}
main15 :: State# RealWorld -> (# State# RealWorld, Command #)
main15
  = \ (s_apnp :: State# RealWorld) ->
      case wantReadableHandle_1
             @ String hGetLine4 stdin (hGetLine2 `cast` <Co:5>) s_apnp
      of
      { (# ipv_aprJ, ipv1_aprK #) ->
      case readIO10 @ Command (run @ Command main16 ipv1_aprK) of {
        [] -> raiseIO# @ SomeException @ Command readIO6 ipv_aprJ;
        : x_assu ds_assv ->
          case ds_assv of {
            [] -> (# ipv_aprJ, x_assu #);
            : ipv2_assC ipv3_assD ->
              raiseIO# @ SomeException @ Command readIO2 ipv_aprJ
          }
      }
      }

-- RHS size: {terms: 1, types: 1, coercions: 1, joins: 0/0}
$sdebugTraceEffect7 :: SNat 'Z
$sdebugTraceEffect7 = SZ @ 'Z @~ <Co:1>

-- RHS size: {terms: 2, types: 135, coercions: 123, joins: 0/0}
$sinputStream1
  :: SNat
       ('S
          (Found
             '[Input Command, Trace, Embed IO, Final IO] (Input Command)))
$sinputStream1
  = SS
      @ ('S
           (Found
              '[Input Command, Trace, Embed IO, Final IO] (Input Command)))
      @ (Found
           '[Input Command, Trace, Embed IO, Final IO] (Input Command))
      @~ <Co:68>
      ($sdebugTraceEffect7 `cast` <Co:55>)

-- RHS size: {terms: 2, types: 63, coercions: 54, joins: 0/0}
$sinputStream5 :: SNat ('S (Found '[Final IO] (Final IO)))
$sinputStream5
  = SS
      @ ('S (Found '[Final IO] (Final IO)))
      @ (Found '[Final IO] (Final IO))
      @~ <Co:32>
      ($sdebugTraceEffect7 `cast` <Co:22>)

-- RHS size: {terms: 2, types: 81, coercions: 76, joins: 0/0}
$sinputStream4
  :: SNat ('S (Found '[Embed IO, Final IO] (Final IO)))
$sinputStream4
  = SS
      @ ('S (Found '[Embed IO, Final IO] (Final IO)))
      @ (Found '[Embed IO, Final IO] (Final IO))
      @~ <Co:41>
      ($sinputStream5 `cast` <Co:35>)

-- RHS size: {terms: 2, types: 101, coercions: 96, joins: 0/0}
$sinputStream3
  :: SNat ('S (Found '[Trace, Embed IO, Final IO] (Final IO)))
$sinputStream3
  = SS
      @ ('S (Found '[Trace, Embed IO, Final IO] (Final IO)))
      @ (Found '[Trace, Embed IO, Final IO] (Final IO))
      @~ <Co:51>
      ($sinputStream4 `cast` <Co:45>)

-- RHS size: {terms: 2, types: 123, coercions: 119, joins: 0/0}
$sinputStream2
  :: SNat
       ('S (Found '[Input Command, Trace, Embed IO, Final IO] (Final IO)))
$sinputStream2
  = SS
      @ ('S
           (Found '[Input Command, Trace, Embed IO, Final IO] (Final IO)))
      @ (Found '[Input Command, Trace, Embed IO, Final IO] (Final IO))
      @~ <Co:62>
      ($sinputStream3 `cast` <Co:57>)

-- RHS size: {terms: 5, types: 66, coercions: 1,702, joins: 0/0}
$sinputStream
  :: forall a.
     Stream
       (Of Command)
       (Sem '[Input Event, Input Command, Trace, Embed IO, Final IO])
       a
$sinputStream
  = \ (@ a_Xoe6) ->
      $winputStream
        @ '[Input Event, Input Command, Trace, Embed IO, Final IO]
        @ a_Xoe6
        ($sinputStream2 `cast` <Co:147>)
        @~ <Co:549>
        ($sinputStream1 `cast` <Co:159>)
        @~ <Co:477>
        ($WSZ `cast` <Co:149>)
        @~ <Co:221>

-- RHS size: {terms: 2, types: 99, coercions: 91, joins: 0/0}
$sdebugTraceEffect6
  :: SNat ('S (Found '[Trace, Embed IO, Final IO] Trace))
$sdebugTraceEffect6
  = SS
      @ ('S (Found '[Trace, Embed IO, Final IO] Trace))
      @ (Found '[Trace, Embed IO, Final IO] Trace)
      @~ <Co:50>
      ($sdebugTraceEffect7 `cast` <Co:41>)

-- RHS size: {terms: 2, types: 121, coercions: 117, joins: 0/0}
$sdebugTraceEffect5
  :: SNat
       ('S (Found '[Input Command, Trace, Embed IO, Final IO] Trace))
$sdebugTraceEffect5
  = SS
      @ ('S (Found '[Input Command, Trace, Embed IO, Final IO] Trace))
      @ (Found '[Input Command, Trace, Embed IO, Final IO] Trace)
      @~ <Co:61>
      ($sdebugTraceEffect6 `cast` <Co:56>)

-- RHS size: {terms: 2, types: 147, coercions: 142, joins: 0/0}
$sdebugTraceEffect4
  :: SNat
       ('S
          (Found
             '[Input Event, Input Command, Trace, Embed IO, Final IO] Trace))
$sdebugTraceEffect4
  = SS
      @ ('S
           (Found
              '[Input Event, Input Command, Trace, Embed IO, Final IO] Trace))
      @ (Found
           '[Input Event, Input Command, Trace, Embed IO, Final IO] Trace)
      @~ <Co:74>
      ($sdebugTraceEffect5 `cast` <Co:68>)

-- RHS size: {terms: 2, types: 161, coercions: 161, joins: 0/0}
$sdebugTraceEffect3
  :: SNat
       ('S
          (Found
             '[Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             Trace))
$sdebugTraceEffect3
  = SS
      @ ('S
           (Found
              '[Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              Trace))
      @ (Found
           '[Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           Trace)
      @~ <Co:81>
      ($sdebugTraceEffect4 `cast` <Co:80>)

-- RHS size: {terms: 2, types: 183, coercions: 178, joins: 0/0}
$sdebugTraceEffect2
  :: SNat
       ('S
          (Found
             '[Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             Trace))
$sdebugTraceEffect2
  = SS
      @ ('S
           (Found
              '[Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              Trace))
      @ (Found
           '[Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           Trace)
      @~ <Co:92>
      ($sdebugTraceEffect3 `cast` <Co:86>)

-- RHS size: {terms: 2, types: 241, coercions: 236, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem1
  :: SNat
       ('S
          (Found
             '[Serdes [Block], HashNaming, Filesystem, Output Message,
               Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Serdes [Block])))
$srunMarkdownSubsystemsToFilesystem1
  = SS
      @ ('S
           (Found
              '[Serdes [Block], HashNaming, Filesystem, Output Message,
                Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Serdes [Block])))
      @ (Found
           '[Serdes [Block], HashNaming, Filesystem, Output Message,
             Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Serdes [Block]))
      @~ <Co:121>
      ($sdebugTraceEffect7 `cast` <Co:115>)

-- RHS size: {terms: 2, types: 255, coercions: 255, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem_$dFind7
  :: SNat
       ('S
          (Found
             '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Serdes [Block])))
$srunMarkdownSubsystemsToFilesystem_$dFind7
  = SS
      @ ('S
           (Found
              '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Serdes [Block])))
      @ (Found
           '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Serdes [Block]))
      @~ <Co:128>
      ($srunMarkdownSubsystemsToFilesystem1 `cast` <Co:127>)

-- RHS size: {terms: 2, types: 223, coercions: 215, joins: 0/0}
$smarkdownLanguageProvider_$dFind8
  :: SNat
       ('S
          (Found
             '[HashNaming, Filesystem, Output Message, Input Command,
               Input Event, Input Command, Trace, Embed IO, Final IO]
             HashNaming))
$smarkdownLanguageProvider_$dFind8
  = SS
      @ ('S
           (Found
              '[HashNaming, Filesystem, Output Message, Input Command,
                Input Event, Input Command, Trace, Embed IO, Final IO]
              HashNaming))
      @ (Found
           '[HashNaming, Filesystem, Output Message, Input Command,
             Input Event, Input Command, Trace, Embed IO, Final IO]
           HashNaming)
      @~ <Co:112>
      ($sdebugTraceEffect7 `cast` <Co:103>)

-- RHS size: {terms: 2, types: 255, coercions: 250, joins: 0/0}
dt_rtCJ
  :: SNat
       ('S
          (Found
             '[Serdes [Block], HashNaming, Filesystem, Output Message,
               Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             HashNaming))
dt_rtCJ
  = SS
      @ ('S
           (Found
              '[Serdes [Block], HashNaming, Filesystem, Output Message,
                Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              HashNaming))
      @ (Found
           '[Serdes [Block], HashNaming, Filesystem, Output Message,
             Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           HashNaming)
      @~ <Co:128>
      ($smarkdownLanguageProvider_$dFind8 `cast` <Co:122>)

-- RHS size: {terms: 2, types: 279, coercions: 274, joins: 0/0}
dt1_rtCK
  :: SNat
       ('S
          (Found
             '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             HashNaming))
dt1_rtCK
  = SS
      @ ('S
           (Found
              '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              HashNaming))
      @ (Found
           '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           HashNaming)
      @~ <Co:140>
      (dt_rtCJ `cast` <Co:134>)

-- RHS size: {terms: 2, types: 303, coercions: 298, joins: 0/0}
dt2_rtCL
  :: SNat
       ('S
          (Found
             '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             HashNaming))
dt2_rtCL
  = SS
      @ ('S
           (Found
              '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              HashNaming))
      @ (Found
           '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           HashNaming)
      @~ <Co:152>
      (dt1_rtCK `cast` <Co:146>)

-- RHS size: {terms: 2, types: 329, coercions: 324, joins: 0/0}
$dFind_rtCM
  :: SNat
       ('S
          (Found
             '[ContentStore (AST [Block]), ScratchMgr [Block],
               LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             HashNaming))
$dFind_rtCM
  = SS
      @ ('S
           (Found
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              HashNaming))
      @ (Found
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           HashNaming)
      @~ <Co:165>
      (dt2_rtCL `cast` <Co:159>)

-- RHS size: {terms: 2, types: 363, coercions: 354, joins: 0/0}
$dFind5_rtCN
  :: SNat
       ('S
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             HashNaming))
$dFind5_rtCN
  = SS
      @ ('S
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              HashNaming))
      @ (Found
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           HashNaming)
      @~ <Co:182>
      ($dFind_rtCM `cast` <Co:172>)

-- RHS size: {terms: 2, types: 307, coercions: 297, joins: 0/0}
dt3_rtCO
  :: SNat
       ('S
          (Found
             '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ScratchMgr [Block])))
dt3_rtCO
  = SS
      @ ('S
           (Found
              '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ScratchMgr [Block])))
      @ (Found
           '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (ScratchMgr [Block]))
      @~ <Co:154>
      ($sdebugTraceEffect7 `cast` <Co:143>)

-- RHS size: {terms: 2, types: 333, coercions: 328, joins: 0/0}
$dFind1_rtCP
  :: SNat
       ('S
          (Found
             '[ContentStore (AST [Block]), ScratchMgr [Block],
               LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (ScratchMgr [Block])))
$dFind1_rtCP
  = SS
      @ ('S
           (Found
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (ScratchMgr [Block])))
      @ (Found
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (ScratchMgr [Block]))
      @~ <Co:167>
      (dt3_rtCO `cast` <Co:161>)

-- RHS size: {terms: 2, types: 367, coercions: 358, joins: 0/0}
$dFind3_rtCQ
  :: SNat
       ('S
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ScratchMgr [Block])))
$dFind3_rtCQ
  = SS
      @ ('S
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ScratchMgr [Block])))
      @ (Found
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (ScratchMgr [Block]))
      @~ <Co:184>
      ($dFind1_rtCP `cast` <Co:174>)

-- RHS size: {terms: 3, types: 570, coercions: 761, joins: 0/0}
$d(%,%)18_rtCR
  :: (Find
        '[Error LookupFailure, State (LastLoadedSnippets [Block]),
          ContentStore (AST [Block]), ScratchMgr [Block],
          LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
          Output Message, Input Command, Input Event, Input Command, Trace,
          Embed IO, Final IO]
        (ScratchMgr [Block]),
      ScratchMgr [Block]
      ~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ScratchMgr [Block])))
$d(%,%)18_rtCR
  = ($dFind3_rtCQ `cast` <Co:385>, $d~~5_rtCl `cast` <Co:376>)

-- RHS size: {terms: 3, types: 544, coercions: 721, joins: 0/0}
$d(%,%)19_rtCS
  :: (Find
        '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
          ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
          HashNaming, Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (ScratchMgr [Block]),
      ScratchMgr [Block]
      ~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ScratchMgr [Block])))
$d(%,%)19_rtCS
  = ($dFind1_rtCP `cast` <Co:355>, $d~~5_rtCl `cast` <Co:366>)

-- RHS size: {terms: 3, types: 206, coercions: 1,873, joins: 0/0}
lvl16_rtCT
  :: ((Find
         '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
           HashNaming, Filesystem, Output Message, Input Command, Input Event,
           Input Command, Trace, Embed IO, Final IO]
         (ScratchMgr [Block]),
       ScratchMgr [Block] ~ ScratchMgr [Block]),
      () :: Constraint)
lvl16_rtCT = ($d(%,%)19_rtCS `cast` <Co:1873>, C:(%%))

-- RHS size: {terms: 2, types: 335, coercions: 324, joins: 0/0}
$dFind2_rtCU
  :: SNat
       ('S
          (Found
             '[ContentStore (AST [Block]), ScratchMgr [Block],
               LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (ContentStore (AST [Block]))))
$dFind2_rtCU
  = SS
      @ ('S
           (Found
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (ContentStore (AST [Block]))))
      @ (Found
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (ContentStore (AST [Block])))
      @~ <Co:168>
      ($sdebugTraceEffect7 `cast` <Co:156>)

-- RHS size: {terms: 2, types: 369, coercions: 360, joins: 0/0}
$dFind4_rtCV
  :: SNat
       ('S
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ContentStore (AST [Block]))))
$dFind4_rtCV
  = SS
      @ ('S
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ContentStore (AST [Block]))))
      @ (Found
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (ContentStore (AST [Block])))
      @~ <Co:185>
      ($dFind2_rtCU `cast` <Co:175>)

-- RHS size: {terms: 3, types: 573, coercions: 765, joins: 0/0}
$d(%,%)22_rtCW
  :: (Find
        '[Error LookupFailure, State (LastLoadedSnippets [Block]),
          ContentStore (AST [Block]), ScratchMgr [Block],
          LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
          Output Message, Input Command, Input Event, Input Command, Trace,
          Embed IO, Final IO]
        (ContentStore (AST [Block])),
      ContentStore (AST [Block])
      ~ IndexOf
          '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
            ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
            HashNaming, Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (Found
             '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (ContentStore (AST [Block]))))
$d(%,%)22_rtCW
  = ($dFind4_rtCV `cast` <Co:387>, $d~~7_rtCk `cast` <Co:378>)

-- RHS size: {terms: 2, types: 167, coercions: 161, joins: 0/0}
dt4_rtCX
  :: SNat
       ('S
          (Found
             '[Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Input Command)))
dt4_rtCX
  = SS
      @ ('S
           (Found
              '[Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Input Command)))
      @ (Found
           '[Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Input Command))
      @~ <Co:84>
      ($sdebugTraceEffect7 `cast` <Co:77>)

-- RHS size: {terms: 2, types: 189, coercions: 184, joins: 0/0}
dt5_rtCY
  :: SNat
       ('S
          (Found
             '[Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Input Command)))
dt5_rtCY
  = SS
      @ ('S
           (Found
              '[Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Input Command)))
      @ (Found
           '[Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Input Command))
      @~ <Co:95>
      (dt4_rtCX `cast` <Co:89>)

-- RHS size: {terms: 2, types: 209, coercions: 204, joins: 0/0}
dt6_rtCZ
  :: SNat
       ('S
          (Found
             '[Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (Input Command)))
dt6_rtCZ
  = SS
      @ ('S
           (Found
              '[Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Input Command)))
      @ (Found
           '[Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Input Command))
      @~ <Co:105>
      (dt5_rtCY `cast` <Co:99>)

-- RHS size: {terms: 2, types: 229, coercions: 224, joins: 0/0}
dt7_rtD0
  :: SNat
       ('S
          (Found
             '[HashNaming, Filesystem, Output Message, Input Command,
               Input Event, Input Command, Trace, Embed IO, Final IO]
             (Input Command)))
dt7_rtD0
  = SS
      @ ('S
           (Found
              '[HashNaming, Filesystem, Output Message, Input Command,
                Input Event, Input Command, Trace, Embed IO, Final IO]
              (Input Command)))
      @ (Found
           '[HashNaming, Filesystem, Output Message, Input Command,
             Input Event, Input Command, Trace, Embed IO, Final IO]
           (Input Command))
      @~ <Co:115>
      (dt6_rtCZ `cast` <Co:109>)

-- RHS size: {terms: 2, types: 253, coercions: 248, joins: 0/0}
dt8_rtD1
  :: SNat
       ('S
          (Found
             '[Serdes [Block], HashNaming, Filesystem, Output Message,
               Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Input Command)))
dt8_rtD1
  = SS
      @ ('S
           (Found
              '[Serdes [Block], HashNaming, Filesystem, Output Message,
                Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Input Command)))
      @ (Found
           '[Serdes [Block], HashNaming, Filesystem, Output Message,
             Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Input Command))
      @~ <Co:127>
      (dt7_rtD0 `cast` <Co:121>)

-- RHS size: {terms: 2, types: 277, coercions: 272, joins: 0/0}
dt9_rtD2
  :: SNat
       ('S
          (Found
             '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Input Command)))
dt9_rtD2
  = SS
      @ ('S
           (Found
              '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Input Command)))
      @ (Found
           '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Input Command))
      @~ <Co:139>
      (dt8_rtD1 `cast` <Co:133>)

-- RHS size: {terms: 2, types: 301, coercions: 296, joins: 0/0}
dt10_rtD3
  :: SNat
       ('S
          (Found
             '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (Input Command)))
dt10_rtD3
  = SS
      @ ('S
           (Found
              '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Input Command)))
      @ (Found
           '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Input Command))
      @~ <Co:151>
      (dt9_rtD2 `cast` <Co:145>)

-- RHS size: {terms: 2, types: 327, coercions: 322, joins: 0/0}
$dFind6_rtD4
  :: SNat
       ('S
          (Found
             '[ContentStore (AST [Block]), ScratchMgr [Block],
               LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Input Command)))
$dFind6_rtD4
  = SS
      @ ('S
           (Found
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Input Command)))
      @ (Found
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Input Command))
      @~ <Co:164>
      (dt10_rtD3 `cast` <Co:158>)

-- RHS size: {terms: 2, types: 193, coercions: 184, joins: 0/0}
dt11_rtD5
  :: SNat
       ('S
          (Found
             '[Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Output Message)))
dt11_rtD5
  = SS
      @ ('S
           (Found
              '[Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Output Message)))
      @ (Found
           '[Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Output Message))
      @~ <Co:97>
      ($sdebugTraceEffect7 `cast` <Co:87>)

-- RHS size: {terms: 2, types: 213, coercions: 208, joins: 0/0}
dt12_rtD6
  :: SNat
       ('S
          (Found
             '[Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (Output Message)))
dt12_rtD6
  = SS
      @ ('S
           (Found
              '[Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Output Message)))
      @ (Found
           '[Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Output Message))
      @~ <Co:107>
      (dt11_rtD5 `cast` <Co:101>)

-- RHS size: {terms: 2, types: 233, coercions: 228, joins: 0/0}
dt13_rtD7
  :: SNat
       ('S
          (Found
             '[HashNaming, Filesystem, Output Message, Input Command,
               Input Event, Input Command, Trace, Embed IO, Final IO]
             (Output Message)))
dt13_rtD7
  = SS
      @ ('S
           (Found
              '[HashNaming, Filesystem, Output Message, Input Command,
                Input Event, Input Command, Trace, Embed IO, Final IO]
              (Output Message)))
      @ (Found
           '[HashNaming, Filesystem, Output Message, Input Command,
             Input Event, Input Command, Trace, Embed IO, Final IO]
           (Output Message))
      @~ <Co:117>
      (dt12_rtD6 `cast` <Co:111>)

-- RHS size: {terms: 2, types: 257, coercions: 252, joins: 0/0}
dt14_rtD8
  :: SNat
       ('S
          (Found
             '[Serdes [Block], HashNaming, Filesystem, Output Message,
               Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Output Message)))
dt14_rtD8
  = SS
      @ ('S
           (Found
              '[Serdes [Block], HashNaming, Filesystem, Output Message,
                Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Output Message)))
      @ (Found
           '[Serdes [Block], HashNaming, Filesystem, Output Message,
             Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Output Message))
      @~ <Co:129>
      (dt13_rtD7 `cast` <Co:123>)

-- RHS size: {terms: 2, types: 281, coercions: 276, joins: 0/0}
dt15_rtD9
  :: SNat
       ('S
          (Found
             '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Output Message)))
dt15_rtD9
  = SS
      @ ('S
           (Found
              '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Output Message)))
      @ (Found
           '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Output Message))
      @~ <Co:141>
      (dt14_rtD8 `cast` <Co:135>)

-- RHS size: {terms: 2, types: 305, coercions: 300, joins: 0/0}
dt16_rtDa
  :: SNat
       ('S
          (Found
             '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             (Output Message)))
dt16_rtDa
  = SS
      @ ('S
           (Found
              '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Output Message)))
      @ (Found
           '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Output Message))
      @~ <Co:153>
      (dt15_rtD9 `cast` <Co:147>)

-- RHS size: {terms: 2, types: 331, coercions: 326, joins: 0/0}
$dFind7_rtDb
  :: SNat
       ('S
          (Found
             '[ContentStore (AST [Block]), ScratchMgr [Block],
               LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             (Output Message)))
$dFind7_rtDb
  = SS
      @ ('S
           (Found
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Output Message)))
      @ (Found
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Output Message))
      @~ <Co:166>
      (dt16_rtDa `cast` <Co:160>)

-- RHS size: {terms: 2, types: 203, coercions: 195, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem3
  :: SNat
       ('S
          (Found
             '[Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
             Filesystem))
$srunMarkdownSubsystemsToFilesystem3
  = SS
      @ ('S
           (Found
              '[Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              Filesystem))
      @ (Found
           '[Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           Filesystem)
      @~ <Co:102>
      ($sdebugTraceEffect7 `cast` <Co:93>)

-- RHS size: {terms: 2, types: 223, coercions: 218, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem2
  :: SNat
       ('S
          (Found
             '[HashNaming, Filesystem, Output Message, Input Command,
               Input Event, Input Command, Trace, Embed IO, Final IO]
             Filesystem))
$srunMarkdownSubsystemsToFilesystem2
  = SS
      @ ('S
           (Found
              '[HashNaming, Filesystem, Output Message, Input Command,
                Input Event, Input Command, Trace, Embed IO, Final IO]
              Filesystem))
      @ (Found
           '[HashNaming, Filesystem, Output Message, Input Command,
             Input Event, Input Command, Trace, Embed IO, Final IO]
           Filesystem)
      @~ <Co:112>
      ($srunMarkdownSubsystemsToFilesystem3 `cast` <Co:106>)

-- RHS size: {terms: 2, types: 237, coercions: 237, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem_$dFind9
  :: SNat
       ('S
          (Found
             '[Serdes [Block], HashNaming, Filesystem, Output Message,
               Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             Filesystem))
$srunMarkdownSubsystemsToFilesystem_$dFind9
  = SS
      @ ('S
           (Found
              '[Serdes [Block], HashNaming, Filesystem, Output Message,
                Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              Filesystem))
      @ (Found
           '[Serdes [Block], HashNaming, Filesystem, Output Message,
             Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           Filesystem)
      @~ <Co:119>
      ($srunMarkdownSubsystemsToFilesystem2 `cast` <Co:118>)

-- RHS size: {terms: 2, types: 251, coercions: 251, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem_$dFind10
  :: SNat
       ('S
          (Found
             '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
               Output Message, Input Command, Input Event, Input Command, Trace,
               Embed IO, Final IO]
             Filesystem))
$srunMarkdownSubsystemsToFilesystem_$dFind10
  = SS
      @ ('S
           (Found
              '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              Filesystem))
      @ (Found
           '[LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           Filesystem)
      @~ <Co:126>
      ($srunMarkdownSubsystemsToFilesystem_$dFind9 `cast` <Co:125>)

-- RHS size: {terms: 2, types: 77, coercions: 70, joins: 0/0}
$sinputToFileWatch3
  :: SNat ('S (Found '[Embed IO, Final IO] (Embed IO)))
$sinputToFileWatch3
  = SS
      @ ('S (Found '[Embed IO, Final IO] (Embed IO)))
      @ (Found '[Embed IO, Final IO] (Embed IO))
      @~ <Co:39>
      ($sdebugTraceEffect7 `cast` <Co:31>)

-- RHS size: {terms: 2, types: 97, coercions: 92, joins: 0/0}
$sinputToFileWatch2
  :: SNat ('S (Found '[Trace, Embed IO, Final IO] (Embed IO)))
$sinputToFileWatch2
  = SS
      @ ('S (Found '[Trace, Embed IO, Final IO] (Embed IO)))
      @ (Found '[Trace, Embed IO, Final IO] (Embed IO))
      @~ <Co:49>
      ($sinputToFileWatch3 `cast` <Co:43>)

-- RHS size: {terms: 2, types: 119, coercions: 115, joins: 0/0}
$ssend2
  :: SNat
       ('S (Found '[Input Command, Trace, Embed IO, Final IO] (Embed IO)))
$ssend2
  = SS
      @ ('S
           (Found '[Input Command, Trace, Embed IO, Final IO] (Embed IO)))
      @ (Found '[Input Command, Trace, Embed IO, Final IO] (Embed IO))
      @~ <Co:60>
      ($sinputToFileWatch2 `cast` <Co:55>)

-- RHS size: {terms: 2, types: 145, coercions: 140, joins: 0/0}
$ssend1
  :: SNat
       ('S
          (Found
             '[Input Event, Input Command, Trace, Embed IO, Final IO]
             (Embed IO)))
$ssend1
  = SS
      @ ('S
           (Found
              '[Input Event, Input Command, Trace, Embed IO, Final IO]
              (Embed IO)))
      @ (Found
           '[Input Event, Input Command, Trace, Embed IO, Final IO]
           (Embed IO))
      @~ <Co:73>
      ($ssend2 `cast` <Co:67>)

-- RHS size: {terms: 2, types: 159, coercions: 159, joins: 0/0}
$ssend7
  :: SNat
       ('S
          (Found
             '[Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Embed IO)))
$ssend7
  = SS
      @ ('S
           (Found
              '[Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Embed IO)))
      @ (Found
           '[Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Embed IO))
      @~ <Co:80>
      ($ssend1 `cast` <Co:79>)

-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
main10 :: forall x1. x1 -> x1
main10 = \ (@ x1_XpxD) (v_apm9 :: x1_XpxD) -> v_apm9

-- RHS size: {terms: 13, types: 236, coercions: 78, joins: 0/0}
main9
  :: forall x1.
     Identity
       (Sem
          '[Input Command, Input Event, Input Command, Trace, Embed IO,
            Final IO]
          x1)
     -> forall (m :: * -> *).
        Monad m =>
        (forall x3.
         Union
           '[Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Sem
              '[Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO])
           x3
         -> m x3)
        -> m (Identity x1)
main9
  = \ (@ x1_XpxE)
      (x2_XpxM
         :: Identity
              (Sem
                 '[Input Command, Input Event, Input Command, Trace, Embed IO,
                   Final IO]
                 x1_XpxE))
      (@ (m_XpxO :: * -> *))
      ($dMonad_XpxQ :: Monad m_XpxO)
      (eta_B1
         :: forall x3.
            Union
              '[Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Sem
                 '[Input Command, Input Event, Input Command, Trace, Embed IO,
                   Final IO])
              x3
            -> m_XpxO x3) ->
      fmap
        @ m_XpxO
        ($p1Applicative @ m_XpxO ($p1Monad @ m_XpxO $dMonad_XpxQ))
        @ x1_XpxE
        @ (Identity x1_XpxE)
        ((main10 @ x1_XpxE) `cast` <Co:5>)
        ((x2_XpxM `cast` <Co:73>) @ m_XpxO $dMonad_XpxQ eta_B1)

-- RHS size: {terms: 49,
              types: 1,415,
              coercions: 1,638,
              joins: 0/5}
main8
  :: forall x (m :: * -> *).
     Output Message m x
     -> forall (f1 :: * -> *).
        Functor f1 =>
        Sem
          '[Tactics
              f1
              m
              '[Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO],
            Input Command, Input Event, Input Command, Trace, Embed IO,
            Final IO]
          (f1 x)
main8
  = \ (@ x_aoeS)
      (@ (m_aoeT :: * -> *))
      (dk_aoeU :: Output Message m_aoeT x_aoeS)
      (@ (f2_aoeV :: * -> *))
      ($dFunctor_aoeW :: Functor f2_aoeV) ->
      let {
        m1_sqVY
          :: Sem
               '[Input Command, Input Event, Input Command, Trace, Embed IO,
                 Final IO]
               x_aoeS
        m1_sqVY
          = case dk_aoeU of { Output co_aof2 o1_aof3 ->
            let {
              dt17_ssKM :: String
              dt17_ssKM = messageToString o1_aof3 } in
            let {
              dt18_ssKN :: IO ()
              dt18_ssKN = hPutStr' stdout dt17_ssKM True } in
            let {
              dt19_ssKO
                :: Weaving
                     (Embed IO)
                     (Sem
                        '[Input Command, Input Event, Input Command, Trace, Embed IO,
                          Final IO])
                     ()
              dt19_ssKO
                = Weaving
                    @ (Embed IO)
                    @ (Sem
                         '[Input Command, Input Event, Input Command, Trace, Embed IO,
                           Final IO])
                    @ ()
                    @ Identity
                    @ (Sem
                         '[Input Command, Input Event, Input Command, Trace, Embed IO,
                           Final IO])
                    @ ()
                    $fFunctorIdentity
                    (dt18_ssKN `cast` <Co:75>)
                    (() `cast` <Co:3>)
                    (main9 `cast` <Co:151>)
                    (($fFoldableIdentity2 @ ()) `cast` <Co:5>)
                    (Just `cast` <Co:9>) } in
            let {
              u_Xprh
                :: Union
                     '[Input Command, Input Event, Input Command, Trace, Embed IO,
                       Final IO]
                     (Sem
                        '[Input Command, Input Event, Input Command, Trace, Embed IO,
                          Final IO])
                     ()
              u_Xprh
                = Union
                    @ '[Input Command, Input Event, Input Command, Trace, Embed IO,
                        Final IO]
                    @ (Sem
                         '[Input Command, Input Event, Input Command, Trace, Embed IO,
                           Final IO])
                    @ ()
                    @ (Found
                         '[Input Command, Input Event, Input Command, Trace, Embed IO,
                           Final IO]
                         (Embed IO))
                    ($ssend1 `cast` <Co:79>)
                    (dt19_ssKO `cast` <Co:921>) } in
            (\ (@ (m2_Xpvv :: * -> *))
               _
               (k_Xpvz
                  :: forall x1.
                     Union
                       '[Input Command, Input Event, Input Command, Trace, Embed IO,
                         Final IO]
                       (Sem
                          '[Input Command, Input Event, Input Command, Trace, Embed IO,
                            Final IO])
                       x1
                     -> m2_Xpvv x1) ->
               k_Xpvz @ () u_Xprh)
            `cast` <Co:73>
            } } in
      (\ (@ (m2_aof5 :: * -> *))
         ($dMonad_aof6 :: Monad m2_aof5)
         (k1_aof7
            :: forall x1.
               Union
                 '[Tactics
                     f2_aoeV
                     m_aoeT
                     '[Output Message, Input Command, Input Event, Input Command, Trace,
                       Embed IO, Final IO],
                   Input Command, Input Event, Input Command, Trace, Embed IO,
                   Final IO]
                 (Sem
                    '[Tactics
                        f2_aoeV
                        m_aoeT
                        '[Output Message, Input Command, Input Event, Input Command, Trace,
                          Embed IO, Final IO],
                      Input Command, Input Event, Input Command, Trace, Embed IO,
                      Final IO])
                 x1
               -> m2_aof5 x1) ->
         >>=
           @ m2_aof5
           $dMonad_aof6
           @ x_aoeS
           @ (f2_aoeV x_aoeS)
           (((raise
                @ (Tactics
                     f2_aoeV
                     m_aoeT
                     '[Output Message, Input Command, Input Event, Input Command, Trace,
                       Embed IO, Final IO])
                @ '[Input Command, Input Event, Input Command, Trace, Embed IO,
                    Final IO]
                @ x_aoeS
                m1_sqVY)
             `cast` <Co:160>)
              @ m2_aof5 $dMonad_aof6 k1_aof7)
           (\ (z_aof9 :: x_aoeS) ->
              liftT1
                @ x_aoeS
                @ (Output Message)
                @ m_aoeT
                @ '[Input Command, Input Event, Input Command, Trace, Embed IO,
                    Final IO]
                z_aof9
                @ f2_aoeV
                $dFunctor_aoeW
                @ m2_aof5
                $dMonad_aof6
                k1_aof7))
      `cast` <Co:162>

-- RHS size: {terms: 13, types: 143, coercions: 47, joins: 0/0}
main14
  :: forall x1.
     Identity (Sem '[Trace, Embed IO, Final IO] x1)
     -> forall (m :: * -> *).
        Monad m =>
        (forall x3.
         Union
           '[Trace, Embed IO, Final IO] (Sem '[Trace, Embed IO, Final IO]) x3
         -> m x3)
        -> m (Identity x1)
main14
  = \ (@ x1_XpxA)
      (x2_XpxI :: Identity (Sem '[Trace, Embed IO, Final IO] x1_XpxA))
      (@ (m_XpxK :: * -> *))
      ($dMonad_XpxM :: Monad m_XpxK)
      (eta_B1
         :: forall x3.
            Union
              '[Trace, Embed IO, Final IO] (Sem '[Trace, Embed IO, Final IO]) x3
            -> m_XpxK x3) ->
      fmap
        @ m_XpxK
        ($p1Applicative @ m_XpxK ($p1Monad @ m_XpxK $dMonad_XpxM))
        @ x1_XpxA
        @ (Identity x1_XpxA)
        ((main10 @ x1_XpxA) `cast` <Co:5>)
        ((x2_XpxI `cast` <Co:42>) @ m_XpxK $dMonad_XpxM eta_B1)

-- RHS size: {terms: 7, types: 86, coercions: 154, joins: 0/0}
main13
  :: Weaving (Embed IO) (Sem '[Trace, Embed IO, Final IO]) Command
main13
  = Weaving
      @ (Embed IO)
      @ (Sem '[Trace, Embed IO, Final IO])
      @ Command
      @ Identity
      @ (Sem '[Trace, Embed IO, Final IO])
      @ Command
      $fFunctorIdentity
      (main15 `cast` <Co:48>)
      (() `cast` <Co:3>)
      (main14 `cast` <Co:89>)
      (($fFoldableIdentity2 @ Command) `cast` <Co:5>)
      (Just `cast` <Co:9>)

-- RHS size: {terms: 3, types: 130, coercions: 364, joins: 0/0}
main_u
  :: Union
       '[Trace, Embed IO, Final IO]
       (Sem '[Trace, Embed IO, Final IO])
       Command
main_u
  = Union
      @ '[Trace, Embed IO, Final IO]
      @ (Sem '[Trace, Embed IO, Final IO])
      @ Command
      @ (Found '[Trace, Embed IO, Final IO] (Embed IO))
      ($sinputToFileWatch3 `cast` <Co:43>)
      (main13 `cast` <Co:321>)

-- RHS size: {terms: 5, types: 92, coercions: 0, joins: 0/0}
main12
  :: forall (m :: * -> *).
     Monad m =>
     (forall x1.
      Union
        '[Trace, Embed IO, Final IO] (Sem '[Trace, Embed IO, Final IO]) x1
      -> m x1)
     -> m Command
main12
  = \ (@ (m_apmo :: * -> *))
      _
      (k_apmq
         :: forall x1.
            Union
              '[Trace, Embed IO, Final IO] (Sem '[Trace, Embed IO, Final IO]) x1
            -> m_apmo x1) ->
      k_apmq @ Command main_u

-- RHS size: {terms: 23, types: 385, coercions: 141, joins: 0/0}
main11
  :: forall x (m1 :: * -> *).
     Input Command m1 x
     -> forall (f :: * -> *) (m :: * -> *).
        (Functor f, Monad m) =>
        (forall x1.
         Union
           '[Tactics f m1 '[Input Command, Trace, Embed IO, Final IO], Trace,
             Embed IO, Final IO]
           (Sem
              '[Tactics f m1 '[Input Command, Trace, Embed IO, Final IO], Trace,
                Embed IO, Final IO])
           x1
         -> m x1)
        -> m (f x)
main11
  = \ (@ x_aodl)
      (@ (m1_aodm :: * -> *))
      (dk_aodn :: Input Command m1_aodm x_aodl)
      (@ (f_aodo :: * -> *))
      ($dFunctor_aodp :: Functor f_aodo)
      (@ (m_apfY :: * -> *))
      (eta_B2 :: Monad m_apfY)
      (eta1_B1
         :: forall x1.
            Union
              '[Tactics
                  f_aodo m1_aodm '[Input Command, Trace, Embed IO, Final IO],
                Trace, Embed IO, Final IO]
              (Sem
                 '[Tactics
                     f_aodo m1_aodm '[Input Command, Trace, Embed IO, Final IO],
                   Trace, Embed IO, Final IO])
              x1
            -> m_apfY x1) ->
      >>=
        @ m_apfY
        eta_B2
        @ x_aodl
        @ (f_aodo x_aodl)
        (((raise
             @ (Tactics
                  f_aodo m1_aodm '[Input Command, Trace, Embed IO, Final IO])
             @ '[Trace, Embed IO, Final IO]
             @ x_aodl
             (case dk_aodn of { Input co_aodu -> main12 `cast` <Co:42> }))
          `cast` <Co:99>)
           @ m_apfY eta_B2 eta1_B1)
        (\ (z_aodA :: x_aodl) ->
           liftT1
             @ x_aodl
             @ (Input Command)
             @ m1_aodm
             @ '[Trace, Embed IO, Final IO]
             z_aodA
             @ f_aodo
             $dFunctor_aodp
             @ m_apfY
             eta_B2
             eta1_B1)

-- RHS size: {terms: 13, types: 113, coercions: 37, joins: 0/0}
main18
  :: forall x1.
     Identity (Sem '[Embed IO, Final IO] x1)
     -> forall (m :: * -> *).
        Monad m =>
        (forall x3.
         Union '[Embed IO, Final IO] (Sem '[Embed IO, Final IO]) x3 -> m x3)
        -> m (Identity x1)
main18
  = \ (@ x1_Xpxw)
      (x2_XpxE :: Identity (Sem '[Embed IO, Final IO] x1_Xpxw))
      (@ (m_XpxG :: * -> *))
      ($dMonad_XpxI :: Monad m_XpxG)
      (eta_B1
         :: forall x3.
            Union '[Embed IO, Final IO] (Sem '[Embed IO, Final IO]) x3
            -> m_XpxG x3) ->
      fmap
        @ m_XpxG
        ($p1Applicative @ m_XpxG ($p1Monad @ m_XpxG $dMonad_XpxI))
        @ x1_Xpxw
        @ (Identity x1_Xpxw)
        ((main10 @ x1_Xpxw) `cast` <Co:5>)
        ((x2_XpxE `cast` <Co:32>) @ m_XpxG $dMonad_XpxI eta_B1)

-- RHS size: {terms: 44, types: 639, coercions: 394, joins: 0/3}
main17
  :: forall x (m :: * -> *).
     Trace m x
     -> forall (f :: * -> *) (m1 :: * -> *).
        (Functor f, Monad m1) =>
        (forall x1.
         Union
           '[Tactics f m '[Trace, Embed IO, Final IO], Embed IO, Final IO]
           (Sem
              '[Tactics f m '[Trace, Embed IO, Final IO], Embed IO, Final IO])
           x1
         -> m1 x1)
        -> m1 (f x)
main17
  = \ (@ x_aocW)
      (@ (m_aocX :: * -> *))
      (dk_aocY :: Trace m_aocX x_aocW)
      (@ (f_aocZ :: * -> *))
      ($dFunctor_aod0 :: Functor f_aocZ)
      (@ (m1_apfY :: * -> *))
      (eta_B2 :: Monad m1_apfY)
      (eta1_B1
         :: forall x1.
            Union
              '[Tactics f_aocZ m_aocX '[Trace, Embed IO, Final IO], Embed IO,
                Final IO]
              (Sem
                 '[Tactics f_aocZ m_aocX '[Trace, Embed IO, Final IO], Embed IO,
                   Final IO])
              x1
            -> m1_apfY x1) ->
      >>=
        @ m1_apfY
        eta_B2
        @ x_aocW
        @ (f_aocZ x_aocW)
        (((raise
             @ (Tactics f_aocZ m_aocX '[Trace, Embed IO, Final IO])
             @ '[Embed IO, Final IO]
             @ x_aocW
             (case dk_aocY of { Trace co1_aod6 m2_aod7 ->
              let {
                dt17_ssKV :: IO ()
                dt17_ssKV = hPutStr' stdout m2_aod7 True } in
              let {
                dt18_ssKW :: Weaving (Embed IO) (Sem '[Embed IO, Final IO]) ()
                dt18_ssKW
                  = Weaving
                      @ (Embed IO)
                      @ (Sem '[Embed IO, Final IO])
                      @ ()
                      @ Identity
                      @ (Sem '[Embed IO, Final IO])
                      @ ()
                      $fFunctorIdentity
                      (dt17_ssKV `cast` <Co:34>)
                      (() `cast` <Co:3>)
                      (main18 `cast` <Co:69>)
                      (($fFoldableIdentity2 @ ()) `cast` <Co:5>)
                      (Just `cast` <Co:9>) } in
              let {
                u_Xprj
                  :: Union '[Embed IO, Final IO] (Sem '[Embed IO, Final IO]) ()
                u_Xprj
                  = Union
                      @ '[Embed IO, Final IO]
                      @ (Sem '[Embed IO, Final IO])
                      @ ()
                      @ (Found '[Embed IO, Final IO] (Embed IO))
                      ($sdebugTraceEffect7 `cast` <Co:31>)
                      (dt18_ssKW `cast` <Co:134>) } in
              (\ (@ (m3_Xpvw :: * -> *))
                 _
                 (k_XpvA
                    :: forall x1.
                       Union '[Embed IO, Final IO] (Sem '[Embed IO, Final IO]) x1
                       -> m3_Xpvw x1) ->
                 k_XpvA @ () u_Xprj)
              `cast` <Co:32>
              }))
          `cast` <Co:77>)
           @ m1_apfY eta_B2 eta1_B1)
        (\ (z_aodg :: x_aocW) ->
           liftT1
             @ x_aocW
             @ Trace
             @ m_aocX
             @ '[Embed IO, Final IO]
             z_aodg
             @ f_aocZ
             $dFunctor_aod0
             @ m1_apfY
             eta_B2
             eta1_B1)

-- RHS size: {terms: 13, types: 86, coercions: 28, joins: 0/0}
main20
  :: forall x1.
     Identity (Sem '[Final IO] x1)
     -> forall (m :: * -> *).
        Monad m =>
        (forall x3. Union '[Final IO] (Sem '[Final IO]) x3 -> m x3)
        -> m (Identity x1)
main20
  = \ (@ x1_Xpxs)
      (x2_XpxA :: Identity (Sem '[Final IO] x1_Xpxs))
      (@ (m_XpxC :: * -> *))
      ($dMonad_XpxE :: Monad m_XpxC)
      (eta_B1
         :: forall x3.
            Union '[Final IO] (Sem '[Final IO]) x3 -> m_XpxC x3) ->
      fmap
        @ m_XpxC
        ($p1Applicative @ m_XpxC ($p1Monad @ m_XpxC $dMonad_XpxE))
        @ x1_Xpxs
        @ (Identity x1_Xpxs)
        ((main10 @ x1_Xpxs) `cast` <Co:5>)
        ((x2_XpxA `cast` <Co:23>) @ m_XpxC $dMonad_XpxE eta_B1)

-- RHS size: {terms: 53, types: 585, coercions: 351, joins: 0/3}
main19
  :: forall x (m1 :: * -> *).
     Embed IO m1 x
     -> forall (f :: * -> *) (m :: * -> *).
        (Functor f, Monad m) =>
        (forall x1.
         Union
           '[Tactics f m1 '[Embed IO, Final IO], Final IO]
           (Sem '[Tactics f m1 '[Embed IO, Final IO], Final IO])
           x1
         -> m x1)
        -> m (f x)
main19
  = \ (@ x_aoci)
      (@ (m1_aocj :: * -> *))
      (dk_aock :: Embed IO m1_aocj x_aoci)
      (@ (f_aocl :: * -> *))
      ($dFunctor1_aocm :: Functor f_aocl)
      (@ (m_apfY :: * -> *))
      (eta_B2 :: Monad m_apfY)
      (eta1_B1
         :: forall x1.
            Union
              '[Tactics f_aocl m1_aocj '[Embed IO, Final IO], Final IO]
              (Sem '[Tactics f_aocl m1_aocj '[Embed IO, Final IO], Final IO])
              x1
            -> m_apfY x1) ->
      >>=
        @ m_apfY
        eta_B2
        @ x_aoci
        @ (f_aocl x_aoci)
        (((raise
             @ (Tactics f_aocl m1_aocj '[Embed IO, Final IO])
             @ '[Final IO]
             @ x_aoci
             (let {
                dt17_ssKR
                  :: forall (f2 :: * -> *).
                     Functor f2 =>
                     f2 ()
                     -> (forall x1. f2 (Sem '[Final IO] x1) -> IO (f2 x1))
                     -> (forall x1. f2 x1 -> Maybe x1)
                     -> State# RealWorld
                     -> (# State# RealWorld, f2 x_aoci #)
                dt17_ssKR
                  = \ (@ (f2_aoct :: * -> *))
                      ($dFunctor2_aocu :: Functor f2_aoct)
                      (ds_aocv :: f2_aoct ())
                      _
                      _
                      (s_ipmE :: State# RealWorld) ->
                      case (dk_aock `cast` <Co:7>) s_ipmE of
                      { (# ipv_ipmH, ipv1_ipmI #) ->
                      (# ipv_ipmH,
                         <$ @ f2_aoct $dFunctor2_aocu @ x_aoci @ () ipv1_ipmI ds_aocv #)
                      } } in
              let {
                dt18_ssKS :: Weaving (Final IO) (Sem '[Final IO]) x_aoci
                dt18_ssKS
                  = Weaving
                      @ (Final IO)
                      @ (Sem '[Final IO])
                      @ x_aoci
                      @ Identity
                      @ (Sem '[Final IO])
                      @ x_aoci
                      $fFunctorIdentity
                      (dt17_ssKR `cast` <Co:77>)
                      (() `cast` <Co:3>)
                      (main20 `cast` <Co:51>)
                      (($fFoldableIdentity2 @ x_aoci) `cast` <Co:5>)
                      (Just `cast` <Co:9>) } in
              let {
                u_Xprf :: Union '[Final IO] (Sem '[Final IO]) x_aoci
                u_Xprf
                  = Union
                      @ '[Final IO]
                      @ (Sem '[Final IO])
                      @ x_aoci
                      @ (Found '[Final IO] (Final IO))
                      ($sdebugTraceEffect7 `cast` <Co:22>)
                      (dt18_ssKS `cast` <Co:96>) } in
              (\ (@ (m2_Xpvy :: * -> *))
                 _
                 (k_XpvC
                    :: forall x1.
                       Union '[Final IO] (Sem '[Final IO]) x1 -> m2_Xpvy x1) ->
                 k_XpvC @ x_aoci u_Xprf)
              `cast` <Co:23>))
          `cast` <Co:58>)
           @ m_apfY eta_B2 eta1_B1)
        (\ (z_aocJ :: x_aoci) ->
           liftT1
             @ x_aoci
             @ (Embed IO)
             @ m1_aocj
             @ '[Final IO]
             z_aocJ
             @ f_aocl
             $dFunctor1_aocm
             @ m_apfY
             eta_B2
             eta1_B1)

-- RHS size: {terms: 13, types: 269, coercions: 89, joins: 0/0}
lvl17_rtDg
  :: forall x1.
     Identity
       (Sem
          '[Output Message, Input Command, Input Event, Input Command, Trace,
            Embed IO, Final IO]
          x1)
     -> forall (m :: * -> *).
        Monad m =>
        (forall x3.
         Union
           '[Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Sem
              '[Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO])
           x3
         -> m x3)
        -> m (Identity x1)
lvl17_rtDg
  = \ (@ x1_Xpxg)
      (x2_Xpxo
         :: Identity
              (Sem
                 '[Output Message, Input Command, Input Event, Input Command, Trace,
                   Embed IO, Final IO]
                 x1_Xpxg))
      (@ (m_Xpxq :: * -> *))
      ($dMonad_Xpxs :: Monad m_Xpxq)
      (eta_B1
         :: forall x3.
            Union
              '[Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Sem
                 '[Output Message, Input Command, Input Event, Input Command, Trace,
                   Embed IO, Final IO])
              x3
            -> m_Xpxq x3) ->
      fmap
        @ m_Xpxq
        ($p1Applicative @ m_Xpxq ($p1Monad @ m_Xpxq $dMonad_Xpxs))
        @ x1_Xpxg
        @ (Identity x1_Xpxg)
        ((main10 @ x1_Xpxg) `cast` <Co:5>)
        ((x2_Xpxo `cast` <Co:84>) @ m_Xpxq $dMonad_Xpxs eta_B1)

-- RHS size: {terms: 248,
              types: 4,421,
              coercions: 6,623,
              joins: 2/16}
$wlvl
  :: forall x (m :: * -> *).
     Filesystem m x
     -> forall (f :: * -> *) (m1 :: * -> *).
        (Functor f, Applicative m1) =>
        (forall a b. m1 a -> (a -> m1 b) -> m1 b)
        -> (forall a b. m1 a -> m1 b -> m1 b)
        -> (forall a. a -> m1 a)
        -> (forall a. String -> m1 a)
        -> (forall x1.
            Union
              '[Tactics
                  f
                  m
                  '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO],
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Sem
                 '[Tactics
                     f
                     m
                     '[Filesystem, Output Message, Input Command, Input Event,
                       Input Command, Trace, Embed IO, Final IO],
                   Output Message, Input Command, Input Event, Input Command, Trace,
                   Embed IO, Final IO])
              x1
            -> m1 x1)
        -> m1 (f x)
$wlvl
  = \ (@ x_stmi)
      (@ (m_stmj :: * -> *))
      (w_stmk :: Filesystem m_stmj x_stmi)
      (@ (f_stml :: * -> *))
      (w1_stmm :: Functor f_stml)
      (@ (m1_stmn :: * -> *))
      (ww_stms :: Applicative m1_stmn)
      (ww1_stmt
         :: forall a b. m1_stmn a -> (a -> m1_stmn b) -> m1_stmn b)
      (ww2_stmu :: forall a b. m1_stmn a -> m1_stmn b -> m1_stmn b)
      (ww3_stmv :: forall a. a -> m1_stmn a)
      (ww4_stmw :: forall a. String -> m1_stmn a)
      (w2_stmp
         :: forall x1.
            Union
              '[Tactics
                  f_stml
                  m_stmj
                  '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO],
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Sem
                 '[Tactics
                     f_stml
                     m_stmj
                     '[Filesystem, Output Message, Input Command, Input Event,
                       Input Command, Trace, Embed IO, Final IO],
                   Output Message, Input Command, Input Event, Input Command, Trace,
                   Embed IO, Final IO])
              x1
            -> m1_stmn x1) ->
      ww1_stmt
        @ x_stmi
        @ (f_stml x_stmi)
        (((raise
             @ (Tactics
                  f_stml
                  m_stmj
                  '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO])
             @ '[Output Message, Input Command, Input Event, Input Command,
                 Trace, Embed IO, Final IO]
             @ x_stmi
             (case w_stmk of {
                ReadFile co1_aosq file_aosr ->
                  let {
                    dt17_st0h
                      :: State# RealWorld -> (# State# RealWorld, Maybe String #)
                    dt17_st0h
                      = \ (s_aosu :: State# RealWorld) ->
                          case catch#
                                 @ Bool
                                 @ SomeException
                                 (\ (s1_aovJ :: State# RealWorld) ->
                                    case createDirectoryIfMissing6 file_aosr s1_aovJ of
                                    { (# ipv_aoEi, ipv1_aoEj #) ->
                                    (# ipv_aoEi, not ipv1_aoEj #)
                                    })
                                 doesDirectoryExist2
                                 s_aosu
                          of
                          { (# ipv_aoEt, ipv1_aoEu #) ->
                          case ipv1_aoEu of {
                            False -> (# ipv_aoEt, Nothing @ String #);
                            True ->
                              case openFile1 file_aosr ReadMode ipv_aoEt of
                              { (# ipv2_aoIj, ipv3_aoIk #) ->
                              case hGetContents1 ipv3_aoIk ipv2_aoIj of
                              { (# ipv4_aoMc, ipv5_aoMd #) ->
                              case $wlenAcc @ Char ipv5_aoMd 0# of { __DEFAULT ->
                              (# ipv4_aoMc, Just @ String ipv5_aoMd #)
                              }
                              }
                              }
                          }
                          } } in
                  let {
                    dt18_st0i
                      :: Weaving
                           (Embed IO)
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           (Maybe String)
                    dt18_st0i
                      = Weaving
                          @ (Embed IO)
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ (Maybe String)
                          @ Identity
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ (Maybe String)
                          $fFunctorIdentity
                          (dt17_st0h `cast` <Co:92>)
                          (() `cast` <Co:3>)
                          (lvl17_rtDg `cast` <Co:173>)
                          (($fFoldableIdentity2 @ (Maybe String)) `cast` <Co:7>)
                          (Just `cast` <Co:9>) } in
                  let {
                    u_XptP
                      :: Union
                           '[Output Message, Input Command, Input Event, Input Command, Trace,
                             Embed IO, Final IO]
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           (Maybe String)
                    u_XptP
                      = Union
                          @ '[Output Message, Input Command, Input Event, Input Command,
                              Trace, Embed IO, Final IO]
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ (Maybe String)
                          @ (Found
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO]
                               (Embed IO))
                          ($ssend7 `cast` <Co:85>)
                          (dt18_st0i `cast` <Co:1160>) } in
                  (\ (@ (m2_Xpy3 :: * -> *))
                     _
                     (k_Xpy7
                        :: forall x1.
                           Union
                             '[Output Message, Input Command, Input Event, Input Command, Trace,
                               Embed IO, Final IO]
                             (Sem
                                '[Output Message, Input Command, Input Event, Input Command, Trace,
                                  Embed IO, Final IO])
                             x1
                           -> m2_Xpy3 x1) ->
                     k_Xpy7 @ (Maybe String) u_XptP)
                  `cast` <Co:84>;
                WriteFile co1_aoMh file_aoMi contents_aoMj ->
                  let {
                    dt17_st0k :: State# RealWorld -> (# State# RealWorld, () #)
                    dt17_st0k = writeFile1 file_aoMi contents_aoMj } in
                  let {
                    dt18_st0l
                      :: Weaving
                           (Embed IO)
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           ()
                    dt18_st0l
                      = Weaving
                          @ (Embed IO)
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ ()
                          @ Identity
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ ()
                          $fFunctorIdentity
                          (dt17_st0k `cast` <Co:90>)
                          (() `cast` <Co:3>)
                          (lvl17_rtDg `cast` <Co:173>)
                          (($fFoldableIdentity2 @ ()) `cast` <Co:5>)
                          (Just `cast` <Co:9>) } in
                  let {
                    u_XptQ
                      :: Union
                           '[Output Message, Input Command, Input Event, Input Command, Trace,
                             Embed IO, Final IO]
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           ()
                    u_XptQ
                      = Union
                          @ '[Output Message, Input Command, Input Event, Input Command,
                              Trace, Embed IO, Final IO]
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ ()
                          @ (Found
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO]
                               (Embed IO))
                          ($ssend7 `cast` <Co:85>)
                          (dt18_st0l `cast` <Co:1159>) } in
                  (\ (@ (m2_Xpy3 :: * -> *))
                     _
                     (k_Xpy7
                        :: forall x1.
                           Union
                             '[Output Message, Input Command, Input Event, Input Command, Trace,
                               Embed IO, Final IO]
                             (Sem
                                '[Output Message, Input Command, Input Event, Input Command, Trace,
                                  Embed IO, Final IO])
                             x1
                           -> m2_Xpy3 x1) ->
                     k_Xpy7 @ () u_XptQ)
                  `cast` <Co:84>;
                DeleteFile co1_aoMo file_aoMp ->
                  let {
                    dt17_st0q :: State# RealWorld -> (# State# RealWorld, () #)
                    dt17_st0q = removeLink1 file_aoMp } in
                  let {
                    dt18_st0r
                      :: Weaving
                           (Embed IO)
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           ()
                    dt18_st0r
                      = Weaving
                          @ (Embed IO)
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ ()
                          @ Identity
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ ()
                          $fFunctorIdentity
                          (dt17_st0q `cast` <Co:90>)
                          (() `cast` <Co:3>)
                          (lvl17_rtDg `cast` <Co:173>)
                          (($fFoldableIdentity2 @ ()) `cast` <Co:5>)
                          (Just `cast` <Co:9>) } in
                  let {
                    u_XptP
                      :: Union
                           '[Output Message, Input Command, Input Event, Input Command, Trace,
                             Embed IO, Final IO]
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           ()
                    u_XptP
                      = Union
                          @ '[Output Message, Input Command, Input Event, Input Command,
                              Trace, Embed IO, Final IO]
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ ()
                          @ (Found
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO]
                               (Embed IO))
                          ($ssend7 `cast` <Co:85>)
                          (dt18_st0r `cast` <Co:1159>) } in
                  (\ (@ (m2_Xpy2 :: * -> *))
                     _
                     (k_Xpy6
                        :: forall x1.
                           Union
                             '[Output Message, Input Command, Input Event, Input Command, Trace,
                               Embed IO, Final IO]
                             (Sem
                                '[Output Message, Input Command, Input Event, Input Command, Trace,
                                  Embed IO, Final IO])
                             x1
                           -> m2_Xpy2 x1) ->
                     k_Xpy6 @ () u_XptP)
                  `cast` <Co:84>;
                Grep co1_aoQe path_aoQf search_aoQg ->
                  let {
                    dt17_st0U :: State# RealWorld -> (# State# RealWorld, [FilePath] #)
                    dt17_st0U
                      = \ (s_aoQj :: State# RealWorld) ->
                          case getDirectoryContents1 path_aoQf s_aoQj of
                          { (# ipv_aoTq, ipv1_aoTr #) ->
                          letrec {
                            go_stdF
                              :: [[Char]]
                                 -> State# RealWorld -> (# State# RealWorld, [Maybe FilePath] #)
                            go_stdF
                              = \ (ds_irAR :: [[Char]]) (eta_X61 :: State# RealWorld) ->
                                  case ds_irAR of {
                                    [] -> (# eta_X61, [] @ (Maybe FilePath) #);
                                    : y_irAW ys_irAX ->
                                      case $fEqModule_$s$c== y_irAW listDirectory5 of {
                                        False ->
                                          case $fEqModule_$s$c== y_irAW listDirectory3 of {
                                            False ->
                                              let {
                                                p'_srDp :: FilePath
                                                p'_srDp = combine path_aoQf y_irAW } in
                                              case openFile1 p'_srDp ReadMode eta_X61 of
                                              { (# ipv2_aoTv, ipv3_aoTw #) ->
                                              case hGetContents1 ipv3_aoTw ipv2_aoTv of
                                              { (# ipv4_aoTA, ipv5_aoTB #) ->
                                              case $wlenAcc @ Char ipv5_aoTB 0# of { __DEFAULT ->
                                              case go_stdF ys_irAX ipv4_aoTA of
                                              { (# ipv6_aoTH, ipv7_aoTI #) ->
                                              (# ipv6_aoTH,
                                                 : @ (Maybe FilePath)
                                                   (join {
                                                      exit_X3S :: Maybe FilePath
                                                      exit_X3S = Just @ FilePath p'_srDp } in
                                                    joinrec {
                                                      tailsGo_srDo :: [Char] -> Maybe FilePath
                                                      tailsGo_srDo (xs_aoTL :: [Char])
                                                        = case isPrefixOf
                                                                 @ Char $fEqChar search_aoQg xs_aoTL
                                                          of {
                                                            False ->
                                                              case xs_aoTL of {
                                                                [] -> Nothing @ FilePath;
                                                                : ds4_aoXs xs'_aoXt ->
                                                                  jump tailsGo_srDo xs'_aoXt
                                                              };
                                                            True -> jump exit_X3S
                                                          }; } in
                                                    jump tailsGo_srDo ipv5_aoTB)
                                                   ipv7_aoTI #)
                                              }
                                              }
                                              }
                                              };
                                            True -> go_stdF ys_irAX eta_X61
                                          };
                                        True -> go_stdF ys_irAX eta_X61
                                      }
                                  }; } in
                          case go_stdF ipv1_aoTr ipv_aoTq of { (# ipv2_aoXB, ipv3_aoXC #) ->
                          (# ipv2_aoXB, catMaybes1 @ FilePath ipv3_aoXC #)
                          }
                          } } in
                  let {
                    dt18_st0V
                      :: Weaving
                           (Embed IO)
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           [FilePath]
                    dt18_st0V
                      = Weaving
                          @ (Embed IO)
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ [FilePath]
                          @ Identity
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ [FilePath]
                          $fFunctorIdentity
                          (dt17_st0U `cast` <Co:92>)
                          (() `cast` <Co:3>)
                          (lvl17_rtDg `cast` <Co:173>)
                          (($fFoldableIdentity2 @ [FilePath]) `cast` <Co:7>)
                          (Just `cast` <Co:9>) } in
                  let {
                    u_XptQ
                      :: Union
                           '[Output Message, Input Command, Input Event, Input Command, Trace,
                             Embed IO, Final IO]
                           (Sem
                              '[Output Message, Input Command, Input Event, Input Command, Trace,
                                Embed IO, Final IO])
                           [FilePath]
                    u_XptQ
                      = Union
                          @ '[Output Message, Input Command, Input Event, Input Command,
                              Trace, Embed IO, Final IO]
                          @ (Sem
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO])
                          @ [FilePath]
                          @ (Found
                               '[Output Message, Input Command, Input Event, Input Command, Trace,
                                 Embed IO, Final IO]
                               (Embed IO))
                          ($ssend7 `cast` <Co:85>)
                          (dt18_st0V `cast` <Co:1160>) } in
                  (\ (@ (m2_Xpy4 :: * -> *))
                     _
                     (k_Xpy8
                        :: forall x1.
                           Union
                             '[Output Message, Input Command, Input Event, Input Command, Trace,
                               Embed IO, Final IO]
                             (Sem
                                '[Output Message, Input Command, Input Event, Input Command, Trace,
                                  Embed IO, Final IO])
                             x1
                           -> m2_Xpy4 x1) ->
                     k_Xpy8 @ [FilePath] u_XptQ)
                  `cast` <Co:84>
              }))
          `cast` <Co:181>)
           @ m1_stmn
           (C:Monad @ m1_stmn ww_stms ww1_stmt ww2_stmu ww3_stmv ww4_stmw)
           w2_stmp)
        (\ (z_aoYf :: x_stmi) ->
           $wpureT
             @ x_stmi
             @ Filesystem
             @ m_stmj
             @ '[Output Message, Input Command, Input Event, Input Command,
                 Trace, Embed IO, Final IO]
             z_aoYf
             @ f_stml
             w1_stmm
             @ m1_stmn
             ww_stms
             ww1_stmt
             w2_stmp)

-- RHS size: {terms: 20, types: 427, coercions: 0, joins: 0/0}
$sfilesystemToIO1
  :: forall x (m :: * -> *).
     Filesystem m x
     -> forall (f :: * -> *) (m1 :: * -> *).
        (Functor f, Monad m1) =>
        (forall x1.
         Union
           '[Tactics
               f
               m
               '[Filesystem, Output Message, Input Command, Input Event,
                 Input Command, Trace, Embed IO, Final IO],
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Sem
              '[Tactics
                  f
                  m
                  '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO],
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO])
           x1
         -> m1 x1)
        -> m1 (f x)
$sfilesystemToIO1
  = \ (@ x_stmi)
      (@ (m_stmj :: * -> *))
      (w_stmk :: Filesystem m_stmj x_stmi)
      (@ (f_stml :: * -> *))
      (w1_stmm :: Functor f_stml)
      (@ (m1_stmn :: * -> *))
      (w2_stmo :: Monad m1_stmn)
      (w3_stmp
         :: forall x1.
            Union
              '[Tactics
                  f_stml
                  m_stmj
                  '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO],
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Sem
                 '[Tactics
                     f_stml
                     m_stmj
                     '[Filesystem, Output Message, Input Command, Input Event,
                       Input Command, Trace, Embed IO, Final IO],
                   Output Message, Input Command, Input Event, Input Command, Trace,
                   Embed IO, Final IO])
              x1
            -> m1_stmn x1) ->
      case w2_stmo of
      { C:Monad ww1_stms ww2_stmt ww3_stmu ww4_stmv ww5_stmw ->
      $wlvl
        @ x_stmi
        @ m_stmj
        w_stmk
        @ f_stml
        w1_stmm
        @ m1_stmn
        ww1_stms
        ww2_stmt
        ww3_stmu
        ww4_stmv
        ww5_stmw
        w3_stmp
      }

-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0}
f3_rtDj :: [FilePath] -> [Name]
f3_rtDj = map @ FilePath @ Name fileToName

-- RHS size: {terms: 9, types: 7, coercions: 2, joins: 0/0}
f1_rtDk :: Maybe String -> Maybe Hash
f1_rtDk
  = \ (ds1_aroS :: Maybe String) ->
      case ds1_aroS of {
        Nothing -> Nothing @ Hash;
        Just a1_aroZ -> Just @ Hash ((packChars a1_aroZ) `cast` <Co:2>)
      }

-- RHS size: {terms: 1, types: 20, coercions: 4, joins: 0/0}
$d~~4_rtDn :: Output Message ~~ Output Message
$d~~4_rtDn
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ (Output Message)
      @ (Output Message)
      @~ <Co:4>

-- RHS size: {terms: 3, types: 193, coercions: 369, joins: 0/0}
$d(%,%)3_rtDo
  :: (Find
        '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
          ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
          HashNaming, Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (Output Message),
      Output Message ~ Output Message)
$d(%,%)3_rtDo
  = ($dFind7_rtDb `cast` <Co:353>, $d~~4_rtDn `cast` <Co:16>)

-- RHS size: {terms: 3, types: 203, coercions: 0, joins: 0/0}
$d(%,%)11_rtDp
  :: ((Find
         '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
           HashNaming, Filesystem, Output Message, Input Command, Input Event,
           Input Command, Trace, Embed IO, Final IO]
         (Output Message),
       Output Message ~ Output Message),
      () :: Constraint)
$d(%,%)11_rtDp = ($d(%,%)3_rtDo, C:(%%))

-- RHS size: {terms: 1, types: 178, coercions: 254, joins: 0/0}
$d~~6_rtDq
  :: Input Command
     ~~ IndexOf
          '[Input Command, Input Event, Input Command, Trace, Embed IO,
            Final IO]
          (Found
             '[Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Input Command))
$d~~6_rtDq
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ (Input Command)
      @ (IndexOf
           '[Input Command, Input Event, Input Command, Trace, Embed IO,
             Final IO]
           (Found
              '[Input Command, Input Event, Input Command, Trace, Embed IO,
                Final IO]
              (Input Command)))
      @~ <Co:254>

-- RHS size: {terms: 3, types: 349, coercions: 523, joins: 0/0}
lvl18_rtDr
  :: (Find
        '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
          ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
          HashNaming, Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (Input Command),
      Input Command
      ~ IndexOf
          '[Input Command, Input Event, Input Command, Trace, Embed IO,
            Final IO]
          (Found
             '[Input Command, Input Event, Input Command, Trace, Embed IO,
               Final IO]
             (Input Command)))
lvl18_rtDr
  = ($dFind6_rtD4 `cast` <Co:349>, $d~~6_rtDq `cast` <Co:174>)

-- RHS size: {terms: 3, types: 205, coercions: 450, joins: 0/0}
$d(%,%)4_rtDs
  :: ((Find
         '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
           HashNaming, Filesystem, Output Message, Input Command, Input Event,
           Input Command, Trace, Embed IO, Final IO]
         (Input Command),
       Input Command ~ Input Command),
      () :: Constraint)
$d(%,%)4_rtDs = (lvl18_rtDr `cast` <Co:450>, C:(%%))

-- RHS size: {terms: 1, types: 18, coercions: 3, joins: 0/0}
$d~~8_rtDt :: HashNaming ~~ HashNaming
$d~~8_rtDt
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ HashNaming
      @ HashNaming
      @~ <Co:3>

-- RHS size: {terms: 3, types: 210, coercions: 397, joins: 0/0}
$d(%,%)20_rtDv
  :: (Find
        '[Error LookupFailure, State (LastLoadedSnippets [Block]),
          ContentStore (AST [Block]), ScratchMgr [Block],
          LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
          Output Message, Input Command, Input Event, Input Command, Trace,
          Embed IO, Final IO]
        HashNaming,
      HashNaming ~ HashNaming)
$d(%,%)20_rtDv
  = ($dFind5_rtCN `cast` <Co:381>, $d~~8_rtDt `cast` <Co:16>)

-- RHS size: {terms: 3, types: 418, coercions: 0, joins: 0/0}
$d(%,%)21_rtDw
  :: ((Find
         '[Error LookupFailure, State (LastLoadedSnippets [Block]),
           ContentStore (AST [Block]), ScratchMgr [Block],
           LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
           Output Message, Input Command, Input Event, Input Command, Trace,
           Embed IO, Final IO]
         HashNaming,
       HashNaming ~ HashNaming),
      ((Find
          '[Error LookupFailure, State (LastLoadedSnippets [Block]),
            ContentStore (AST [Block]), ScratchMgr [Block],
            LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
            Output Message, Input Command, Input Event, Input Command, Trace,
            Embed IO, Final IO]
          (Error LookupFailure),
        Error LookupFailure ~ Error LookupFailure),
       () :: Constraint))
$d(%,%)21_rtDw = ($d(%,%)20_rtDv, $d(%,%)10_rtCs)

-- RHS size: {terms: 3, types: 991, coercions: 0, joins: 0/0}
$d(%,%)23_rtDx
  :: ((Find
         '[Error LookupFailure, State (LastLoadedSnippets [Block]),
           ContentStore (AST [Block]), ScratchMgr [Block],
           LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
           Output Message, Input Command, Input Event, Input Command, Trace,
           Embed IO, Final IO]
         (ContentStore (AST [Block])),
       ContentStore (AST [Block])
       ~ IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ContentStore (AST [Block])))),
      ((Find
          '[Error LookupFailure, State (LastLoadedSnippets [Block]),
            ContentStore (AST [Block]), ScratchMgr [Block],
            LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
            Output Message, Input Command, Input Event, Input Command, Trace,
            Embed IO, Final IO]
          HashNaming,
        HashNaming ~ HashNaming),
       ((Find
           '[Error LookupFailure, State (LastLoadedSnippets [Block]),
             ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Error LookupFailure),
         Error LookupFailure ~ Error LookupFailure),
        () :: Constraint)))
$d(%,%)23_rtDx = ($d(%,%)22_rtCW, $d(%,%)21_rtDw)

-- RHS size: {terms: 3, types: 1,561, coercions: 0, joins: 0/0}
$d(%,%)24_rtDy
  :: ((Find
         '[Error LookupFailure, State (LastLoadedSnippets [Block]),
           ContentStore (AST [Block]), ScratchMgr [Block],
           LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
           Output Message, Input Command, Input Event, Input Command, Trace,
           Embed IO, Final IO]
         (ScratchMgr [Block]),
       ScratchMgr [Block]
       ~ IndexOf
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Found
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (ScratchMgr [Block]))),
      ((Find
          '[Error LookupFailure, State (LastLoadedSnippets [Block]),
            ContentStore (AST [Block]), ScratchMgr [Block],
            LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
            Output Message, Input Command, Input Event, Input Command, Trace,
            Embed IO, Final IO]
          (ContentStore (AST [Block])),
        ContentStore (AST [Block])
        ~ IndexOf
            '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
              ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
              HashNaming, Filesystem, Output Message, Input Command, Input Event,
              Input Command, Trace, Embed IO, Final IO]
            (Found
               '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                 ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                 HashNaming, Filesystem, Output Message, Input Command, Input Event,
                 Input Command, Trace, Embed IO, Final IO]
               (ContentStore (AST [Block])))),
       ((Find
           '[Error LookupFailure, State (LastLoadedSnippets [Block]),
             ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           HashNaming,
         HashNaming ~ HashNaming),
        ((Find
            '[Error LookupFailure, State (LastLoadedSnippets [Block]),
              ContentStore (AST [Block]), ScratchMgr [Block],
              LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
              Output Message, Input Command, Input Event, Input Command, Trace,
              Embed IO, Final IO]
            (Error LookupFailure),
          Error LookupFailure ~ Error LookupFailure),
         () :: Constraint))))
$d(%,%)24_rtDy = ($d(%,%)18_rtCR, $d(%,%)23_rtDx)

-- RHS size: {terms: 178,
              types: 5,503,
              coercions: 124,240,
              joins: 0/16}
$shandleCommand1
  :: Command
     -> forall (m :: * -> *).
        Monad m =>
        (forall x.
         Union
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO]
           (Sem
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO])
           x
         -> m x)
        -> m ()
$shandleCommand1
  = \ (ds_ap9v :: Command)
      (@ (m_apfY :: * -> *))
      (eta_B1 :: Monad m_apfY) ->
      case ds_ap9v of {
        RenameName src_apap dst_apaq ->
          let {
            lvl20_ssH5 :: Message
            lvl20_ssH5 = Renamed src_apap dst_apaq } in
          let {
            ds1_sstX
              :: forall (m1 :: * -> *).
                 Monad m1 =>
                 (forall x.
                  Union
                    '[Error LookupFailure, State (LastLoadedSnippets [Block]),
                      ContentStore (AST [Block]), ScratchMgr [Block],
                      LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                      Output Message, Input Command, Input Event, Input Command, Trace,
                      Embed IO, Final IO]
                    (Sem
                       '[Error LookupFailure, State (LastLoadedSnippets [Block]),
                         ContentStore (AST [Block]), ScratchMgr [Block],
                         LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                         Output Message, Input Command, Input Event, Input Command, Trace,
                         Embed IO, Final IO])
                    x
                  -> m1 x)
                 -> m1 ()
            ds1_sstX
              = renameName1
                  @ '[Error LookupFailure, State (LastLoadedSnippets [Block]),
                      ContentStore (AST [Block]), ScratchMgr [Block],
                      LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                      Output Message, Input Command, Input Event, Input Command, Trace,
                      Embed IO, Final IO]
                  ($d(%,%)21_rtDw `cast` <Co:4219>)
                  src_apap
                  dst_apaq } in
          \ (k_apau
               :: forall x.
                  Union
                    '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                      ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                      HashNaming, Filesystem, Output Message, Input Command, Input Event,
                      Input Command, Trace, Embed IO, Final IO]
                    (Sem
                       '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                         ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                         HashNaming, Filesystem, Output Message, Input Command, Input Event,
                         Input Command, Trace, Embed IO, Final IO])
                    x
                  -> m_apfY x) ->
            let {
              lvl21_ssH6 :: m_apfY ()
              lvl21_ssH6
                = $woutput
                    @ Message
                    @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                    ($d(%,%)11_rtDp `cast` <Co:10338>)
                    lvl20_ssH5
                    @ m_apfY
                    k_apau } in
            >>=
              @ m_apfY
              eta_B1
              @ (Either LookupFailure ())
              @ ()
              (((runError
                   @ LookupFailure
                   @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                       ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                       HashNaming, Filesystem, Output Message, Input Command, Input Event,
                       Input Command, Trace, Embed IO, Final IO]
                   @ ()
                   (ds1_sstX `cast` <Co:180>))
                `cast` <Co:171>)
                 @ m_apfY eta_B1 k_apau)
              (\ (z_apd4 :: Either LookupFailure ()) ->
                 case z_apd4 of {
                   Left err_apdk ->
                     $woutput
                       @ Message
                       @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                           HashNaming, Filesystem, Output Message, Input Command, Input Event,
                           Input Command, Trace, Embed IO, Final IO]
                       ($d(%,%)11_rtDp `cast` <Co:10338>)
                       (LookupFailure err_apdk)
                       @ m_apfY
                       k_apau;
                   Right ds2_apdV -> case ds2_apdV of { () -> lvl21_ssH6 }
                 });
        LoadSnippet name_ape8 ->
          let {
            lvl20_ssH7 :: Message
            lvl20_ssH7 = WroteSnippet name_ape8 } in
          let {
            ds1_ssBX
              :: forall (m1 :: * -> *).
                 Monad m1 =>
                 (forall x.
                  Union
                    '[Error LookupFailure, State (LastLoadedSnippets [Block]),
                      ContentStore (AST [Block]), ScratchMgr [Block],
                      LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                      Output Message, Input Command, Input Event, Input Command, Trace,
                      Embed IO, Final IO]
                    (Sem
                       '[Error LookupFailure, State (LastLoadedSnippets [Block]),
                         ContentStore (AST [Block]), ScratchMgr [Block],
                         LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                         Output Message, Input Command, Input Event, Input Command, Trace,
                         Embed IO, Final IO])
                    x
                  -> m1 x)
                 -> m1 ()
            ds1_ssBX
              = loadSnippet1
                  @ [Block]
                  @ '[Error LookupFailure, State (LastLoadedSnippets [Block]),
                      ContentStore (AST [Block]), ScratchMgr [Block],
                      LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                      Output Message, Input Command, Input Event, Input Command, Trace,
                      Embed IO, Final IO]
                  ($d(%,%)24_rtDy `cast` <Co:6611>)
                  name_ape8 } in
          \ (k_apec
               :: forall x.
                  Union
                    '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                      ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                      HashNaming, Filesystem, Output Message, Input Command, Input Event,
                      Input Command, Trace, Embed IO, Final IO]
                    (Sem
                       '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                         ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                         HashNaming, Filesystem, Output Message, Input Command, Input Event,
                         Input Command, Trace, Embed IO, Final IO])
                    x
                  -> m_apfY x) ->
            let {
              lvl21_ssH8 :: m_apfY ()
              lvl21_ssH8
                = $woutput
                    @ Message
                    @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                    ($d(%,%)11_rtDp `cast` <Co:10338>)
                    lvl20_ssH7
                    @ m_apfY
                    k_apec } in
            >>=
              @ m_apfY
              eta_B1
              @ (Either LookupFailure ())
              @ ()
              (((runError
                   @ LookupFailure
                   @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                       ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                       HashNaming, Filesystem, Output Message, Input Command, Input Event,
                       Input Command, Trace, Embed IO, Final IO]
                   @ ()
                   (ds1_ssBX `cast` <Co:180>))
                `cast` <Co:171>)
                 @ m_apfY eta_B1 k_apec)
              (\ (z_apee :: Either LookupFailure ()) ->
                 case z_apee of {
                   Left err_apeh ->
                     $woutput
                       @ Message
                       @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                           HashNaming, Filesystem, Output Message, Input Command, Input Event,
                           Input Command, Trace, Embed IO, Final IO]
                       ($d(%,%)11_rtDp `cast` <Co:10338>)
                       (LookupFailure err_apeh)
                       @ m_apfY
                       k_apec;
                   Right ds2_apek -> case ds2_apek of { () -> lvl21_ssH8 }
                 });
        ReloadScratch ->
          \ (k_apes
               :: forall x.
                  Union
                    '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                      ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                      HashNaming, Filesystem, Output Message, Input Command, Input Event,
                      Input Command, Trace, Embed IO, Final IO]
                    (Sem
                       '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                         ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                         HashNaming, Filesystem, Output Message, Input Command, Input Event,
                         Input Command, Trace, Embed IO, Final IO])
                    x
                  -> m_apfY x) ->
            let {
              lvl20_ssHb :: m_apfY ()
              lvl20_ssHb
                = let {
                    lvl21_ssHa :: m_apfY ()
                    lvl21_ssHa
                      = $woutput
                          @ Message
                          @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                              ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                              HashNaming, Filesystem, Output Message, Input Command, Input Event,
                              Input Command, Trace, Embed IO, Final IO]
                          ($d(%,%)11_rtDp `cast` <Co:10338>)
                          SnippetLoadError
                          @ m_apfY
                          k_apes } in
                  >>=
                    @ m_apfY
                    eta_B1
                    @ ()
                    @ ()
                    ($wput
                       @ (LastLoadedSnippets [Block])
                       @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                           ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                           HashNaming, Filesystem, Output Message, Input Command, Input Event,
                           Input Command, Trace, Embed IO, Final IO]
                       ($d(%,%)15_rtCo `cast` <Co:5661>)
                       (([] @ (Name, AST [Block])) `cast` <Co:4>)
                       @ m_apfY
                       k_apes)
                    (\ _ -> lvl21_ssHa) } in
            >>=
              @ m_apfY
              eta_B1
              @ (Maybe [(Name, AST [Block])])
              @ ()
              ($wgetDefinitions
                 @ [Block]
                 @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                 (lvl16_rtCT `cast` <Co:9123>)
                 @ m_apfY
                 k_apes)
              (\ (z_apeA :: Maybe [(Name, AST [Block])]) ->
                 case z_apeA of {
                   Nothing -> lvl20_ssHb;
                   Just snippets_apeU ->
                     let {
                       lvl21_ssHc :: m_apfY ()
                       lvl21_ssHc
                         = $woutput
                             @ Message
                             @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                                 ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                                 HashNaming, Filesystem, Output Message, Input Command, Input Event,
                                 Input Command, Trace, Embed IO, Final IO]
                             ($d(%,%)11_rtDp `cast` <Co:10338>)
                             (LoadedSnippets
                                (map
                                   @ (Name, AST [Block])
                                   @ Name
                                   (fst @ Name @ (AST [Block]))
                                   snippets_apeU))
                             @ m_apfY
                             k_apes } in
                     >>=
                       @ m_apfY
                       eta_B1
                       @ ()
                       @ ()
                       ($wput
                          @ (LastLoadedSnippets [Block])
                          @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                              ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                              HashNaming, Filesystem, Output Message, Input Command, Input Event,
                              Input Command, Trace, Embed IO, Final IO]
                          ($d(%,%)15_rtCo `cast` <Co:5661>)
                          (snippets_apeU `cast` <Co:4>)
                          @ m_apfY
                          k_apes)
                       (\ _ -> lvl21_ssHc)
                 });
        CommitSnippet name_apf6 ->
          let {
            lvl20_ssHe :: Message
            lvl20_ssHe = UnknownSnippet name_apf6 } in
          let {
            k1_ssHh :: [Name]
            k1_ssHh = : @ Name name_apf6 ([] @ Name) } in
          let {
            k2_ssHj :: Message
            k2_ssHj = CommittedSnippets k1_ssHh } in
          \ (k_apf4
               :: forall x.
                  Union
                    '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                      ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                      HashNaming, Filesystem, Output Message, Input Command, Input Event,
                      Input Command, Trace, Embed IO, Final IO]
                    (Sem
                       '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                         ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                         HashNaming, Filesystem, Output Message, Input Command, Input Event,
                         Input Command, Trace, Embed IO, Final IO])
                    x
                  -> m_apfY x) ->
            let {
              lvl21_ssHf :: m_apfY ()
              lvl21_ssHf
                = $woutput
                    @ Message
                    @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                    ($d(%,%)11_rtDp `cast` <Co:10338>)
                    lvl20_ssHe
                    @ m_apfY
                    k_apf4 } in
            let {
              lvl22_ssHk :: m_apfY ()
              lvl22_ssHk
                = $woutput
                    @ Message
                    @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                    ($d(%,%)11_rtDp `cast` <Co:10338>)
                    k2_ssHj
                    @ m_apfY
                    k_apf4 } in
            let {
              lvl23_ssHl :: () -> m_apfY ()
              lvl23_ssHl = \ _ -> lvl22_ssHk } in
            >>=
              @ m_apfY
              eta_B1
              @ (LastLoadedSnippets [Block])
              @ ()
              ($wget
                 @ (LastLoadedSnippets [Block])
                 @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                 ($d(%,%)15_rtCo `cast` <Co:5661>)
                 @ m_apfY
                 k_apf4)
              (\ (z_apfb :: LastLoadedSnippets [Block]) ->
                 case lookup
                        @ Name @ (AST [Block]) $fEqName name_apf6 (z_apfb `cast` <Co:3>)
                 of {
                   Nothing -> lvl21_ssHf;
                   Just ast_apfn ->
                     >>=
                       @ m_apfY
                       eta_B1
                       @ ()
                       @ ()
                       ($wcommitSnippet
                          @ [Block]
                          @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                              ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                              HashNaming, Filesystem, Output Message, Input Command, Input Event,
                              Input Command, Trace, Embed IO, Final IO]
                          ($dFind_rtCM `cast` <Co:351>)
                          @~ <Co:1914>
                          ($dFind2_rtCU `cast` <Co:357>)
                          @~ <Co:1265>
                          (: @ (Name, AST [Block])
                             (name_apf6, ast_apfn)
                             ([] @ (Name, AST [Block])))
                          @ m_apfY
                          eta_B1
                          k_apf4)
                       lvl23_ssHl
                 });
        Quit ->
          let {
            ds1_ssDe :: m_apfY ()
            ds1_ssDe = pure @ m_apfY ($p1Monad @ m_apfY eta_B1) @ () () } in
          \ _ -> ds1_ssDe
      }

Rec {
-- RHS size: {terms: 59,
              types: 2,055,
              coercions: 12,010,
              joins: 0/5}
$sdaemon_$s$w$srunAsDaemon1
  :: forall (m :: * -> *).
     (forall x.
      Union
        '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
          ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
          HashNaming, Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (Sem
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO])
        x
      -> m x)
     -> (forall a. [Char] -> m a)
     -> (forall a. a -> m a)
     -> (forall a b. m a -> m b -> m b)
     -> (forall a b. m a -> (a -> m b) -> m b)
     -> (Applicative m,
         (Command
          -> forall (m1 :: * -> *).
             Monad m1 =>
             (forall x.
              Union
                '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                  ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                  HashNaming, Filesystem, Output Message, Input Command, Input Event,
                  Input Command, Trace, Embed IO, Final IO]
                (Sem
                   '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO])
                x
              -> m1 x)
             -> m1 ())
         ~R# (Command
              -> Sem
                   '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                   ()),
         (Command
          -> forall (m1 :: * -> *).
             Monad m1 =>
             (forall x.
              Union
                '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                  ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                  HashNaming, Filesystem, Output Message, Input Command, Input Event,
                  Input Command, Trace, Embed IO, Final IO]
                (Sem
                   '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO])
                x
              -> m1 x)
             -> m1 Bool)
         ~R# (Command
              -> Sem
                   '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                   Bool)) =>
        m ()
$sdaemon_$s$w$srunAsDaemon1
  = \ (@ (m_stjD :: * -> *))
      (sc_stwX
         :: forall x.
            Union
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Sem
                 '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                   ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                   HashNaming, Filesystem, Output Message, Input Command, Input Event,
                   Input Command, Trace, Embed IO, Final IO])
              x
            -> m_stjD x)
      (sc1_stwW :: forall a. [Char] -> m_stjD a)
      (sc2_stwV :: forall a. a -> m_stjD a)
      (sc3_stwU :: forall a b. m_stjD a -> m_stjD b -> m_stjD b)
      (sc4_stwT :: forall a b. m_stjD a -> (a -> m_stjD b) -> m_stjD b)
      (sc5_stwS :: Applicative m_stjD)
      (sg_stwR
         :: (Command
             -> forall (m1 :: * -> *).
                Monad m1 =>
                (forall x.
                 Union
                   '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                   (Sem
                      '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO])
                   x
                 -> m1 x)
                -> m1 ())
            ~R# (Command
                 -> Sem
                      '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                      ()))
      (sg1_stwQ
         :: (Command
             -> forall (m1 :: * -> *).
                Monad m1 =>
                (forall x.
                 Union
                   '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                     ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                     HashNaming, Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                   (Sem
                      '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO])
                   x
                 -> m1 x)
                -> m1 Bool)
            ~R# (Command
                 -> Sem
                      '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                        ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                      Bool)) ->
      let {
        lvl20_ssEz :: m_stjD ()
        lvl20_ssEz
          = $sdaemon_$s$w$srunAsDaemon1
              @ m_stjD
              sc_stwX
              sc1_stwW
              sc2_stwV
              sc3_stwU
              sc4_stwT
              sc5_stwS
              @~ <Co:1>
              @~ <Co:1> } in
      let {
        lvl21_ssEA :: () -> m_stjD ()
        lvl21_ssEA = \ _ -> lvl20_ssEz } in
      let {
        lvl22_ssEC :: m_stjD ()
        lvl22_ssEC = pure @ m_stjD sc5_stwS @ () () } in
      let {
        $dMonad_ar0M :: Monad m_stjD
        $dMonad_ar0M
          = C:Monad
              @ m_stjD sc5_stwS sc4_stwT sc3_stwU sc2_stwV sc1_stwW } in
      sc4_stwT
        @ Command
        @ ()
        ($winput
           @ Command
           @ '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
               ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
               HashNaming, Filesystem, Output Message, Input Command, Input Event,
               Input Command, Trace, Embed IO, Final IO]
           ($d(%,%)4_rtDs `cast` <Co:12008>)
           @ m_stjD
           sc_stwX)
        (\ (z_ar0S :: Command) ->
           let {
             lvl23_ssEB :: m_stjD ()
             lvl23_ssEB
               = sc4_stwT
                   @ ()
                   @ ()
                   ($shandleCommand1 z_ar0S @ m_stjD $dMonad_ar0M sc_stwX)
                   lvl21_ssEA } in
           sc4_stwT
             @ Bool
             @ ()
             (pure
                @ m_stjD
                sc5_stwS
                @ Bool
                (case z_ar0S of {
                   __DEFAULT -> False;
                   Quit -> True
                 }))
             (\ (z1_ar0T :: Bool) ->
                case z1_ar0T of {
                  False -> lvl23_ssEB;
                  True -> lvl22_ssEC
                }))
end Rec }

-- RHS size: {terms: 13, types: 375, coercions: 340, joins: 0/0}
$sdaemon3
  :: forall (m :: * -> *).
     Monad m =>
     (forall x.
      Union
        '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
          ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
          HashNaming, Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (Sem
           '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
             ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
             HashNaming, Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO])
        x
      -> m x)
     -> m ()
$sdaemon3
  = \ (@ (m_stjD :: * -> *))
      (w_stjE :: Monad m_stjD)
      (w1_stjF
         :: forall x.
            Union
              '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                HashNaming, Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Sem
                 '[State (LastLoadedSnippets [Block]), ContentStore (AST [Block]),
                   ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                   HashNaming, Filesystem, Output Message, Input Command, Input Event,
                   Input Command, Trace, Embed IO, Final IO])
              x
            -> m_stjD x) ->
      case w_stjE of
      { C:Monad ww1_stjI ww2_stjJ ww3_stjK ww4_stjL ww5_stjM ->
      $sdaemon_$s$w$srunAsDaemon1
        @ m_stjD
        w1_stjF
        ww5_stjM
        ww4_stjL
        ww3_stjK
        ww2_stjJ
        ww1_stjI
        @~ <Co:172>
        @~ <Co:168>
      }

-- RHS size: {terms: 1, types: 18, coercions: 3, joins: 0/0}
$d~~9_rtDz :: Filesystem ~~ Filesystem
$d~~9_rtDz
  = Eq#
      @ ((* -> *) -> * -> *)
      @ ((* -> *) -> * -> *)
      @ Filesystem
      @ Filesystem
      @~ <Co:3>

-- RHS size: {terms: 3, types: 114, coercions: 210, joins: 0/0}
$d(%,%)6_rtDA
  :: (Find
        '[Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        Filesystem,
      Filesystem ~ Filesystem)
$d(%,%)6_rtDA = ($WSZ `cast` <Co:196>, $d~~9_rtDz `cast` <Co:14>)

-- RHS size: {terms: 3, types: 124, coercions: 0, joins: 0/0}
lvl19_rtDB
  :: ((Find
         '[Filesystem, Output Message, Input Command, Input Event,
           Input Command, Trace, Embed IO, Final IO]
         Filesystem,
       Filesystem ~ Filesystem),
      () :: Constraint)
lvl19_rtDB = ($d(%,%)6_rtDA, C:(%%))

-- RHS size: {terms: 119,
              types: 2,063,
              coercions: 19,013,
              joins: 0/8}
$shashNamingToFilesystem1
  :: forall x (m :: * -> *).
     HashNaming m x
     -> forall (f :: * -> *).
        Functor f =>
        Sem
          '[Tactics
              f
              m
              '[HashNaming, Filesystem, Output Message, Input Command,
                Input Event, Input Command, Trace, Embed IO, Final IO],
            Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          (f x)
$shashNamingToFilesystem1
  = \ (@ x_aroh)
      (@ (m_aroi :: * -> *))
      (dk_aroj :: HashNaming m_aroi x_aroh)
      (@ (f_arok :: * -> *))
      ($dFunctor_arol :: Functor f_arok) ->
      let {
        m1_srBS
          :: Sem
               '[Filesystem, Output Message, Input Command, Input Event,
                 Input Command, Trace, Embed IO, Final IO]
               x_aroh
        m1_srBS
          = case dk_aroj of {
              LinkName co1_aroA name_aroB ds_aroC ->
                let {
                  w1_arBW :: FilePath
                  w1_arBW
                    = letrec {
                        go_asPe :: [Char] -> [Char]
                        go_asPe
                          = \ (ds1_asPf :: [Char]) ->
                              case ds1_asPf of {
                                [] -> name_aroB `cast` <Co:1>;
                                : y_asPk ys_asPl -> : @ Char y_asPk (go_asPe ys_asPl)
                              }; } in
                      go_asPe magicPrefix } in
                let {
                  w2_arBX :: String
                  w2_arBX
                    = case ds_aroC `cast` <Co:1> of
                      { PS ww1_arBG ww2_arBH ww3_arBP ww4_arBQ ->
                      $wunpackAppendCharsLazy
                        ww1_arBG ww2_arBH ww3_arBP ww4_arBQ ([] @ Char)
                      } } in
                (\ (@ (m2_arBY :: * -> *))
                   _
                   (w4_arC0
                      :: forall x1.
                         Union
                           '[Filesystem, Output Message, Input Command, Input Event,
                             Input Command, Trace, Embed IO, Final IO]
                           (Sem
                              '[Filesystem, Output Message, Input Command, Input Event,
                                Input Command, Trace, Embed IO, Final IO])
                           x1
                         -> m2_arBY x1) ->
                   $wwriteFile
                     @ '[Filesystem, Output Message, Input Command, Input Event,
                         Input Command, Trace, Embed IO, Final IO]
                     (lvl19_rtDB `cast` <Co:4557>)
                     w1_arBW
                     w2_arBX
                     @ m2_arBY
                     w4_arC0)
                `cast` <Co:94>;
              UnlinkName co1_aroN name_aroO ->
                let {
                  w1_arC9 :: FilePath
                  w1_arC9
                    = letrec {
                        go_asPe :: [Char] -> [Char]
                        go_asPe
                          = \ (ds_asPf :: [Char]) ->
                              case ds_asPf of {
                                [] -> name_aroO `cast` <Co:1>;
                                : y_asPk ys_asPl -> : @ Char y_asPk (go_asPe ys_asPl)
                              }; } in
                      go_asPe magicPrefix } in
                (\ (@ (m2_arCa :: * -> *))
                   _
                   (w3_arCc
                      :: forall x1.
                         Union
                           '[Filesystem, Output Message, Input Command, Input Event,
                             Input Command, Trace, Embed IO, Final IO]
                           (Sem
                              '[Filesystem, Output Message, Input Command, Input Event,
                                Input Command, Trace, Embed IO, Final IO])
                           x1
                         -> m2_arCa x1) ->
                   $wdeleteFile
                     @ '[Filesystem, Output Message, Input Command, Input Event,
                         Input Command, Trace, Embed IO, Final IO]
                     (lvl19_rtDB `cast` <Co:4557>)
                     w1_arC9
                     @ m2_arCa
                     w3_arCc)
                `cast` <Co:94>;
              LookupHashByName co1_aroT name_aroU ->
                let {
                  ds1_srAi :: FilePath
                  ds1_srAi = ++ @ Char magicPrefix (name_aroU `cast` <Co:1>) } in
                (\ (@ (m2_arp7 :: * -> *))
                   ($dMonad_arp8 :: Monad m2_arp7)
                   (eta_B1
                      :: forall x1.
                         Union
                           '[Filesystem, Output Message, Input Command, Input Event,
                             Input Command, Trace, Embed IO, Final IO]
                           (Sem
                              '[Filesystem, Output Message, Input Command, Input Event,
                                Input Command, Trace, Embed IO, Final IO])
                           x1
                         -> m2_arp7 x1) ->
                   fmap
                     @ m2_arp7
                     ($p1Applicative @ m2_arp7 ($p1Monad @ m2_arp7 $dMonad_arp8))
                     @ (Maybe String)
                     @ (Maybe Hash)
                     f1_rtDk
                     ($wreadFile
                        @ '[Filesystem, Output Message, Input Command, Input Event,
                            Input Command, Trace, Embed IO, Final IO]
                        (lvl19_rtDB `cast` <Co:4557>)
                        ds1_srAi
                        @ m2_arp7
                        eta_B1))
                `cast` <Co:94>;
              LookupNamesByHash co1_arpl ds_arpm ->
                let {
                  ds2_srB9 :: [Char]
                  ds2_srB9
                    = case ds_arpm `cast` <Co:1> of
                      { PS ww1_arBG ww2_arBH ww3_arBP ww4_arBQ ->
                      $wunpackAppendCharsLazy
                        ww1_arBG ww2_arBH ww3_arBP ww4_arBQ ([] @ Char)
                      } } in
                (\ (@ (m2_arpp :: * -> *))
                   ($dMonad_arpq :: Monad m2_arpp)
                   (eta_B1
                      :: forall x1.
                         Union
                           '[Filesystem, Output Message, Input Command, Input Event,
                             Input Command, Trace, Embed IO, Final IO]
                           (Sem
                              '[Filesystem, Output Message, Input Command, Input Event,
                                Input Command, Trace, Embed IO, Final IO])
                           x1
                         -> m2_arpp x1) ->
                   fmap
                     @ m2_arpp
                     ($p1Applicative @ m2_arpp ($p1Monad @ m2_arpp $dMonad_arpq))
                     @ [FilePath]
                     @ [Name]
                     f3_rtDj
                     ($wgrep
                        @ '[Filesystem, Output Message, Input Command, Input Event,
                            Input Command, Trace, Embed IO, Final IO]
                        (lvl19_rtDB `cast` <Co:4557>)
                        magicPrefix
                        ds2_srB9
                        @ m2_arpp
                        eta_B1))
                `cast` <Co:94>
            } } in
      (\ (@ (m2_arpx :: * -> *))
         ($dMonad_arpy :: Monad m2_arpx)
         (k_arpz
            :: forall x1.
               Union
                 '[Tactics
                     f_arok
                     m_aroi
                     '[HashNaming, Filesystem, Output Message, Input Command,
                       Input Event, Input Command, Trace, Embed IO, Final IO],
                   Filesystem, Output Message, Input Command, Input Event,
                   Input Command, Trace, Embed IO, Final IO]
                 (Sem
                    '[Tactics
                        f_arok
                        m_aroi
                        '[HashNaming, Filesystem, Output Message, Input Command,
                          Input Event, Input Command, Trace, Embed IO, Final IO],
                      Filesystem, Output Message, Input Command, Input Event,
                      Input Command, Trace, Embed IO, Final IO])
                 x1
               -> m2_arpx x1) ->
         >>=
           @ m2_arpx
           $dMonad_arpy
           @ x_aroh
           @ (f_arok x_aroh)
           (((raise
                @ (Tactics
                     f_arok
                     m_aroi
                     '[HashNaming, Filesystem, Output Message, Input Command,
                       Input Event, Input Command, Trace, Embed IO, Final IO])
                @ '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO]
                @ x_aroh
                m1_srBS)
             `cast` <Co:201>)
              @ m2_arpx $dMonad_arpy k_arpz)
           (\ (z_arpB :: x_aroh) ->
              liftT1
                @ x_aroh
                @ HashNaming
                @ m_aroi
                @ '[Filesystem, Output Message, Input Command, Input Event,
                    Input Command, Trace, Embed IO, Final IO]
                z_arpB
                @ f_arok
                $dFunctor_arol
                @ m2_arpx
                $dMonad_arpy
                k_arpz))
      `cast` <Co:203>

-- RHS size: {terms: 18, types: 698, coercions: 7,028, joins: 0/0}
$srunMarkdownSubsystemsToFilesystem
  :: forall a.
     FilePath
     -> Sem
          '[ContentStore (AST [Block]), ScratchMgr [Block],
            LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
            Output Message, Input Command, Input Event, Input Command, Trace,
            Embed IO, Final IO]
          a
     -> Sem
          '[Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
          a
$srunMarkdownSubsystemsToFilesystem
  = \ (@ a_XoYw)
      (scratch2_aoZ0 :: FilePath)
      (x_aoZ1
         :: Sem
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              a_XoYw) ->
      interpretH
        @ HashNaming
        @ '[Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
        @ a_XoYw
        $shashNamingToFilesystem1
        (runBlockSerdes
           @ '[HashNaming, Filesystem, Output Message, Input Command,
               Input Event, Input Command, Trace, Embed IO, Final IO]
           @ a_XoYw
           ($wmarkdownLanguageProvider
              @ '[Serdes [Block], HashNaming, Filesystem, Output Message,
                  Input Command, Input Event, Input Command, Trace, Embed IO,
                  Final IO]
              ($smarkdownLanguageProvider_$dFind8 `cast` <Co:243>)
              @~ <Co:566>
              ($WSZ `cast` <Co:242>)
              @~ <Co:355>
              @ a_XoYw
              ($wscratchMgrToFilesystem
                 @ [Block]
                 @ '[LanguageProvider [Block], Serdes [Block], HashNaming,
                     Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]
                 @ a_XoYw
                 ($srunMarkdownSubsystemsToFilesystem_$dFind9 `cast` <Co:257>)
                 @~ <Co:1450>
                 ($WSZ `cast` <Co:256>)
                 @~ <Co:381>
                 scratch2_aoZ0
                 ($wcontentStoreToFilesystem
                    @ [Block]
                    @ '[ScratchMgr [Block], LanguageProvider [Block], Serdes [Block],
                        HashNaming, Filesystem, Output Message, Input Command, Input Event,
                        Input Command, Trace, Embed IO, Final IO]
                    @ a_XoYw
                    ($srunMarkdownSubsystemsToFilesystem_$dFind10 `cast` <Co:271>)
                    @~ <Co:1832>
                    ($srunMarkdownSubsystemsToFilesystem_$dFind7 `cast` <Co:275>)
                    @~ <Co:900>
                    $s$fHashable[]
                    x_aoZ1))))

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
scratch1 :: Addr#
scratch1 = "scratch.sem"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
scratch :: FilePath
scratch = unpackCString# scratch1

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule2 :: Addr#
$trModule2 = "Main"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: TrName
$trModule1 = TrNameS $trModule2

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule4 :: Addr#
$trModule4 = "main"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule3 :: TrName
$trModule3 = TrNameS $trModule4

-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$trModule :: Module
$trModule = Module $trModule3 $trModule1

-- RHS size: {terms: 35, types: 417, coercions: 14, joins: 0/1}
main7
  :: forall x (m :: * -> *).
     State (LastLoadedSnippets [Block]) m x
     -> LastLoadedSnippets [Block]
     -> forall (m1 :: * -> *).
        Monad m1 =>
        (forall x2.
         Union
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO]
           (Sem
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO])
           x2
         -> m1 x2)
        -> m1 (x, LastLoadedSnippets [Block])
main7
  = \ (@ x_aq2K)
      (@ (m_aq2L :: * -> *))
      (e1_aq2M :: State (LastLoadedSnippets [Block]) m_aq2L x_aq2K)
      (x1_aq2N :: LastLoadedSnippets [Block])
      (@ (m1_aq2O :: * -> *))
      ($dMonad_aq2P :: Monad m1_aq2O)
      _ ->
      let {
        lvl20_sttw :: Applicative m1_aq2O
        lvl20_sttw = $p1Monad @ m1_aq2O $dMonad_aq2P } in
      >>=
        @ m1_aq2O
        $dMonad_aq2P
        @ (LastLoadedSnippets [Block], x_aq2K)
        @ (x_aq2K, LastLoadedSnippets [Block])
        (case e1_aq2M of {
           Get co_aq2X ->
             (pure
                @ m1_aq2O
                lvl20_sttw
                @ (LastLoadedSnippets [Block], LastLoadedSnippets [Block])
                (x1_aq2N, x1_aq2N))
             `cast` <Co:7>;
           Put co_aq30 s1_aq31 ->
             (pure
                @ m1_aq2O
                lvl20_sttw
                @ (LastLoadedSnippets [Block], ())
                (s1_aq31, ()))
             `cast` <Co:7>
         })
        (\ (z_aq33 :: (LastLoadedSnippets [Block], x_aq2K)) ->
           case z_aq33 of { (a1_aq36, b1_aq37) ->
           pure
             @ m1_aq2O
             lvl20_sttw
             @ (x_aq2K, LastLoadedSnippets [Block])
             (b1_aq37, a1_aq36)
           })

-- RHS size: {terms: 14, types: 492, coercions: 660, joins: 0/0}
main6
  :: forall (m :: * -> *).
     Monad m =>
     (forall x1.
      Union
        '[ContentStore (AST [Block]), ScratchMgr [Block],
          LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
          Output Message, Input Command, Input Event, Input Command, Trace,
          Embed IO, Final IO]
        (Sem
           '[ContentStore (AST [Block]), ScratchMgr [Block],
             LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
             Output Message, Input Command, Input Event, Input Command, Trace,
             Embed IO, Final IO])
        x1
      -> m x1)
     -> m ()
main6
  = \ (@ (m_aoZn :: * -> *))
      ($dMonad_aoZo :: Monad m_aoZn)
      (eta_B1
         :: forall x1.
            Union
              '[ContentStore (AST [Block]), ScratchMgr [Block],
                LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                Output Message, Input Command, Input Event, Input Command, Trace,
                Embed IO, Final IO]
              (Sem
                 '[ContentStore (AST [Block]), ScratchMgr [Block],
                   LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                   Output Message, Input Command, Input Event, Input Command, Trace,
                   Embed IO, Final IO])
              x1
            -> m_aoZn x1) ->
      fmap
        @ m_aoZn
        ($p1Applicative @ m_aoZn ($p1Monad @ m_aoZn $dMonad_aoZo))
        @ (LastLoadedSnippets [Block], ())
        @ ()
        (snd @ (LastLoadedSnippets [Block]) @ ())
        (((interpretInStateT
             @ (State (LastLoadedSnippets [Block]))
             @ (LastLoadedSnippets [Block])
             @ '[ContentStore (AST [Block]), ScratchMgr [Block],
                 LanguageProvider [Block], Serdes [Block], HashNaming, Filesystem,
                 Output Message, Input Command, Input Event, Input Command, Trace,
                 Embed IO, Final IO]
             @ ()
             (main7 `cast` <Co:334>)
             (([] @ (Name, AST [Block])) `cast` <Co:4>)
             ($sdaemon3 `cast` <Co:166>))
          `cast` <Co:156>)
           @ m_aoZn $dMonad_aoZo eta_B1)

-- RHS size: {terms: 12, types: 294, coercions: 1,851, joins: 0/0}
main5
  :: forall (m :: * -> *).
     Monad m =>
     (forall x.
      Union
        '[Filesystem, Output Message, Input Command, Input Event,
          Input Command, Trace, Embed IO, Final IO]
        (Sem
           '[Filesystem, Output Message, Input Command, Input Event,
             Input Command, Trace, Embed IO, Final IO])
        x
      -> m x)
     -> m ()
main5
  = \ (@ (m_aq1L :: * -> *))
      (w3_aq1M :: Monad m_aq1L)
      (w4_aq1N
         :: forall x.
            Union
              '[Filesystem, Output Message, Input Command, Input Event,
                Input Command, Trace, Embed IO, Final IO]
              (Sem
                 '[Filesystem, Output Message, Input Command, Input Event,
                   Input Command, Trace, Embed IO, Final IO])
              x
            -> m_aq1L x) ->
      $wdebugTraceEffect
        @ Filesystem
        @ '[Filesystem, Output Message, Input Command, Input Event,
            Input Command, Trace, Embed IO, Final IO]
        @ ()
        ($WSZ `cast` <Co:196>)
        @~ <Co:315>
        ($sdebugTraceEffect2 `cast` <Co:199>)
        @~ <Co:988>
        ($fShowFilesystem @ (* -> *))
        ($srunMarkdownSubsystemsToFilesystem
           @ () scratch (main6 `cast` <Co:153>))
        @ m_aq1L
        w3_aq1M
        w4_aq1N

-- RHS size: {terms: 5, types: 160, coercions: 299, joins: 0/0}
main4
  :: Sem
       '[Input Command, Input Event, Input Command, Trace, Embed IO,
         Final IO]
       ()
main4
  = interpretH
      @ (Output Message)
      @ '[Input Command, Input Event, Input Command, Trace, Embed IO,
          Final IO]
      @ ()
      main8
      (interpretH
         @ Filesystem
         @ '[Output Message, Input Command, Input Event, Input Command,
             Trace, Embed IO, Final IO]
         @ ()
         ($sfilesystemToIO1 `cast` <Co:205>)
         (main5 `cast` <Co:94>))

-- RHS size: {terms: 3, types: 65, coercions: 0, joins: 0/0}
main3
  :: forall (m :: * -> *).
     Monad m =>
     (forall x.
      Union
        '[Input Event, Input Command, Trace, Embed IO, Final IO]
        (Sem '[Input Event, Input Command, Trace, Embed IO, Final IO])
        x
      -> m x)
     -> m ()
main3
  = runInputViaInfiniteStream1
      @ Command
      @ '[Input Event, Input Command, Trace, Embed IO, Final IO]
      $sinputStream
      @ ()
      main4

-- RHS size: {terms: 16, types: 200, coercions: 625, joins: 0/0}
main2
  :: forall (m :: * -> *).
     Monad m =>
     (forall x.
      Union
        '[Input Command, Trace, Embed IO, Final IO]
        (Sem '[Input Command, Trace, Embed IO, Final IO])
        x
      -> m x)
     -> m ()
main2
  = \ (@ (m_apXU :: * -> *))
      (w3_apXV :: Monad m_apXU)
      (w4_apXW
         :: forall x.
            Union
              '[Input Command, Trace, Embed IO, Final IO]
              (Sem '[Input Command, Trace, Embed IO, Final IO])
              x
            -> m_apXU x) ->
      case w3_apXV of
      { C:Monad ww6_apYj ww7_apYk ww8_apYl ww9_apYm ww10_apYn ->
      $winputToFileWatch
        @ '[Input Command, Trace, Embed IO, Final IO]
        @ ()
        ($sinputToFileWatch2 `cast` <Co:117>)
        @~ <Co:442>
        scratch
        (main3 `cast` <Co:66>)
        @ m_apXU
        ww6_apYj
        ww7_apYk
        ww8_apYl
        ww9_apYm
        ww10_apYn
        w4_apXW
      }

-- RHS size: {terms: 7, types: 101, coercions: 360, joins: 0/0}
main1 :: Sem '[Final IO] ()
main1
  = interpretH
      @ (Embed IO)
      @ '[Final IO]
      @ ()
      (main19 `cast` <Co:81>)
      (interpretH
         @ Trace
         @ '[Embed IO, Final IO]
         @ ()
         (main17 `cast` <Co:101>)
         (interpretH
            @ (Input Command)
            @ '[Trace, Embed IO, Final IO]
            @ ()
            (main11 `cast` <Co:125>)
            (main2 `cast` <Co:53>)))

-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
main :: IO ()
main = $srunFinal @ () main1

-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
main21 :: State# RealWorld -> (# State# RealWorld, () #)
main21 = runMainIO1 @ () main

-- RHS size: {terms: 1, types: 0, coercions: 3, joins: 0/0}
main :: IO ()
main = main21 `cast` <Co:3>

------ Local rules for imported ids --------
"SPEC/Main runMarkdownSubsystemsToFilesystem @ '[Filesystem,
                                                Output Message, Input Command, Input Event,
                                                Input Command, Trace, Embed IO, Final IO] _"
    forall (@ a_aoYu)
           ($d(%,%)28_sr13
              :: Member
                   Filesystem
                   '[Filesystem, Output Message, Input Command, Input Event,
                     Input Command, Trace, Embed IO, Final IO]).
      runMarkdownSubsystemsToFilesystem @ '[Filesystem, Output Message,
                                            Input Command, Input Event, Input Command, Trace,
                                            Embed IO, Final IO]
                                        @ a_aoYu
                                        $d(%,%)28_sr13
      = $srunMarkdownSubsystemsToFilesystem @ a_aoYu
"SPEC/Main inputStream @ '[Input Event, Input Command, Trace,
                          Embed IO, Final IO] _" [2]
    forall (@ a_aoe3)
           (w_XsEF
              :: Members
                   '[Final IO, Input Command, Input Event]
                   '[Input Event, Input Command, Trace, Embed IO, Final IO]).
      inputStream @ '[Input Event, Input Command, Trace, Embed IO,
                      Final IO]
                  @ a_aoe3
                  w_XsEF
      = $sinputStream @ a_aoe3
"SPEC/Main usingSem @ IO _ _"
    forall (@ (r_assR :: EffectRow))
           (@ a_assS)
           ($dMonad_sssY :: Monad IO).
      usingSem @ IO @ r_assR @ a_assS $dMonad_sssY
      = $susingSem @ r_assR @ a_assS
"SPEC/Main runFinal @ IO _"
    forall (@ a_aqY1) ($dMonad_sssK :: Monad IO).
      runFinal @ IO @ a_aqY1 $dMonad_sssK
      = $srunFinal @ a_aqY1
spacekitteh commented 4 years ago

Neat!

Also, some of those effects look pretty interesting; are you up for putting any of them in polysemy-zoo?

ocharles commented 4 years ago

Can we see the other side? That is, the .hs for this core?

isovector commented 4 years ago

@ocharles it's a big project I'm working on for https://www.patreon.com/designandinterpretation, so I'm not ready releasing it in it's full glory yet. But here's the meat, sans interpreters:


handleCommand
    :: Members
        '[ ContentStore (AST v)
         , HashNaming
         , Output Message
         , ScratchMgr v
         , State (LastLoadedSnippets v)
         ] r
    => Command
    -> Sem r ()
handleCommand (RenameName src dst) =
  runError (renameName src dst) >>= \case
    Left err -> output $ LookupFailure err
    Right () -> output $ Renamed src dst
handleCommand (LoadSnippet name) =
  runError (loadSnippet name) >>= \case
    Left err -> output $ LookupFailure err
    Right () -> output $ WroteSnippet name
handleCommand ReloadScratch =
  reloadScratch >>= \case
    Just snippets -> do
      put $ LastLoadedSnippets snippets
      output $ LoadedSnippets $ fmap fst snippets
    Nothing -> do
      put $ LastLoadedSnippets []
      output SnippetLoadError
handleCommand (CommitSnippet name) = do
  LastLoadedSnippets snippets <- get
  case lookup name snippets of
    Just ast -> do
      commitSnippet [(name, ast)]
      output $ CommittedSnippets [name]
    Nothing  -> output $ UnknownSnippet name
handleCommand Quit = pure ()
{-# INLINABLE handleCommand #-}

runAsDaemon
    :: Member (Input i) r
    => (i -> Sem r Bool)
    -> (i -> Sem r ())
    -> Sem r ()
runAsDaemon should_quit action = do
  i <- input
  should_quit i >>= \case
    True  -> pure ()
    False -> do
      action i
      runAsDaemon should_quit action
{-# INLINABLE runAsDaemon #-}

daemon
    :: Members
        '[ ContentStore (AST v)
         , HashNaming
         , Input Command
         , Output Message
         , ScratchMgr v
         , State (LastLoadedSnippets v)
         ] r
    => Sem r ()
daemon = runAsDaemon (pure . (== Quit)) handleCommand
{-# INLINABLE daemon #-}

main :: IO ()
main = runFinal
     $ embedToFinal
     $ traceToIO
     $ runInputSem (embed readLn)
     $ inputToFileWatch scratch
     $ runInputViaInfiniteStream inputStream
     $ runOutputSem (embed . putStrLn . messageToString)
     $ filesystemToIO
     $ debugTraceEffect @Filesystem
     $ runMarkdownSubsystemsToFilesystem scratch
     $ evalState (LastLoadedSnippets mempty)
     $ daemon

{-# SPECIALIZE
      daemon :: Sem '[ State (LastLoadedSnippets [Block])
                     , ContentStore (AST [Block])
                     , ScratchMgr [Block]
                     , LanguageProvider [Block]
                     , Serdes [Block]
                     , HashNaming
                     , Filesystem
                     , Output Message
                     , Input Command
                     , Input Event
                     , Input Command
                     , Trace
                     , Embed IO
                     , Final IO
                     ] ()
  #-}