Meaning of variable'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Meaning of variable'

Erik de Castro Lopo-29
Hi all,

I'm looking at some Haskell code that has things like:

    var' <- function

and also functions with names like:

    function' = .....

What does the tick mean??

Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Do I do everything in C++ and teach a course in advanced swearing?"
-- David Beazley at IPC8, on choosing a language for teaching
Reply | Threaded
Open this post in threaded view
|

Meaning of variable'

Brandon S Allbery KF8NH
On 2009 Jan 4, at 0:52, Erik de Castro Lopo wrote:
>    function' = .....
>
> What does the tick mean??


By convention it signals a variant of the function without the tick.  
Semantically it doesn't mean anything special; you can use ' in an  
identifier as long as it's not the first character.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [hidden email]
system administrator [openafs,heimdal,too many hats] [hidden email]
electrical and computer engineering, carnegie mellon university    KF8NH


Reply | Threaded
Open this post in threaded view
|

Meaning of variable'

Erik de Castro Lopo-29
Brandon S. Allbery KF8NH wrote:

> By convention it signals a variant of the function without the tick.  
> Semantically it doesn't mean anything special; you can use ' in an  
> identifier as long as it's not the first character.

Thanks Brandon. Thats what I guessed but I couldn't find a good
google search term to confirm that.

Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"If you already know what recursion is, just remember the answer.
Otherwise, find someone who is standing closer to Douglas Hofstadter;
then ask him or her what recursion is."
--  http://www.cabochon.com/~stevey/blog-rants/godel-escher-blog.html
Reply | Threaded
Open this post in threaded view
|

Meaning of variable'

Bas van Dijk-2
In reply to this post by Brandon S Allbery KF8NH
On Sun, Jan 4, 2009 at 6:55 AM, Brandon S. Allbery KF8NH
<[hidden email]> wrote:
> On 2009 Jan 4, at 0:52, Erik de Castro Lopo wrote:
>>
>>   function' = .....
>>
>> What does the tick mean??
>
>
> By convention it signals a variant of the function without the tick...

The tick is often used to signal a more strict variant of the function
without the tick.

See foldl and foldl' for example:

http://haskell.org/ghc/docs/latest/html/libraries/base/Data-List.html#v:foldl

regards,

Bas