Hi,
I’m still working with YHC Core to try to eventually
to convert to Java.
I’m having a little bit of trouble trying to
fully understand the semantics of the YHC Core language.
I’ve translated
increase x = x+1
into
Core for a simple example. The Core
produced is
Core {
coreName :: Increase
coreImports :: [Data.Ratio,Prelude]
coreDatas ::
[
[]
coreFuncs ::
[
CoreFunc {
coreFuncName :: Increase.increase
coreFuncArgs ::
[v207,v208]
coreFuncBody :: CorePos 4:1-4:16 (CoreApp
(
CoreApp
(
CoreFun
Prelude.+
)
[CoreVar v207]
)
[CoreVar v208,CoreApp
(
CoreApp
(
CoreFun Prelude.fromInteger
)
[CoreVar v207]
)
[CoreInteger 1]])
}
]
}
The bit I’m having trouble with is the CoreApp’s they have an expression and a list of
expressions, does this mean that the first expression should be applied to each
element of the list?
In particular from above
(CoreApp
(CoreApp (CoreFun
Prelude.+) [CoreVar v207])
[
CoreVar v208,
CoreApp
(CoreApp (CoreFun Prelude.fromInteger) [CoreVar
v207])
[CoreInteger
1]
]
)
so is v208
the 1 from the original Haskell? If
so why is it then explicitly mentioned (CoreIntger 1)?
This function originally took 1 argument it now takes 2.
As you can tell I’m a little confused!
If anyone can enlighten me It’d
be appreciated.
Many Thanks,