Groups
Groups
Sign in
Groups
Groups
proglang-course-2014
Conversations
About
Send feedback
Help
nested function calls
92 views
Skip to first unread message
jonazza...@gmail.com
unread,
Mar 7, 2014, 1:12:55 PM
3/7/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to proglang-c...@googlegroups.com
Hi
How should we evaluate :
id x = x;
twice f x = f (f x) ;
main = twice id 6 ;
in good1.fun
as it requires another function?
Aarne Ranta
unread,
Mar 8, 2014, 11:48:38 AM
3/8/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to proglang-c...@googlegroups.com
Hello,
Can you explain what you mean by "requires another function"?
Everything that is needed is in the code.
The evaluation should go this way:
main
= twice id 6
= (\f -> \x -> f (f x)) id 6
= id (id 6)
= (\x -> x) (id 6)
= id 6
= (\x -> x) 6
= 6
Not necessarily in this order, but these are the main steps and the result.
Regards
Aarne.
Reply all
Reply to author
Forward
0 new messages