Giter Site home page Giter Site logo

Comments (3)

opqdonut avatar opqdonut commented on August 22, 2024

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.

TheInnerLight avatar TheInnerLight commented on August 22, 2024

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.

asarkar avatar asarkar commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.