Comments (3)
Good stuff. I'll need to think about how I want to incorporate this into the material. I'd rather not talk (at this point) about performance too much, but rather about expressivity. I guess I need to figure out an example function that can't be implemented without a helper function.
from haskell-mooc.
Yeah, it's difficult, I had the same issues, I originally started by thinking about the repeatString
function example but I realised that, without context, students would probably wonder why the function wasn't expressed differently as:
repeatString 0 _ = ""
repeatString n str = str ++ repeatString (n-1) str
It's not obvious why this version, that doesn't need a helper function, isn't better than the presented version that accepts the result
because it more closely follows the recursion examples in the previous chapter.
This function, despite also being non-tail recursive, is far less obviously problematic compared to the factorial one, which you can at least observe has pathological memory behaviour by running it.
from haskell-mooc.
After reading the problem description, it’s not clear to me where is the reliance on other programming languages. The first implementation of factorial isn’t efficient, sure, but nothing in it requires knowledge of other programming languages.
More practically, it is highly unlikely that Haskell is someone’s first encounter with a programming language. It is not taught as a primary language in computer science beginner courses, neither it is popular enough for someone to start learning on their own.
from haskell-mooc.
Related Issues (20)
- Stack build fails HOT 2
- Add Hacktoberfest label HOT 1
- Update the packages to modern Haskell HOT 8
- Set14b.hs does not load in GHCI HOT 2
- Missing tests for prettyPrint, Part 1, Set 5a, Ex. 12. HOT 1
- Add fmap tests for Set 13b Exercise 7 HOT 1
- Data.Traversable forbidden on haskell.mooc.fi yet not forbidden in haskell-mooc/exercises/Set11aTest.hs HOT 2
- Lecture 3 Quiz HOT 1
- Make quizzes more accessible to colorblind users HOT 1
- Encountered an error related to ffi.h while building the project on Apple Silicon macOS Ventura 13.3.1 HOT 2
- Minor typo in lecture 3.9
- Set14bTest.hs doesn't close the database connection which leads to incorrect testing HOT 1
- Ex 6 of Set4a.hs HOT 2
- Exercise 8.3 ambiguous definition HOT 1
- Submission fails with factory code HOT 4
- 2.3.1 List Operations: missing `last` HOT 3
- Three different versions of GHCi found in interactive `stack ghci`
- Use HTTPS for external links when possible (round 2) HOT 3
- Set 7 Ex 8 Passes locally, but not on the website HOT 2
- stack build fails, hspec missing dependency libtinfo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell-mooc.