Skip to content

Comments

Galley polysemy (5/5) - Final cleanup#1917

Merged
pcapriotti merged 24 commits intodevelopfrom
pcapriotti/galley-polysemy-cleanup
Nov 16, 2021
Merged

Galley polysemy (5/5) - Final cleanup#1917
pcapriotti merged 24 commits intodevelopfrom
pcapriotti/galley-polysemy-cleanup

Conversation

@pcapriotti
Copy link
Contributor

@pcapriotti pcapriotti commented Nov 9, 2021

This PR is about replacing the Galley monad with a bare Sem. All direct uses of IO have been hidden under effects (almost, see below):

  • Logging now goes through the TinyLog effect in polysemy-wire-zoo.
  • Getting the current time is handled by an Input UTCTime effect.
  • Aws queuing has been abstracted as an action in TeamStore.

Some functions still access options directly, and therefore make use of an Input Opts effect. This could be improved later by adding the specific option getters needed to a related effect.

The local domain is provided by a Input (Local ()) effect. However, I've tried using this effect sparingly, and instead pass around a local value explicitly when possible. In fact, as part of this PR, there is a new Servant combinator ZAuthLocalUser that turns the ZUser header into a Local UserId argument. When wai-routes is faded out completely, we will be able to remove the global interpreter for Input (Local ()) entirely.

There is one remaining Final IO effect, used to stream csv team data. This is harder to hide under an effect, because it would correspond to a higher order action whose argument has one more effect than the base, and it's not clear how to interpret such a thing.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • changelog.d contains the following bits of information:
    • A file with the changelog entry in one or more suitable sub-sections. The sub-sections are marked by directories inside changelog.d.

@pcapriotti pcapriotti changed the base branch from develop to pcapriotti/galley-polysemy-errors November 9, 2021 14:49
Base automatically changed from pcapriotti/galley-polysemy-errors to develop November 10, 2021 05:49
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-cleanup branch 2 times, most recently from 6d3e5e4 to 0fa15c7 Compare November 11, 2021 07:15
@pcapriotti pcapriotti marked this pull request as ready for review November 15, 2021 07:50
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-cleanup branch from ff6b0f5 to 1202a5e Compare November 15, 2021 07:51
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-cleanup branch from 1202a5e to d4d0027 Compare November 15, 2021 07:51
@isovector
Copy link
Contributor

I built this PR with core-warn enabled, looking for likely culprits as to why Galley.API.Public is so slow to compile. There is a huge amount of coercions going on, with the most egregious being:

src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in servantSitemap at these locations:
        • src/Galley/API/Public.hs:79:3-16
        • src/Galley/API/Public.hs:81:48-79
        • src/Galley/API/Public.hs:82:37-57
        ...             
                        
    Terms: 1 Types: 0 Coercions: 1461330


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in sitemap at these locations:
        • <no location info>
                        
    Terms: 1 Types: 0 Coercions: 32167


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in f at these locations:
        • <no location info>
                        
    Terms: 5 Types: 698 Coercions: 24792


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in servantSitemap at these locations:
        • <no location info>
                        
    Terms: 322 Types: 850286 Coercions: 1509190


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetSearchVisibilityH at these locations:
        • <no location info>
                        
    Terms: 14 Types: 716 Coercions: 54200


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetTeamMemberH at these locations:
        • <no location info>
                        
    Terms: 17 Types: 731 Coercions: 46693


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetTeamMembersH at these locations:
        • <no location info>
                        
    Terms: 16 Types: 752 Coercions: 29120

    
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetConversationRoles1 at these locations:
        • <no location info>
                        
    Terms: 16 Types: 2138 Coercions: 23770


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetTeamConversationRoles at these locations:
        • <no location info>
                        
    Terms: 3 Types: 697 Coercions: 29120

src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetTeamConversations at these locations:
        • <no location info>
                        
    Terms: 4 Types: 697 Coercions: 44898
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetTeamConversation at these locations:
        • <no location info>
                        
    Terms: 5 Types: 697 Coercions: 61550
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetSSOStatusInternal1 at these locations:
        • <no location info>
                        
    Terms: 16 Types: 2136 Coercions: 24788
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetTeamSearchVisibilityAvailableInternal1 at these locations:
        • <no location info>
                        
    Terms: 16 Types: 2136 Coercions: 24788
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetValidateSAMLEmailsInternal1 at these locations:
        • <no location info>
                        
    Terms: 15 Types: 2136 Coercions: 10310

src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetDigitalSignaturesInternal1 at these locations:
        • <no location info>
                        
    Terms: 15 Types: 2136 Coercions: 10310
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetAppLockInternal1 at these locations:
        • <no location info>
                        
    Terms: 14 Types: 2136 Coercions: 24788


