I have to write down algorithms in my thesis, and these are getting way shorter if I use "map," "fold," and "filter" heavily.

This generally results in a "map, fold, filter"-chain with a depth of 3.


fold( map( ..., filter(...))...)

Is it okay to assume that these functions are known, and what is the parameter convention?

  • 2
    I'm voting to close this question as off-topic because the second part of the question is asking about introducing a LaTeX package which seems to be on-topic for TeX.SE website. – enthu Mar 6 '15 at 15:52
  • 1
    @EnthusiasticStudent better to edit it to remove the second part of the question, I think (and have done). – jakebeal Mar 6 '15 at 16:50
  • @jakebeal At this early stage, I think it is up to the users to decide to whether edit their questions and rescue their questions from getting closed or leave them as it is. I personally do not agree with you to major edit the content of the questions/answers of other users at the first day the content is posted. At least, we should wait for some time to let the users to decide about their questions (and get familiar with the website's close/reopen feature). After some time of inactivity (about one or two weeks) we may major edit the questions, reopen them or rise close/delete votes on them. – enthu Mar 6 '15 at 17:31
  • 1
    Are you using a functional language? In that case: you must! They are part of the basic concepts in functional programming and will make code more familiar and easier to follow (a fold/filter/map has some properties that always hold, while a generic recursive definition can do everything.) It may be different for imperative languages where the programmers think in different terms (although map and filter ought to be simple enough to understand. fold would probably be the confusing bit). – Bakuriu Mar 6 '15 at 19:04
  • @Bakuriu The related software is actually C++, but the presented algorithm/method is explained in pseudocode. It contains many list operations, so these functions are in my opinion a good fit. But related to the given answers/comments it would be good to cite a source where these functions are generally defined, just to be sure. My audience are computer scientists (shouldn't be a problem) and chip designers (not so sure). Btw: I am happy with the changes to the question. – thi gg Mar 6 '15 at 19:15

If you are writing to a computer science audience who would be expected to have a some knowledge of functional programming, then yes, these sorts of basic elements are quite reasonable to assume knowledge of.

If you are writing to an audience without such background knowledge, then you will need to explain what they are (and give a reference for more information) before you use them.

  • 1
    +1, should be fine for a CS audience. For a different audience, I suggest not using them, even if you explain them, because functional programming can be confusing for the uninitiated. – Marc Claesen Mar 6 '15 at 14:22
  • 1
    @Marc Arguably, it can be confusing for people who know what it is. :P – Seiyria Mar 6 '15 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.