lambda-placeholders

A library to emulate laceholders similar to Scala. https://github.com/mmirman/lambda-placeholders

Latest on Hackage:0.0.0.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed by Matthew Mirman
Maintained by matt@mirman.com

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
Depends on:
Used by 1 package:
comments powered byDisqus