Commit 4a6c92b6 authored by simonmar's avatar simonmar
Browse files

[project @ 2005-10-06 10:40:10 by simonmar]

add dataConFieldType

From: Autrijus Tang <autrijus@autrijus.org>
parent 026ea0a9
......@@ -12,7 +12,8 @@ module DataCon (
dataConTyVars, dataConStupidTheta,
dataConArgTys, dataConOrigArgTys, dataConResTy,
dataConInstOrigArgTys, dataConRepArgTys,
dataConFieldLabels, dataConStrictMarks, dataConExStricts,
dataConFieldLabels, dataConFieldType,
dataConStrictMarks, dataConExStricts,
dataConSourceArity, dataConRepArity,
dataConIsInfix,
dataConWorkId, dataConWrapId, dataConWrapId_maybe, dataConImplicitIds,
......@@ -40,6 +41,7 @@ import Outputable
import Unique ( Unique, Uniquable(..) )
import ListSetOps ( assoc )
import Util ( zipEqual, zipWithEqual )
import Maybes ( expectJust )
\end{code}
......@@ -454,6 +456,10 @@ dataConImplicitIds dc = case dcIds dc of
dataConFieldLabels :: DataCon -> [FieldLabel]
dataConFieldLabels = dcFields
dataConFieldType :: DataCon -> FieldLabel -> Type
dataConFieldType con label = expectJust "unexpected label" $
lookup label (dcFields con `zip` dcOrigArgTys con)
dataConStrictMarks :: DataCon -> [StrictnessMark]
dataConStrictMarks = dcStrictMarks
......
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