You do not have permission to delete messages in this group
Copy link
Report message
Sign in to 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 haskel...@googlegroups.com
Going through learn you a haskell.
In recursion chapter, there is an implementation of take function. I am trying to implement it another way but keep getting compiler error "Not in scope: ‘as’"
Here is the code
take' :: Int -> [a] -> [a] take' _ []=[] take' x _ | x _ <= 0 = [] | otherwise x (a:as) = a : take'(x-1)as
Can someone tell me what is wrong with this program?
Derek McLoughlin
unread,
Dec 20, 2014, 8:06:08 AM12/20/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
Sign in to 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 haskel...@googlegroups.com
Guards are just boolean conditions, and you can't (without using an extension called PatternGuards) do pattern matching in them:
take' :: Int -> [a] -> [a]
take' _ [] = []
take' x (a:as)
| x <= 0 = []
| otherwise = a : take' (x-1) as
Abhinav Gogna
unread,
Dec 22, 2014, 2:40:31 PM12/22/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
Sign in to 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 haskel...@googlegroups.com
Thank you Derek!
mustafa mert güntürkün
unread,
Jan 5, 2015, 8:13:21 AM1/5/15
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
Sign in to 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 haskel...@googlegroups.com
Hi all i have a question;
im going to be final exam today 2 hour later.I should know ;
Haskell's address binding mechanism for these
-static
-stack-dynamic
-explicit heap-dynamic and implicit heap-dynamic if u know the answer could u send me pls..