[haskell-llvm] llvm-patch: Generalise the CallArgs type class so you can use call with two return types within one module

Max Bolingbroke batterseapower at hotmail.com
Wed Jul 6 08:54:32 BST 2011


On 5 July 2011 10:37, Henning Thielemann <lemming at henning-thielemann.de> wrote:
> Yes I am building from the git repository. What I usually do for my projects
> is to bump the version immediately after an Hackage upload, since the
> changes I do afterwards will definitely not belong to the Hackage version.

If you check bos's commit history you will see that it is his practice
to bump version just before a release. For example, the current
Hackage version was released on May 19th
(http://hackage.haskell.org/package/llvm) and the corresponding commit
on May 19th includes a version number bump to the released version
(https://github.com/bos/llvm/commit/a5176f87931dfbcb3355f62e67ed4a25e345db2e).

RE swapping the arguments to CallArgs, I can do this. However,
CallArgs and FunctionArgs do not seem to be entirely analogous. We
have:

class CallArgs f g r | g -> r f, f r -> g where
class FunctionArgs f g r | f -> g r, g r -> f where

Note that the parameters f and g occur in the functional dependencies
in precisely opposite senses in these classes. So if we were slavish
about consistency we might be tempted to swap these two parameters as
well.

There is also precedence for "r" first in the definition of
CodeGenFunction (in this case because it must be a monad in the right
way):

newtype CodeGenFunction r a

Nonetheless, I have submitted a patch for the "r" parameter change to bos.

Max



More information about the Haskell-llvm mailing list