On Sun, Jul 18, 2010 at 10:19 PM, Eitan Goldshtrom
<thesource...@gmail.com> wrote:
> Silly question, but I can't find the answer on the net. I think I'm just
> using the wrong words in my search. I'm looking for a way to create constant
> expressions in Haskell. The C/C++ equivalent of what I'm talking about is
>
> #define NAME VALUE

NAME = VALUE

the inliner should easily take care of it, if VALUE is a constant.
Note that in the designation above, NAME will *be* a constant value
due to the functional aspect of Haskell (it can't change later on).
You need the discrimination in C because something like

int NAME = VALUE;

defines a global variable, which may change and hence cannot be inlined.


-- 
J.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to