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:
parent
7922af23fe
commit
2ba64b1e08
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user