Skip to content

Instantly share code, notes, and snippets.

@paraseba
Created November 8, 2022 22:42
Show Gist options
  • Save paraseba/7fb8ddfb6502d85b0b2ae31c8f9d899e to your computer and use it in GitHub Desktop.
Save paraseba/7fb8ddfb6502d85b0b2ae31c8f9d899e to your computer and use it in GitHub Desktop.
addColor :: forall (c :: Symbol) t. KnownSymbol c => SomeColor -> ThemeInstance t -> ThemeInstance (c : t)
addColor sc (ThemeInstance m) = ThemeInstance $ Map.insert colorName sc m
where colorName = symbolVal (Proxy @c)
emptyThemeInstance :: ThemeInstance '[]
emptyThemeInstance = ThemeInstance Map.empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment