Skip to content

Instantly share code, notes, and snippets.

@JustinChristensen
Created August 27, 2023 23:11
Show Gist options
  • Save JustinChristensen/d6f0c180899a1b03008dbf6b9007ec38 to your computer and use it in GitHub Desktop.
Save JustinChristensen/d6f0c180899a1b03008dbf6b9007ec38 to your computer and use it in GitHub Desktop.
type family DataType t = s | s -> t where
DataType Int32 = "int"
DataType Text = "text"
asType :: Tagged t String
asType = Tagged $ symbolVal (Proxy :: Proxy (DataType t))
{-
• No instance for (KnownSymbol (DataType t0))
arising from a use of ‘symbolVal’
• In the second argument of ‘($)’, namely
‘symbolVal (Proxy :: Proxy (DataType t))’
In the expression: Tagged $ symbolVal (Proxy :: Proxy (DataType t))
In an equation for ‘asType’:
asType = Tagged $ symbolVal (Proxy :: Proxy (DataType t))
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment