1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

🔥 the ToTagInstance for lists.

This commit is contained in:
Rob Rix 2019-09-23 17:40:37 -04:00
parent 7922af23fe
commit 2ba64b1e08
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -52,16 +52,12 @@ class ToTagBy (strategy :: Strategy) t where
data Strategy = Generic | Custom
type family ToTagInstance t :: Strategy where
ToTagInstance [_] = 'Custom
ToTagInstance ((_ :+: _) _) = 'Custom
ToTagInstance (Py.FunctionDefinition Loc) = 'Custom
ToTagInstance (Py.ClassDefinition Loc) = 'Custom
ToTagInstance (Py.Call Loc) = 'Custom
ToTagInstance _ = 'Generic
instance ToTag t => ToTagBy 'Custom [t] where
tag' = traverse_ tag
instance (ToTag (l a), ToTag (r a)) => ToTagBy 'Custom ((l :+: r) a) where
tag' (L1 l) = tag l
tag' (R1 r) = tag r