1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 02:14:20 +03:00

📝 why OVERLAPPABLE.

This commit is contained in:
Rob Rix 2016-06-16 11:58:17 -04:00
parent cff9ac00ab
commit 63ed038654

View File

@ -33,6 +33,8 @@ class HasField (fields :: [*]) (field :: *) where
-- Instances
-- OVERLAPPABLE is required for the HasField instances so that we can handle the two cases: either the head of the non-empty h-list is the requested field, or it isnt. The third possible case (the h-list is empty) is rejected at compile-time.
instance {-# OVERLAPPABLE #-} HasField fields field => HasField (notIt ': fields) field where
getField (RCons _ t) = getField t