Gigabyte SystemsYour no 1 I.C.T partner
0
  • Log in
  • Create an account
  • Check out
  • Home
  • Productshot deals
    • Computers & Accessories

      • Desktops
      • Laptops
      • Tabs & Smartphones
      • Memory Cards
      • Chargers & Adapters
      • Cases & Sleeves
      • Monitors
      • Keyboards & Mouse

      Servers & Accessories

      • Tower Servers
      • Rackmount Servers
      • Storage Servers
      • Power Supplies
      • SAS Hard Disks
      • Server RAM
      • Raiser Cards

      Networking & Accessories

      • Ethernet Switch
      • Routers
      • Patch Panels
      • Networking Cables
      • Server Cabinets
      • PABX Systems & Fax Machines
      • Wireless Access Points

      Software

      • Windows
      • Linux
      • Office
      • Accounting
      • Antivirus

      Printers & Copiers

      • Printers
      • Copiers
      • Toners
      • Catridges
      • Office Products
  • Services
    • Networking & Telephony

      • Network LAN
      • Hubs & Switches
      • VoIP
      • PABX & Installation
      • Simple Network Management Protocol
      • Router Configuration
      • Virtual Private Networking(VPN)
      • Firewalls

      Computer Repair & Support Services

      • Technical Support
      • Hardware upgrades / Installation
      • Motherboard Replacement
      • Memory Upgrades
      • Photocopying & Printing

      CCTV Installation

      • CCTV Installation

      Software

      • Website Design & Development
      • Software Installation
      • Software Upgrading
      • Troubleshooting
  • Support
  • About usour team
  • Contact us

Gigabyte Systems

  • Home
  • Products
    • Computers & Accessories
      • Desktops
      • Laptops
      • Tabs & Smartphones
      • Memory Cards
      • Chargers & Adapters
      • Cases & Sleeves
      • Monitors
      • Keyboards & Mouse
    • Servers & Accessories
      • Tower Servers
      • Rackmount Servers
      • Storage Servers
      • Power Supplies
      • SAS Hard Disks
      • Server RAM
    • Networking & Accessories
      • Ethernet Switch
      • Routers
      • Patch Panels
      • Networking Cables
      • Server Cabinets
      • PABX Systems & Fax Machines
    • Software
      • Windows
      • Linux
      • Office
      • Accounting
      • Antivirus
  • Services
    • Networking & Telephony
      • Network LAN
      • Hubs & Switches
      • VoIP
      • PABX & Installation
      • Simple Network Management Protocol
      • Router Configuration
      • Virtual Private Networking(VPN)
      • Firewalls
    • Computer Repair & Support Services
      • Technical Support
      • Hardware upgrades / Installation
      • Motherboard Replacement
      • Memory Upgrades
      • Photocopying & Printing
    • CCTV Installation
      • CCTV Installation
    • Software
      • Website Design & Development
      • Software Installation
      • Software Upgrading
      • Troubleshooting
  • Support
  • About Us
  • Contact us
  • Home
  • Our Services

Memory Upgrades


   

 
 
 Erlang is a functional programming language. Among other things this means that funs can be used as the arguments to functions and that functions (or funs) can return funs. Functions that return funs, or functions that can accept funs as their arguments, are called higher-order functions. We’ll see a few examples of these in the next sections.
Now all of this might not sound very exciting since we haven’t seen what we can do with funs. So far, the code in a fun looks just like
regular function code in a module, but nothing could be further from the truth. Higher-order functions are the very essence of functional programming languages—they breathe fire into the belly of the code.
Once you’ve learned to use them, you’ll love them. We’ll see a lot more of them in the future.
Functions That Return Funs
Not only can funs be used as arguments to functions (such as map and
filter), but functions can also return funs.
Here’s an example—suppose I have a list of something, say fruit:
1> Fruit = [apple,pear,orange].
[apple,pear,orange]
Now I can define a function MakeTest(L) that turns a list of things (L) into
a test function that checks whether its argument is in the list L:
2> MakeTest = fun(L) -> (fun(X) -> lists:member(X, L) end) end.
#Fun<erl_eval.6.56006484>
3> IsFruit = MakeTest(Fruit).
#Fun<erl_eval.6.56006484>
lists:member(X, L) returns true if X is a member of the list L; otherwise, it
returns false. Now that we have built a test function, we can try it:
4> IsFruit(pear).
true
5> IsFruit(apple).
true
6> IsFruit(dog).
false
We can also use it as an argument to lists:filter/2:
7> lists:filter(IsFruit, [dog,orange,cat,apple,bear]).
[orange,apple]
The notation for funs that return funs takes a little getting used to,
so let’s dissect the notation to make what’s going on a little clearer. A
function that returns a “normal” value looks like this:
1> Double = fun(X) -> ( 2 * X ) end.
#Fun<erl_eval.6.56006484>
2> Double(5).
10

Our Services

  • Network LAN
  • Hubs And Switches
  • PABX and Installation
  • Simple Network Management Protocol(SNMP)
  • Router Configuration
  • Virtual Private Networking(VPN)
  • Firewalls
  • Technical Support
  • Hardware Upgrades
  • Motherboard Replacement
  • Memory Upgrades
  • CCTV Installation
  • Software Installation
  • Software Upgrading
  • Troubleshooting
  • Voice Over Internet Protocol
  • Website Development
  • Photocopying Printing
  • Data Recovery

  • Home
  • Search
  • Services
  • About Us
  • Contact us

  • Desktops
  • Printers
  • Laptops
  • Catridges
  • Software

  • Network LAN
  • Hubs and Switches
  • Technical Support
  • Memory Upgrades
  • CCTV Installation

  • Twitter
  • Facebook
  • Google+

© 2025 Gigabyte Systems. All Rights Reserved.

Product Added to Cart