src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetClassifiedDomainsInternal1 at these locations:
        • <no location info>
                        
    Terms: 12 Types: 2136 Coercions: 14481
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $sgetConferenceCallingInternal at these locations:
        • <no location info>
                        
    Terms: 6 Types: 1394 Coercions: 26197

src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 78 Types: 150490 Coercions: 92307
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 158 Types: 370458 Coercions: 207770
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 78 Types: 150477 Coercions: 92299
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 323 Types: 896163 Coercions: 469575
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 78 Types: 150217 Coercions: 92139
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 163 Types: 384826 Coercions: 214845
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 83 Types: 163231 Coercions: 98913
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgtoServant at these locations:
        • <no location info>
                        
    Terms: 43 Types: 68908 Coercions: 46488
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 78 Types: 150490 Coercions: 92292
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 158 Types: 370458 Coercions: 207739
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 78 Types: 150477 Coercions: 92284
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 323 Types: 896163 Coercions: 469511
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 78 Types: 150217 Coercions: 92124
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 163 Types: 384826 Coercions: 214813
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 83 Types: 163231 Coercions: 98897
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProduct:*:_$cgfromServant at these locations:
        • <no location info>
                        
    Terms: 43 Types: 68908 Coercions: 46480
    
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProductM1 at these locations:
        • <no location info>
                        
    Terms: 5 Types: 46971 Coercions: 187872
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $stoServant at these locations:
        • <no location info>
                        
    Terms: 323 Types: 850986 Coercions: 1509190
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in $s$fGServantProductM1 at these locations:
        • <no location info>
                        
    Terms: 5 Types: 46979 Coercions: 281843
                        
   
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in lvl at these locations:
        • <no location info>
                        
    Terms: 38 Types: 57684 Coercions: 40230

src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in f at these locations:
        • <no location info>
                        
    Terms: 2 Types: 697 Coercions: 62166
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in lvl at these locations:
        • <no location info>
                        
    Terms: 15 Types: 281781 Coercions: 140903
                        
                        
src/Galley/API/Public.hs: warning:
    Found a large number of coercions in GHC Core.
       GHC produced a a quadratic number of coercions relative to the number of terms.
      This can happen for expensive type families that are used outside of phantom contexts.
                        
    These coercions were introduced in lvl at these locations:
        • <no location info>
                        
    Terms: 15 Types: 281781 Coercions: 140900

It's still spitting out core warnings after the five minutes I spent filtering out those results.

@isovector
Copy link
Contributor

isovector commented Nov 15, 2021

Doing some formatting, the compile-time cost centers are these:

1509190 servantSitemap
1509190 $stoServant
1461330 servantSitemap
469575  $s$fGServantProduct:*:_$cgtoServant
469511  $s$fGServantProduct:*:_$cgfromServant
281843  $s$fGServantProductM1
214845  $s$fGServantProduct:*:_$cgtoServant
214813  $s$fGServantProduct:*:_$cgfromServant
207770  $s$fGServantProduct:*:_$cgtoServant
207739  $s$fGServantProduct:*:_$cgfromServant
187872  $s$fGServantProductM1
140903  lvl
140900  lvl
98913   $s$fGServantProduct:*:_$cgtoServant
98897   $s$fGServantProduct:*:_$cgfromServant
92307   $s$fGServantProduct:*:_$cgtoServant
92299   $s$fGServantProduct:*:_$cgtoServant
92292   $s$fGServantProduct:*:_$cgfromServant
92284   $s$fGServantProduct:*:_$cgfromServant
92139   $s$fGServantProduct:*:_$cgtoServant
92124   $s$fGServantProduct:*:_$cgfromServant
62166   f
61550   $sgetTeamConversation
54200   $sgetSearchVisibilityH
46693   $sgetTeamMemberH
46488   $s$fGServantProduct:*:_$cgtoServant
46480   $s$fGServantProduct:*:_$cgfromServant
44898   $sgetTeamConversations
40230   lvl
32167   sitemap
29120   $sgetTeamMembersH
29120   $sgetTeamConversationRoles
26197   $sgetConferenceCallingInternal
24792   f
24788   $sgetTeamSearchVisibilityAvailableInternal1
24788   $sgetSSOStatusInternal1
24788   $sgetAppLockInternal1
23770   $sgetConversationRoles1
14481   $sgetClassifiedDomainsInternal1
10310   $sgetValidateSAMLEmailsInternal1
10310   $sgetDigitalSignaturesInternal1

these numbers are coercion sizes, each of which needs to be typechecked, outputted into core, and traversed for each optimization. In particular, you're running into the problems described in this blog post. The vast majority of the issues are coming from the call to genericServerT --- is that something that can be written by hand?

@isovector
Copy link
Contributor

isovector commented Nov 15, 2021

As a followup, I ran core-warn with -fplugin-opt=CoreWarn:no-warn-large-coercions to get a sense of whether there are big polysemy dictionaries at play. The only hits are for servant, so whatever is going wrong here is probably it's fault, rather than polysemy.

