The lambda-placeholders package

[Tags:bsd3, library]

A description of the workings of placeholders in Scala can be found here: http://www.artima.com/pins1ed/functions-and-closures.html#8.5.


[Skip to Readme]

Properties

Versions 0.0.0.0
Dependencies base (<=7) [details]
License BSD3
Author Matthew Mirman
Maintainer matt@mirman.com
Category Language
Home page https://github.com/mmirman/lambda-placeholders
Source repository head: git clone git://github.com/mmirman/lambda-placeholders.git
Uploaded Thu May 29 00:54:49 UTC 2014 by MatthewMirman
Distributions NixOS:0.0.0.0
Downloads 296 total (9 in the last 30 days)
Votes
1 []
Status Docs available [build log]
Successful builds reported [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for lambda-placeholders

Readme for lambda-placeholders-0.0.0.0

lambda-placeholders

lambda-placeholders is a Haskell library to emulate the placeholders feature of Scala.

Background

  • Placeholders in Scala act similar to those used in category theory.
  • Rather than create a lambda or name a function, an underscore is used in place of a parameter and the function is abstracted over that location.
  • This placeholders library doesn't use underscores, rather it leverages similar capabilities found in TupleSections.
  • A description of Scala placeholders can be found here.

Example

{-# LANGUAGE
 TupleSections 
 #-}
module Main where 
import Language.Placeholders

foo (a,b,c) = a + b + c

curried_foo = foo.$.(2, , )

main = do
    putStrLn $ show $ curried_foo 4 5