diff options
author | Simon Jakobi <simon.jakobi@gmail.com> | 2018-04-02 22:27:44 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-04-07 13:30:15 -0400 |
commit | 7bd7fecbc9819adfb097aab5fa7e0fe1cdf1cefd (patch) | |
tree | 900ac894a0d4375041cbb9878c49b86cf221af0f | |
parent | 26cfe291c5d581299a40ae5177979ddf1b465ec0 (diff) | |
download | haskell-7bd7fecbc9819adfb097aab5fa7e0fe1cdf1cefd.tar.gz |
Improve documentation for refineDefaultAlt
-rw-r--r-- | compiler/coreSyn/CoreUtils.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 5608afc334..792da99f38 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -645,12 +645,13 @@ filterAlts _tycon inst_tys imposs_cons alts impossible_alt inst_tys (DataAlt con, _, _) = dataConCannotMatch inst_tys con impossible_alt _ _ = False -refineDefaultAlt :: [Unique] -> TyCon -> [Type] - -> [AltCon] -- Constructors that cannot match the DEFAULT (if any) +-- | Refine the default alternative to a 'DataAlt', if there is a unique way to do so. +refineDefaultAlt :: [Unique] -- ^ Uniques for constructing new binders + -> TyCon -- ^ Type constructor of scrutinee's type + -> [Type] -- ^ Type arguments of scrutinee's type + -> [AltCon] -- ^ Constructors that cannot match the DEFAULT (if any) -> [CoreAlt] - -> (Bool, [CoreAlt]) --- Refine the default alternative to a DataAlt, --- if there is a unique way to do so + -> (Bool, [CoreAlt]) -- ^ 'True', if a default alt was replaced with a 'DataAlt' refineDefaultAlt us tycon tys imposs_deflt_cons all_alts | (DEFAULT,_,rhs) : rest_alts <- all_alts , isAlgTyCon tycon -- It's a data type, tuple, or unboxed tuples. |