This is easily testable.
deriving instance Typeable Entry
deriving instance Typeable FileKind
deriving instance Typeable 'FOLDER
deriving instance Typeable 'FILE
convertBack :: SomeEntry -> Either (Entry FILE) (Entry FOLDER)
convertBack (SomeEntry x)
| typeOf x == typeOf (Folder "" "") = Right x
| otherwise = Left x
Couldn't match type ‘k’ with ‘'FOLDER’
‘k’ is a rigid type variable bound by
a pattern with constructor
SomeEntry :: forall (k :: FileKind). Entry k -> SomeEntry,
in an equation for ‘convertBack’
at cafe2.hs:24:14
Expected type: Entry 'FOLDER
Actual type: Entry k
Relevant bindings include x :: Entry k (bound at cafe2.hs:24:24)
In the first argument of ‘Right’, namely ‘x’
In the expression: Right x