Lambdaheads: Unterschied zwischen den Versionen

aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springen
Zeile 21: Zeile 21:
 
== nächster regulärer Termin ==
 
== nächster regulärer Termin ==
  
Termin: Di, '''2013-07-16''' ab 20:00 Uhr in der Bibliothek [[Lage|im Metalab]]
+
Termin: Di, '''2013-08-13''' ab 20:00 Uhr in der Bibliothek [[Lage|im Metalab]]
  
 
=== Programm ===
 
=== Programm ===
  
generators in future ECMAscript
+
Einführung emacs lisp
  
 
=== Teilnehmer ===
 
=== Teilnehmer ===
Zeile 70: Zeile 70:
  
 
= Frühere Events =
 
= Frühere Events =
 +
 +
== 2013-07-16 ==
 +
 +
generators in future ECMAscript (node.js 0.11.2) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
 +
 +
Python 3
 +
 +
<pre>
 +
def pager(lines, pagelen=60):
 +
    for lineno, line in enumerate(lines):
 +
        yield line
 +
        if lineno % pagelen == 0:
 +
            yield "\f"
 +
 +
for line in pager((range(10000))):
 +
    print(line)
 +
</pre>
 +
 +
Perl 6
 +
 +
<pre>
 +
use v6;
 +
 +
sub pager($lines, $pagelen=60) {
 +
    gather for zip 1..200, $lines -> $lineno, $line {
 +
        take $line;
 +
        take "\f" if $lineno %% $pagelen
 +
    }
 +
}
 +
 +
for pager(1..*, 30) -> $line {
 +
    say $line;
 +
}
 +
</pre>
 +
 +
Haskell
 +
 +
<pre>
 +
pager ::(Show a) => [a] -> Int -> [String]
 +
pager xs n = [if i %% n then show x else "\f" | (x,i) <- zip xs [1..]]
 +
 +
(%%) :: Int -> Int -> Bool
 +
i %% n = (rem i n) /= 0
 +
 +
 +
main :: IO ()
 +
main = putStr ( unlines (pager [1..10000] 60))
 +
</pre>
  
 
== 2013-06-18 ==
 
== 2013-06-18 ==

Version vom 29. Juli 2013, 19:52 Uhr


Lambdaheads
Lambdaheads-Logo.jpg
Status: active
Thema: Lambdaheads
Organisator: citizen428, epsilonhalbe
Treffen: alter Termin + 28 Tage
Zielgruppe: Jeder mit Interesse an funktionaler Programmierung, vom Mathematiker zum Software-Entwickler.
Inhalt: Ein regelmäßiges Treffen von Leuten die sich für Lisp-Dialekte und funktionale Programmierung im Allgemeinen interessieren.
Zuletzt aktualisiert: 2013-07-29

WTF

Ein regelmäßiges Treffen von Leuten die sich für Lisp-Dialekte und funktionale Programmierung im Allgemeinen interessieren.

Kommende Events

Nächster Termin = alter Termin + 28 Tage

nächster regulärer Termin

Termin: Di, 2013-08-13 ab 20:00 Uhr in der Bibliothek im Metalab

Programm

Einführung emacs lisp

Teilnehmer


Vortragswünsche

  • Coq - a proof assistant (ε/2?)
  • Interfacing to SDL/Games in functional languages (Purely Functional Retro Games)
  • Readable/non-trivial Haskell Examples (ε/2, e.g. Pandoc)
  • How Darcs works
  • Two λ enter, one λ leaves: Snap vs. Yesod
  • Emacs

Vortragsvorschläge

  • Hunchentoot, Web programming, maybe hunchentoot-fcgi (WIP) or Postmodern (japhy)
  • Zippers (citizen428)
  • fold and it's universal mapping property - ein versuch fold kennenzulernen - ε/2
  • Intro to QuickCheck and Software Testing in Haskell (ε/2)
  • Intro to a Clojure Web Framework (Noir semi-done, again citizen428)

Links

Kontakt

Frühere Events

2013-07-16

generators in future ECMAscript (node.js 0.11.2) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators

Python 3

def pager(lines, pagelen=60):
    for lineno, line in enumerate(lines):
        yield line
        if lineno % pagelen == 0:
            yield "\f"

for line in pager((range(10000))):
    print(line)

Perl 6

use v6;

sub pager($lines, $pagelen=60) {
    gather for zip 1..200, $lines -> $lineno, $line {
        take $line;
        take "\f" if $lineno %% $pagelen
    }
}

for pager(1..*, 30) -> $line {
    say $line;
}

Haskell

pager ::(Show a) => [a] -> Int -> [String]
pager xs n = [if i %% n then show x else "\f" | (x,i) <- zip xs [1..]]

(%%) :: Int -> Int -> Bool
i %% n = (rem i n) /= 0


main :: IO ()
main = putStr ( unlines (pager [1..10000] 60))

2013-06-18

comb, one of the opposites of join (the other one is split)

String.prototype.comb = function(re) {
    // lol type conversion the hacky way
    re = ('' + re)              // now it's a string
        .replace(/^\//, '')     // hack off leading
        .replace(/\/$/, '');    // trailing delimiter
    // no interpolation, no sigils, no sprintf
    return eval('this.match(/(' + re + ')+/g)');
}

gather/take construct reimplemented for JS - a replacement for the idiom of declaring a collecting variable and pushing into it occasionally http://perl6.wikia.com/wiki/Gather

function gather(fn) {
    var guard = new Array;
    var take = function (items) {
        guard = guard.concat(items);
    };
    fn(take);
    return guard;
};

console.log(
    gather(function(take) {
        for (var i = 0; i <= 10; i++) {
            if (i % 2) {
                take(i);
            }
        }
    })
)

var arr = [];
for (var i = 0; i <= 10; i++) {
    if (i % 2) {
        arr.push(i);
    }
}

Haskell example is incomplete

gather x = foldr (:) [] x
main = print $ gather [0..10]

reimplementation of List::Gen::by http://p3rl.org/List::Gen#by-NUM-LIST (no generators, just list transformation)

function by(n, a) {
    var r = new Array;
    while(a.length) {
        r.push(a.splice(0, n));
    };
    console.log(a);
    return r;
};

function by2(n, a) {
    return a.length ? [a.slice(0, n)].concat(by2(n, a.slice(n))) : [];
}

console.log( by2(5, [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]) );
console.log( by2(5, [1,2,3,4,5,6,7,8,9,10,11,12,13,14]) );
console.log( by2(5, [1,2,3,4]) );
console.log( by2(5, []) );
// contrib by intval
// divides array into equal arrays, each of size n
function by(n, arr) {
    function byby(n, arr, accum) {
        if(arr.length < 1) {
            return accum;
        }
        var head = [arr.slice(0,n)];
        var tail = arr.slice(n);
        return byby(n, tail, accum.concat(head));
    }
    return byby(n, arr, []);
}

console.log( by(5, [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]) );
console.log( by(5, [1,2,3,4,5,6,7,8,9,10,11,12,13,14]) );
console.log( by(5, [1,2,3,4]) );
console.log( by(25, []) );

2013-05-21

A revival to much muttering, fretting and frowning of brows!

2012-10-15

  • Coding Challenge: bring your favourite languages, solve a small practical real-world problem from Stack Overflow in a functional fashion, let's hack and learn from each others' solutions [1] [2]

http://stackoverflow.com/questions/12872469

2012-09-17

2012-08-20

- Burrows-Wheeler Transformation aus "R.Bird - Pearls of functional Programming"

  • Algorithmus durchbesprechen und
  • Ein bischen testen mit QuickCheck

2012-07-23

2012-06-25

  • ClojureC - neues Projekt von schani

2012-05-24

2012-04-30

2012-03-05

Mo, 2012-04-02 ab 19:30 Uhr in der Bibliothek im Metalab
Mo, 2012-03-05 ab 19:30 Uhr in der Bibliothek im Metalab

Programm: Ich bin vor kurzem auf den catalyst coding contest hingewiesen worden und habe versucht das Challenge von 2010 in Haskell zu lösen, und stehe nun (ich armer Tor) vor dem 5ten Level. Und komm nicht weiter. Ich werde meinen Code präsentieren und wäre interessiert Lösungen funktionaler und nichtfunktionaler Art zu sehen, bzw. hoffe ich auf Ideen eurerseits wie ich weitercoden könnte.

Mein Zeug bzw die Aufgabenbeschreibungen (als pdf) findet Ihr auf github - ε/2

2012-02-13

Mo 2012-02-13 ab 19:30 in der Bibliothek im Metalab

Programm:

2012-01-09

Mo, 2012-01-09 ab 19:30 Uhr in der Bibliothek im Metalab

Programming Challenge by daxim. Solutions in Ruby (citizen428), Haskell (ε/2), Python2 (a friend of ε/2) and Common Lisp (japhy).

2011-11-12

Mo., 2011-11-12, ab 19:30 Uhr im Hauptraum im Metalab

angeregte Diskussion auf der Couch vor der Blinkenwall über alles mögliche™

2011-10-17

Mo, 17.10. ab 19:30 Uhr in der Bibliothek im Metalab

2011-09-19

Mo, 19.9. ab 19:30 Uhr in der Bibliothek im Metalab

  • Overview: Martins (=ε/2) Spielprojekt "Algebra Alchemy"
    • Symbolic Algebra
    • Algebraic Expression Trees
    • Parsing
    • Testing (HUnit)
    • Documentation (Haddock)

in Haskell all DIY - hopefully readable ;-)