src/Galley/Run.hs: warning:
    Found a large chain of dictionaries produced in GHC Core.
      A big instance chain that is generating a linear amount of core dictionaries.
      This is probably caused by instance induction on an unbalanced structure (like a type-level list).
      Consider using a balanced structure (like a type-level tree).
    
    Arising from:
    
    Biggest dictionary:  (GHC.TypeNats.KnownNat 1000,
                          GHC.TypeNats.KnownNat 1000,
                          (Data.Range.Bounds Int32,
                           (singletons-2.6:Data.Singletons.Internal.SingI 1,
                            singletons-2.6:Data.Singletons.Internal.SingI 1000,
                            singletons-2.6:Data.Singletons.Prelude.Instances.TrueSym0
                            ~ 'True)),
                          (singletons-2.6:Data.Singletons.Internal.SingI 1,
                           singletons-2.6:Data.Singletons.Internal.SingI 1000,
                           singletons-2.6:Data.Singletons.Prelude.Instances.TrueSym0 ~ 'True),
                          (singletons-2.6:Data.Singletons.Internal.SingI 1000,
                           singletons-2.6:Data.Singletons.Internal.SingI 1000,
                           singletons-2.6:Data.Singletons.Prelude.Instances.TrueSym0 ~ 'True),
                          Wire.API.Routes.MultiTablePaging.State.PagingTable
                            Wire.API.Routes.MultiTablePaging.LocalOrRemoteTable,
                          GHC.TypeLits.KnownSymbol "ConversationIds")
    Size of type:  17
    Number of dictionaries:  9
    

src/Galley/Run.hs: warning:
    Found a large chain of dictionaries produced in GHC Core.
      A big instance chain that is generating a linear amount of core dictionaries.
      This is probably caused by instance induction on an unbalanced structure (like a type-level list).
      Consider using a balanced structure (like a type-level tree).
    
    Arising from:
    
    Biggest dictionary:  Wire.API.Routes.MultiVerb.IsResponseList
                           '[JSON]
                           '[Wire.API.ErrorDescription.ErrorDescription
                               403 "action-denied" "Insufficient authorization",
                             Wire.API.ErrorDescription.ErrorDescription
                               404 "no-conversation" "Conversation not found",
                             Wire.API.ErrorDescription.ErrorDescription
                               400 "bad-request" "Custom roles not supported",
                             Wire.API.ErrorDescription.ErrorDescription
                               403 "invalid-op" "invalid operation for self conversation",
                             Wire.API.ErrorDescription.ErrorDescription
                               403 "invalid-op" "invalid operation for 1:1 conversations",
                             Wire.API.ErrorDescription.ErrorDescription
                               403 "invalid-op" "invalid operation for connect conversation",
                             Wire.API.Routes.MultiVerb.RespondEmpty 204 "No change",
                             Wire.API.Routes.MultiVerb.Respond
                               200 "Member removed" Wire.API.Event.Conversation.Event]
    Size of type:  24
    Number of dictionaries:  29

@isovector
Copy link
Contributor

isovector commented Nov 15, 2021

Here's the analogous big-coercion from Spar:

src/Spar/API.hs: warning:
    These coercions were introduced in api at these locations:
        • src/Spar/API.hs:(141,3)-(146,20)
        • src/Spar/API.hs:141:3-13
        • src/Spar/API.hs:144:10-15
        ...       
                  
    Terms: 3964 Types: 36150 Coercions: 58259

compare to Galley:

src/Galley/API/Public.hs: warning:
    These coercions were introduced in servantSitemap at these locations:
        • src/Galley/API/Public.hs:79:3-16
        • src/Galley/API/Public.hs:81:48-79
        • src/Galley/API/Public.hs:82:37-57
        ...             
                        
    Terms: 1 Types: 0 Coercions: 1461330

which is two orders of magnitude larger. There are two differences as far as I can see between the two --- Spar doesn't use genericServerT, and Spar composes several sub-ServerTs together to build the larger one. I'd wager than making both changes in Galley would drop the compilation time by 100x.

@isovector isovector closed this Nov 15, 2021
@isovector isovector reopened this Nov 15, 2021
@isovector
Copy link
Contributor

isovector commented Nov 15, 2021

None of this is to say that the polysemy proofs aren't huge (see polysemy-research/polysemy#427) --- but after writing a quick unsafe proof that optimizes away, they are not the issue.

Copy link
Contributor

@mdimjasevic mdimjasevic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I left a comment on the Now effect vs. Input UTCTime.

Comment on lines 29 to 30
data Now m a where
GetTime :: Now m UTCTime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you introduced this effect? A lot of places use Input UTCTime instead of this effect. Are they any different than the getTime action of this effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a leftover. Removed in b0170c0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants