|
Eeyo posted:This was kind of covered earlier with the haskell course from UPenn, but are there other sources of "homework assignments" in functional languages? I can read a book until I'm blue in the face but it's useless without something to work on. Nothing too big either, I don't want to write some giant program that I could have done in any other language, I just want to have the important features highlighted in the assignment. This is one of the reasons I didn't really like learn you a haskell/erlang. It talked about a lot of stuff but that's pretty much fluff, I would have preferred a helpful reference and some assignments. I really liked Write Yourself a Scheme in 48 Hours
|
# ¿ May 6, 2015 04:45 |
|
|
# ¿ May 7, 2024 02:13 |
|
tekz posted:Thanks. I've noticed that the O'Reilly examples for simple stuff seems to include a lot of boilerplate. For example, for calculating the product of values in a list, instead of doing something simple like: It is! Their implementation can run in constant space while yours, potentially, could blow up the stack. Check out the Wikipedia article on Tail Call Recursion/Optimization for more info.
|
# ¿ Oct 10, 2016 22:20 |
|
I'm looking at Idris. Can anyone shed some light on what's going on here: code:
|
# ¿ Feb 4, 2017 19:31 |
|
Ralith posted:Remember that k : Nat is implicitly universally quantified, because it's lower case. Read the constructors as "for all Nats k, FZ inhabits Fin (S k)" and "for all Nats k, applying FS to a Fin k produces a Fin (S k)" Asymmetrikon posted:Fin n represents a finite set of size n (where n is greater than 0) - so like the natural numbers, but bounded by n. xtal posted:Do you notice a similarity between that type and the linked list? It's numbers represented at the type level by recursion. A function like 'length' on link lists could convert this type to an integer. These were all pretty insightful, thanks!
|
# ¿ Feb 5, 2017 00:24 |