2011-08-29

Lambdaheads Spezial, 29.8., 18:15 - 19:45

User:Antifuchs zeig AllegroGraph in der Bibliothek im Metalab.

2011-07-25

Mo, 25.7. ab 19:30 Uhr in der Bibliothek im Metalab

2011-06-27

Mo, 27.6. ab 19:30 Uhr in der Bibliothek im Metalab

  • OCaml is dead - long live OCaml
  • Sequential versus ISeq - Clo-shure?!?
  • Haskell examples - code of a newbie (ε/2)
  • Misc stuff to read the Monad.Reader #13 - Typeclassopedia

2011-05-30

Mo, 30.5. ab 19:30 Uhr in der Bibliothek im Metalab

2011-05-02

Mo, 2.5. ab 19:30 Uhr in der Bibliothek im Metalab

2011-04-04

Mo, 4.4. ab 19:30 Uhr in der Bibliothek im Metalab

2011-03-07

Mo, 7.3.2011 ab 19:30 in der Bibliothek im Metalab

2011-02-07

Mo, 7.2.2011 ab 19:30 Uhr in der Bibliothek im Metalab

  • Y-Combinator in Perl/Lisp/Javascript (citizen428)
  • myReverse list - a hard task todo on the fly - except in haskell ;-) (ε/2)

2011-01-17

Mo, 17.1. ab 19:30 Uhr in der Bibliothek im Metalab

2010-11-29

Mo, 29.11. ab 19:30 Uhr in der Bibliothek im Metalab

Brian Beckman's "Don't fear the Monads" talk

2010-10-04

Mo. 04.10.2010 ab 19:30 Uhr in der Bibliothek im Metalab

  • Common Lisp Object System (japhy)

2010-09-06

Mo. 06.09.2010 ab 19:30 Uhr in der Bibliothek im Metalab

  • Func proc concepts: Higher-order functions (citizen428)
  • Functional programming in Perl 6 (Daxim)
  • Function level programming with APL and J (citizen428)

2010-07-12

Mo. 12.07.2010 ab 19:30 Uhr im Hauptraum im Metalab

2010-06-14

Mo. 14.06.2010 ab 19:30 Uhr in der Bibliothek im Metalab

2010-05-17

Mo. 17.05.2010 ab 19:30 Uhr in der Bibliothek im Metalab

2010-04-19

Mo. 19.04.2010 ab 19:30 Uhr in der Bibliothek im Metalab

2010-03-22

Mo. 22.03.2010 ab 19:30 Uhr in der Bibliothek im Metalab