Verified Commit aa041841 authored by Camil Staps's avatar Camil Staps
Browse files

Instances and derivations of the arrow type

parent c1f0f950
......@@ -152,11 +152,15 @@ where
link _ (TypeDefEntry tde) = TypeDefEntry
{ tde
& tde_instances=idxfilter \e -> case e of
InstanceEntry ie -> or [t == name \\ 'T'.Type t _ <- concatMap ('T'.subtypes o fst) ie.ie_types]
InstanceEntry ie -> case name of
"(->)" -> any (\t -> t=:('T'.Func _ _ _) || t=:('T'.Arrow _)) $ concatMap ('T'.subtypes o fst) ie.ie_types
_ -> or [t == name \\ 'T'.Type t _ <- concatMap ('T'.subtypes o fst) ie.ie_types]
_ -> False
, tde_derivations=idxfilter \e -> case e of
DeriveEntry {de_type='T'.Type t _} -> t == name
_ -> False
DeriveEntry {de_type='T'.Type t _} -> t == name
DeriveEntry {de_type='T'.Arrow _} -> name == "(->)"
DeriveEntry {de_type='T'.Func _ _ _} -> name == "(->)"
_ -> False
, tde_usages=idxfilter \e -> case e of
FunctionEntry {fe_type=Just t} -> or [t == name \\ 'T'.Type t _ <- 'T'.subtypes t]
_ -> False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment