User Tools

Site Tools


codesnippets:listcomprehension

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
codesnippets:listcomprehension [2021/04/10 15:24] โ€“ f2b216codesnippets:listcomprehension [2025/10/08 00:48] (current) โ€“ external edit 127.0.0.1
Line 1: Line 1:
 ====== List comprehension ====== ====== List comprehension ======
-~~DISCUSSION~~ 
  
   * syntactic sugar to apply set operations to lists   * syntactic sugar to apply set operations to lists
   * syntax := "[" //output expression// "|" //variable / binding// = //input set// "," //predicate// "]"   * syntax := "[" //output expression// "|" //variable / binding// = //input set// "," //predicate// "]"
-  * e.g. ''[ 1 / x | x <- [-1,-0.75..1], x /= 0 ]''+  * e.g. ''[ 1 / x | x <- [-1, -0.75 .. 1], x /= 0 ]''
     * creates a list      * creates a list 
       * of reciprocal numbers (''1 / x'')       * of reciprocal numbers (''1 / x'')
Line 32: Line 31:
 </code> </code>
  
 +
 +===== โœŽ =====
 +~~DISCUSSION~~
codesnippets/listcomprehension.1618061043.txt.gz ยท Last modified: (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki