API Annotatons in a FunBind

Alan & Kim Zimmerman alan.zimm at gmail.com
Mon Dec 15 21:15:40 UTC 2014


After individual FunBinds have been parsed, they are combined in
getMonoBind.

In the process, all the original FunBind fun_id's bar one are discarded,
including its location.

This causes a problem for source-to-source conversions of functions such as
the following

(&&&  ) [] [] =  []
xs    &&&   [] =  xs
(  &&&  ) [] ys =  ys

Where there are compound RdrNames, and each has different spacing.

I am proposing to add a (Maybe (Located id)) to the Match datatype to deal
with this.


data Match id body
  = Match
        Maybe (Located id) -- fun_id in subsequent function equations
        [LPat id]               -- The patterns
        (Maybe (LHsType id))    -- A type signature for the result of the
match
                                -- Nothing after typechecking
        (GRHSs id body)

Is this a problem?

Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20141215/60f69bd0/attachment.html>


More information about the ghc-devs mailing list