GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
List::Generator(3) User Contributed Perl Documentation List::Generator(3)

List::Generator - provides functions for generating lists

version 0.974

this module is an alias for List::Gen. it is the same as List::Gen in every way.

    use List::Generator;

    my $range = <1 .. 1_000_000_000 by 3>;

    my $squares = gen {$_ ** 2} <1..>;

    my $fib = <0, 1, *+* ...>;

    say "@$fib[0 .. 10]"; # 0 1 1 2 3 5 8 13 21 34 55

    list(1 .. 5)->map('*2')->say; # 2 4 6 8 10

    <1..>->zip('.' => <a..>)->say(5); # 1a 2b 3c 4d 5e

each line below prints '1 9 25 49 81' :

    functions:           (gen {$_**2} filter {$_ % 2} 1, 10)->say;

    list comprehensions: <**2 for 1 .. 10 if odd>->say;

    dwimmy methods:      <1..10>->grep('odd')->map('**2')->say;

    normal methods:      range(1, 10)->grep(sub {$_%2})->map(sub {$_**2})->say;

  • see List::Gen for core documentation.
  • see List::Gen::Benchmark for performance tips.
  • see List::Gen::Cookbook for usage tips.
  • see List::Gen::Haskell for an experimental implementation of haskell's lazy list behavior.
  • see List::Gen::Lazy for the tools used to create List::Gen::Haskell.
  • see List::Gen::Lazy::Ops for some of perl's operators implemented as lazy haskell like functions.
  • see List::Gen::Lazy::Builtins for most of perl's builtin functions implemented as lazy haskell like functions.
  • see List::Gen::Perl6 for a source filter that adds perl6's meta operators to use with generators, rather than the default overloaded operators

Eric Strom, "<asg at cpan.org>"

copyright 2009-2011 Eric Strom.

this program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

see http://dev.perl.org/licenses/ for more information.

2011-10-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.